Content of the invention
The embodiment of the present invention provides a kind of recognition methods of input and output I/O type and device, with solve in prior art when
Problem to sequential flow identification mistake when IO is out of order.
In a first aspect, the embodiment of the present invention provides a kind of recognition methods of input and output I/O type, including:
Receive I/O Request;
Attribute information according to described I/O Request and preset algorithm judge whether described I/O Request meets existing set of types
The criterion closed;In each existing type set, included each I/O Request belongs to same IO sequential flow;
If judging to know the criterion that described I/O Request meets an existing type set, using described I/O Request as one
Individual new element is added in described existing type set.
In conjunction with a first aspect, in the first mode in the cards of first aspect, described attribute information includes described
The temporal information of I/O Request and the positional information of corresponding storage device;Described preset algorithm is euclidean distance method;
Correspondingly, the attribute information according to described I/O Request and preset algorithm judge whether described I/O Request meets and have
The criterion of type set include:
According to described temporal information and described positional information, calculate described I/O Request and each existing class using euclidean distance method
Spacing between the center of type set;
The spacing calculating is compared with the distance threshold of corresponding existing type set, if spacing is not more than distance
Threshold value, then know that described I/O Request meets the criterion of described corresponding existing type set.
In conjunction with the first mode in the cards of first aspect, in the second of first aspect mode in the cards
In, also include:
If spacing is more than distance threshold, know that described I/O Request is unsatisfactory for the criterion of described type set;If institute
State the criterion that I/O Request is unsatisfactory for all existing type set, then using described I/O Request as unique element, generate one
Individual new type set.
In conjunction with first aspect, first aspect the first to second any one mode in the cards, in first aspect
In the third mode in the cards, described described I/O Request is added in described type set it as new element
Afterwards, also include:
According to the attribute information of described I/O Request, update the criterion of described type set.
The third mode in the cards in conjunction with first aspect, in the 4th kind of mode in the cards of first aspect,
Also include:
Delete the type set not having new element to add in the scheduled time.
Second aspect, the embodiment of the present invention provides a kind of identifying device of I/O type, including:
Receiver module, for receiving I/O Request;
For the attribute information according to described I/O Request and preset algorithm, judge module, judges whether described I/O Request is full
Foot has the criterion of type set;In each existing type set, included each I/O Request belongs to same IO sequential flow;
Processing module, if for judging to know the criterion that described I/O Request meets an existing type set, by institute
State I/O Request to be added in described existing type set as a new element.
In conjunction with second aspect, in the first mode in the cards of second aspect, described attribute information includes described
The temporal information of I/O Request and the positional information of corresponding storage device;Described preset algorithm is euclidean distance method;
Correspondingly, described judge module includes:
Computing unit, for according to described temporal information and described positional information, calculating described IO using euclidean distance method
Spacing between the center of request and each existing type set;
Comparing unit, for the spacing calculating is compared with the distance threshold of corresponding existing type set, if
Spacing is not more than distance threshold, then know that described I/O Request meets the criterion of described corresponding existing type set.
The first mode in the cards in conjunction with second aspect, in the second mode in the cards of second aspect,
If described comparing unit is additionally operable to spacing is more than distance threshold, know that described I/O Request is unsatisfactory for the differentiation of described type set
Condition;If described I/O Request is unsatisfactory for the criterion of all existing type set, using described I/O Request as unique unit
Element, generates a new type set.
In conjunction with second aspect, second aspect the first to second any one mode in the cards, in second aspect
In three kinds of modes in the cards, also include:
Described I/O Request is added in described type set it as new element for described by update module
Afterwards, the attribute information according to described I/O Request, updates the criterion of described type set.
The third mode in the cards in conjunction with second aspect, in the 4th kind of mode in the cards of second aspect,
Also include:
Removing module, for deleting the type set not having new element to add in the scheduled time.
The recognition methods of embodiment of the present invention input and output I/O type and device, by receiving I/O Request, according to described IO
The attribute information of request and preset algorithm judge whether described I/O Request meets the criterion of existing type set;Each existing
In type set, included each I/O Request belongs to same IO sequential flow, if judging to know that described I/O Request meets an existing class
The criterion of type set, then be added to described I/O Request in described existing type set as a new element.I.e. root
I/O Request is divided in suitable type set attribute information according to I/O Request, and belonging to the I/O Request in same type set is one
Road sequential flow, it is achieved thereby that the identification to sequential flow, lifts the hit rate prefetching, the performance of reading data is greatly improved, solve
In prior art when IO is out of order the problem to sequential flow identification mistake.
Specific embodiment
Purpose, technical scheme and advantage for making the embodiment of the present invention are clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described it is clear that described embodiment is
The a part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment being obtained under the premise of not making creative work, broadly falls into the scope of protection of the invention.
Fig. 1 is the flow chart of the recognition methods embodiment one of input and output I/O type of the present invention, as shown in figure 1, this enforcement
The method of example can include:
Step 101, reception I/O Request.
Wherein it is possible to the I/O Request sending for Receiving Host, this I/O Request can be order IO or random IO.
Step 102, the attribute information according to described I/O Request and preset algorithm judge whether described I/O Request meets
There is the criterion of type set;In each existing type set, included each I/O Request belongs to same IO sequential flow.
Wherein, the attribute information of described I/O Request can include the temporal information of I/O Request, the size of I/O Request and IO
Arbitrary attribute such as the positional information of the corresponding storage device of request or multiple combinations of attributes are using the described I/O Request of composition
Attribute information, in addition flexibly can also be configured according to the service feature of I/O Request.
Wherein, described existing type set criterion flexibly can be set according to the attribute information of described I/O Request
Put.
If step 103 judges to know the criterion that described I/O Request meets an existing type set, please by described IO
Ask and be added in described existing type set as a new element.
The present embodiment, by receiving I/O Request, described in the attribute information according to described I/O Request and preset algorithm judgement
Whether I/O Request meets the criterion of existing type set;In all types of set, included each I/O Request belongs to same IO
Sequential flow, if judging to know the criterion that described I/O Request meets an existing type set, using described I/O Request as one
Individual new element is added in described existing type set.I.e. I/O Request is divided into suitable class by the attribute information according to I/O Request
In type set, belonging to the I/O Request in same type set is a road sequential flow, it is achieved thereby that the identification to sequential flow, lifting
The hit rate prefetching, is greatly improved the performance reading data, solves in prior art and identifies mistake when IO is out of order to sequential flow
Problem.
Fig. 2 is the flow chart of the recognition methods embodiment two of present invention I O type, as shown in Fig. 2 the method for the present embodiment
Can include:
Step 201, reception I/O Request.
Wherein it is possible to the I/O Request that Receiving Host sends, this I/O Request can be order IO can also be random IO.
Step 202, the attribute information according to described I/O Request and preset algorithm judge whether described I/O Request meets
There is the criterion of type set;If meeting, execution step 203, if being unsatisfactory for, execution step 204.
Wherein, in all types of set, included each I/O Request belongs to same IO sequential flow.
Wherein, described attribute information includes the temporal information of described I/O Request and the positional information of corresponding storage device;Institute
Stating preset algorithm is euclidean distance method;
Correspondingly, the attribute information according to described I/O Request and preset algorithm judge whether described I/O Request meets and have
The criterion of type set include:According to described temporal information and described positional information, calculate institute using euclidean distance method
State the spacing between I/O Request and the center of each existing type set;By the spacing calculating and corresponding existing type set
Distance threshold is compared.
If spacing is not more than distance threshold, know that I/O Request meets the criterion of described type set;If spacing is big
In distance threshold, then know that described I/O Request is unsatisfactory for the criterion of described type set, when described I/O Request is unsatisfactory for institute
Have existing type set criterion when, then execution step 204.
Specifically, the positional information of the corresponding storage device of I/O Request is position in disk for the corresponding data block of I/O Request
Information.
Step 203, described I/O Request is added in described type set as a new element.
Step 204, using described I/O Request as unique element, generate a new type set.
If having new element to add in step 205 described type set, according to the attribute letter of the new I/O Request adding
Breath, updates the criterion of described type set.
Step 206, delete the scheduled time in do not have new element add type set.
The present embodiment by accepting I/O Request, sentence by the temporal information according to described I/O Request and the position of corresponding storage device
Whether the described I/O Request that breaks meets the criterion of existing type set, if meeting the criterion of existing type set, will
Described I/O Request is added in described type set as new element, and according to the attribute information of the new I/O Request adding more
The newly criterion of described type set, if be unsatisfactory for the criterion of all existing type set, using I/O Request as only
The new type set of one Element generation, further, is carried out to the type set not having new element to add in the scheduled time
Delete, it is achieved thereby that the identification to I/O type, the I/O Request being divided into same type set belongs to same sequential flow IO, respectively
Set of types is combined into different sequential flow IO, and then realizes the identification of multichannel sequential flow, lifts the hit rate prefetching, reading is greatly improved
The performance of data.
Adopt a specific embodiment below, the technical scheme of embodiment of the method shown in Fig. 2 is described in detail.Figure
3 is the flow chart of the recognition methods embodiment three of present invention I O type, and Fig. 4 is the recognition methods embodiment three of present invention I O type
Structural representation, as shown in figure 3, the method for the present embodiment can include:
S301:The I/O Request a that storage device Receiving Host sends.
S302:Storage device judges its place segment data cell according to the temporal information of I/O Request a and positional information
(Chunk)Whether belong to existing type.
Wherein, temporal information receives the time of the I/O Request a of main frame transmission for storage device, and positional information is I/O Request
Positional information in disk for a corresponding data block.
Specifically, judge whether to belong to existing type procedure as follows:Please according to each IO in a set in existing type
The temporal information asked and positional information calculation go out the average time information of this set and average range information, will each I/O Request make
For an object, map that to, in 2 dimension spaces, calculate the central information of this set within this space, using identical
Method calculate the central information of each set in existing type set;When receive I/O Request a then according to its temporal information and
Positional information uses euclidean distance method to calculate the spacing at the center to each existing type set for the I/O Request a, by the spacing calculating
It is compared with the distance threshold of corresponding type set.
S303:If belonging to arbitrary set in existing type set, enter step 304, if being not belonging in existing type set
Arbitrary set then enters step 305.
Specifically, if the center distance of the I/O Request a calculating in S302 to each existing type set is not more than correspondence
All types of set distance threshold, then know that I/O Request a meets the criterion of the type set;If it is not, then knowing that IO please
A is asked to be unsatisfactory for the criterion of the type combination.
S304:I/O Request a is added in suitable type set, as shown in figure 4, and the attribute letter according to I/O Request a
Breath updates the criterion of the type set, and enters S306.
Specifically, after each is integrated into generation, because order IO is to conduct interviews a sector address is spatially unidirectional
, the object in set is to constantly update with the I/O Request newly arriving, so the criterion of set also should be corresponding
It is updated, to adapt to new I/O type is identified.
S305:Using I/O Request a as unique element, generate a new set, as shown in figure 4, and according to I/O Request a
Attribute information update the criterion of this new set, enter S306.
In S304 and S305, when I/O Request a is put under in appropriate set, according to I/O Request a, main frame desired data is returned
After main frame, the Chunk that I/O Request a can be located retains its IO attribute information, for safeguarding its affiliated type set
Aggregate information, in Chunk, other data messages are purged.
S306:The type set not having new element to add in Preset Time is deleted.
Specifically, because the data entering storage system is to constantly update, in such as video request program, play regards
Frequency file must be eliminated as early as possible and can not be always present in internal memory, so the either establishment of new type set or I/O type
Identification be all dynamic.
The concrete recognition methods of S301-S306 when storage device receives other I/O Request, can be adopted, the method can
It is applied to the identification of any type IO, according to above-mentioned steps, I/O Request is divided in suitable type set, a type set
In each I/O Request, corresponding same sequential flow, different type set corresponds to different order stream, and then have effectively achieved multichannel
The identification of sequential flow, lifts the hit rate prefetching, and the performance of reading data is greatly improved.Further, permissible using said method
It is prevented effectively from sequential flow and random IO is erroneously interpreted as due to the presence of other road orders IO, eliminate between multichannel sequential flow
Interference, in the case of identifying multichannel sequential flow respectively, can take to prefetch accordingly/cache to each road order IO and arrange
Apply, reach performance of storage system and optimize;In multichannel sequential flow IO and random IO and in the case of depositing, exclude the dry of random IO
Disturb, can correctly identify sequential flow IO, it is to avoid random IO is misidentified as order IO, causes to prefetch/cache measure mistake, band
Carry out unnecessary performance loss;For the flexible configuration of IO attribute, multiple dimensions are identified to order IO and random IO,
Largely relax the out of order impact that algorithm is caused of IO.
Fig. 5 is the structural representation of the device embodiment one of identification of present invention I O type, as shown in figure 5, the present embodiment
Device can include:Receiver module 11, judge module 12 and processing module 13, wherein, receiver module 11 is used for receiving IO
Request, judge module 12 is used for judging whether described I/O Request meets according to the attribute information of described I/O Request and preset algorithm
The criterion of existing type set;In each existing type set, included each I/O Request belongs to same IO sequential flow, place
If reason module 13 is used for the criterion judging to know that described I/O Request meets an existing type set, described I/O Request is made
It is added in described existing type set for a new element.
The device of the present embodiment, can be used for executing the technical scheme of embodiment of the method shown in Fig. 1, it realizes principle and skill
Art effect is similar to, and here is omitted.
Fig. 6 is the structural representation of the device embodiment two of present invention I O type identification, as shown in fig. 6, the present embodiment
Device on the basis of Fig. 5 shown device structure, further, described attribute information include described I/O Request temporal information and
The positional information of corresponding storage device, described preset algorithm is euclidean distance method, and judge module 12 can include:Computing unit
121 and comparing unit 122, wherein, computing unit 121 is used for according to described temporal information and described positional information, using European
Furthest Neighbor calculates the spacing between described I/O Request and the center of each existing type set, and comparing unit 122 is used for calculating
Spacing be compared with the distance threshold of corresponding existing type set, if spacing is not more than distance threshold, know described
I/O Request meets the criterion of described corresponding existing type set.
Wherein, if described comparing unit 122 is additionally operable to spacing and is more than distance threshold, know that described I/O Request is unsatisfactory for institute
State the criterion of type set;If described I/O Request is unsatisfactory for the criterion of all existing type set, by described IO
Request, as unique element, generates a new type set.
Further, this device also includes update module 61 and removing module 62, and wherein, update module 61 is used for described general
After described I/O Request is added in described type set as a new element, according to the attribute information of described I/O Request,
Update the criterion of described type set, removing module 62 is used for deleting the set of types not having new element to add in the scheduled time
Close.
The device of the present embodiment, can be used for executing the technical scheme of embodiment of the method shown in Fig. 2, it realizes principle and skill
Art effect is similar to, and here is omitted.
It should be understood that disclosed apparatus and method in several embodiments provided by the present invention, can be passed through it
Its mode is realized.For example, device embodiment described above is only schematically, for example, the division of described unit, and only
It is only a kind of division of logic function, actual can have other dividing mode when realizing, and for example multiple units or assembly can be tied
Close or be desirably integrated into another system, or some features can be ignored, or do not execute.Another, shown or discussed
Coupling each other or direct-coupling or communication connection can be by some interfaces, the INDIRECT COUPLING of device or unit or logical
Letter connects, and can be electrical, mechanical or other forms.
The described unit illustrating as separating component can be or may not be physically separate, show as unit
The part showing can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple
On NE.The mesh to realize this embodiment scheme for some or all of unit therein can be selected according to the actual needs
's.
In addition, can be integrated in a processing unit in each functional unit in each embodiment of the present invention it is also possible to
It is that unit is individually physically present it is also possible to two or more units are integrated in a unit.Above-mentioned integrated list
Unit both can be to be realized in the form of hardware, it would however also be possible to employ the form that hardware adds SFU software functional unit is realized.
The above-mentioned integrated unit realized in the form of SFU software functional unit, can be stored in an embodied on computer readable and deposit
In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions with so that a computer
Equipment(Can be personal computer, server, or network equipment etc.)Or processor(processor)Execution the present invention each
The part steps of embodiment methods described.And aforesaid storage medium includes:USB flash disk, portable hard drive, read-only storage(Read-
Only Memory, ROM), random access memory(Random Access Memory, RAM), magnetic disc or CD etc. various
Can be with the medium of store program codes.
Those skilled in the art can be understood that, for convenience and simplicity of description, only with above-mentioned each functional module
Division be illustrated, in practical application, can as desired will above-mentioned functions distribution complete by different functional modules
Become, the internal structure of device will be divided into different functional modules, to complete all or part of function described above.On
State the specific work process of the device of description, may be referred to the corresponding process in preceding method embodiment, will not be described here.
Finally it should be noted that:Various embodiments above only in order to technical scheme to be described, is not intended to limit;To the greatest extent
Pipe has been described in detail to the present invention with reference to foregoing embodiments, it will be understood by those within the art that:Its according to
So the technical scheme described in foregoing embodiments can be modified, or wherein some or all of technical characteristic is entered
Row equivalent;And these modifications or replacement, do not make the essence of appropriate technical solution depart from various embodiments of the present invention technology
The scope of scheme.