Embodiment
In order to be illustrated more clearly in the technical scheme in the embodiment of the invention, the accompanying drawing of required use is done an introduction simply in will describing embodiment below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
The schematic flow sheet of the information piggybacking method that Fig. 1 provides for the embodiment of the invention one.As shown in Figure 1, present embodiment can may further comprise the steps:
Step 400, receive the incidentally message that starter sends, described in the transmit queue of starter incidentally the information next to be sent of message be write request message;
This incidentally message be the message previous to be sent of write request message in the transmit queue of starter, it can be a starter according to existing SCSI agreement to the read request message that object machine sends, and also can be write request message.
Step 401, detection residual memory space;
Step 402, send the feedback information of described request message correspondence to described starter, described feedback information comprises described detected residual memory space information.
The information piggybacking method that present embodiment provides can be applied in the system that constitutes by scsi interface, but is not limited to the system that scsi interface constitutes.Can comprise starter and a plurality of object machine that is connected to this starter simultaneously in the system by the scsi interface formation, wherein, starter can be server, PC (Personal Computer, hereinafter to be referred as: PC) wait equipment, object machine can be memory devices such as disk array, hard disk
When object machine receives the incidentally message of starter transmission, object machine can incidentally send to starter with the residual memory space information of the expression self residual storage size feedback information by above-mentioned incidentally message correspondence, judges whether to send write request message by starter according to the residual memory space size of object machine.
After starter receives the residual memory space information that the feedback information of object machine by the request message correspondence incidentally send, this starter judges according to this residual memory space information whether the residual memory space in the object machine is not less than the required storage space of data to be sent, if then directly send data to object machine.If not, then starter resends this write request message according to existing SCSI agreement, sends the write request message of this write request message correspondence then according to the feedback information of object machine.
Present embodiment incidentally sends to starter by feedback information with residual memory space information, make this starter directly to send data according to this residual memory space information to object machine, thereby once mutual by between starter and the object machine, realized SCSI write request process, shorten the processing time of whole write request process, improved the efficient of write request.
The schematic flow sheet of the information piggybacking method that Fig. 2 provides for the embodiment of the invention two.As shown in Figure 2, present embodiment can may further comprise the steps:
Step 601, send incidentally message to object machine, described in the transmit queue of starter incidentally the information next to be sent of message be write request message;
The feedback information of the described incidentally message correspondence that step 602, the described object machine of reception send, described feedback information comprises the detected residual memory space information of described object machine;
Step 603, when described residual memory space information indicates the residual memory space size of described object machine to satisfy the request space of described write request message correspondence, send data to described object machine.
Present embodiment is identical with the system that information piggybacking method was suitable for that the foregoing description one provides, and all is the system that scsi interface constitutes.Wherein, incidentally message can be read request message, also can be write request message, wherein, read request message is the request message that initiator request is sent when reading a certain data in the object machine, and data message is the data that starter need be with data storage be sent during to object machine.
At first send incidentally message according to existing SCSI agreement to object machine by starter, when object machine receives this incidentally after the message, indication executable operations according to this message, complete successfully the operation of this message indication when object machine after, object machine detects the residual memory space of self, and the feedback information of the residual memory space information that will represent the self residual storage size by this message correspondence incidentally sends to starter.
After starter receives the residual memory space information that the feedback information of object machine by this message correspondence incidentally send, this starter judges according to this residual memory space information whether the residual memory space in the object machine satisfies the required storage space of data to be sent, if then this starter directly sends data to object machine.If not, then starter sends this write request message according to existing SCSI agreement, sends the write request message of this write request message correspondence then according to the feedback information of object machine.
After starter receives incidentally residual memory space information in the feedback information of message correspondence incidentally in the present embodiment, when this residual memory space information determines that the residual memory space size of object machine satisfies the request space of request message correspondence, send data to object machine, thereby once mutual by between starter and the object machine, realized SCSI write request process, shorten the processing time of whole write request process, improved the efficient of write request.
The signaling diagram of the information piggybacking method that Fig. 3 provides for the embodiment of the invention three, present embodiment can may further comprise the steps:
Step 501, object machine receive the read request message that starter sends.
Need to prove that the request message in the present embodiment is that example describes with the read request message, but is not limited to read request message.Read request message in the present embodiment can repeat no more with reference to the description of the foregoing description one herein.
Step 502, object machine are according to the indication reading of data of this read request message.
What object machine received in the present embodiment is read request message, and then object machine reads the data of this read request message indication.
Further, if when object machine is according to the indication reading of data of this read request message in this step, read failure, then process ends.
Step 503, object machine detect the residual memory space of self.
Step 504, object machine incidentally send to starter by this read request feedback information with Status codes:50h.
Because the request message in the present embodiment is a read request message, then after object machine successfully reads the data of this read request message indication, need returns reading of data to starter and return the read request feedback information.Further, successfully detect the residual memory space of self when object machine after, then object machine will represent that read request message runs succeeded and the Status codes:50h of residual memory space incidentally sends to starter by the read request feedback information.
The Status codes:50h that step 505, starter incidentally send according to the read request feedback information judges whether the residual memory space of object machine is not less than the required occupation space of data to be sent, if then execution in step 506; If not, execution in step 507 then.
Starter receives the Status codes:50h that object machine incidentally sends by the read request feedback information, and judge the size of the residual memory space of object machine according to this Status codes:50h, when this residual memory space was not less than the required occupation space of data to be sent, then execution in step 506; When this residual memory space during less than the required occupation space of data to be sent, then execution in step 507.
Step 506, starter directly send write request message to object machine.
Step 507, starter resend the length information of this write request message.
In the present embodiment Status codes:50h is incidentally sent to starter by the read request feedback information, judge according to Status codes:50h whether the residual memory space of object machine is not less than the required occupation space of generation transmission data by starter, if, then starter directly sends write request message to object machine, thereby once mutual by between starter and the object machine, realized SCSI write request process, shorten the processing time of whole write request process, improved the efficient of write request.
Further, the Status codes:50h in the present embodiment can also incidentally send to starter by the data feedback information of write request message correspondence, and concrete execution in step and request message are that the execution in step of read request message is identical, repeat no more herein.
The schematic flow sheet of the information piggybacking method that Fig. 4 provides for the embodiment of the invention four.Shown in figure four, present embodiment can may further comprise the steps:
The incidentally message that step 101, the described starter of reception send, in the transmit queue of starter, this incidentally the information next to be sent of message be write request message, described incidentally message comprises the length information of described write request message, and the length information of described write request message is used to indicate the size in the space of described initiator request;
Step 102, judge according to the length information of described write request message whether the residual memory space of object machine is not less than the space of described initiator request, when the residual memory space of described object machine is not less than the space of described initiator request, then return the state feedback information of described write request message correspondence to described starter, described state feedback information is used to indicate described starter to send the data of described write request message correspondence.
The information piggybacking method that present embodiment provides can be applied in the system that constitutes by scsi interface, but is not limited to the system that scsi interface constitutes.Can comprise starter and a plurality of object machine that is connected to this starter simultaneously in the system by the scsi interface formation, wherein, starter can be server, PC (Personal Computer, hereinafter to be referred as: PC) wait equipment, object machine can be memory devices such as disk array, hard disk.
In the present embodiment, the starter formation transmit queue that information to be sent can be sorted, two continuous information to be sent are respectively incidentally message and write request message in transmit queue, and the sending order of this write request message is positioned at this incidentally after the message time, then this starter is carried at this incidentally in the message with the length information of this write request message, makes the length information of write request message and message incidentally send to object machine simultaneously.Wherein, this incidentally message can be read request message, also can be write request message.
When object machine receives this incidentally after the message, this object machine judges according to the length information that carries in the message incidentally whether the residual memory space of self is not less than the size in space that starter is asked, if then return the state feedback information of this write request message correspondence to starter.Wherein, this state feedback information is used to indicate starter to send the write request message of this write request message correspondence.
When starter receives the state feedback information that this object machine returns,, directly send the data to be written of write request message correspondence to object machine according to this state feedback information.Thereby once mutual by between starter and the object machine realized SCSI write request process.
When present embodiment is write request message when the information next to be sent of the incidentally message in the transmit queue of starter, starter incidentally sends to object machine with the length information of this write request message by message incidentally, make object machine can determine whether to indicate this starter to send the write request message of the write request message correspondence of this transmit queue first place according to the length information of this write request message, thereby reduced mutual between one-shot device and the object machine, shorten the processing time of whole write request process, improved the efficient of write request.
The schematic flow sheet of the information piggybacking method that Fig. 5 provides for the embodiment of the invention five.As shown in Figure 5, present embodiment can may further comprise the steps:
Step 301, when the information next to be sent of the incidentally message in the transmit queue is write request message, the length information of described write request message incidentally incidentally sending to object machine in the message, is distributed the space of the length information correspondence of described write request message to ask described object machine;
The state feedback information of the described write request message correspondence that step 302, the described object machine of reception return;
Step 303, send the data of described write request message correspondence to object machine according to described state feedback information.
Present embodiment is identical with the system that information piggybacking method was suitable for that the foregoing description one provides, and all is the system that scsi interface constitutes.Can comprise starter and a plurality of object machine that is connected to this starter simultaneously in the system by the scsi interface formation, wherein, starter and object machine are described in detail in the foregoing description one, are not giving unnecessary details herein.
In the present embodiment, in the transmit queue of starter, exist two continuous information to be sent to be respectively incidentally message and write request message, and the sending order of write request message is positioned at this incidentally after the message time, this starter is carried at this incidentally in the message with the length information of this write request message, makes the length information of write request message and message incidentally send to object machine simultaneously.With the request target device is this corresponding space of write request distribution of messages.Wherein, incidentally message can be read request message, also can be write request message.The length information of read request message, write request message, write request message has been described in detail in the foregoing description one, repeats no more herein.
When object machine receives this incidentally after the message, at first according to this indication executable operations of message incidentally, for example: when incidentally message was read request message, this object machine read corresponding write request message according to the indication of this read request message; When incidentally message was write request message as if this, then this object machine was according to the indication storage data of this write request message.
If object machine is according to the indication executable operations failure of message incidentally, then this incidentally the length information of the write request message in the message will not processed, the flow process end; If executable operations success, then object machine can to this incidentally the executing state of message feed back, particularly, if after object machine is finished data read operation according to read request message, return the read request feedback information to starter; After if object machine is finished data storage operations according to write request message, to starter return data feedback information.
In the present embodiment, at object machine according to after incidentally corresponding operating is finished in the indication of message, object machine judges according to the length information that carries in the message incidentally whether the residual memory space of self is not less than the size in space that starter is asked, and will represent write request message application space whether successful state feedback information be carried at corresponding executing state and send to starter in feeding back.State feedback information comprises success status information and status of fail information, and success status information and status of fail information have been described in detail in the foregoing description two, repeat no more herein.
When starter receives read request feedback information that this object machine returns or data feedback information, this starter determines whether that according to the state feedback information in read request feedback information or the data feedback information needs send the data to be written of next write request message correspondence to object machine, if when this state feedback information was success status information, then starter directly sent the data to be written of next write request message correspondence to object machine; If this state feedback information is during for status of fail information incidentally, process ends then.
In the present embodiment when the information next to be sent of the incidentally message in the transmit queue of starter is write request message, starter incidentally sends to object machine with the length information of this write request message by message incidentally, and the state feedback information of returning according to object machine sends the data of write request message correspondence, thereby reduced mutual between one-shot device and the object machine, shorten the processing time of whole write request process, improved the efficient of write request.
The signaling diagram of the information piggybacking method that Fig. 6 provides for the embodiment of the invention six, the information piggybacking method that present embodiment provides based on the foregoing description one further is elaborated to embodiment of the invention information piggybacking method.As shown in Figure 6, present embodiment can may further comprise the steps:
In message incidentally, further be provided with in the present embodiment command description piece (CommandDescription Block, hereinafter to be referred as: CDB), be used for the incidentally length information of write request message.Set CDB has taken 16 bytes in the present embodiment, and (Logical Block Address is hereinafter to be referred as LBA) field to have comprised reservation (Reserved) field and LBA (Logical Block Addressing) among this CDB.Need to prove, this incidentally can also carry incidentally log-on message in the message, be used to indicate object machine whether to start piggy mechanism, incidentally log-on message in the present embodiment is that example describes with this Reserved field, but be not limited to the Reserved field, the length information of the write request message of present embodiment is that example describes with the LBA field, but is not limited to the LBA field.
The Reserved fields account is with the 1st byte in the CDB of present embodiment, LBA fields account 2-9 byte, wherein, the address value that the length information of this write request message of 2-5 byte representation is asked, the size in the length information request space of this write request message of 6-9 byte representation.The hypothetical target device is logical unit number (Logical Unit Number, hereinafter to be referred as: LUN) equipment, and the storage size of this LUN equipment is no more than 2T, the LBA field length of representing the 2T space so only needs 32, therefore, CDB is that 16 bytes can satisfy the demand of LBA field to length in the present embodiment.
Need to prove that the incidentally message in the present embodiment is that example describes with write request message, but is not limited to write request message.Flow process when incidentally message is read request message, the flow process when incidentally message is write request message is identical, no longer chases after described herein.
Step 201, object machine receive the write request message that starter sends, and Reserved field and LBA field are incidentally arranged in this write request message.
Step 202, object machine are stored data according to the indication of this write request message.
When object machine receives this incidentally after the message, at first according to this indication executable operations of message incidentally, be specially: if this is when incidentally message is read request message, then this object machine reads corresponding write request message according to the indication of this read request message; When incidentally message was write request message as if this, then this object machine was according to the indication storage data of this write request message.
What object machine received in the present embodiment is write request message, and then object machine is preserved the data in this write request message.
Further, in the present embodiment if object machine according to the indication executable operations failure of message incidentally, then this incidentally the length information of the write request message in the message will be not processed.For example: when object machine is stored data according to the indication of this write request message in this step, storage failure, then process ends.
Step 203, object machine judge whether the Reserved field in this write request message indicates the startup piggy mechanism, if then execution in step 204; If not, then object machine carries Status codes:50h to starter return data feedback information in this data feedback information.
Need to prove that object machine is according to after incidentally corresponding operating is finished in the indication of message, object machine can to this incidentally the executing state of message feed back.In feedback, carry the whether successful state feedback information in write request message application space to executing state.Wherein, state feedback information comprises success status information and status of fail information, and the residual memory space of object machine is not less than the initiator request space, and then object machine returns success status information to starter; The residual memory space of object machine is less than the initiator request space, and then object machine returns status of fail information to starter.
For example: if object machine is carried out the read data success according to the indication of read request message, and residual memory space is when being not less than the initiator request space, and then object machine returns the read request feedback information to starter, carries success status information in this read request message; If object machine is carried out the success of storage data according to the indication of write request message, and residual memory space is during less than the initiator request space, and then object machine carries status of fail information to starter return data feedback information in this data feedback information
Further, the state feedback information in the present embodiment is that example describes with state encoding (Status codes), but is not limited to Status codes.Incidentally success status information in the present embodiment is that example describes with 00h, but is not limited to 00h.This 00h represents that incidentally message runs succeeded and residual memory space is not less than the request space.Be provided with a new Status codes:50h in the present embodiment, incidentally status of fail information is that example describes with 50h, but is not limited to 50h.This 50 represent also incidentally that message runs succeeded and residual memory space less than the request space.
In this step, object machine reads this incidentally Reserved field in the message, if this Reserved field indication starts piggy mechanism, then execution in step 204; If when this Reserved field indication did not start piggy mechanism, then object machine carried Statuscodes:50h to starter return data feedback information in this data feedback information.
Further, after starter receives Status codes:50h, finish current flow process, and resend write request message according to existing SCSI agreement.
Step 204, object machine are resolved this write request message, obtain the LBA field in this write request message.
Wherein, the LBA field is used to indicate the size in initiator request space.
Step 205, object machine judge according to this LBA field whether residual memory space is not less than the space of initiator request, if then execution in step 206; If not, then object machine carries Status codes:50h to starter return data feedback information in this data feedback information.
Object machine detects the residual memory space of self, and judges according to the LBA field whether current residual memory space is not less than the size in request space.
Step 206, object machine carry Status codes:00h to starter return data feedback information in this data feedback information.
Because the incidentally message in the present embodiment is write request message, then after object machine is successfully stored this write request message, need be to starter return data feedback information.Further, when object machine judges that the residual memory space of self is not less than the request space, then object machine will represent that write request message runs succeeded and residual memory space is not less than the Status codes:00h that asks the space and is carried in this data feedback information and sends to starter.
Need to prove, when being read request message, then after object machine successfully reads a certain data of storing in self, need return the read request feedback information to starter as if the incidentally message in the present embodiment.Further, when object machine judges that the residual memory space of self is not less than the request space, then object machine will represent that read request message runs succeeded and residual memory space is not less than the Status codes:00h that asks the space and is carried at this read request feedback information and sends to starter.
Step 207, starter receive the data feedback information that carries Status codes:00h, and send data according to Status codes:00h to object machine.
When starter receives the data feedback information that object machine returns,, directly send data to object machine according to the Status codes:00h that carries in this data feedback information.
Need to prove, if the Status codes that carries in this data feedback information runs succeeded for expression write request message and residual memory space during less than the 50h in request space, then need resend the length information of this write request message according to existing SCSI agreement, feedback information according to object machine sends corresponding write request message then, carries out the operation that data write object machine.
In the present embodiment Reserved field and LBA field are incidentally sent to object machine by write request message, judge according to Reserved field and LBA field whether residual memory space is not less than the request space by object machine, if, then return the data feedback information that carries Status codes:00h to starter, thereby once mutual by between starter and the object machine, realized SCSI write request process, shorten the processing time of whole write request process, improved the efficient of write request.
The structural representation of the object machine that Fig. 7 provides for the embodiment of the invention seven.As shown in Figure 7, the present embodiment object machine comprises:
First receiver module 711 is used to receive the incidentally message that starter sends, in the transmit queue of starter this incidentally the information next to be sent of message be write request message;
Detection module 712 is used to detect residual memory space;
First sending module 713 is used for sending this incidentally feedback information of message correspondence to starter, and this feedback information comprises detected residual memory space information.
Present embodiment incidentally sends to starter by feedback information with residual memory space information, make this starter directly to send data according to this residual memory space information to object machine, thereby once mutual by between starter and the object machine, realized SCSI write request process, shorten the processing time of whole write request process, improved the efficient of write request.
The structural representation of the starter that Fig. 8 provides for the embodiment of the invention eight.As shown in Figure 8, the present embodiment object machine comprises:
Second sending module 811 is used for sending incidentally message to object machine, in the transmit queue of starter this incidentally the information next to be sent of message be write request message;
Second receiver module 812, this that is used for that the receiving target device sends be the feedback information of message correspondence incidentally, and this feedback information comprises the detected residual memory space information of object machine;
The 3rd sending module 813 is used for when residual memory space information indicates the residual memory space size of described object machine to satisfy the request space of this write request message correspondence, sends data to object machine.
After starter receives incidentally residual memory space information in the feedback information of message correspondence incidentally in the present embodiment, when this residual memory space information determines that the residual memory space size of object machine satisfies the request space of request message correspondence, send data to object machine, thereby once mutual by between starter and the object machine, realized SCSI write request process, shorten the processing time of whole write request process, improved the efficient of write request.
The information that Fig. 9 provides for the embodiment of the invention nine is the structural representation of system incidentally.As shown in Figure 9, present embodiment comprises: object machine 911 and starter 912;
Object machine 911 is used to receive the incidentally message that starter sends, described in the transmit queue of starter incidentally the information next to be sent of message be write request message; Detect residual memory space; To the feedback information of the described incidentally message correspondence of described starter transmission, described feedback information comprises described detected residual memory space information;
Starter 912 is used for sending incidentally message to object machine, described in the transmit queue of starter incidentally the information next to be sent of message be write request message; Receive the feedback information of the described incidentally message correspondence of described object machine transmission, described feedback information comprises the detected residual memory space information of described object machine; When described residual memory space information indicates the residual memory space size of described object machine to satisfy the request space of described write request message correspondence, send data to described object machine.
Object machine 911 receives the incidentally message that starter 912 sends in the embodiment of the invention, in the transmit queue of starter 912 this incidentally the message next to be sent of message be write request message, object machine 911 is by detecting the size of self residual storage space, and the information that will comprise the residual memory space size incidentally sends to starter in the feedback information of message correspondence incidentally, make starter 912 under the prompting of this message, send the data of write request message correspondence, thereby once mutual by between starter 912 and the object machine 911, realized SCSI write request process, shorten the processing time of whole write request process, improved the efficient of write request.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be finished by the relevant hardware of programmed instruction, aforesaid program can be stored in the computer read/write memory medium, this program is carried out the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.