CN102073463B - Flow prediction method and device, and prereading control method and device - Google Patents

Flow prediction method and device, and prereading control method and device Download PDF

Info

Publication number
CN102073463B
CN102073463B CN2010106225693A CN201010622569A CN102073463B CN 102073463 B CN102073463 B CN 102073463B CN 2010106225693 A CN2010106225693 A CN 2010106225693A CN 201010622569 A CN201010622569 A CN 201010622569A CN 102073463 B CN102073463 B CN 102073463B
Authority
CN
China
Prior art keywords
information
historical
stream
read request
coupling
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
CN2010106225693A
Other languages
Chinese (zh)
Other versions
CN102073463A (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.)
Innovation Technology Co., Ltd.
Shenzhen Innovation Software Technology Co., Ltd.
Original Assignee
CHUANGXINKE SOFTWARE TECHNOLOGY (SHENZHEN) Co Ltd
Innovation And Technology Storage 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 CHUANGXINKE SOFTWARE TECHNOLOGY (SHENZHEN) Co Ltd, Innovation And Technology Storage Technology Co Ltd filed Critical CHUANGXINKE SOFTWARE TECHNOLOGY (SHENZHEN) Co Ltd
Priority to CN2010106225693A priority Critical patent/CN102073463B/en
Publication of CN102073463A publication Critical patent/CN102073463A/en
Application granted granted Critical
Publication of CN102073463B publication Critical patent/CN102073463B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a flow prediction method and device, and a prereading control method and device. The flow prediction method can inquire most matched historical I/O information of a current read request, and can predict whether the current read request belongs to an existing flow according to the situation whether the most matched historical I/O information has the corresponding flow information when the current read request is correlated with the most matched historical I/O information. In addition, the flow prediction method can also predict whether the updated most matched historical I/O information corresponds to one new flow according to the situation whether the most matched historical I/O information, updated according to the current read request, satisfies the flow mode. Thus, only when the situation that the current read request belongs to the flow mode suitable for prereading is predicted, the prereading operation for the current read request can be triggered, so that the hit rate of the read request can be improved, I/O resource waste caused by executing prereading by position random access can be avoided, thereby helping improve the performance of a storage system.

Description

The stream Forecasting Methodology is with device and read control method and device in advance
Technical field
The present invention relates to the data pre-head technology, particularly a kind of flow Forecasting Methodology, based on stream prediction a kind of read in advance control method and a kind of flow prediction unit, based on a kind of control device of reading in advance of stream prediction.
Background technology
Because the arithmetic capability of main frame from strength to strength, the performance of storage system begins to become the bottleneck of The whole calculations system.
In order to solve this type of problem; As shown in Figure 1, generally meeting be provided with the buffer memory (this buffer memory is arranged in the memory controller between main frame and the disk array usually) of a high speed between main frame and disk array, when the disk array in the host access storage system; Can arrive first and go in the buffer memory in the storage system to seek; If data are present in the buffer memory, just do not need reading of data from hard disk again, but can realize that through buffer memory read request hits.Wherein, the data that are present in the buffer memory might be that therefore preceding operation has been read and kept in wherein, perhaps, are to read in advance the buffer memory from disk selectively according to certain rule, and this paper only pays close attention to situation about reading in advance.
Because the read or write speed of buffer memory is hundreds of times of disk, if thereby can in buffer memory, read request hit, just can shorten the I/O stand-by period of read request greatly.But simultaneously; The capacity of buffer memory generally all can be far smaller than the capacity of disk; Can not all data all be read in the buffer memory in advance, thereby, how under the limited prerequisite of buffer memory capacity, effectively utilize in advance and read; Promptly become the key point of the hit rate that improves read request, and then influence the performance of storage system.
Summary of the invention
In view of this, the invention provides a kind of stream Forecasting Methodology, a kind of control method and a kind of stream prediction unit, a kind of control device of reading in advance read in advance, help raising performance of storage system.
A kind of stream Forecasting Methodology provided by the invention comprises:
The historical I/O information of mating most of A, inquiry and current read request;
B, judge that whether current read request is associated with the historical I/O information of said coupling, if execution in step D then, otherwise execution in step C;
C, be newly-built historical I/O information of current read request and process ends;
D, upgrade the historical I/O information of said coupling, execution in step E then according to current read request;
Whether the said the most historical I/O information of coupling after E, judgement are upgraded exists corresponding stream information, belongs to already present stream and execution in step F if then confirm current read request, otherwise execution in step G;
F, corresponding stream information and the process ends of renewal;
Whether the said the most historical I/O information of coupling after G, judgement are upgraded satisfies the condition of stream mode, if corresponding new stream of the said historical I/O information of mating the most after then confirming to upgrade and execution in step H, otherwise process ends;
H, be the said new stream information and the process ends of the most historical I/O information creating of coupling after upgrading.
A kind of control method of reading in advance provided by the invention comprises the steps A~H of above-mentioned stream Forecasting Methodology, and after step F and step H, further comprises: I, triggering are directed against the preparatory read operation of current read request.Preferably, during the time of end address of before stream information comprises, once reading in advance and last visit, after said step I, can also further comprise again:
J, calculate the mean value of the stream length in the stream information of some streams recently, and the merchant of the mean value that calculates and a preset empirical value is read length in advance as what be directed against current read request;
Whether the difference of the preceding end address of once reading in advance in the stream information of K, judgement correspondence and the start address of current read request is less than said mean value; If; Then carry out preparatory read operation to current read request according to the said length of reading in advance; Otherwise, the preparatory read operation that cancellation has triggered to current read request.
A kind of stream prediction unit provided by the invention comprises:
The matching inquiry module, the historical I/O information of mating most of inquiry and current read request;
Related judge module judges that whether current read request is associated with the historical I/O information of said coupling, if trigger message update module then, otherwise trigger message is set up module;
Information is set up module, is newly-built historical I/O information of current read request and end process;
Information updating module is upgraded said historical I/O information of mating most according to current read request, triggers the continuous query module then;
The continuous query module judges whether the said the most historical I/O information of coupling after upgrading exists the stream information of correspondence, belongs to an already present stream, also triggers the stream update module if then confirm current read request, flows judging module otherwise trigger;
The stream update module is upgraded corresponding stream information and end process;
The stream judging module; Judge whether the said the most historical I/O information of coupling after upgrading satisfies the condition of stream mode; If the corresponding new stream of the historical I/O information of the said coupling the most after then confirm upgrading, and trigger stream and set up module, otherwise end process;
Stream is set up module, is the said new stream information and the end process of the most historical I/O information creating of coupling after upgrading.
A kind of control device of reading in advance provided by the invention comprises above-mentioned stream prediction unit and can read to start module in advance by what stream update module and stream set up that module triggers.Preferably, during the time of end address of before stream information comprises, once reading in advance and last visit, can also further comprise again and can be read in advance to start that module triggers like lower module:
The length computation module is calculated the mean value of the stream length in the stream information of some streams recently, and the merchant who the mean value that calculates and one is preset empirical value as preparatory read operation required read length in advance;
Read execution module in advance; Whether the difference of the preceding end address of once reading in advance in the stream information of judgement correspondence and the start address of current read request is less than said mean value; If; Then carry out preparatory read operation, otherwise cancellation is to the preparatory read operation of current read request to current read request according to the said length of reading in advance.
Visible by technique scheme; The present invention can inquire the historical I/O information of mating most with current read request; And when current read request is associated with said historical I/O information of mating most; Can whether there be corresponding stream information according to said historical I/O information of mating most, dopes current read request and whether belong to an already present stream, and; Also can whether satisfy the condition of stream mode according to the historical I/O information of the said coupling after upgrading according to current read request, whether the historical I/O information that dopes the said coupling the most after the renewal corresponding new stream.
Thereby; Utilize control method and the device read in advance of the present invention; Only just trigger preparatory read operation doping under the situation that current read request belongs to the stream mode that is fit to read in advance to current read request; Thereby can improve the hit rate of read request and avoid position random access execution to read the I/O wasting of resources that is caused in advance, and then help to improve the performance of storage system.
Further, the control method of reading in advance of the present invention can also be after triggering preparatory read operation with device, and dynamically length is read in adjustment in advance, avoid fixing read in advance length the I/O wasting of resources that possibly cause;
Again further; Of the present invention when reading control method in advance and can also be not less than the mean value of reading length in advance in the difference of the start address of preceding end address of once reading in advance and current read request with device; Rule out that the data that need read in advance have been present in the buffer memory, and the preparatory read operation (being equivalent to become 0 with reading length in advance) that has been triggered of cancellation, thus avoid unnecessary read in advance the I/O wasting of resources that possibly cause.
Description of drawings
Fig. 1 is the normal storage system configuration diagram that adopts data pre-head in the prior art;
Fig. 2 is for read the preferable stream intention of control method in advance in the embodiment of the invention;
Fig. 3 is the structural representation of a kind of historical I/O information that provides in the embodiment of the invention;
Fig. 4 is the structural representation of a kind of stream information of providing in the embodiment of the invention;
Fig. 5 is the exemplary configurations synoptic diagram of reading control device in advance in the embodiment of the invention;
Fig. 6 is the storage system configuration diagram of reading control device in advance that includes in the embodiment of the invention.
Embodiment
For making the object of the invention, technical scheme and advantage clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, to further explain of the present invention.
For the continuous stream access module in address, obviously can improve hit rate in data pre-head to the buffer memory that the address that is about to visited is continuous; And, then be difficult to confirm to be about to the data that quilt is visited for the discrete random access mode in address, read also to be difficult to guarantee hit rate in advance even if adopt.Therefore, present embodiment considers at first how to predict whether current read request belongs to stream, and belongs to stream and the time just can trigger preparatory read operation doping current read request.
Fig. 2 is for read the preferable stream intention of control method in advance in the embodiment of the invention.As shown in Figure 2, the control method of reading in advance in the present embodiment comprises the steps: at least
Step 201, the historical I/O information of mating most of inquiry and current read request.
In the present embodiment; Be provided with a historical information storehouse; This historical information storehouse records corresponding historical I/O information respectively to visit before; Preferably, the structure of every historical I/O information can be as shown in Figure 3, includes but not limited at least: start address, end address, access time, access times and the stream information ID of corresponding visit.For the historical I/O information of this class formation, can the historical I/O information that have an immediate start address with current read request be the most historical I/O information of coupling in this step.
In addition, for the stream information ID in the historical I/O information, when its when being invalid, the corresponding visit of expression does not belong to stream; And when it was effective, the effective value of this stream information ID was represented and corresponding sign of visiting the stream information of corresponding stream.Have only the pairing visit of historical I/O information to belong to a stream; This history I/O information just can exist corresponding stream information, its stream information ID also just can be effective; The structure of described stream information can be as shown in Figure 4, and it includes but not limited at least: corresponding stream preceding once read the length of end address, corresponding stream and the last access time of corresponding stream in advance.
Step 202 judges that whether current read request is associated with the most historical I/O information of coupling, if execution in step 204 then, otherwise execution in step 203.
Being associated described in this step makes to refer to current read request and the pairing visit of the most historical I/O information of coupling, whether spatially with the time on enough approaching.
Preferably; For historical I/O information as shown in Figure 3; The difference that can judge current read request and the said start address of the historical I/O information of coupling in this step whether in certain address realm M and the difference of access time be to be positioned at time corresponding scope Ts, if all be, represent that then current read request is associated with said historical I/O information of mating most; Otherwise, represent current read request and the said historical I/O information onrelevant that matees most.
Step 203; For all not having any related current read request with the historical I/O information of mating most; It obviously belongs on time and space independently visit and can not belong to a stream enough approaching on time and space; Thereby in the historical information storehouse for the newly-built historical I/O information of current read request, be used for follow-up inquiry the when visit of other read requests is arranged again, and process ends.
Preferably, for historical I/O information as shown in Figure 3, this step can with the start address of current read request, end address, access time respectively as start address, end address, access time in the newly-built historical I/O information; And it is invalid that the access times in the newly-built historical I/O information are set to 1, stream information ID is made as.
Step 204; Because current read request exists related with the pairing visit of historical I/O information of mating most; Thereby current read request can belong to visit enough approaching on time and space with the pairing visit of historical I/O information of mating most; Therefore, according to current read request upgrade the historical I/O information of coupling, in order to the current read request and the pairing visit of the most historical I/O information of coupling are merged, execution in step 205 then.
Preferably, for historical I/O information as shown in Figure 3, update mode can be following:
The update mode of a, start address: judge the start address of current read request and the size of the start address of upgrading the preceding historical I/O information of mating most; If the start address of current read request is less than the start address of the historical I/O information of mating most before upgrading; Then with the start address of current read request as start address for the historical I/O information of the coupling after upgrading; Otherwise the start address of the historical I/O information of mating most that renewal is preceding is left the start address of the historical I/O information of mating most after the renewal; That is, with the start address of current read request with upgrade before the start address of historical I/O information of coupling in minimum one as start address for the historical I/O information of the coupling after upgrading;
The update mode of b, end address: the size of judging end address with the end address of upgrading the preceding historical I/O information of mating most of current read request; If the end address of current read request is greater than the end address of the historical I/O information of mating most before upgrading; Then with the end address of current read request as end address for the historical I/O information of the coupling after upgrading; Otherwise the end address of the historical I/O information of mating most that renewal is preceding is left the end address of the historical I/O information of mating most after the renewal; That is, with the end address of current read request with upgrade before the end address of historical I/O information of coupling in a maximum end address as the historical I/O information of mating most after upgrading;
The update mode of c, access time and access times: the access times of the historical I/O information of mating most as access time of the historical I/O information of the coupling after upgrading, after will upgrading add 1 with access time of current read request.
Step 205 judges whether the most historical I/O information of coupling after upgrading exists corresponding stream information, belongs to already present stream and execution in step 206 if then confirm current read request, otherwise execution in step 207.
Preferably, for historical I/O information as shown in Figure 3, of preamble; Have only the pairing visit of historical I/O information to belong to a stream; This history I/O information just can exist corresponding stream information, its stream information ID also just can be effective, and therefore, this step can judge whether the stream information ID in the historical I/O information of coupling the most is effective; If effectively expression the most historical I/O information of coupling have corresponding stream information, otherwise expression the most historical I/O information of coupling do not have corresponding stream information.
Step 206 is upgraded corresponding stream information, and execution in step 209 then.
Preferably; For stream information as shown in Figure 4; This step mainly is the stream length and the last access time of upgrading in the stream information; Specifically, the stream length in the stream information of correspondence is updated to the start address after end address after the renewal of the most historical I/O information of coupling deducts renewal, is updated to the access time of current read request the last access time.And the preceding end address of once reading in advance can be waited for and being upgraded after preparatory read operation is triggered again, and certainly, the last access time also can treat to upgrade after preparatory read operation is triggered again.
Step 207; Though current read request does not belong to an already present stream; But it also might constitute a new stream with the pairing visit of historical I/O information of mating most, therefore, wouldn't assert that current read request does not belong to stream; But judge the condition that whether satisfies stream mode according to the most historical I/O information of coupling after the current read request renewal earlier; Be current read request and the condition that whether satisfies stream mode after the pairing visit of the most historical I/O information of coupling merges, if corresponding new stream of historical I/O information of the said coupling the most after then upgrading according to current read request, promptly current read request with constituted a new stream after the pairing visit of the most historical I/O information of coupling merges; Execution in step 208 then; Otherwise current read request merges the back with the pairing visit of historical I/O information of mating most and does not constitute temporarily new stream thereby process ends.
Preferably; For historical I/O information as shown in Figure 3; Whether the access times of historical I/O information that can judge the coupling after the renewal in this step are greater than preset threshold value; If; Access times after then representing current read request and the pairing visit of the most historical I/O information of coupling merging have satisfied the connected reference number of times of a stream, thereby the most historical I/O information of coupling after can confirming to upgrade satisfies the condition of stream mode, otherwise the most historical I/O information of coupling of expression after upgrading does not satisfy the condition of stream mode.
Step 208, the stream information ID of the historical I/O information of the coupling for the new stream information of the historical I/O information creating of the coupling the most after upgrading and after renewal is set is effective respective value, execution in step 209 then.
Preferably, for stream information as shown in Figure 4, the end address after the renewal of the historical I/O information that the stream length in the stream information of this correspondence is set to mate most deducts the start address after the renewal.And the preceding end address of once reading in advance is set to sky temporarily with the last access time, treats to upgrade after preparatory read operation is triggered again.
Step 209 triggers the preparatory read operation to current read request.
Because this step only just triggers the preparatory read operation to current read request doping under the situation that current read request belongs to the stream mode that is fit to read in advance; Thereby can improve the hit rate of read request and avoid position random access execution to read the I/O wasting of resources that is caused in advance, and then help to improve the performance of storage system.
Step 201~208 in this flow process before step 209 triggers the preparatory read operation that is directed against current read request can constitute one and independently flow Forecasting Methodology, and this stream Forecasting Methodology is not limited in the control that is used for reading in advance.
In addition; After step 209; Promptly can carry out preparatory read operation to the current read request that belongs to stream, if but carry out preparatory read operation according to the changeless length of reading in advance simply, might excessive to cause a large amount of preparatory read datas be not the needed data of current read request owing to reading length in advance; Thereby the probability that preparatory read data is hit is not high, so cause the I/O resource waste, cause performance of storage system to descend.For example video editing business has different code streams, and the IO characteristics also can be different, and the preparatory read data amount that needs also can be different.
Therefore, present embodiment has preferably increased and has calculated step 210~212 of reading length in advance and reading in advance to adjudicate after step 209.
Step 210, with reference to the mean value of reading length in advance of several streams in the regular period, confirm to the preparatory read operation of current read request should use read length in advance, execution in step 211 then.
For example, can calculate the mean value L of the stream length in the stream information of nearest some streams, and the merchant L/P of the mean value L that calculates and a preset empirical value P is read length in advance as what be directed against current read request.Like this, the preceding end address J that once reads in advance in the corresponding stream information just is updated to J+L/P.
Utilize this step, can dynamically adjust and read length in advance, avoid fixing read in advance length the I/O wasting of resources that possibly cause.
Step 211, judge the needed data of current read request whether by before preparatory read operation read in the buffer memory, if, then the preparatory read operation that triggered of cancellation to current read request, process ends then, otherwise, execution in step 212.
In this step; Whether the difference of start address that can judge preceding end address of once reading in advance and current read request in the corresponding stream information is less than mean value L; If; Represent that then the needed data of current read request are not all read in the buffer memory by preparatory read operation before, otherwise, represent that the needed data of current read request are all read in the buffer memory by preparatory read operation before.
For the cancellation of preparatory read operation, the mode that this step can be through the preparatory read operation of direct termination or will read length in advance and change to 0 mode or ability and be achieved according to other any one modes that the technician can expect.
Utilize this step, can rule out the data that need read in advance when being present in the buffer memory, the preparatory read operation that cancellation has been triggered, thereby avoid unnecessary read in advance the I/O wasting of resources that possibly cause.
Step 212 is carried out the preparatory read operation to current read request, process ends then according to the length of reading in advance that step 211 calculates.
So far, the control procedure of reading in advance to a read request finishes.
Except above-mentioned stream Forecasting Methodology and as shown in Figure 2 the reading in advance the control method that is made up of step 201~208, present embodiment also provides a kind of of correspondence to read control device in advance and be contained in this to read the stream prediction unit in the control device in advance.
Fig. 5 is the exemplary configurations synoptic diagram of reading control device in advance in the embodiment of the invention.As shown in Figure 5, reading control device in advance and can be arranged on according to mode as shown in Figure 6 in the memory controller between main frame and the disk array, and comprise at least in the present embodiment: matching inquiry module 501, related judge module 502, information are set up module 503, information updating module 504, continuous query module 505, stream update module 506, stream judging module 507, stream and are set up module 508 and read to start module 509 in advance.
Matching inquiry module 501, the historical I/O information of mating most of inquiry and current read request.Preferably, for historical I/O information as shown in Figure 3, matching inquiry module 501 can be with the historical I/O information that has an immediate start address with current read request as the most historical I/O information of coupling.
Related judge module 502 judges that the historical I/O information of the coupling whether current read request is inquired with matching inquiry module 501 is associated, if trigger message update module 504 then, otherwise trigger message is set up module 503; Preferably; For historical I/O information as shown in Figure 3; Related judge module 502 can judge whether current read request all is positioned at corresponding scope with the difference of the poorest and access time of the start address of the historical I/O information of coupling, is associated with the historical I/O information of mating most otherwise representes current read request and the historical I/O information onrelevant that matees most if then represent current read request.
Information is set up module 503, is newly-built historical I/O information of current read request and end process; Preferably, for historical I/O information as shown in Figure 3, information set up module 503 can with the start address of current read request, end address, access time respectively as start address, end address, access time in the newly-built historical I/O information; And it is invalid that the access times in the newly-built historical I/O information are set to 1, stream information ID is made as.
Information updating module 504 is upgraded the historical I/O information of mating most according to current read request, triggers continuous query module 505 then; Preferably, for historical I/O information as shown in Figure 3, information updating module 504 can be with reference to upgrading like the mode that step 204 adopted in the preamble.
Continuous query module 505 judges whether the most historical I/O information of coupling after upgrading exists the stream information of correspondence, belongs to an already present stream, also triggers stream update module 506 if then confirm current read request, flows judging module 507 otherwise trigger; Preferably; For historical I/O information as shown in Figure 3; Continuous query module 505 can judge whether the stream information ID in the historical I/O information of mating the most is effective; If effectively expression the most historical I/O information of coupling have corresponding stream information, otherwise expression the most historical I/O information of coupling do not have corresponding stream information.
Stream update module 506 is upgraded corresponding stream information, and triggers and read to start module 509 in advance; Preferably; For stream information as shown in Figure 4, stream update module 506 is updated to the stream length in the stream information of correspondence the start address after end address after the renewal of the most historical I/O information of coupling deducts renewal, the access time that the last access time just is updated to current read request.
Flow judging module 507, judge whether the most historical I/O information of coupling after upgrading satisfies the condition of stream mode, if confirm that then current read request has formed a new stream, also triggering stream is set up module 508, otherwise end process; Preferably; For historical I/O information as shown in Figure 3; The stream judging module can judge that whether the access times of the historical I/O information of mating most after the renewal are greater than preset threshold value; If the most historical I/O information of coupling after then expression is upgraded satisfies the condition of stream mode, otherwise the most historical I/O information of coupling after the expression renewal does not satisfy the condition of stream mode.
Stream is set up module 508, and the stream information ID of the historical I/O information of the coupling for the new stream information of the historical I/O information creating of the coupling the most after upgrading and after renewal is set is effective respective value, and, trigger and read to start module 509 in advance.
Read to start module 509 in advance, trigger preparatory read operation to current read request.
Only just trigger preparatory read operation doping under the situation that current read request belongs to the stream mode that is fit to read in advance owing to read to start module 509 in advance to current read request; Thereby can improve the hit rate of read request and avoid position random access execution to read the I/O wasting of resources that is caused in advance, and then help to improve the performance of storage system.
Need to prove; Above-mentioned matching inquiry module 501, related judge module 502, information are set up module 503, information updating module 504, continuous query module 505, stream update module 506, stream judging module 507, stream and are set up module 508 and can constitute one and independently flow prediction unit, and this stream prediction unit is not limited in the control that is used for reading in advance.
In addition; Reading to start module 509 triggerings in advance to after the preparatory read operation of current read request; Promptly can carry out preparatory read operation to the current read request that belongs to stream, if but carry out preparatory read operation according to the changeless length of reading in advance simply, might excessive to cause a large amount of preparatory read datas be not the needed data of current read request owing to reading length in advance; Thereby the probability that preparatory read data is hit is not high, so cause the I/O resource waste, cause performance of storage system to descend.For example video editing business has different code streams, and the IO characteristics also can be different, and the preparatory read data amount that needs also can be different.
Therefore, reading control device in advance and preferably also can set up and be used to calculate the functional module of reading length in advance and reading in advance to adjudicate in the present embodiment.
Specifically, the functional module that to be used to calculate the functional module of reading length in advance be length computation module 510, be used for reading in advance to adjudicate is for read execution module 511 in advance.
Length computation module 510, with reference to the mean value L that reads length in advance of several streams in the regular period, confirm to the preparatory read operation of current read request should use read length in advance; Preferably, length computation module 510 can be calculated the mean value L of the stream length in the stream information of nearest some streams, and with the merchant L/P of the mean value L that calculates and a preset empirical value P as preparatory read operation required read length in advance; Like this, the preceding end address J that once reads in advance in the corresponding stream information just is updated to J+L/P.
Read execution module 511 in advance; Judge whether the needed data of current read request are read in the buffer memory by preparatory read operation before, if then allow to carry out preparatory read operation to current read request according to reading length in advance; Otherwise cancellation is to the preparatory read operation of current read request; Preferably; Whether read the difference of start address that execution module 511 can judge preceding end address of once reading in advance and current read request in the corresponding stream information in advance less than mean value L; If; Represent that then the needed data of current read request are not all read in the buffer memory by preparatory read operation before, otherwise, represent that the needed data of current read request are all read in the buffer memory by preparatory read operation before.
The above is merely preferred embodiment of the present invention, is not to be used to limit protection scope of the present invention.All within spirit of the present invention and principle, any modification of being done, be equal to replacement and improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. a stream Forecasting Methodology is characterized in that this stream Forecasting Methodology comprises the steps:
The historical I/O information of mating most of A, inquiry and current read request;
B, judge that whether current read request is associated with the historical I/O information of said coupling, if execution in step D then, otherwise execution in step C;
C, be newly-built historical I/O information of current read request and process ends;
D, upgrade the historical I/O information of said coupling, execution in step E then according to current read request;
Whether the said the most historical I/O information of coupling after E, judgement are upgraded exists corresponding stream information, belongs to already present stream and execution in step F if then confirm current read request, otherwise execution in step G;
F, corresponding stream information and the process ends of renewal;
Whether the said the most historical I/O information of coupling after G, judgement are upgraded satisfies the condition of stream mode, if corresponding new stream of the said historical I/O information of mating the most after then confirming to upgrade and execution in step H, otherwise process ends;
H, be the said new stream information and the process ends of the most historical I/O information creating of coupling after upgrading.
2. stream Forecasting Methodology as claimed in claim 1 is characterized in that, said historical I/O information comprises start address, end address, access time, access times and stream information ID at least; Said stream information comprises stream length and last access time at least;
In said steps A: the historical I/O information that has immediate start address with current read request is the historical I/O information of mating most;
In said step B: judge whether current read request all is positioned at corresponding scope with the said difference of the poorest and access time of the start address of the historical I/O information of coupling, be associated with said historical I/O information of mating most otherwise represent current read request and the said historical I/O information onrelevant that matees most if then represent current read request;
In said step C: with the start address of current read request, end address, access time respectively as start address, end address, access time in the newly-built historical I/O information; And it is invalid that the access times in the newly-built historical I/O information are set to 1, stream information ID is made as;
In said step D: a start address of minimum in the start address of the said historical I/O information of mating most that the start address and the renewal of current read request is preceding as the said historical I/O information of mating most after upgrading; With the end address of current read request with upgrade before the end address of historical I/O information of said coupling in a maximum end address as the said historical I/O information of mating most after upgrading; And the access times of the said historical I/O information of mating most as access time of the historical I/O information of the said coupling after upgrading, after will upgrading add 1 with access time of current read request;
In said step e: judge whether the stream information ID in the said historical I/O information of mating the most is effective; If effectively then represent that there is corresponding stream information in the historical I/O information of said coupling, otherwise represent that there is not corresponding stream information in the historical I/O information of said coupling;
In said step F: the stream length in the stream information of correspondence is updated to the start address after end address after the renewal of the said the most historical I/O information of coupling deducts renewal, is updated to the access time of current read request the last access time in the stream information of correspondence;
In said step G: whether the access times of judging the said historical I/O information of mating most after upgrading are greater than preset threshold value; If; The said the most historical I/O information of coupling after then expression is upgraded satisfies the condition of stream mode, otherwise the said the most historical I/O information of coupling after the expression renewal does not satisfy the condition of stream mode.
One kind based on stream prediction read control method in advance, it is characterized in that this is read control method in advance and comprises the steps:
The historical I/O information of mating most of A, inquiry and current read request;
B, judge that whether current read request is associated with the historical I/O information of said coupling, if execution in step D then, otherwise execution in step C;
C, be newly-built historical I/O information of current read request and process ends;
D, upgrade the historical I/O information of said coupling, execution in step E then according to current read request;
Whether the said the most historical I/O information of coupling after E, judgement are upgraded exists corresponding stream information, belongs to already present stream and execution in step F if then confirm current read request, otherwise execution in step G;
F, the corresponding stream information of renewal, execution in step I then;
Whether the said the most historical I/O information of coupling after G, judgement are upgraded satisfies the condition of stream mode, if corresponding new stream of the said historical I/O information of mating the most after then confirming to upgrade and execution in step H, otherwise process ends;
The stream information ID of the historical I/O information of H, the coupling for the new stream information of the historical I/O information creating of the said coupling the most after upgrading and after renewal is set is effective respective value, then execution in step I;
I, triggering are directed against the preparatory read operation of current read request.
4. the control method of reading in advance as claimed in claim 3 is characterized in that, said historical I/O information comprises start address, end address, access time, access times and stream information ID at least; Said stream information comprises stream length and last access time at least;
In said steps A: the historical I/O information that has immediate start address with current read request is the historical I/O information of mating most;
In said step B: judge whether current read request all is positioned at corresponding scope with the said difference of the poorest and access time of the start address of the historical I/O information of coupling, be associated with said historical I/O information of mating most otherwise represent current read request and the said historical I/O information onrelevant that matees most if then represent current read request;
In said step C: with the start address of current read request, end address, access time respectively as start address, end address, access time in the newly-built historical I/O information; And it is invalid that the access times in the newly-built historical I/O information are set to 1, stream information ID is made as;
In said step D: a start address of minimum in the start address of the said historical I/O information of mating most that the start address and the renewal of current read request is preceding as the said historical I/O information of mating most after upgrading; With the end address of current read request with upgrade before the end address of historical I/O information of said coupling in a maximum end address as the said historical I/O information of mating most after upgrading; And the access times of the said historical I/O information of mating most as access time of the historical I/O information of the said coupling after upgrading, after will upgrading add 1 with access time of current read request;
In said step e: judge whether the stream information ID in the said historical I/O information of mating the most is effective; If effectively then represent that there is corresponding stream information in the historical I/O information of said coupling, otherwise represent that there is not corresponding stream information in the historical I/O information of said coupling;
In said step F: the stream length in the stream information of correspondence is updated to the start address after end address after the renewal of the said the most historical I/O information of coupling deducts renewal, is updated to the access time of current read request the last access time in the stream information of correspondence;
In said step G: whether the access times of judging the said historical I/O information of mating most after upgrading are greater than preset threshold value; If; The said the most historical I/O information of coupling after then expression is upgraded satisfies the condition of stream mode, otherwise the said the most historical I/O information of coupling after the expression renewal does not satisfy the condition of stream mode.
5. the control method of reading in advance as claimed in claim 4 is characterized in that the end address that said stream information is once read before further comprising in advance;
After said step I, this is read control method in advance and further comprises:
The mean value of the stream length in the stream information of J, nearest some the streams of calculating; And with the merchant of the mean value that calculates and a preset empirical value as to current read request read length in advance, upgrade the preceding end address of once reading in advance in the corresponding stream information based on the length of reading in advance that calculates then;
Whether the difference of the preceding end address of once reading in advance in the stream information of K, judgement correspondence and the start address of current read request is less than said mean value; If; Then carry out preparatory read operation to current read request according to the said length of reading in advance; Otherwise, the preparatory read operation that cancellation has triggered to current read request.
6. one kind is flowed prediction unit, it is characterized in that this stream prediction unit comprises:
The matching inquiry module, the historical I/O information of mating most of inquiry and current read request;
Related judge module judges that whether current read request is associated with the historical I/O information of said coupling, if trigger message update module then, otherwise trigger message is set up module;
Information is set up module, is newly-built historical I/O information of current read request and end process;
Information updating module is upgraded said historical I/O information of mating most according to current read request, triggers the continuous query module then;
The continuous query module judges whether the said the most historical I/O information of coupling after upgrading exists the stream information of correspondence, belongs to an already present stream, also triggers the stream update module if then confirm current read request, flows judging module otherwise trigger;
The stream update module is upgraded corresponding stream information and end process;
The stream judging module; Judge whether the said the most historical I/O information of coupling after upgrading satisfies the condition of stream mode; If the corresponding new stream of the historical I/O information of the said coupling the most after then confirm upgrading, and trigger stream and set up module, otherwise end process;
Stream is set up module, is the said new stream information and the end process of the most historical I/O information creating of coupling after upgrading.
7. stream prediction unit as claimed in claim 6 is characterized in that, said historical I/O information comprises start address, end address, access time, access times and stream information ID at least; Said stream information comprises stream length and last access time at least;
The historical I/O information that the matching inquiry module will have an immediate start address with current read request is as the most historical I/O information of coupling;
Related judge module judges whether current read request all is positioned at corresponding scope with the difference of the poor and access time of the start address of the historical I/O information of said coupling, is associated with said historical I/O information of mating most otherwise representes current read request and the said historical I/O information onrelevant that matees most if then represent current read request;
Information set up module with the start address of current read request, end address, access time respectively as start address, end address, access time in the newly-built historical I/O information; And it is invalid that the access times in the newly-built historical I/O information are set to 1, stream information ID is made as;
Information updating module with the start address of current read request with upgrade before the start address of historical I/O information of said coupling in a minimum start address as the said historical I/O information of mating most after upgrading; With the end address of current read request with upgrade before the end address of historical I/O information of said coupling in a maximum end address as the said historical I/O information of mating most after upgrading; And the access times of the said historical I/O information of mating most as access time of the historical I/O information of the said coupling after upgrading, after will upgrading add 1 with access time of current read request;
The continuous query module judges whether the stream information ID in the said historical I/O information of mating the most is effective; If effectively then represent that there is corresponding stream information in the historical I/O information of said coupling, otherwise represent that there is not corresponding stream information in the historical I/O information of said coupling;
The stream update module is updated to the stream length in the stream information of correspondence the start address after end address after the renewal of the said the most historical I/O information of coupling deducts renewal; And, be updated to access time of current read request the last access time in the stream information of correspondence;
The stream judging module judges that whether the access times of the said historical I/O information of mating most after upgrading are greater than preset threshold value; If; The said the most historical I/O information of coupling after then expression is upgraded satisfies the condition of stream mode, otherwise the said the most historical I/O information of coupling after the expression renewal does not satisfy the condition of stream mode.
8. read control device in advance for one kind, it is characterized in that, this is read control device in advance and comprises:
The matching inquiry module, the historical I/O information of mating most of inquiry and current read request;
Related judge module judges that whether current read request is associated with the historical I/O information of said coupling, if trigger message update module then, otherwise trigger message is set up module;
Information is set up module, is newly-built historical I/O information of current read request and end process;
Information updating module is upgraded said historical I/O information of mating most according to current read request, triggers the continuous query module then;
The continuous query module judges whether the said the most historical I/O information of coupling after upgrading exists the stream information of correspondence, belongs to an already present stream, also triggers the stream update module if then confirm current read request, flows judging module otherwise trigger;
The stream update module is upgraded corresponding stream information, and triggers and read to start module in advance;
The stream judging module; Judge whether the said the most historical I/O information of coupling after upgrading satisfies the condition of stream mode; If the corresponding new stream of the historical I/O information of the said coupling the most after then confirm upgrading, and trigger stream and set up module, otherwise end process;
Stream is set up module, and the stream information ID of the historical I/O information of the coupling for the new stream information of the historical I/O information creating of the said coupling the most after upgrading and after renewal is set is effective respective value, and, trigger and read to start module in advance;
Read to start module in advance, trigger preparatory read operation to current read request.
9. the control device of reading in advance as claimed in claim 8 is characterized in that, said historical I/O information comprises start address, end address, access time, access times and stream information ID at least; Said stream information comprises stream length and last access time at least;
The historical I/O information that the matching inquiry module will have an immediate start address with current read request is as the most historical I/O information of coupling;
Related judge module judges whether current read request all is positioned at corresponding scope with the difference of the poor and access time of the start address of the historical I/O information of said coupling, is associated with said historical I/O information of mating most otherwise representes current read request and the said historical I/O information onrelevant that matees most if then represent current read request;
Information set up module with the start address of current read request, end address, access time respectively as start address, end address, access time in the newly-built historical I/O information; And it is invalid that the access times in the newly-built historical I/O information are set to 1, stream information ID is made as;
Information updating module with the start address of current read request with upgrade before the start address of historical I/O information of said coupling in a minimum start address as the said historical I/O information of mating most after upgrading; With the end address of current read request with upgrade before the end address of historical I/O information of said coupling in a maximum end address as the said historical I/O information of mating most after upgrading; And the access times of the said historical I/O information of mating most as access time of the historical I/O information of the said coupling after upgrading, after will upgrading add 1 with access time of current read request;
The continuous query module judges whether the stream information ID in the said historical I/O information of mating the most is effective; If effectively then represent that there is corresponding stream information in the historical I/O information of said coupling, otherwise represent that there is not corresponding stream information in the historical I/O information of said coupling;
The stream update module is updated to the stream length in the stream information of correspondence the start address after end address after the renewal of the said the most historical I/O information of coupling deducts renewal; And, be updated to access time of current read request the last access time in the stream information of correspondence;
The stream judging module judges that whether the access times of the said historical I/O information of mating most after upgrading are greater than preset threshold value; If; The said the most historical I/O information of coupling after then expression is upgraded satisfies the condition of stream mode, otherwise the said the most historical I/O information of coupling after the expression renewal does not satisfy the condition of stream mode.
10. the control device of reading in advance as claimed in claim 9 is characterized in that the end address that said stream information is once read before further comprising in advance;
This is read control device in advance and reads in advance to control and further comprise and can be read in advance to start that module triggers like lower module:
The length computation module; The mean value of the stream length in the stream information of nearest some the streams of calculating; And with the merchant of the mean value that calculates and a preset empirical value as preparatory read operation required read length in advance, upgrade the preceding end address of once reading in advance in the corresponding stream information based on the length of reading in advance that calculates then;
Read execution module in advance; Whether the difference of the preceding end address of once reading in advance in the stream information of judgement correspondence and the start address of current read request is less than said mean value; If; Then allow to carry out preparatory read operation, otherwise cancellation is to the preparatory read operation of current read request to current read request according to the said length of reading in advance.
CN2010106225693A 2010-12-28 2010-12-28 Flow prediction method and device, and prereading control method and device Active CN102073463B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010106225693A CN102073463B (en) 2010-12-28 2010-12-28 Flow prediction method and device, and prereading control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010106225693A CN102073463B (en) 2010-12-28 2010-12-28 Flow prediction method and device, and prereading control method and device

Publications (2)

Publication Number Publication Date
CN102073463A CN102073463A (en) 2011-05-25
CN102073463B true CN102073463B (en) 2012-08-22

Family

ID=44032016

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010106225693A Active CN102073463B (en) 2010-12-28 2010-12-28 Flow prediction method and device, and prereading control method and device

Country Status (1)

Country Link
CN (1) CN102073463B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508642A (en) * 2011-11-10 2012-06-20 华为技术有限公司 Method and device for prefetching data
CN107168891B (en) * 2014-07-23 2020-08-14 华为技术有限公司 I/O feature identification method and device
CN104134027B (en) * 2014-07-23 2017-10-10 华为技术有限公司 A kind of sequential flow knows method for distinguishing and device
CN105487987B (en) * 2015-11-20 2018-09-11 深圳市迪菲特科技股份有限公司 A kind of concurrent sequence of processing reads the method and device of IO
CN106708750B (en) * 2016-12-22 2020-08-04 郑州云海信息技术有限公司 Cache pre-reading method and system of storage system
CN110389709A (en) * 2018-04-19 2019-10-29 北京忆恒创源科技有限公司 Sequential stream detection and data pre-head
CN110580128A (en) * 2018-06-11 2019-12-17 北京忆恒创源科技有限公司 Directing data pre-reads using cache feedback information
CN111694504B (en) * 2019-03-15 2023-03-31 杭州宏杉科技股份有限公司 Method and device for processing read request

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1994028485A1 (en) * 1993-05-28 1994-12-08 Rambus, Inc. Cache system and method for prefetching of data
CN1366633A (en) * 2000-03-31 2002-08-28 松下电器产业株式会社 Disk memory device, data pre-head method, and recorded medium
US7313656B1 (en) * 2004-12-27 2007-12-25 Emc Corporation Pre-fetch prediction method for disk drives
CN101788887A (en) * 2010-02-05 2010-07-28 浪潮(北京)电子信息产业有限公司 System and method of I/O cache stream based on database in disk array

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1994028485A1 (en) * 1993-05-28 1994-12-08 Rambus, Inc. Cache system and method for prefetching of data
CN1366633A (en) * 2000-03-31 2002-08-28 松下电器产业株式会社 Disk memory device, data pre-head method, and recorded medium
US7313656B1 (en) * 2004-12-27 2007-12-25 Emc Corporation Pre-fetch prediction method for disk drives
CN101788887A (en) * 2010-02-05 2010-07-28 浪潮(北京)电子信息产业有限公司 System and method of I/O cache stream based on database in disk array

Also Published As

Publication number Publication date
CN102073463A (en) 2011-05-25

Similar Documents

Publication Publication Date Title
CN102073463B (en) Flow prediction method and device, and prereading control method and device
CN101595461B (en) Extending flash drive lifespan
CN100412865C (en) Read-copy update system and method
KR101434887B1 (en) Cache system and cache service providing method using network switches
JP6525109B2 (en) Control device, transfer method, and computer program
CN104471434A (en) Location prediction for power conservation in a mobile device
EP2793175A2 (en) Optimization utilizing machine learning
CN102609466B (en) Method and system for controlling shared memory
CN104808952A (en) Data caching method and device
CN103095686B (en) Focus metadata access control method and service device
TW201015289A (en) Coordinated link power management
CN102230804B (en) Method for updating and displaying navigation route of real-time traffic status and navigation server
CN104571954A (en) Method and device for storing data
CN103514216A (en) Serial number generating method based on database system
CN103885807A (en) Equipment program updating method
JP2005115600A (en) Information processor and method
CN105308566A (en) On-demand scalable timer wheel
JP5578850B2 (en) How to update the data bank
US9300486B2 (en) Dynamically managing a system of servers
KR102311557B1 (en) Lane information generation system by lane
US8554798B2 (en) Asynchronous state engine with plug-ins for flexible application development
CN108293040B (en) Transfer control device, vehicle, and transfer control method
CN108944921A (en) A kind of longitudinally controlled method and apparatus for vehicle
KR20210151771A (en) A recording medium in which a program for executing a vehicle dispatch management method running to a destination, a management server used therefor, and a dispatch management method for a vehicle running to a destination are recorded
US8234513B2 (en) Power management method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Room 505, Taixing Building, 11 Garden East Road, Haidian District, Beijing, 100191

Co-patentee after: Shenzhen Innovation Software Technology Co., Ltd.

Patentee after: Innovation Technology Co., Ltd.

Address before: Room 0801-0810, 51 College Road, Haidian District, Beijing, 100191

Co-patentee before: Chuangxinke Software Technology (Shenzhen) Co., Ltd.

Patentee before: Innovation and Technology Storage Technology Co., Ltd.