A kind of method and apparatus of identification terminal order line
Technical field
The present invention relates to the capable method and apparatus of a kind of recognition command, particularly relate to a kind of method and apparatus of identification terminal order line.
Background technology
Terminal has a wide range of applications in all kinds of Unix main frames and communication system, by terminal operate and management have direct, safe and reliable, resource occupation is little, the efficient advantages of higher.Terminal mainly is made up of keyboard that is used to import and the display that is used to export, and display is a character pattern, and the row and column of some is arranged, and itself does not have disposal ability, only is a kind of input/output medium of type mode.Terminal can be the equipment of hardware, couples together by communication line and host computer system; Also can be the virtual terminal of software, for example the terminal software that moves on the PC can arrive one or more main frame that connects by network entry.
Many and large-scale host computer system or the core communication apparatus of terminal is connected, and this just has very high requirement to the stability and the fail safe of its operation, therefore will audit to user's terminal operation, and the execution of high-risk operation is limited.The operation of terminal mainly is divided into order line and real-time, interactive dual mode, and is also inequality to the method that this dual mode is audited: can simply carry out playback to terminal output to the real-time, interactive mode; To command line mode, each bar order that hope can recording user be carried out and corresponding execution result.And command line mode is audited and limited, at first just must realize that recognition command is capable.
The method that existing recognition command is capable has three classes:
The method of the first kind is, carries out work by terminal mode, and input data and dateout through terminal are carried out record, when needing record reset, and therefrom seeks information and the operation that needs.These class methods are more original, shortcoming is: just terminal data itself is simply write down and playback, can only see that concrete operation meets, can't directly see the tabulation of all orders, the efficient of audit is very low, and can't block high-risk order in real time by said method.
The method of second class is, shell at this operating system is installed in the operating system of main frame, because this program is to move as the part of operating system, so the identification and the judgement of operating system are at first passed through in user's operation, operating system transfers user's input to system executable operational order, and operating system writes journal file to order line by shell earlier before carrying out mentioned order, so that further audit and control.The shortcoming of these class methods is: need make amendment to the operating system of main frame operation, and the content that different operating system is revised differs greatly, so workload big, safeguard complicatedly, risk is higher, it is very big to implement difficulty; When relating to multiple operating system, the versatility of shell is very low.
The method of the 3rd class is, simulation of dateout process and conversion to terminal, the word of respectively composing a piece of writing that is finally shown, then the literal that shows is coupled together and write a big text, on each row, seek the CMD of main frame, if being arranged, prompt just thinks that this row is an order, gets off the content behind the prompt then as command record.These class methods rely on specific CMD, but owing to prompt can change by the setting of operating system, or CMD also may be only with the form appearance of text sometimes, and therefore, the reliability of these class methods is poor.
In said method, prior art adopts second class or the 3rd class methods more, so have following shortcoming and problem: the reliability of identification is relatively poor, or realization is complicated, cost is high, versatility is poor.Reliability is difficult to realize simultaneously with low-cost, high universalizable.
Summary of the invention
Technical problem to be solved by this invention provides a kind of method of identification terminal order line, relatively poor with the reliability that solves the identification that exists in the above-mentioned prior art, or realize complicated, cost is high, the shortcoming and the problem of versatility difference, realizes that low-cost, high universalizable guarantees the reliability of discerning simultaneously.
The present invention also provide a kind of identification terminal order line device.
The method of identification terminal order line provided by the invention comprises the following steps:
Obtain input data and dateout between terminal and the main frame;
Dateout is simulated by pseudo-terminal, obtained output content, described output content comprises displaying contents and SOT state of termination;
In conjunction with the input data output content is discerned, obtained terminal command line.
The method that method of intercepting by network intercepting or communication line or software are transmitted is obtained input data and the dateout between terminal and the main frame.
Output content is discerned in conjunction with the input data according to following step:
Check output content;
When CMD appears in output content, check whether the input data are arranged;
If the input data are arranged, think that then the displaying contents behind the CMD is an order line in the output content;
When order acknowledgement key, command execution key or order cancellation key appear in the input data, think that then an order line finishes.
Preferably, output content is discerned in conjunction with the input data according to following step:
Set up a command library, comprise all orders of operating system in the command library;
Check output content;
When CMD appears in output content, check whether the input data are arranged;
If the input data are arranged, then first field of displaying contents behind the CMD and the order in the command library are mated; If the order that can mate is arranged, think that then the displaying contents behind the CMD is an order line;
When order acknowledgement key, command execution key or order cancellation key appear in the input data, think that then an order line finishes.
Preferably, output content is discerned in conjunction with the input data according to following step:
Wait for input data or output content;
Obtain the current command status recognition;
When the command recognition state is the order input state, think that then the displaying contents of output content is an order line;
When order acknowledgement key, command execution key or order cancellation key appear in the input data, think that then an order line finishes.
Obtain the current command status recognition according to following state exchange step:
Making default state is the program output state;
When receiving input character, state transfers the order input state to, the further input data of checking, and when being order acknowledge character, command execution character or order cancellation character as if the input data, state transfers the program output state to.
Preferably, obtain the current command status recognition according to following state exchange step:
Making default state is the program output state;
When receiving input character, state transfers the order input state to;
Further check the input data under the order input state, if the input data are for helping character, state transfers the command cue state to;
The further input data of checking under the order input state, when being order acknowledge character, command execution character or order cancellation character as if the input data, state transfers the program output state to;
Under the command cue state, when input data when being non-help character, state transfers the order input state to.
Preferably, obtain the current command status recognition according to following state exchange step:
Making default state is the program output state;
When dateout is that state transfers the interactive application state to when entering the characteristic sequence of interaction mode;
When receiving input character, state transfers the order input state to;
Further check the input data under the order input state, if the input data are for helping character, state transfers the command cue state to;
The further input data of checking under the order input state, when being order acknowledge character, command execution character or order cancellation character as if the input data, state transfers the program output state to;
Under the command cue state, when input data when being non-help character, state transfers the order input state to;
Under the interactive application state, when dateout is that state transfers the program output state to when withdrawing from the characteristic sequence of interaction mode.
Described help character be the TAB key or "? " key.
The described characteristic sequence that enters interaction mode is:
No. 47, the pattern that is provided with of VT102 and compatible terminal, and/or No. 1047, the pattern that is provided with of VT102 and compatible terminal, and/or No. 1049, the pattern that is provided with of VT102 and compatible terminal, and/or No. 1, the pattern that is provided with of VT100 and compatible terminal.
The described characteristic sequence that withdraws from interaction mode is:
No. 47, the removing pattern of VT102 and compatible terminal, and/or No. 1047, the removing pattern of VT102 and compatible terminal, and/or No. 1049, the removing pattern of VT102 and compatible terminal, and/or No. 1, the removing pattern of VT100 and compatible terminal.
The invention also discloses a kind of device of the identification terminal order line based on said method, described device comprises:
The terminal data acquisition equipment is responsible for obtaining input data and dateout between terminal and the main frame;
The terminal simulation device, dateout is obtained output content by the simulation of pseudo-terminal;
Command recognition unit is discerned output content in conjunction with the input data, obtains terminal command line.
Described command recognition unit comprises:
Output content is differentiated sub-device, checks output content, and when CMD appearred in the output content of pseudo-terminal, sub-device was differentiated in the prompting input;
Sub-device is differentiated in input, differentiate the prompting of sub-device according to output content, obtain order line, when i.e. prompting CMD and terminal occur input is arranged, think that then the displaying contents of output content of the pseudo-terminal behind the prompt is an order line, when order acknowledgement key, command execution key or order cancellation key appear in the input data, think that then an order line finishes.
Preferably, described command recognition unit comprises:
Command library comprises all orders of system in the command library;
Output content is differentiated sub-device, checks output content, and when CMD appearred in the output content of pseudo-terminal, sub-device was differentiated in the prompting input;
Sub-device is differentiated in input, differentiate the prompting of sub-device according to output content, obtain order line, when promptly CMD appears in prompting, then first field that pseudo-terminal behind the CMD is shown and the order in the command library are mated, if coupling thinks that then the displaying contents of output content of the pseudo-terminal behind the prompt is an order line, when order acknowledgement key or command execution key or order cancellation key appear in the input data, think that then an order line finishes.
Preferably, described command recognition unit comprises:
Sub-device is differentiated in input, checks whether terminal has input;
The command recognition state is determined sub-device, judges the current command status recognition according to input data and dateout;
Obtain the sub-device of order line, the current command status recognition is order during input state, thinks that then the displaying contents of output content of pseudo-terminal is an order line, when order acknowledgement key or command execution key appear in the input data, think that then an order line finishes, obtain the capable and preservation of mentioned order; When the order cancellation key appears in the input data, think that an order line finishes, but it is capable not preserve mentioned order.
Described command recognition state comprises:
The program output state represents that at this moment terminal is just exported in the result of generating routine;
The order input state, the user is just at input command in expression, from user's button input under the program output state, confirms or the cancellation input up to the user.
Preferably, described command recognition state comprises:
The program output state represents that at this moment terminal is just exported in the result of generating routine;
The order input state, the user is just at input command in expression, from user's button input under the program output state, confirms or the cancellation input up to the user;
The command cue state, expression is in the assist command input state of order completion at present.
Preferably, described command recognition state comprises:
The program output state represents that at this moment terminal is just exported in the result of generating routine;
The order input state, the user is just at input command in expression, from user's button input under the program output state, confirms or the cancellation input up to the user;
The interactive application state represents that this computer-chronograph is in the interactive application state of some full frame interactive programs of operation;
The command cue state, expression is in the assist command input state of order completion at present.
Compared with prior art, the present invention have simultaneously realize simple, cost is low, versatility is good, the advantage of high reliability, has guaranteed the reliability of identification when realizing low-cost, high universalizable, and is specific as follows:
1, realization is simple, cost is low;
Because above-mentioned method and apparatus at first obtains input data and dateout between terminal and the main frame, simulate dateout then and obtain output content, in conjunction with the input data output content is discerned thereafter, obtain station command.Above-mentioned application and installation all are independent of the operating system of main frame, need not the software on every computer is made amendment, and complexity and risk are all lower, so realization is simple, cost is low
2, versatility is good;
Because the data basis of above-mentioned method and apparatus operation is the initial data of the input and output of terminal and main frame, the data format that does not relate to operating system or application software, therefore can be applied to have good versatility under the environment of various operating systems and application software eaily.
3, high reliability
Because above-mentioned method and apparatus is not only to discern at input data or dateout, but after obtaining input data and dateout between terminal and the main frame, dateout is simulated demonstration, obtain output content, in conjunction with the input data output content is discerned then, and multiple method in conjunction with identification is disclosed, therefore the identification that realizes has very high reliability.
Description of drawings
Fig. 1 is the basic step flow chart of the capable method of recognition command of the present invention;
Fig. 2 is the flow chart of steps of the method that recognition command of the present invention is capable among the embodiment 1;
Fig. 3 is the apparatus structure block diagram that recognition command of the present invention is capable among the embodiment 2;
Fig. 4 is the flow chart of steps of the method that recognition command of the present invention is capable among the embodiment 3;
Fig. 5 is the capable apparatus structure block diagrams of recognition command of the present invention for embodiment 4;
Fig. 6 is the flow chart of steps of the embodiment 5 of the capable method of recognition command of the present invention;
Fig. 7 is the apparatus structure block diagram of the capable embodiment of recognition command of the present invention 6;
Fig. 8 is for judging method one flow chart of steps of the current command status recognition;
Fig. 9 is for judging the method two flow chart of steps of the current command status recognition;
Figure 10 is for judging method three flow chart of steps of the current command status recognition.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
The invention discloses a kind of method and apparatus of identification terminal order line, described method and apparatus is based on that following step realizes:
With reference to Fig. 1,
At first, obtain input data and dateout between terminal and the main frame, intercept and capture or intercept the communication data between terminal use and the main frame, obtain the input and output data flow of terminal.Specifically can realize according to terminal type is different with deployed environment by the mode that network intercepting, communication line are intercepted or software is transmitted.
Then, use pseudo-terminal that dateout is simulated, obtain output content, visible pseudo-terminal is the transducer that dateout is transferred to output content, and common pseudo-terminal has: VT102 and compatible pseudo-terminal, VT100 and compatible pseudo-terminal etc.The operation principle and the step of pseudo-terminal are: pseudo-terminal inside mainly contains maintenance terminal state and two main states of output buffer: SOT state of termination is made up of the position at the size of current terminal, cursor place, current screen etc.; Preserve the content of current cursor be expert at before newline in the output buffer.The process major cycle of simulation is carried out around each terminal output character, and the normal exit criteria of major cycle is that terminal is closed.At each output character of reading, pseudo-terminal is judged its type, can belong to general character, simple control character and three kinds of situations of terminal control sequence.General character mainly comprises letter, numeral and various symbol and space; Simple control character defines in standard A SCII sign indicating number, realizes the control character of simple terminal control function, as backspace, carriage return, line feed, tab etc.; The terminal control sequence is to define in the VT102 terminal protocol, form by a series of characters, be used for to terminal carry out complicated state and function control as cursor position and state are set, character and background color are set, roll screen, to whole section literal of full line delete, screen switching etc.Various output characters and sequence can exert an influence to the state and the output buffer of terminal, and effects such as screen switching, cursor position change and content modification take place.These influences can take place usually simultaneously, as export " a " character, can be the character change of the current cursor position of terminal " a ", then cursor are moved forward a position; If cursor has arrived last row of terminal before, then cursor can advance to first row of next line; If simultaneously cursor has arrived last column of terminal before, then can produce the make progress action of roll screen of a single file, after the delegation that makes new advances clearly cursor is set to first row of newline.Pseudo-terminal comes the more state and the output buffer of new terminal according to these rules according to each character of reading, finally obtains output content.Output content comprises displaying contents and SOT state of termination.
In conjunction with the input data output content is discerned,, realized that the approach of identification has so several: input data or dateout are discerned from existing technology; To import data be converted to the input content discern; Dateout is converted to output content to be discerned.Scheme disclosed by the invention is to discerning through the output content that obtains after the analog-converted dateout in conjunction with the input data.This method in conjunction with identification can realize identification low-cost, efficiently and have good versatility.
By above-mentioned steps, finally obtain terminal command line.Can store the order line that identification obtains, also can offer other system and be further processed, as order audit, dangerous blocking-up of ordering or the like.
Following embodiment all is based on above-mentioned steps or principle, and discloses several in conjunction with importing the concrete scheme that data are discerned output content.
Embodiment 1
With reference to Fig. 2, present embodiment discloses a kind of concrete scheme of method of identification terminal order line.At first, obtain input data and dateout between terminal and the main frame.Then dateout is simulated by pseudo-terminal, obtained output content, described output content comprises displaying contents and SOT state of termination.In conjunction with the input data output content being discerned concrete grammar is: when CMD appears in the output content of pseudo-terminal, check whether terminal has the input data; Then do not continue to check output content if there are the input data,, think that then the displaying contents of the output content behind the prompt is an order line if terminal has input; The displaying contents of the pseudo-terminal behind the record prompt is checked the input data simultaneously, when order acknowledgement key, command execution key or order cancellation key appear in the input data, thinks that then an order line finishes.By above-mentioned steps, identification obtains terminal command line.
Embodiment 2
With reference to Fig. 3, this is a kind of device of the identification terminal order line based on embodiment 1 scheme.This device comprises terminal data acquisition equipment 31, terminal simulation device 32 and command recognition unit 33, and wherein command recognition unit 33 comprises that output content is differentiated sub-device 34 and sub-device 35 is differentiated in input.
Terminal data acquisition equipment 31 is responsible for obtaining the input and output data 101 between terminal and the main frame, and the input and output data of obtaining 101 are divided into dateout 102 and input data 103; 32 pairs of dateouts of terminal simulation device 102 are simulated, and obtain the output content 104 of terminal, and described output content comprises displaying contents and SOT state of termination; Command recognition unit 33 is discerned in conjunction with output content 104 and input data 103, and wherein output content is differentiated sub-device 34, checks output content 104, and when CMD appearred in the output content 104 of pseudo-terminal, sub-device 35 was differentiated in the prompting input; Input is differentiated sub-device 35 and is differentiated the prompting of sub-device 34 according to output content, when CMD appears in the output content 104 of pseudo-terminal, checks then whether input data 103 are arranged; Do not continue to wait for prompting if there are 103 of input data,, think that then the displaying contents of output content 104 of the pseudo-terminal behind the prompt is an order line if terminal has input; The output content 104 of the pseudo-terminal behind the record prompt when order acknowledgement key, command execution key or order cancellation key appear in input data 103, thinks that then an order line finishes.By above-mentioned steps, identification obtains terminal command line 105.
Embodiment 3
With reference to Fig. 4, present embodiment discloses the concrete scheme of the method for another kind of identification terminal order line.At first, obtain input data and dateout between terminal and the main frame.Then dateout is simulated by pseudo-terminal, obtained output content, described output content comprises displaying contents and SOT state of termination.In conjunction with the input data output content being discerned concrete grammar is: set up a command library, comprise all orders of operating system in the command library; Check the output content of pseudo-terminal; When CMD appears in output content, check whether terminal has input; Then do not continue to check output content if there are the input data; If terminal has input, then first field that pseudo-terminal behind the CMD is shown and the order in the command library are mated; Then do not continue to check output content if there is the order of coupling; If the order that can mate is arranged, think that then the displaying contents of the output content behind the prompt is an order line; Displaying contents behind the record prompt is checked the input data simultaneously, when order acknowledgement key, command execution key or order cancellation key appear in the input data, thinks that then an order line finishes.By above-mentioned steps, identification obtains terminal command line.
Embodiment 4
With reference to Fig. 5, this is a kind of device of the identification terminal order line based on embodiment 3 schemes.This device comprises terminal data acquisition equipment 51, terminal simulation device 52 and command recognition unit 53, and wherein command recognition unit 53 comprises that output content is differentiated sub-device 54, sub-device 55 and command library 56 are differentiated in input.
Terminal data acquisition equipment 51 is responsible for obtaining the input and output data 101 between terminal and the main frame, and the input and output data of obtaining 101 are divided into dateout 102 and input data 103; 52 pairs of dateouts of terminal simulation device 102 are simulated, and obtain the output content 104 of terminal, and described output content comprises displaying contents and SOT state of termination; Command recognition unit 53 is discerned in conjunction with output content 104 and input data 103, and wherein output content is differentiated sub-device 54, checks output content 104, and when CMD appearred in the output content 104 of pseudo-terminal, sub-device 55 was differentiated in the prompting input; Input is differentiated sub-device 55 and is differentiated the prompting of sub-device 34 according to output content, when CMD appears in the output content 104 of pseudo-terminal, checks then whether input data 103 are arranged; Do not continue to wait for prompting if there are 103 of input data, if terminal has input, then feed back to output content and differentiate sub-device 54, output content is differentiated first field that 54 in sub-device shows pseudo-terminal behind the CMD and the order in the command library 56 is mated; Then do not continue to check output content 104 if there is the order of coupling; If the order that can mate is arranged, think that then the displaying contents of output content 104 of the pseudo-terminal behind the prompt is an order line; The displaying contents of the pseudo-terminal behind the record prompt, input is simultaneously differentiated sub-device 55 and is checked input data 103, when order acknowledgement key, command execution key or order cancellation key appearred in input data 103, the notice output content was differentiated 54 1 order lines of sub-device and is finished.By above-mentioned steps, identification obtains terminal command line 105.
Embodiment 5
With reference to Fig. 6,8,9,10, present embodiment discloses a kind of concrete scheme of method of identification terminal order line.At first, obtain input data and dateout between terminal and the main frame.Then dateout is simulated by pseudo-terminal, obtained output content, described output content comprises displaying contents and SOT state of termination.
Wait for input data or output content; When input, judge the state that the current command is discerned according to input data and dateout, about the method for judging the state that the current command is discerned following three kinds of methods are arranged, be applicable to different concrete applied environments:
Method one, with reference to Fig. 8, establishing default state is the program output state; When receiving input data 802, state transfers the order input state to, is that state transfers the program output state to when ordering acknowledge character, command execution character or order cancellation character 203 until these input data or input data afterwards.
For the ease of understanding the method one in the present embodiment, with the following example that is operating as: when the user after CMD " [user@host dir] ", input command " 1s-1 ", and carry out by carriage return; Computer is carried out the 1s program, shows the output result, and then display command prompt " [user@host dir] $ ".
For the mentioned order input, from user key-press, the state of command recognition becomes the order input state from the program output state variable.At this moment the displaying contents of terminal simulator is " [user@host dir] $ ", and writing down prompt length simultaneously is 17 (spaces that comprise afterbody).When the user pressed enter key by the time, the displaying contents of terminal simulator became " [user@host dir] $1s-1 ", just thought at this moment in the buffering area that the displaying contents behind the 17th character is exactly the order of user's input and gives record; Be the status modifier of command recognition the program output state then, after this show occur from this command execution to next prompt before the terminal output content all regard the direct record of output of program as, so but next prompt itself do not stopped can not exporting immediately as yet owing to this row by line feed character.Write down the order line of identification, this moment, the state of command recognition was got back to the program output state again, waited the order line of next input to be identified.
If the input process of last example is, at first input " 1-1 " moves to cursor by the CTRL-A Macintosh then and presses " s " after capable head moves to second lattice to cursor with Right Arrow or CTRL-F Macintosh again and return the car operation then.Although can produce more complicated terminal control sequence, the displaying contents that is obtained by terminal simulator at last all is the same, and order line still can be by correct identification.
Method two: with reference to Fig. 9, default state is the program output state; When receiving input data 802, state transfers the order input state to, is that state transfers the program output state to when ordering acknowledge character, command execution character or order cancellation character 203 until these input data or input data afterwards; When the input data when helping character 204, state transfers the command cue state to, until when to import data be non-help character 902, state transfers the order input state to.
For the ease of understanding the method two in the present embodiment, with the following example that is operating as: the user presses tab key after having imported " 1s-1R ", this moment tab key to be operated system definition be help button, " EADME " five characters of the automatic completion of operating system meeting back, the user directly carries out this order by carriage return then.
Concrete identifying is, the state of command recognition enters the order input state when the user begins to import, " EADME " that shows after the user presses TAB when terminal enters the buffering area of terminal simulator automatically, and this moment, displaying contents was correct order " 1s-1 README ".
In last example, if the file with the R beginning under the current directory has " README " and " RELEASES " two, the user presses the TAB key after having imported " 1s-1R ", operating system is replenished the E character at first automatically, line feed shows " README " and " RELEASES " two filenames then, again the part order " 1s-1RE " that enters a new line the display command prompt afterwards and finished, the user sees prompting back input A character and presses the TAB key that the automatic completion of operating system " DME " character forms complete order " 1s-1 README ".
Concrete identifying is, system is receiving the user when importing the TAB character, the state of command recognition enters the command cue state, operating system shows that newline, optional file name are pointed out and order line is not finished in the demonstration that enters a new line again afterwards, and the terminal output of this moment can be recorded to the output procedure file but can not be considered to order carries out record.Press A key and last enter key up to the user, the state of command recognition reenters the order input state again, so complete order " 1s-1 README " can go on record.
Method three: with reference to Figure 10, default state is the program output state; When dateout is that state transfers the interactive application state to when entering the characteristic sequence 206 of interaction mode, until being that state transfers the program output state to when withdrawing from the characteristic sequence 207 of interaction mode when dateout; When receiving input data 802, state transfers the order input state to, is that state transfers the program output state to when ordering acknowledge character, command execution character or order cancellation character 203 until these data data or input data afterwards; When the input data when helping character 204, state transfers the command cue state to, until when to import data be non-help character 902, state transfers the order input state to.
For the ease of understanding the method three in the present embodiment, with the following example that is operating as: user's utility command " viREADME " operation vi program is edited the file of a README by name.He need add that content is the delegation of " [user@host dir] $hello " in end of file, therefore he moves on to tail of file to cursor by the G key earlier, sets up a newline by the o key again, word for word squeezes into after this row content by carriage return, press esc key then, ZZ preserves file and withdraws from.
Concrete identifying is, under the VT102 terminal, vi can be by show state when entering interactive editor's pattern sequence " ESC[? 1049h " switch to standby screen (alternative screen), after detecting this sequence, the state of command recognition switches to the interactive application state, ensuing operation can not be recorded, withdraw from vi up to the user, the sequence of terminal output show state " ESC[? 10491 " switch back original screen, after detecting this sequence, the state of command recognition becomes the program output state.Wait for next step operation of terminal use.
Above-mentioned help character 204 be tab key or "? " key.Above-mentioned common character is the input character except helping character or order acknowledge character or command execution character.The above-mentioned characteristic sequence 206 that enters interaction mode is: No. 47, the pattern that is provided with of VT102 and compatible terminal, and/or No. 1047, the pattern that is provided with of VT102 and compatible terminal, and/or No. 1049, the pattern that is provided with of VT102 and compatible terminal, and/or No. 1, the pattern that is provided with of VT100 and compatible terminal.The above-mentioned characteristic sequence 207 that withdraws from interaction mode is: No. 47, the removing pattern of VT102 and compatible terminal, and/or No. 1047, the removing pattern of VT102 and compatible terminal, and/or No. 1049, the removing pattern of VT102 and compatible terminal, and/or No. 1, the removing pattern of VT100 and compatible terminal.
When the current command status recognition is the order input state, think that then the displaying contents of pseudo-terminal is an order line, the record output content; When order acknowledgement key, command execution key or order cancellation key appear in the input data, think that then an order line finishes.By above-mentioned steps, can discern easily and accurately and obtain terminal command line.
Embodiment 6
With reference to Fig. 7,8,9,10, this is a kind of device of the identification terminal order line based on embodiment 5 schemes.This device comprises terminal data acquisition equipment 71, terminal simulation device 72 and command recognition unit 73, and wherein command recognition unit 73 comprises that obtaining the sub-device 74 of order line, the input sub-device 75 of differentiation and command recognition state determines sub-device 76.
Terminal data acquisition equipment 71 is responsible for obtaining the input and output data 101 between terminal and the main frame, and the input and output data of obtaining 101 are divided into dateout 102 and input data 103.72 pairs of dateouts of terminal simulation device 102 are simulated, and obtain the output content 104 of terminal, and described output content comprises displaying contents and SOT state of termination.Command recognition unit 73 is discerned in conjunction with output content 104 and input data 103, and detailed process is as follows: input is differentiated sub-device 75 and is checked whether terminal has input, and when input, input is differentiated sub-device 75 prompt command status recognitions and determined sub-device 76; The command recognition state determines that sub-device 76 is according to importing the state that data 103 and dateout 102 judge that the current command is discerned, be based among the embodiment 5 three kinds about the process of the state of judging the current command identification and judge what the status method of the current commands identification were carried out, when the current command status recognition is the order input state, think that then the displaying contents of pseudo-terminal is an order line, the command recognition state determines that 76 promptings of sub-device obtain the sub-device 74 of order line; Obtain the sub-device 74 record output contents 104 of order line; When order acknowledgement key, command execution key or order cancellation key appearred in the input data, input was differentiated sub-device 75 promptings and is obtained the sub-device 74 of order line, obtains the sub-device 74 of order line and thinks that promptly an order line finishes.By above-mentioned steps, identification obtains terminal command line 105.
More than to a kind of identification terminal order line method provided by the present invention, device, be described in detail, used specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.