Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
Fig. 1 is the process flow diagram of an embodiment of buffer area disposal route of the present invention, and as shown in Figure 1, the method for present embodiment comprises:
Step 101, send the buffer size computation requests, carry the operation note information relevant in the said buffer size computation requests with this input-output operation to the buffer area opertaing device.
For instance, after accomplishing an IO operation, the buffer area treatment facility can send the buffer size computation requests to the buffer area opertaing device, has carried in this buffer size computation requests and the relevant operation note information of this IO operation.This operation note information can comprise and the relevant various record data of this IO operation; For instance; These record data can comprise the running environment parameter and the information etc. that expends time in of this IO operation, can reflect the performance of this IO operation through operation note information comprehensively.
The buffer size information that step 102, the said buffer area opertaing device of reception also feed back according to said operation note information acquisition.
Concrete, the buffer area opertaing device can obtain the operation note information of carrying in this buffer size computation requests after receiving this buffer size computation requests, thereby can be according to this operation note information acquisition buffer size information.
Obtain buffer size information principle can for: if the efficient of this IO operation is higher than the efficient of preceding IO operation; The data processing time that is this IO operation is less than the data processing time that a preceding IO operates; Then increase the size of buffer area; The best buffer size that is current acquisition is compared with the preceding best buffer size that once obtains, and can further increase, thereby can obtain higher IO operating efficiency; If the efficient of this IO operation is lower than the efficient of preceding IO operation; Be the data processing time of the data processing time of this IO operation more than preceding IO operation, then reduce the size of buffer area, i.e. the best buffer size of current acquisition is compared with the preceding best buffer size that once obtains; Need reduce; Thereby under the lower situation of IO operating efficiency, improve the efficient of IO operation, and then guarantee the success ratio of IO operation through the size that reduces buffer area; Otherwise remain unchanged, i.e. the best buffer size of current acquisition equates with the preceding best buffer size that once obtains.
In concrete implementation procedure; Process according to operation note information acquisition buffer size information can be accomplished through the computing technique parameter; Technical parameter according to calculating is obtained confirms how to regulate buffer size; Reaching the buffer size of current the best, thereby better improve the efficient of IO operation.
Step 103, the size of regulating buffer area according to said buffer size information.
Concrete, the buffer area opertaing device can be given the buffer area treatment facility with the buffer size information feedback that obtains, thereby makes the buffer area treatment facility can regulate the size of buffer area according to this buffer size information.
In system's operation a period of time; After carrying out repeatedly the IO operation, above-mentioned steps 101 can be carried out repeatedly with step 102 repeatedly, thereby repeatedly the size of buffer area is regulated; Thereby make the size of buffer area be adjusted to current optimum value gradually, fully adapt to the program run environment.
Present embodiment is through sending the buffer size computation requests of carrying operation note information to the buffer area opertaing device; Make the buffer area opertaing device can be used to regulate the buffer size information of buffer size according to this operation note information acquisition; And give the buffer area treatment facility with this buffer size information feedback, make the buffer area treatment facility can regulate the size of buffer area according to this buffer size information.The buffer area opertaing device is in the process that obtains buffer size information; Can make full use of relevant various operation note information with this IO operation; The different running environment of comprehensive consideration program, therefore, the versatility of present embodiment when regulating buffer size is good.And present embodiment does not need artificial the participation when regulating buffer size, can carry out dynamic adjustments to the size of buffer area, and degree of regulation is good, and through repeatedly IO operation, can determine preferable buffer size.
In another embodiment of buffer area disposal route of the present invention, this operation note information can comprise: the data total amount information of this input-output operation, last buffer size information and information consuming time.Need to prove; Present embodiment has only provided three kinds of operation note information, but it will be appreciated by persons skilled in the art that as required; Various required record data all can be included in this operation note information, to obtain more rationally accurate buffer size information.
In another embodiment of buffer area disposal route of the present invention, said in the step 101 sent the buffer size computation requests to the buffer area opertaing device, can comprise: adopt asynchronous system to send the buffer size computation requests to said buffer area opertaing device.Through adopting asynchronous system to send the buffer size computation requests, can not influence the original system flow process, thereby guarantee the normal operation of program in the system to the buffer area opertaing device.
Fig. 2 is the process flow diagram of an embodiment of buffer area control method of the present invention, and as shown in Figure 2, the method for present embodiment comprises:
The buffer size computation requests that step 201, reception buffer area treatment facility send carries in the said buffer size computation requests and the relevant operation note information of this IO operation;
For instance, after accomplishing an IO operation, the buffer area treatment facility can send the buffer size computation requests to the buffer area opertaing device, has carried in this buffer size computation requests and the relevant operation note information of this IO operation.This operation note information can comprise and the relevant various record data of this IO operation; For instance; These record data can comprise the running environment parameter and the information etc. that expends time in of this IO operation, can reflect the performance of this IO operation through operation note information comprehensively.
Step 202, according to said operation note information acquisition buffer size information, and said buffer size information sent to said buffer area treatment facility, so that said buffer area treatment facility is regulated the size of buffer area according to said buffer size information.
The buffer area opertaing device can obtain the operation note information of carrying in this buffer size computation requests after receiving this buffer size computation requests, thereby can be according to this operation note information acquisition buffer size information.Obtain buffer size information principle can for: if the efficient of this IO operation is higher than the efficient of preceding IO operation; Then increase the size of buffer area; The best buffer size that is current acquisition is compared with the preceding best buffer size that once obtains; Can further increase, thereby can obtain higher IO operating efficiency; If the efficient of this IO operation is lower than the efficient of preceding IO operation; Then reduce the size of buffer area; The best buffer size that is current acquisition is compared with the preceding best buffer size that once obtains, need reduce, thereby under the lower situation of IO operating efficiency; Size through reducing buffer area improves the IO operating efficiency, and then guarantees the success ratio of IO operation; Otherwise remain unchanged, i.e. the best buffer size of current acquisition equates with the preceding best buffer size that once obtains.
In concrete implementation procedure, can accomplish through the computing technique parameter according to the process of operation note information acquisition buffer size information.For example can preestablish some technical indicators,, confirm to be used to regulate the buffer size information of buffer size again according to this technical indicator then according to operation note information calculations corresponding techniques index.
Then, the buffer area opertaing device can be given the buffer area treatment facility with the buffer size information feedback that obtains, thereby makes the buffer area treatment facility can regulate the size of buffer area according to this buffer size information.
In system's operation a period of time; After carrying out repeatedly the IO operation, above-mentioned steps 201 can be carried out repeatedly with step 202 repeatedly, thereby repeatedly the size of buffer area is regulated; Thereby make the size of buffer area be adjusted to optimum value gradually, fully adapt to the program run environment.
Present embodiment carries the buffer size computation requests of operation note information through reception; Make the buffer area opertaing device can be used to regulate the buffer size information of buffer size according to this operation note information acquisition; And give the buffer area treatment facility with this buffer size information feedback, make the buffer area treatment facility can regulate the size of buffer area according to this buffer size information.The buffer area opertaing device is in the process that obtains buffer size information; Can make full use of relevant various operation note information with this IO operation; The different running environment of comprehensive consideration program, therefore, the versatility of present embodiment when regulating buffer size is good.And present embodiment does not need artificial the participation when regulating buffer size, can carry out dynamic adjustments to the size of buffer area, and degree of regulation is good, and through repeatedly IO operation, can determine preferable buffer size.
In another embodiment of buffer area control method of the present invention, said operation note information can comprise: the data total amount information of this input-output operation, last buffer size information and information consuming time; Described in the step 201 according to said operation note information acquisition buffer size information; Can comprise: according to the data processing time information of said this input-output operation of operation note information acquisition, and according to the said buffer size information of said data processing time information acquisition.
Further; Said according to the said buffer size information of said data processing time information acquisition; Can comprise: if said data processing time is longer than the last secondary data processing time, then reduce buffer size, the buffer size after will reducing is as said buffer size information; If said data processing time is shorter than the last secondary data processing time, then increase buffer size, with the buffer size after increasing as said buffer size information; If said data processing time information equates with the last secondary data processing time, then with previous buffer size as said buffer size information.
In concrete implementation procedure, obtain buffer size information computation process can for:
At first calculate the data processing time of this IO operation through following method:
The data processing time of this IO operation equals the ratio of data quantity stored in information consuming time and the unit buffer area.Wherein, data quantity stored equals the data total amount information of this IO operation and the ratio of last buffer size information in the unit buffer area.
Carry out judgment processing according to the data processing time of this IO operation then:
If the data processing time of this IO operation is greater than the data processing time of preceding IO operation, then
Buffer size information equals the difference of preceding buffer size information and stepping amount, and wherein stepping amount can be selected according to the needs to the adjustment precision of buffer size information;
If the data processing time of this IO operation equals the data processing time of preceding IO operation, then
Buffer size information equals a preceding buffer size information;
If the data processing time of this IO operation is less than the data processing time of preceding IO operation, then
Buffer size information equal preceding buffer size information and stepping amount with.
In the present embodiment; The buffer area opertaing device can be used to regulate the buffer size information of buffer size according to data total amount information, buffer size information and the information acquisition consuming time of this IO operation; And give the buffer area treatment facility with this buffer size information feedback, make the buffer area treatment facility can regulate the size of buffer area according to this buffer size information.Present embodiment does not need artificial the participation, can carry out dynamic adjustments to the size of buffer area, and degree of regulation is good, and through repeatedly IO operation, can determine best buffer size.And present embodiment can make full use of the relevant various operation note information with this IO operation, considers the different running environment of program comprehensively, and therefore, the versatility when regulating buffer size is good.
Fig. 3 is the signaling process figure of an embodiment of the inventive method embodiment, and is as shown in Figure 3, and the method for present embodiment comprises:
Step 301, IO equipment send the request message that obtains the required buffer size information of this IO operation to the buffer area treatment facility.
Step 302, buffer area treatment facility send to IO equipment with current cache district size information.
Step 303, IO equipment carry out this IO operation according to current cache district size information;
IO equipment can be arranged to this buffer size information with the size of buffer area after this current buffer size information of acquisition, carry out this IO operation then.
Step 304, IO equipment report and the relevant operation note information of this IO operation to the buffer area treatment facility.
Operation note information in this step is described in detail in the aforementioned embodiment, repeats no more.
Step 305, buffer area treatment facility send the buffer size computation requests through asynchronous system to said buffer area opertaing device, carry in the said buffer size computation requests and the relevant operation note information of this IO operation.
Through adopting asynchronous system to send the buffer size computation requests, can not influence the original system flow process, thereby guarantee the normal operation of program in the system to the buffer area opertaing device.
Step 306, buffer area opertaing device are operated the relevant new buffer size information of operation note information acquisition according to said with this IO.
The buffer area opertaing device can be used preset algorithm operation note information is calculated, thereby obtains the buffer size information after this IO operation.
Step 307, buffer area opertaing device are given the buffer area treatment facility with the buffer size information feedback that obtains in the step 306.
The buffer area opertaing device can be given the buffer area treatment facility with the buffer size information feedback that obtains; Thereby make the buffer area treatment facility can regulate the size of buffer area, promptly make things convenient for IO equipment when IO operation next time, to obtain this buffer size information according to this buffer size information.
In system's operation a period of time; After carrying out repeatedly the IO operation, above-mentioned steps 301 can be carried out repeatedly with step 307 repeatedly, thereby repeatedly the size of buffer area is regulated; Thereby make the size of buffer area be adjusted to preferred values gradually, fully adapt to the program run environment.
Present embodiment is through sending the buffer size computation requests of carrying operation note information to the buffer area opertaing device; Make the buffer area opertaing device can be used to regulate the buffer size information of buffer size according to this operation note information acquisition; And give the buffer area treatment facility with this buffer size information feedback, make the buffer area treatment facility can regulate the size of buffer area according to this buffer size information.The buffer area opertaing device is in the process that obtains buffer size information; Can make full use of relevant various operation note information with this IO operation; The different running environment of comprehensive consideration program, therefore, the versatility of present embodiment when regulating buffer size is good.And present embodiment does not need artificial the participation when regulating buffer size, can carry out dynamic adjustments to the size of buffer area, and degree of regulation is good, and through repeatedly IO operation, can determine best buffer size.
Fig. 4 is the structural representation of an embodiment of buffer area treatment facility of the present invention, and as shown in Figure 4, the equipment of present embodiment comprises: first sending module 11, first receiver module 12 and first processing module 13, wherein:
First sending module 11 is used for sending the buffer size computation requests to the buffer area opertaing device, carries the operation note information relevant with this input-output operation in the said buffer size computation requests;
First receiver module 12 is used to receive the buffer size information of said buffer area opertaing device according to said operation note information acquisition and feedback;
First processing module 13 is used for the size according to said buffer size information adjusting buffer area.
The equipment of present embodiment is corresponding with the realization principle of buffer area disposal route embodiment of the present invention shown in Figure 1, repeats no more here.
Present embodiment is through sending the buffer size computation requests of carrying operation note information to the buffer area opertaing device; Make the buffer area opertaing device can be used to regulate the buffer size information of buffer size according to this operation note information acquisition; And give the buffer area treatment facility with this buffer size information feedback, make the buffer area treatment facility can regulate the size of buffer area according to this buffer size information.Present embodiment does not need artificial the participation when regulating buffer size, can carry out dynamic adjustments to the size of buffer area, and degree of regulation is good, and through repeatedly IO operation, can determine preferable buffer size.And; The buffer area opertaing device can make full use of the relevant various operation note information of operating with this IO in the process that obtains buffer size information, consider the different running environment of program comprehensively; Therefore, the versatility of present embodiment when regulating buffer size is good.
Fig. 5 is the structural representation of an embodiment of buffer area opertaing device of the present invention, and as shown in Figure 5, the equipment of present embodiment comprises: second receiver module 21, second processing module 22 and second sending module 23, wherein:
Second receiver module 21 is used to receive the buffer size computation requests that the buffer area treatment facility sends, and carries the operation note information relevant with this input-output operation in the said buffer size computation requests;
Second processing module 22 is used for according to said operation note information acquisition buffer size information;
Second sending module 23 is used for said buffer size information is sent to said buffer area treatment facility, so that said buffer area treatment facility is regulated the size of buffer area according to said buffer size information.
The equipment of present embodiment is corresponding with the realization principle of buffer area control method embodiment of the present invention shown in Figure 2, repeats no more here.
Fig. 6 is the structural representation of another embodiment of buffer area opertaing device of the present invention, and as shown in Figure 6, the equipment of present embodiment comprises: second receiver module 21, second processing module 22 and second sending module 23, wherein:
Second receiver module 21 is used to receive the buffer size computation requests that the buffer area treatment facility sends, and carries the operation note information relevant with this input-output operation in this buffer size computation requests;
Second processing module 22 is used for according to said operation note information acquisition buffer size information;
Second sending module 23 is used for said buffer size information is sent to said buffer area treatment facility, so that said buffer area treatment facility is regulated the size of buffer area according to said buffer size information.
Further, second processing module 22 can comprise: first processing unit 221 and second processing unit 222, wherein:
First processing unit 221 is used for the data processing time information according to said this input-output operation of operation note information acquisition;
Second processing unit 222 is used for according to the said buffer size information of said data processing time information acquisition.
Concrete, if the data processing time of this IO operation is greater than the data processing time of preceding IO operation, then
Buffer size information equals the difference of preceding buffer size information and stepping amount, and wherein stepping amount can be selected according to the needs to the adjustment precision of buffer size information;
If the data processing time of this IO operation equals the data processing time of preceding IO operation, then
Buffer size information equals a preceding buffer size information;
If the data processing time of this IO operation is less than the data processing time of preceding IO operation, then
Buffer size information equal preceding buffer size information and stepping amount with.
Buffer area opertaing device the foregoing description of the present invention carries the buffer size computation requests of operation note information through reception; Make the buffer area opertaing device can be used to regulate the buffer size information of buffer size according to this operation note information acquisition; And give the buffer area treatment facility with this buffer size information feedback, make the buffer area treatment facility can regulate the size of buffer area according to this buffer size information.Present embodiment does not need artificial the participation when regulating buffer size, can carry out dynamic adjustments to the size of buffer area, and degree of regulation is good, and through repeatedly IO operation, can determine preferable buffer size, improves the efficient of IO operation.And; The buffer area opertaing device can make full use of the relevant various operation note information of operating with this IO in the process that obtains buffer size information, consider the different running environment of program comprehensively; Therefore, the versatility of present embodiment when regulating buffer size is good.
Fig. 7 is the structural representation of an embodiment of memory device of the present invention; As shown in Figure 7; The memory device of present embodiment comprises: buffer area treatment facility 1 and buffer area opertaing device 2; Wherein, buffer area treatment facility 1 is used for sending the buffer size computation requests to said buffer area opertaing device 2, carries the operation note information relevant with this input-output operation in the said buffer size computation requests; Receive the buffer size information of said buffer area opertaing device 2, to regulate the size of buffer area according to said buffer size information according to said operation note information acquisition and feedback; Said buffer area opertaing device 2 is used to receive the buffer size computation requests that said buffer area treatment facility 1 sends; According to said operation note information acquisition buffer size information; And said buffer size information sent to said buffer area treatment facility 1, so that said buffer area treatment facility 1 is regulated the size of buffer area according to said buffer size information.
In the memory device of present embodiment; Buffer area treatment facility 1 is corresponding with the realization principle of buffer area disposal route embodiment of the present invention shown in Figure 1; Buffer area opertaing device 2 is corresponding with the realization principle of buffer area control method embodiment of the present invention shown in Figure 2; The realization principle of the concrete reciprocal process of buffer area treatment facility 1 and buffer area opertaing device 2 and the inventive method embodiment shown in Figure 3 is corresponding, repeats no more here.
Present embodiment is through sending the buffer size computation requests of carrying operation note information to the buffer area opertaing device; Make the buffer area opertaing device can be used to regulate the buffer size information of buffer size according to this operation note information acquisition; And give the buffer area treatment facility with this buffer size information feedback, make the buffer area treatment facility can regulate the size of buffer area according to this buffer size information.The buffer area opertaing device is in the process that obtains buffer size information; Can make full use of and the relevant various operation note information of this IO operation; The different running environment of comprehensive consideration program, therefore, the versatility of present embodiment when regulating buffer size is good.And present embodiment does not need artificial the participation when regulating buffer size, can carry out dynamic adjustments to the size of buffer area, and degree of regulation is good, and through repeatedly IO operation, can determine preferable buffer size.
What should explain at last is: above embodiment is only in order to technical scheme of the present invention to be described but not limit it; Although the present invention has been carried out detailed explanation with reference to preferred embodiment; Those of ordinary skill in the art is to be understood that: it still can make amendment or be equal to replacement technical scheme of the present invention, also can not make amended technical scheme break away from the spirit and the scope of technical scheme of the present invention and these are revised or be equal to replacement.