WO2007147339A1 - Method and device for identifying terminal command line - Google Patents
Method and device for identifying terminal command line Download PDFInfo
- Publication number
- WO2007147339A1 WO2007147339A1 PCT/CN2007/001872 CN2007001872W WO2007147339A1 WO 2007147339 A1 WO2007147339 A1 WO 2007147339A1 CN 2007001872 W CN2007001872 W CN 2007001872W WO 2007147339 A1 WO2007147339 A1 WO 2007147339A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- command
- state
- terminal
- output
- input
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/10—Program control for peripheral devices
- G06F13/105—Program control for peripheral devices where the programme performs an input/output emulation function
- G06F13/107—Terminal emulation
Definitions
- the present invention relates to a method and apparatus for identifying a command line, and more particularly to a method and apparatus for identifying a command line of a terminal.
- the terminal has a wide range of applications in various Unix hosts and communication systems.
- the operation and management through the terminal are direct, safe, reliable, resource-intensive, and efficient.
- the terminal is mainly composed of a keyboard for input and a display for output.
- the display is in a character mode, and has a certain number of rows and columns. It usually has no processing capability, and is a text mode input/output medium.
- the terminal can be a hardware device connected to the host system through a communication line; or it can be a virtual terminal of the software, such as terminal software running on a personal computer, and can log in to one or more hosts through the network.
- Terminals are often connected to large host systems or core communication devices, which imposes high requirements on the stability and security of their operations. Therefore, users should be audited for terminal operations and restrictions on the execution of high-risk operations.
- the operation of the terminal is mainly divided into two methods: command line and real-time interaction.
- the methods for auditing these two methods are different: the real-time interaction mode can be played back in the terminal output of the terminal; Record each command executed by the user and the corresponding execution result.
- the first method is to install a shell for the operating system in the operating system of the host. Since the program is run as part of the operating system, the user's operation must first be identified and judged by the system.
- the operating system converts the user input into its own executable operation command, and the production system first writes the command line to the log file through the shell before performing the above command for further auditing and control.
- the disadvantages of this type of method are: The operating system of the host needs to be modified, and the contents of different operating system modifications are very different, so the workload is large, the maintenance is complicated, the risk is high, and the implementation is very difficult; when multiple operations are involved
- the versatility of the shell is low when the system is in use.
- the second method is to simulate and convert the output data of the terminal to obtain the final line of text, and then connect the displayed text to a large text file, and find the command prompt of the host on each line.
- you have a prompt you think that the line is a command, and then record the contents of the prompt as a command.
- Such methods rely on a specific command prompt, but because the prompt can be changed by the operating system's settings, or sometimes the command prompt may only appear as text, the reliability of such methods is poor.
- the technical problem to be solved by the present invention is to provide a method and a device for identifying a command line of a terminal, so as to solve the disadvantages and problems of poor reliability, high complexity, and low versatility of the identification in the prior art. It meets the requirements of low cost and high versatility while improving the reliability of identification.
- the method for identifying a command line of a terminal includes the following steps:
- the output data is simulated by the analog terminal to obtain the output content of the terminal
- the terminal command line in the output content is identified based on the input data.
- the obtaining input data and output data between the terminal and the host includes: acquiring input data and output data between the terminal and the host through network listening, communication line interception, or proxy forwarding.
- the identifying, according to the input data, the terminal command line in the output content includes: when the output content appears at the command line prompt, recording the output content as a command line until the input data is a command confirmation key, a command execution key, or a command cancellation.
- the command line ends when the key is pressed.
- the output content includes display content and terminal status
- the recording output content as the command line further includes: matching the first field of the display content after the command prompt with the command in the command library; if there is a command that can be matched, recording the field and the output content of the command as the command.
- the command line ends when the input data is a command confirmation key, a command execution key, or a command cancel key; the command library includes all commands of the host operating system.
- the identifying, according to the input data, the terminal command line in the output content comprises: determining, by the terminal input data and the output sequence in the output content, the current command recognition status, and identifying the status according to the command The state recognizes the terminal command line.
- the identifying, according to the input data, the terminal command line in the output content comprises: determining a current command recognition state according to the input data; the command recognition state includes a command input state and a program output state;
- the output content is recorded as a command line until the command line ends when the command input state transitions to the program output state.
- the determining, according to the input data, the current command recognition state includes: transferring the command input state when there is input data in the program output state; inputting the data as a command confirmation character, a command execution character, or a command cancellation character in the command input state When it is transferred to the program output state.
- the command recognition status further includes a command prompt state
- the determining the current command recognition state according to the input data further includes: when the input data is a help character in the command input state, the command prompt state is entered; when the input data is a non-help character in the command prompt state, the command input state is transferred.
- the command recognition status further includes a command waiting state
- the method further includes: when the input data is a command confirmation character in the command input state, transferring to the command waiting state; when the output data is a newline character in the command waiting state, transferring to the program output state;
- the terminal command line includes: when the command wait state is transferred to the program output state, the output content in the terminal emulation buffer is the terminal command line.
- the command recognition status further includes an interactive application status
- the method further includes: when the output data is a feature sequence entering the interaction state in the program output state, transferring to the interactive application state; when the output data is the feature sequence of the exit interaction state in the interactive application state, the program is transferred to the program Output status.
- the help character is a TAB key or a "?,” key.
- the sequence of features entering the interaction state is: setting mode 47 of VT102 and compatible terminal, and/or setting mode 1047 of VT102 and compatible terminal, and/or setting mode 1049 of VT102 and compatible terminal, And / or VT100 and compatible terminal setting mode No. 1;
- the sequence of characteristics of the exiting interaction state is: VT102 and compatible terminal clear mode No. 47, and/or VT102 and compatible terminal clear mode 1047, and/or VT102 and compatible terminal clear mode 1049, and/or VT100 And the clear mode of the compatible terminal No. 1.
- the present invention also discloses an apparatus for identifying a terminal command line based on the above method, the apparatus comprising:
- the terminal data capture module is configured to acquire input data and output data between the terminal and the host; the terminal simulation module is configured to simulate output data through the analog terminal to obtain output content; and the command recognition module is configured to output according to the input data.
- the terminal command line is identified in the content.
- the command recognition module includes:
- the output content discriminating sub-module is configured to prompt the input of the discriminating sub-module when the output content of the analog terminal appears, and the output content recorded before the notification of the input discriminating sub-module is received as the terminal after the command prompt appears.
- Command Line
- the input discriminating sub-module is configured to view the input data after receiving the prompt of the output content discriminating sub-module, and when the input data appears the command confirm key, the command execution key or the command cancel key, notify the output content that the sub-module ends a command line.
- the output content includes display content and terminal status
- the command recognition module further includes: a command library submodule, configured to store all commands of the host operating system;
- the output content discriminating sub-module matches the first field of the content displayed after the command prompt with the command in the command library sub-module when the output content appears at the command prompt, and if yes, prompts to input the discriminating sub-module, and After the command prompt appears, the output of the record recorded before the notification of the input discrimination sub-module is received is used as the terminal command line.
- the command recognition module includes:
- the input discriminating sub-module is configured to prompt the command to identify the status determining sub-module when the terminal has input data
- the command recognition state determining submodule is configured to determine a current command recognition state after receiving the prompt of the input discriminating submodule, and the command recognizing state includes a command input state and a program output state, and is transferred to the command input by the program output state.
- the command line submodule is obtained, and when the command input state is transferred to the program output state, the command line submodule is notified to end a command line;
- the program output state indicates that the terminal is generating a result output of the program
- the command input state indicates that the output data of the terminal is a command; when the input data is input in the program output state, the command input state is entered, and when the command input state is the command confirmation character, the command execution character, or the command cancel character, the command input state Enter the program output status.
- the command recognition status further includes: a command prompt state, indicating an auxiliary command input state in the command completion; when the input data is a help character in the command input state, the command prompt state is entered; and the command prompt state is input When the data is a non-help character, it is transferred to the command input state.
- a command prompt state indicating an auxiliary command input state in the command completion
- the command recognition state further includes a command waiting state; when the input data is a command confirmation character in the command input state, the command wait state is transferred; when the output data is a newline character in the command waiting state, the program output state is transferred to the program. ;
- the command recognition state determining sub-module prompts the acquisition command line sub-module to use the output content in the terminal emulation buffer as a command line when transitioning from the command waiting state to the program output state.
- the command recognition state further includes: an interactive application state indicating that the state of the interactive program is running; and when the output data is a feature sequence entering the interactive state in the program output state, transitioning to the interactive application state; When the output data in the application state is the feature sequence of the exit interactive state, it is transferred to the program output state.
- the invention has the advantages of simple implementation, low cost, excellent versatility and high reliability, and the reliability of the identification is improved while satisfying the requirements of low cost and high versatility, as follows:
- the above method and device first acquire input data and output data between the terminal and the host, then the analog output data acquires the output content, and then the input content is combined with the input data to identify the output content, and the terminal command is obtained.
- the above-mentioned use and installation are independent of the host's operating system, without the need to modify the software on each computer, the complexity and risk are relatively low, so the implementation of the single, low cost;
- the data foundation of the above method and device operation is the original data of the input and output of the terminal and the host, and does not involve the data format of the operating system or the application software, it can be conveniently applied to various operating systems and application software environments. , with excellent versatility;
- the above methods and devices are not only for identifying input data or output data, but After obtaining the input data and the output data between the terminal and the host, the output data is simulated and displayed, the output content is obtained, and then the output content is recognized by the input data, and a plurality of methods for combining and identifying are disclosed, so that the identification is realized. High reliability.
- FIG. 1 is a flow chart showing the basic steps of a method for identifying a command line according to the present invention
- FIG. 2 is a flow chart showing the steps of the method for identifying a command line according to the present invention in Embodiment 1;
- FIG. 3 is a block diagram showing the structure of an apparatus for identifying a command line according to the present invention in Embodiment 2;
- FIG. 4 is a flow chart showing the steps of the method for identifying a command line according to the present invention in Embodiment 3;
- FIG. 5 is a block diagram showing the structure of the device for identifying a command line according to the present invention in Embodiment 4;
- FIG. 6 is a flow chart showing the steps of the method for identifying a command line according to the present invention in Embodiment 5;
- FIG. 7 is a block diagram showing the structure of the device for identifying a command line according to the present invention in Embodiment 6;
- FIG. 8 is a flow chart of a method for determining a current command recognition state in Embodiment 5;
- FIG. 9 is a second step flow chart of a method for determining a current command recognition state in Embodiment 5;
- FIG. 10 is a process for determining a current command recognition state in Embodiment 5.
- FIG. 11 is a four-step flow chart of the method for determining the current command recognition state in the fifth embodiment.
- the present invention discloses a method of identifying a command line of a terminal, the method being implemented based on the following steps:
- Step S110 Acquire input data and output data between the terminal and the host.
- the communication data between the end user and the host can be intercepted or intercepted to obtain the input and output data streams of the terminal.
- it can be implemented through network listening, communication line monitoring, or proxy forwarding.
- Step S120 Simulate the output data by using an analog terminal to obtain an output content.
- the analog terminal is a converter that converts the output data into output content.
- Common analog terminals are: VT102 and the terminal, VT100 and compatible analog terminal.
- One mode of operation of the analog terminal includes: simulating the main maintenance terminal status and output buffer inside the terminal: The terminal status is determined by the size of the current terminal and the cursor The position, current screen, etc.; the output buffer holds the current cursor line until the line break.
- the simulated main loop of the process is performed around each terminal output character, and the normal exit condition of the main loop is that the terminal is turned off.
- the analog terminal judges its type, which can belong to three cases: general characters, simple control characters, and terminal control sequences.
- the general characters mainly include letters, numbers and various symbols and spaces; simple control characters are defined in standard ASCII code, and control characters that implement simple terminal control functions, such as backspace, carriage return, line feed, tab, etc.;
- the terminal control sequence is defined in the VT102 terminal protocol and consists of a series of characters for performing complex state and function control on the terminal, such as setting the cursor position and state, setting the character and background color, scrolling, and writing the entire line of text. Delete, screen change, etc.
- Various output characters and sequences affect the state of the terminal and the output buffer, such as screen switching, cursor position change, and content modification. These effects usually occur at the same time.
- the analog terminal updates the state of the terminal and the output buffer according to each character read, and finally obtains the output content.
- the output includes display content and terminal status.
- Step S130 identifying the output content in combination with the input data.
- the output content obtained by analog conversion of the output data is identified in combination with the input data.
- Step S140 obtaining a terminal command line.
- the identified command line can be stored, or it can be provided to other systems for further processing, such as command auditing, blocking of dangerous commands, and so on.
- this embodiment discloses a specific scheme of a method for identifying a command line of a terminal. step
- Step S210 Acquire input data and output data between the terminal and the host.
- Step S220 Simulate the output data through the analog terminal to obtain output content, where the output content includes display content and terminal status.
- the specific method for identifying the output content in combination with the input data is as follows: Step S230: When the output content is displayed, and the output content of the analog terminal appears at the command prompt, step S240 is performed to check whether the terminal is If there is no input data, go to step S230 and continue to check the output content; if the terminal has input, the display content of the output content after the prompt is regarded as the command line, and step S250 is performed, and the analog terminal after the prompt is recorded.
- step S260 and step S270 Displaying the content while viewing the input data; in step S260 and step S270, when the input data appears command confirmation key, command execution key or command cancel key, it is considered that a command line ends, and the display content after the recorded prompt is the terminal Command Line.
- the terminal command line is identified.
- this is an apparatus for identifying a terminal command line based on the embodiment 1 scheme.
- the apparatus includes a terminal data capture module 31, a terminal emulation module 32, and a command recognition module 33, wherein the command recognition module 33 includes an output content discriminating sub-module 34 and an input discriminating sub-module 35.
- the terminal data capture module 31 is responsible for acquiring input and output data 101 between the terminal and the host, and dividing the acquired input and output data 101 into output data 102 and input data 103; the terminal simulation module 32 simulates the output data 102 to obtain the terminal.
- Output content 104 the output content includes display content and terminal status;
- the command recognition module 33 performs command line identification in combination with the output content 104 and the input data 103, wherein the output content discriminating sub-module 34 views the output content 104, when the analog terminal
- the prompt input sub-module 35 is prompted to check whether there is input data 103; if there is no input data 103, it continues to wait; if the terminal has input, the output content of the analog terminal after the prompt is considered
- the display content of 104 is the command line; the output content 104 of the analog terminal after the prompt is recorded;
- the input discrimination sub-module 35 checks whether the input data 103 has a command confirmation key, a command execution key or a command according to the prompt of
- Step S410 Acquire input data and output data between the terminal and the host.
- Step S420 Simulate the output data through the analog terminal to obtain output content, where the output content includes display content and terminal status.
- Step S430 establishing a command library, the command library includes all the commands of the operating system
- Step S440 viewing the output content of the analog terminal; when the output content appears at the command prompt, the step is S450, check whether the terminal has input; If there is no input data, go to step S440 to continue to view the output content; if the terminal has input, execute step S460 to match the first field displayed by the analog terminal after the command prompt with the command in the command library; The command goes to step S440 to continue to view the output content; if there is a command that can be matched, it is considered that the display content of the output content after the prompt is the command line, and step S470 is executed, the display content after the prompt is recorded, and the input data is viewed at the same time; Step S460 and step S470, when the input data appears command confirmation key, command execution key or command cancel key, it is considered that one command line ends, and the display content after the recorded prompt is the command line of the terminal.
- this is an apparatus for identifying a terminal command line based on the embodiment 3 scheme.
- the apparatus includes a terminal data capture module 51, a terminal emulation module 52, and a command recognition module 53, wherein the command recognition module 53 includes an output content discriminating sub-module 54, an input discriminating sub-module 55, and a command library sub-module 56.
- the terminal data capture module 51 is responsible for acquiring input and output data 101 between the terminal and the host, and dividing the acquired input and output data 101 into output data 102 and input data 103; the terminal simulation module 52 simulates the output data 102, and acquires the terminal.
- Outputting content 104, the output content includes display content and terminal status;
- command recognition module 53 performs command line identification in combination with output content 104 and input data 103, wherein output content discriminating sub-module 54, viewing output content 104, and simulating output content of the terminal 104
- the command prompt appears, check if there is input ⁇ : according to 103; if there is no input data 103, continue to wait, if the terminal has input, record the output content of the analog terminal, and display the first display of the analog terminal after the command prompt.
- the fields are matched with the commands in the command library sub-module 56; if there is no matching command, the output content 104 is continuously viewed and the record of the first field is cleared; if there is a command that can be matched, the simulated terminal after the prompt is considered
- the output content of the output content 104 is the command line; continue to record
- the display content of the analog terminal after the symbol is simultaneously prompted to input the discrimination sub-module 55; the input discrimination sub-module 55 views the input data 103, and when the input data 103 appears a command confirmation key, a command execution key or a command cancel key, the output content discriminator is notified.
- Module 54 - a command line ends. Through the above steps, the terminal command line is recognized.
- Step S610 acquiring input data and output data between the terminal and the host.
- Step S620 Simulate the output data through the analog terminal to obtain output content, where the output content includes display content and terminal status.
- step S630 determining the state of the current command identification according to the input data, the output data, or the input data and the output data
- Step S640 when the current command recognition state is the command input state, It is considered that the display content of the analog terminal is the command line and is recorded
- step S650 when the input data appears command confirmation key, the command execution key or the command cancel key, it is considered that one command line ends and the recording is suspended
- step S660 according to The recorded content is obtained from the terminal user's command line.
- the method for determining the state of the current command identification in step S630 includes the following three methods, which are applicable to different specific application environments:
- the default state is the program output state; when any input data 802 is received, the state is changed to the command input state until the received input data includes the input data or the subsequent input data.
- the command confirmation character, the command execution character, or the command cancel character 203 the state is changed to the program output state.
- the state of the current command identification is determined based on the input data.
- the status of the command recognition changes from the program output state to the command input state from the user's button.
- the terminal emulation program displays "[user@host dir]$" and the record prompt length is 17 (including the trailing spaces).
- the display content of the terminal emulation program has become "[user@host dir]$ ls -l,,, then the display content after the 17th character in the buffer is the user input.
- the command is also recorded; then the status of the command recognition is changed to the program output state, and the output of the terminal displayed from the execution of the command until the next prompt appears as the output of the program is directly recorded, but the next prompt Since the line has not been terminated by the newline character, it will not be output immediately.
- the status of the command recognition returns to the program output state, waiting for the next input command line to be recognized.
- Method 2 Referring to FIG. 9, the default state is the program output state; when the input data 802 is received, the state is changed to the command input state until the input data or the subsequent input data is a command confirmation character, a command execution character or a command.
- the state is changed to the program output state; when the input data is the help character 204, the state is changed to the command prompt state until the input data is the helpless character 902, and the state is changed to the command input state.
- the terminal output captured in the command prompt state is not used as the command line until the command input state is entered again.
- the status of the current command identification is determined based on the input data.
- the specific recognition process is that the state of the command recognition enters the command input state when the user starts inputting, and the "EADME" displayed by the terminal after the user presses the TAB automatically enters the buffer of the terminal simulation program, and the display content is correct.
- Command "Is -1 README”.
- the specific identification process is: when the system receives the TAB character input by the user, the status of the command recognition enters the command prompt state, and then the operating system displays a line feed, an optional file name prompt, and re-wraps the uncompleted command line, and the terminal at this time
- the output will be logged to the output process file but will not be considered a command for recording.
- the status of the command recognition re-enters the command input state, so the complete command "Is -1 README" can be recorded.
- Method 3 Referring to FIG. 10, the default state is the program output state; when the output data is the feature sequence 206 entering the interactive state, the state transitions to the interactive application state until the output data is the feature sequence 207 exiting the interactive state.
- the state is changed to the program output state; when the input data 802 is received, the state is changed to the command input state until the data or the subsequent input data is the command confirmation character, the command execution character or the command cancel character 203, and the state is changed to the program.
- Output status when entering data for help At the time of character 204, the state transitions to the command prompt state until the input data is the helpless character 902, and the state transitions to the command input state.
- the state of the current command identification is determined based on the input data and the output data.
- the user runs the vi program using the command "vi README” to edit a file named EADME. He needs to add a line with the content "[user@host dir]$ hello" at the end of the file, so he first presses the G key to move the cursor to the end of the file, then presses the 0 key to create a new line, and enters the line verbatim. Press Enter after the content, then press ESC, ZZ to save the file and exit.
- the specific recognition process is that under the VT102 terminal, vi enters the interactive editing mode by displaying the sequence of the state "ESC[?1049h,, switching to the alternate screen, after the sequence is detected, the command is recognized. The state is switched to the interactive application state, and the next operation will not be recorded until the user exits vi.
- the terminal outputs a sequence of display states "ESC[?10491" to switch back to the original screen. After detecting the sequence, the command recognizes The status changes to the program output status. Wait for the next step of the end user.
- the above help character 204 is a Tab key or a "?” key.
- the above ordinary characters are input characters other than the help character or the command confirmation character or the command execution character.
- the feature sequence 206 entering the interactive state is: setting mode 47 of VT102 and compatible terminal, and/or setting mode 1047 of VT102 and compatible terminal, and/or setting mode 1049 of VT102 and compatible terminal, and/or VT100. And the setting mode of the compatible terminal No. 1.
- the feature sequence 207 of the above-mentioned exit interaction state is: VT102 and compatible terminal clear mode No. 47, and/or VT102 and compatible terminal clear mode 1047, and/or VT102 and compatible terminal clear mode 1049, and/or VT100. And the clear mode of the compatible terminal No. 1.
- Method 4 Referring to Figure 11, the default state is the program output state; when the input data 802 is received, the state is changed to the command input state until the input data or the subsequent input data is the command cancel character 203, the state is turned In the command input state, when the input data is the command confirmation character 208, the state is changed to the command waiting state; when the output data is the newline character 209 in the command waiting state, the content in the terminal simulation buffer is the The recognized command, while the status changes to the program output state; the terminal output captured in the command wait state still belongs to the command line until the wait state is exited.
- the status of the current command identification is determined based on the input data and the output data.
- the display content of the analog terminal is regarded as the command line, and the output content is recorded; when the command data confirms the key, the command execution key or the command cancel key, the command line ends.
- the apparatus includes a terminal data capture module 71, a terminal simulation module 72, and a command recognition module 73, wherein the command recognition module 73 includes an acquisition command line sub-module 74, an input discrimination sub-module 75, and a command recognition status determination sub-module 76.
- the terminal data capture module 71 is responsible for acquiring input and output data 101 between the terminal and the host, and dividing the acquired input and output data 101 into output data 102 and input data 103.
- the terminal emulation module 72 simulates the output data 102 to obtain the output content 104 of the terminal, the output content including the display content and the terminal status.
- the command recognition module 73 performs command line identification in combination with the output content 104 and the input data 103.
- the specific process is as follows.
- the input discrimination sub-module 75 checks whether the terminal has an input. When there is an input, the input determination sub-module 75 prompts the command recognition status determination sub-module.
- the command recognition state determining sub-module 76 may determine the state of the current command identification based on the input data 103 or the input data 103 and the output data 102 according to the input data 103. The process of determining the state of the current command identification may be based on the embodiment.
- the current command is the command line
- the command recognition state determination sub-module 76 prompts to acquire the command line sub-module 74
- the acquisition command line sub-module 74 records the output content 104; when the input data appears
- the command recognition state determination sub-module 76 transfers the current command recognition state from the command input state to the program output state, and notifies the acquisition command line sub-module 74 that the command line ends.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
A method for identifying a terminal command line is disclosed. The method comprises: acquiring input data and output data between a terminal and a host; emulating the output data with an emulation terminal to obtain output content; and identifying a terminal command line of the output content based on the input data. Upon the method described above, a device for identifying a terminal command line is provided. Therefore, the invention can identify a terminal command line with low cost and high applicability, and can ensure the reliability of recognition.
Description
一种识别终端命令行的方法和装置 Method and device for identifying terminal command line
本申请要求于 2006 年 6 月 14 日提交中国专利局、 申请号为 200610087243.9、 发明名称为"一种识别终端命令行的方法和装置 "的中国专利 申请的优先权, 其全部内容通过引用结合在本申请中。 The present application claims priority to Chinese Patent Application No. 200610087243.9, entitled "A Method and Apparatus for Identifying Terminal Command Lines", filed on June 14, 2006, the entire contents of which are incorporated by reference. In this application.
技术领域 Technical field
本发明涉及一种识别命令行的方法和装置,特别是涉及一种识别终端命令 行的方法和装置。 The present invention relates to a method and apparatus for identifying a command line, and more particularly to a method and apparatus for identifying a command line of a terminal.
背景技术 Background technique
终端在各类 Unix主机和通讯系统中有着广泛的应用 ,通过终端进行操作和 管理具有直接、 安全可靠、 资源占用小、 效率高等优点。 终端主要由用于输 入的键盘和用于输出的显示器组成, 显示器为字符模式, 有一定数量的行和 列,其本身通常没有处理能力, 是一种文字模式的输入输出媒介。 终端可以是 硬件的设备, 通过通讯线路与主机系统连接起来; 也可以是软件的虚拟终端, 例如个人电脑上运行的终端软件, 可以通过网络登录一台或多台主机。 The terminal has a wide range of applications in various Unix hosts and communication systems. The operation and management through the terminal are direct, safe, reliable, resource-intensive, and efficient. The terminal is mainly composed of a keyboard for input and a display for output. The display is in a character mode, and has a certain number of rows and columns. It usually has no processing capability, and is a text mode input/output medium. The terminal can be a hardware device connected to the host system through a communication line; or it can be a virtual terminal of the software, such as terminal software running on a personal computer, and can log in to one or more hosts through the network.
终端多与大型的主机系统或核心通讯设备连接, 这就对其操作的稳定性 和安全性有很高的要求,因此要对用户的终端操作进行审计, 并对高危操作的 执行进行限制。 终端的操作主要分为命令行和实时交互两种方式, 对这两种 方式进行审计的方法并不相同: 对实时交互方式可以筒单的 ^巴终端输出进行 回放; 对命令行方式, 希望能够记录用户执行的每一条命令以及相应的执行 结果。 而对命令行方式进行审计和限制, 首先就必须实现识别命令行。 Terminals are often connected to large host systems or core communication devices, which imposes high requirements on the stability and security of their operations. Therefore, users should be audited for terminal operations and restrictions on the execution of high-risk operations. The operation of the terminal is mainly divided into two methods: command line and real-time interaction. The methods for auditing these two methods are different: the real-time interaction mode can be played back in the terminal output of the terminal; Record each command executed by the user and the corresponding execution result. To audit and limit the command line mode, you must first implement the recognition command line.
现有的识别命令行的方法有两类: There are two types of existing methods for identifying command lines:
第一类的方法是,在主机的操作系统中安装针对该操作系统的外壳程序, 由于该程序是作为操作系统的一部分运行的,所以用户的操作首先要通过才喿作 系统的识别和判断,操作系统将用户输入转为自身可执行的操作命令,而搡作 系统在执行上述命令前,先通过外壳程序把命令行写入日志文件, 以便进一步 的审计和控制。此类方法的缺点在于: 需要对主机的操作系统进行修改, 而且 不同的操作系统修改的内容相差很大,因此工作量大、 维护复杂, 风险较高, 实施起来困难很大; 当涉及多操作系统时, 外壳程序的通用性很低。
笫二类的方法是,对终端的输出数据进行模拟和转换, 得到最终显示的各 行文字,然后将显示的文字连接起来写入一个大的文本文件, 在各行上寻找主 机的命令提示符, 如果有提示符就认为该行是一个命令, 然后把提示符后的 内容作为命令记录下来。 此类方法依赖特定的命令提示符, 但是由于提示符 可以通过操作系统的设置而改变,或有时命令提示符也可能仅仅以文本的形式 出现, 因此, 此类方法的可靠性比较差。 The first method is to install a shell for the operating system in the operating system of the host. Since the program is run as part of the operating system, the user's operation must first be identified and judged by the system. The operating system converts the user input into its own executable operation command, and the production system first writes the command line to the log file through the shell before performing the above command for further auditing and control. The disadvantages of this type of method are: The operating system of the host needs to be modified, and the contents of different operating system modifications are very different, so the workload is large, the maintenance is complicated, the risk is high, and the implementation is very difficult; when multiple operations are involved The versatility of the shell is low when the system is in use. The second method is to simulate and convert the output data of the terminal to obtain the final line of text, and then connect the displayed text to a large text file, and find the command prompt of the host on each line. When you have a prompt, you think that the line is a command, and then record the contents of the prompt as a command. Such methods rely on a specific command prompt, but because the prompt can be changed by the operating system's settings, or sometimes the command prompt may only appear as text, the reliability of such methods is poor.
在上述方法中,存在以下的缺点和问题:识别的可靠性较差,或实现复杂、 成本高、 通用性差。 可靠性与低成本、 高通用性难以同时实现。 In the above method, there are the following disadvantages and problems: the reliability of recognition is poor, or the implementation is complicated, the cost is high, and the versatility is poor. Reliability, low cost, and high versatility are difficult to achieve at the same time.
发明内容 Summary of the invention
本发明所要解决的技术问题是提供一种识別终端命令行的方法及装置,以 解决上述现有技术中存在的识别的可靠性较差, 或实现复杂、 成本高、 通用性 差的缺点和问题, 满足低成本、 高通用性要求的同时提高识别的可靠性。 The technical problem to be solved by the present invention is to provide a method and a device for identifying a command line of a terminal, so as to solve the disadvantages and problems of poor reliability, high complexity, and low versatility of the identification in the prior art. It meets the requirements of low cost and high versatility while improving the reliability of identification.
本发明提供的识别终端命令行的方法, 包括下列步驟: The method for identifying a command line of a terminal provided by the present invention includes the following steps:
获取终端与主机之间的输入数据和输出数据; Obtaining input data and output data between the terminal and the host;
将输出数据通过模拟终端进行模拟, 获取终端的输出内容; The output data is simulated by the analog terminal to obtain the output content of the terminal;
根据输入数据识别输出内容中的终端命令行。 The terminal command line in the output content is identified based on the input data.
可选的,所述获取终端与主机之间的输入数据和输出数据包括: 通过网络 侦听、 通讯线路侦听或代理转发来获取终端与主机之间的输入数据和输出数 据。 Optionally, the obtaining input data and output data between the terminal and the host includes: acquiring input data and output data between the terminal and the host through network listening, communication line interception, or proxy forwarding.
可选的,所述根据输入数据识别输出内容中的终端命令行包括: 当输出内 容出现命令行提示符时,记录输出内容作为命令行, 直至输入数据为命令确认 键、 命令执行键或命令取消键时该命令行结束。 Optionally, the identifying, according to the input data, the terminal command line in the output content includes: when the output content appears at the command line prompt, recording the output content as a command line until the input data is a command confirmation key, a command execution key, or a command cancellation. The command line ends when the key is pressed.
优选的, 所述输出内容包括显示内容和终端状态; Preferably, the output content includes display content and terminal status;
所述记录输出内容作为命令行进一步包括:将命令提示符后显示内容的第 一个字段与命令库中的命令进行匹配; 若有可以匹配的命令, 则记录该字段与 其后的输出内容作为命令行,直至输入数据为命令确认键、命令执行键或命令 取消键时该命令行结束; 所述命令库中包含所述主机操作系统的所有命令。 The recording output content as the command line further includes: matching the first field of the display content after the command prompt with the command in the command library; if there is a command that can be matched, recording the field and the output content of the command as the command The command line ends when the input data is a command confirmation key, a command execution key, or a command cancel key; the command library includes all commands of the host operating system.
优选的, 所述根据输入数据识别输出内容中的终端命令行包括: 通过终端 输入数据和输出内容中的输出序列确定当前命令识别状态,并按照命令识别状
态识别终端命令行。 Preferably, the identifying, according to the input data, the terminal command line in the output content comprises: determining, by the terminal input data and the output sequence in the output content, the current command recognition status, and identifying the status according to the command The state recognizes the terminal command line.
优选的, 所述根据输入数据识别输出内容中的终端命令行包括: 根据输入数据确定当前命令识别状态;所述命令识别状态包括命令输入状 态和程序输出状态; . Preferably, the identifying, according to the input data, the terminal command line in the output content comprises: determining a current command recognition state according to the input data; the command recognition state includes a command input state and a program output state;
在命令输入状态下,记录输出内容作为命令行,直至由命令输入状态转入 程序输出状态时该命令行结束。 In the command input state, the output content is recorded as a command line until the command line ends when the command input state transitions to the program output state.
可选的,所述根据输入数据确定当前命令识别状态包括:在程序输出状态 下有输入数据时转入命令输入状态;在命令输入状态下输入数据为命令确认字 符、 命令执行字符或命令取消字符时, 转入程序输出状态。 Optionally, the determining, according to the input data, the current command recognition state includes: transferring the command input state when there is input data in the program output state; inputting the data as a command confirmation character, a command execution character, or a command cancellation character in the command input state When it is transferred to the program output state.
优选的, 所述命令识别状态还包括命令提示状态; Preferably, the command recognition status further includes a command prompt state;
所述根据输入数据确定当前命令识别状态还包括:在命令输入状态下输入 数据为帮助字符时,转入命令提示状态;在命令提示状态下输入数据为非帮助 字符时, 转入命令输入状态。 The determining the current command recognition state according to the input data further includes: when the input data is a help character in the command input state, the command prompt state is entered; when the input data is a non-help character in the command prompt state, the command input state is transferred.
优选的, 所述命令识别状态还包括命令等待状态; Preferably, the command recognition status further includes a command waiting state;
所述方法还包括: 在命令输入状态下输入数据为命令确认字符时,转入命 令等待状态; 在命令等待状态下输出数据为换行字符时, 转入程序输出状态; 所述识别输出内容中的终端命令行包括:在由命令等待状态转入程序输出 状态时, 终端模拟緩冲区内的输出内容即为终端命令行。 The method further includes: when the input data is a command confirmation character in the command input state, transferring to the command waiting state; when the output data is a newline character in the command waiting state, transferring to the program output state; The terminal command line includes: when the command wait state is transferred to the program output state, the output content in the terminal emulation buffer is the terminal command line.
优选的, 所述命令识别状态还包括交互式应用状态; Preferably, the command recognition status further includes an interactive application status;
所述方法还包括:在程序输出状态下当输出数据为进入交互状态的特征序 列时,转入交互式应用状态;在交互式应用状态下输出数据为退出交互状态的 特征序列时, 转入程序输出状态。 The method further includes: when the output data is a feature sequence entering the interaction state in the program output state, transferring to the interactive application state; when the output data is the feature sequence of the exit interaction state in the interactive application state, the program is transferred to the program Output status.
可选的, 所述帮助字符为 TAB键或"?,,键。 Optionally, the help character is a TAB key or a "?," key.
可选的,所述进入交互状态的特征序列为: VT102及兼容终端的设置模式 47号,和 /或 VT102及兼容终端的设置模式 1047号,和 /或 VT102及兼容终端 的设置模式 1049号,和 /或 VT100及兼容终端的设置模式 1号; Optionally, the sequence of features entering the interaction state is: setting mode 47 of VT102 and compatible terminal, and/or setting mode 1047 of VT102 and compatible terminal, and/or setting mode 1049 of VT102 and compatible terminal, And / or VT100 and compatible terminal setting mode No. 1;
所述退出交互状态的特征序列为: VT102及兼容终端的清除模式 47号, 和 /或 VT102及兼容终端的清除模式 1047号 , 和 /或 VT102及兼容终端的清除 模式 1049号,和 /或 VT100及兼容终端的清除模式 1号。
本发明还公开了一种基于上述方法的识别终端命令行的装置,所述装置包 括: The sequence of characteristics of the exiting interaction state is: VT102 and compatible terminal clear mode No. 47, and/or VT102 and compatible terminal clear mode 1047, and/or VT102 and compatible terminal clear mode 1049, and/or VT100 And the clear mode of the compatible terminal No. 1. The present invention also discloses an apparatus for identifying a terminal command line based on the above method, the apparatus comprising:
终端数据捕获模块, 用于获取终端与主机之间的输入数据和输出数据; 终端模拟模块, 用于将输出数据通过模拟终端进行模拟, 获取输出内容; 命令识别模块, 用于根据输入数据在输出内容中识别终端命令行。 The terminal data capture module is configured to acquire input data and output data between the terminal and the host; the terminal simulation module is configured to simulate output data through the analog terminal to obtain output content; and the command recognition module is configured to output according to the input data. The terminal command line is identified in the content.
可选的, 所述命令识别模块包括: Optionally, the command recognition module includes:
输出内容判别子模块, 用于当模拟终端的输出内容出现命令提示符时,提 示输入判别子模块, 并将在出现命令提示符后、收到输入判别子模块的通知前 记录的输出内容作为终端命令行; The output content discriminating sub-module is configured to prompt the input of the discriminating sub-module when the output content of the analog terminal appears, and the output content recorded before the notification of the input discriminating sub-module is received as the terminal after the command prompt appears. Command Line;
输入判别子模块, 用于在收到输出内容判别子模块的提示后查看输入数 据, 当输入数据出现命令确认键、命令执行键或命令取消键时, 通知输出内容 判别子模块一个命令行结束。 The input discriminating sub-module is configured to view the input data after receiving the prompt of the output content discriminating sub-module, and when the input data appears the command confirm key, the command execution key or the command cancel key, notify the output content that the sub-module ends a command line.
优选的, 所述所述输出内容包括显示内容和终端状态; Preferably, the output content includes display content and terminal status;
所述命令识别模块还包括:命令库子模块, 用于存储所述主机操作系统的 所有命令; The command recognition module further includes: a command library submodule, configured to store all commands of the host operating system;
所述输出内容判别子模块在输出内容出现命令提示符时,将命令提示符后 显示内容的第一个字段与命令库子模块中的命令进行匹配,若匹配则提示输入 判别子模块, 并将在出现命令提示符后、收到输入判别子模块的通知前记录的 输出内容作为终端命令行。 The output content discriminating sub-module matches the first field of the content displayed after the command prompt with the command in the command library sub-module when the output content appears at the command prompt, and if yes, prompts to input the discriminating sub-module, and After the command prompt appears, the output of the record recorded before the notification of the input discrimination sub-module is received is used as the terminal command line.
优选的, 所述命令识别模块包括: Preferably, the command recognition module includes:
输入判别子模块, 用于在终端有输入数据时提示命令识别状态确定子模 块; The input discriminating sub-module is configured to prompt the command to identify the status determining sub-module when the terminal has input data;
命令识别状态确定子模块,用于在收到输入判别子模块的提示后确定当前 命令识别状态 ,+所述命令识别状态包括命令输入状态和程序输出状态, 并在由 程序输出状态转入命令输入状态时提示获取命令行子模块,在由命令输入状态 转入程序输出状态时通知获取命令行子模块一个命令行结束; The command recognition state determining submodule is configured to determine a current command recognition state after receiving the prompt of the input discriminating submodule, and the command recognizing state includes a command input state and a program output state, and is transferred to the command input by the program output state. When prompted, the command line submodule is obtained, and when the command input state is transferred to the program output state, the command line submodule is notified to end a command line;
获取命令行子模块,用于根据命令识別状态确定子模块的提示,在命令输 入状态下记录输出内容, 作为命令行。 Obtain a command line sub-module for determining the prompt of the sub-module according to the command recognition state, and recording the output content as a command line in the command input state.
可选的, 所述程序输出 态表示终端正在产生程序的结果输出;
所述命令输入状态表示终端的输出数据为命令;在程序输出状态下有输入 数据时转入命令输入状态,在命令输入状态下输入数据为命令确认字符、命令 执行字符或命令取消字符时, 转入程序输出状态。 Optionally, the program output state indicates that the terminal is generating a result output of the program; The command input state indicates that the output data of the terminal is a command; when the input data is input in the program output state, the command input state is entered, and when the command input state is the command confirmation character, the command execution character, or the command cancel character, the command input state Enter the program output status.
优选的, 所述命令识别状态还包括: 命令提示状态, 表示处于命令补全的 辅助命令输入状态; 在命令输入状态下输入数据为帮助字符时,转入命令提示 状态; 在命令提示状态下输入数据为非帮助字符时, 转入命令输入状态。 Preferably, the command recognition status further includes: a command prompt state, indicating an auxiliary command input state in the command completion; when the input data is a help character in the command input state, the command prompt state is entered; and the command prompt state is input When the data is a non-help character, it is transferred to the command input state.
优选的, 所述命令识别状态还包括命令等待状态; 在命令输入状态下输入 数据为命令确认字符时, 转入命令等待状态; 在命令等待状态下输出数据为换 行字符时, 转入程序输出状态; Preferably, the command recognition state further includes a command waiting state; when the input data is a command confirmation character in the command input state, the command wait state is transferred; when the output data is a newline character in the command waiting state, the program output state is transferred to the program. ;
所述命令识別状态确定子模块在由命令等待状态转入程序输出状态时提 示获取命令行子模块将终端模拟緩冲区内的输出内容作为命令行。 The command recognition state determining sub-module prompts the acquisition command line sub-module to use the output content in the terminal emulation buffer as a command line when transitioning from the command waiting state to the program output state.
优选的, 所述命令识别状态还包括: 交互式应用状态, 表示处于运行交互 程序的状态; 在程序输出状态下当输出数据为进入交互状态的特征序列时,转 入交互式应用状态;在交互式应用状态下输出数据为退出交互状态的特征序列 时, 转入程序输出状态。 Preferably, the command recognition state further includes: an interactive application state indicating that the state of the interactive program is running; and when the output data is a feature sequence entering the interactive state in the program output state, transitioning to the interactive application state; When the output data in the application state is the feature sequence of the exit interactive state, it is transferred to the program output state.
与现有技术相比, 本发明同时具有实现简单、 成本低、 通用性优良、 高可 靠性的优点, 在满足低成本、 高通用性要求的同时提高了识别的可靠性, 具体 如下: Compared with the prior art, the invention has the advantages of simple implementation, low cost, excellent versatility and high reliability, and the reliability of the identification is improved while satisfying the requirements of low cost and high versatility, as follows:
1、 实现筒单、 成本低; 1. Realize the single order and low cost;
由于上迷的方法和装置首先获取终端与主机之间的输入数据和输出数据, 然后模拟输出数据获取输出内容,其后结合输入数据对输出内容进行识别,得 到终端命令。 上述 用和安装都独立于主机的操作系统, 无需对每台计算机上 的软件进行修改, 复杂度和风险都比较低, 所以实现筒单、 成本低; Since the above method and device first acquire input data and output data between the terminal and the host, then the analog output data acquires the output content, and then the input content is combined with the input data to identify the output content, and the terminal command is obtained. The above-mentioned use and installation are independent of the host's operating system, without the need to modify the software on each computer, the complexity and risk are relatively low, so the implementation of the single, low cost;
1、 通用性优良; 1. Excellent versatility;
由于上述的方法和装置操作的数据基础是终端与主机的输入和输出的原 始数据, 不涉及操作系统或应用软件的数据格式, 因此可以比较方便的应用于 各种操作系统和应用软件的环境下, 具有优良的通用性; Since the data foundation of the above method and device operation is the original data of the input and output of the terminal and the host, and does not involve the data format of the operating system or the application software, it can be conveniently applied to various operating systems and application software environments. , with excellent versatility;
3、 高可靠性 ; 3, high reliability;
由于上迷的方法和装置不是仅仅针对输入数据或输出数据进行识别,而是
获取终端与主机之间的输入数据和输出数据后,对输出数据进行模拟显示,获 取输出内容, 然后结合输入数据对输出内容进行识别, 而且公开了多种结合识 别的方法, 因此实现的识别具有很高的可靠性。 Since the above methods and devices are not only for identifying input data or output data, but After obtaining the input data and the output data between the terminal and the host, the output data is simulated and displayed, the output content is obtained, and then the output content is recognized by the input data, and a plurality of methods for combining and identifying are disclosed, so that the identification is realized. High reliability.
附图说明 DRAWINGS
图 1为本发明所述的识別命令行的方法的基本步骤流程图; 1 is a flow chart showing the basic steps of a method for identifying a command line according to the present invention;
图 2为实施例 1中本发明所述的识别命令行的方法的步骤流程图; 图 3为实施例 2中本发明所述的识别命令行的装置结构框图; 2 is a flow chart showing the steps of the method for identifying a command line according to the present invention in Embodiment 1; FIG. 3 is a block diagram showing the structure of an apparatus for identifying a command line according to the present invention in Embodiment 2;
图 4为实施例 3中本发明所述的识别命令行的方法的步骤流程图; 图 5为实施例 4中本发明所述的识别命令行的装置结构框图; 4 is a flow chart showing the steps of the method for identifying a command line according to the present invention in Embodiment 3; FIG. 5 is a block diagram showing the structure of the device for identifying a command line according to the present invention in Embodiment 4;
图 6为实施例 5中本发明所述的识別命令行的方法的步骤流程图; 图 7为实施例 6中本发明所述的识別命令行的装置结构框图; 6 is a flow chart showing the steps of the method for identifying a command line according to the present invention in Embodiment 5; FIG. 7 is a block diagram showing the structure of the device for identifying a command line according to the present invention in Embodiment 6;
图 8为实施例 5中判定当前命令识别状态的方法一步骤流程图; 图 9为实施例 5中判定当前命令识别状态的方法二步骤流程图; 图 10为实施例 5中判定当前命令识别状态的方法三步驟流程图; 图 11为实施例 5中判定当前命令识別状态的方法四步骤流程图。 8 is a flow chart of a method for determining a current command recognition state in Embodiment 5; FIG. 9 is a second step flow chart of a method for determining a current command recognition state in Embodiment 5; FIG. 10 is a process for determining a current command recognition state in Embodiment 5. Method three-step flow chart; FIG. 11 is a four-step flow chart of the method for determining the current command recognition state in the fifth embodiment.
具体实施方式 detailed description
为使本发明的上述目的、特征和优点能够更加明显易懂, 下面结合附图和 具体实施方式对本发明作进一步详细的说明。 The present invention will be further described in detail with reference to the accompanying drawings and specific embodiments.
本发明公开了一种识别终端命令行的方法,所述方法是基于以下的步骤实 现的: The present invention discloses a method of identifying a command line of a terminal, the method being implemented based on the following steps:
参照图 1, Refer to Figure 1.
步骤 S110, 获取终端与主机之间的输入数据和输出数据。 可以截获或侦 听终端用户和主机之间的通讯数据,获取终端的输入和输出数据流。根据终端 类型和部署环境不同具体可以可通过网络侦听、通讯线路侦听或代理转发等方 式实现。 Step S110: Acquire input data and output data between the terminal and the host. The communication data between the end user and the host can be intercepted or intercepted to obtain the input and output data streams of the terminal. Depending on the terminal type and deployment environment, it can be implemented through network listening, communication line monitoring, or proxy forwarding.
步骤 S120, 使用模拟终端对输出数据进行模拟, 获取输出内容。 模拟终 端是将输出数据转为输出内容的转换器,常见的模拟终端有: VT102及兼 莫 拟终端、 VT100及兼容模拟终端等。模拟终端的一种工作方式包括: 模拟终端 内部主要维护终端状态和输出緩冲区: 终端状态由当前终端的大小、光标所在
的位置、 当前屏幕等组成; 输出緩冲区中保存当前光标所在行直到换行符之前 的内容。模拟的过程主循环是围绕每个终端输出字符进行的,主循环的正常退 出条件是终端被关闭。 针对读出的每个输出字符, 模拟终端判断其类型, 可属 于一般字符、简单控制字符和终端控制序列三种情况。一般字符主要包括字母、 数字和各种符号以及空格; 简单控制字符是在标准 ASCII码中定义的, 实现简 单的终端控制功能的控制字符, 如退格、 回车、 换行、 制表符等; 终端控制序 列是 VT102终端协议中定义的, 由一系列字符组成, 用于对终端进行复杂的 状态和功能控制如设置光标位置和状态、设置字符和背景颜色、 滚展、 对整行 整段文字进行删除、屏幕切换等。各种输出字符和序列会对终端的状态和输出 緩冲区产生影响, 发生屏幕切换、 光标位置变更及内容修改等操作。这些影响 通常会同时发生, 如输出一个" a"字符, 会把终端当前光标位置的字符修改为 "a", 然后把光标向前移动一个位置; 如果之前光标已经到达了终端的最后一 列,则光标会行进到下一行的笫一列; 同时如果之前光标已经到达了终端的最 后一行,则会产生一个单行向上滚屏的动作, 清出新的一行以后把光标设置到 新行的笫一列。模拟终端依据这些规则,根据读到的每个字符来更新终端的状 态和输出緩冲区, 最终得到输出内容。 输出内容包括显示内容和终端状态。 Step S120: Simulate the output data by using an analog terminal to obtain an output content. The analog terminal is a converter that converts the output data into output content. Common analog terminals are: VT102 and the terminal, VT100 and compatible analog terminal. One mode of operation of the analog terminal includes: simulating the main maintenance terminal status and output buffer inside the terminal: The terminal status is determined by the size of the current terminal and the cursor The position, current screen, etc.; the output buffer holds the current cursor line until the line break. The simulated main loop of the process is performed around each terminal output character, and the normal exit condition of the main loop is that the terminal is turned off. For each output character read out, the analog terminal judges its type, which can belong to three cases: general characters, simple control characters, and terminal control sequences. The general characters mainly include letters, numbers and various symbols and spaces; simple control characters are defined in standard ASCII code, and control characters that implement simple terminal control functions, such as backspace, carriage return, line feed, tab, etc.; The terminal control sequence is defined in the VT102 terminal protocol and consists of a series of characters for performing complex state and function control on the terminal, such as setting the cursor position and state, setting the character and background color, scrolling, and writing the entire line of text. Delete, screen change, etc. Various output characters and sequences affect the state of the terminal and the output buffer, such as screen switching, cursor position change, and content modification. These effects usually occur at the same time. For example, if you output an "a" character, the character at the current cursor position of the terminal will be changed to "a", and then the cursor will be moved forward by one position; if the cursor has reached the last column of the terminal before, then The cursor will travel to the next column of the next line; at the same time, if the cursor has reached the last line of the terminal, a single line scrolling action will be generated, and after clearing a new line, the cursor will be set to the next column of the new line. According to these rules, the analog terminal updates the state of the terminal and the output buffer according to each character read, and finally obtains the output content. The output includes display content and terminal status.
步骤 S130, 结合输入数据对输出内容进行识别。 结合输入数据对输出数 据经过模拟转换后得到的输出内容进行识别。 这种结合识别的方法可以低成 本、 高效的实现识别且具有良好的通用性。 Step S130, identifying the output content in combination with the input data. The output content obtained by analog conversion of the output data is identified in combination with the input data. This method of combined recognition can achieve low cost, high efficiency, and good versatility.
步骤 S140, 得到终端命令行。 可以存储识别得到的命令行, 也可以提供 给其他系统进行进一步的处理, 如命令审计、 危险命令的阻断等等。 Step S140, obtaining a terminal command line. The identified command line can be stored, or it can be provided to other systems for further processing, such as command auditing, blocking of dangerous commands, and so on.
以下的实施例均是基于上述步骤或原理,并公开了几种结合输入 :据对输 出内容进行识别的具体方案。 The following embodiments are based on the above steps or principles, and disclose several combinations of inputs: specific solutions for identifying output content.
实施例 1 Example 1
参照图 2, 本实施例公开了一种识别终端命令行的方法的具体方案。 步驟 Referring to FIG. 2, this embodiment discloses a specific scheme of a method for identifying a command line of a terminal. step
S210, 获取终端与主机之间的输入数据和输出数据。 步驟 S220, 将输出数据 通过模拟终端进行模拟, 获取输出内容,所述输出内容包括显示内容和终端状 态。 结合输入数据对输出内容进行识別具体方法是: 步骤 S230, 查看输出内 容, 模拟终端的输出内容出现命令提示符时, 执行步骤 S240, 查看终端是否
有输入数据; 若无输入数据则转步骤 S230, 继续查看输出内容; 若终端有输 入, 则认为提示符后的输出内容的显示内容为命令行, 执行步骤 S250, 记录 提示符后的模拟终端的显示内容,同时查看输入数据;步骤 S260和步驟 S270, 当输入数据出现命令确认键、命令执行键或命令取消键时, 则认为一个命令行 结束, 以记录的提示符后的显示内容为终端的命令行。通过上述步骤, 识别得 到终端命令行。 S210. Acquire input data and output data between the terminal and the host. Step S220: Simulate the output data through the analog terminal to obtain output content, where the output content includes display content and terminal status. The specific method for identifying the output content in combination with the input data is as follows: Step S230: When the output content is displayed, and the output content of the analog terminal appears at the command prompt, step S240 is performed to check whether the terminal is If there is no input data, go to step S230 and continue to check the output content; if the terminal has input, the display content of the output content after the prompt is regarded as the command line, and step S250 is performed, and the analog terminal after the prompt is recorded. Displaying the content while viewing the input data; in step S260 and step S270, when the input data appears command confirmation key, command execution key or command cancel key, it is considered that a command line ends, and the display content after the recorded prompt is the terminal Command Line. Through the above steps, the terminal command line is identified.
实施例 2 Example 2
参照图 3 , 这是一种基于实施例 1方案的识别终端命令行的装置。 该装置 包括终端数据捕获模块 31、终端模拟模块 32和命令识别模块 33 ,其中命令识 別模块 33包括输出内容判別子模块 34和输入判別子模块 35。 Referring to Fig. 3, this is an apparatus for identifying a terminal command line based on the embodiment 1 scheme. The apparatus includes a terminal data capture module 31, a terminal emulation module 32, and a command recognition module 33, wherein the command recognition module 33 includes an output content discriminating sub-module 34 and an input discriminating sub-module 35.
终端数据捕获模块 31 负责获取终端与主机之间的输入和输出数据 101 , 将获取的输入和输出数据 101分为输出数据 102和输入数据 103; 终端模拟模 块 32对输出数据 102进行模拟, 获取终端的输出内容 104, 所述输出内容包 括显示内容和终端状态; 命令识别模块 33结合输出内容 104和输入数据 103 进行命令行识別, 其中输出内容判別子模块 34, 查看输出内容 104, 当模拟终 端的输出内容 104出现命令提示符时, 提示输入判别子模块 35, 并查看是否 有输入数据 103; 若无输入数据 103则继续等待, 若终端有输入, 则认为提示 符后的模拟终端的输出内容 104的显示内容为命令行;记录提示符后的模拟终 端的输出内容 104; 输入判别子模块 35根据输出内容判别子模块 34的提示, 查看输入数据 103是否出现命令确认键、命令执行键或命令取消键, 当出现命 令确认键、 命令执行键或命令取消键时, 通知输出内容判别子模块 34—个命 令行结束。 通过上述步骤, 识别得到终端命令行 105。 The terminal data capture module 31 is responsible for acquiring input and output data 101 between the terminal and the host, and dividing the acquired input and output data 101 into output data 102 and input data 103; the terminal simulation module 32 simulates the output data 102 to obtain the terminal. Output content 104, the output content includes display content and terminal status; the command recognition module 33 performs command line identification in combination with the output content 104 and the input data 103, wherein the output content discriminating sub-module 34 views the output content 104, when the analog terminal When the output content 104 appears at the command prompt, the prompt input sub-module 35 is prompted to check whether there is input data 103; if there is no input data 103, it continues to wait; if the terminal has input, the output content of the analog terminal after the prompt is considered The display content of 104 is the command line; the output content 104 of the analog terminal after the prompt is recorded; the input discrimination sub-module 35 checks whether the input data 103 has a command confirmation key, a command execution key or a command according to the prompt of the output content discrimination sub-module 34. Cancel button, when the command confirmation button appears, life Execution key or cancel key command, informing output content judging sub-module 34- a command line ends. Through the above steps, the terminal command line 105 is identified.
实施例 3 Example 3
参照图 4, 本实施例公开了另一种识别终端命令行的方法的具体方案。 步 骤 S410, 获取终端与主机之间的输入数据和输出数据。 步骤 S420, 将输出数 据通过模拟终端进行模拟,获取输出内容,所述输出内容包括显示内容和终端 状态。 结合输入数据对输出内容进行识别具体方法是: 步骤 S430, 建立一个 命令库, 命令库中包含操作系统所有的命令; 步骤 S440, 查看模拟终端的输 出内容; 输出内容出现命令提示符时, 行步骤 S450, 查看终端是否有输入;
若无输入数据则转步骤 S440, 继续查看输出内容; 若终端有输入, 则执行步 骤 S460, 将命令提示符后模拟终端显示的第一个字段与命令库中的命令进行 匹配; 若无匹配的命令则转步骤 S440, 继续查看输出内容; 若有可以匹配的 命令, 则认为提示符后的输出内容的显示内容为命令行, 执行步骤 S470, 记 录提示符后的显示内容, 同时查看输入数据; 步骤 S460和步驟 S470, 当输入 数据出现命令确认键、 命令执行键或命令取消键时, 则认为一个命令行结束, 以记录的提示符后的显示内容为终端的命令行。通过上述步骤,识别得到终端 命令行。 Referring to FIG. 4, this embodiment discloses another specific scheme of a method for identifying a command line of a terminal. Step S410: Acquire input data and output data between the terminal and the host. Step S420: Simulate the output data through the analog terminal to obtain output content, where the output content includes display content and terminal status. The specific method for identifying the output content in combination with the input data is: Step S430, establishing a command library, the command library includes all the commands of the operating system; Step S440, viewing the output content of the analog terminal; when the output content appears at the command prompt, the step is S450, check whether the terminal has input; If there is no input data, go to step S440 to continue to view the output content; if the terminal has input, execute step S460 to match the first field displayed by the analog terminal after the command prompt with the command in the command library; The command goes to step S440 to continue to view the output content; if there is a command that can be matched, it is considered that the display content of the output content after the prompt is the command line, and step S470 is executed, the display content after the prompt is recorded, and the input data is viewed at the same time; Step S460 and step S470, when the input data appears command confirmation key, command execution key or command cancel key, it is considered that one command line ends, and the display content after the recorded prompt is the command line of the terminal. Through the above steps, the terminal command line is identified.
实施例 4 Example 4
参照图 5, 这是一种基于实施例 3方案的识別终端命令行的装置。 该装置 包括终端数据捕获模块 51、终端模拟模块 52和命令识别模块 53 ,其中命令识 别模块 53包括输出内容判别子模块 54、 输入判别子模块 55和命令库子模块 56。 Referring to Fig. 5, this is an apparatus for identifying a terminal command line based on the embodiment 3 scheme. The apparatus includes a terminal data capture module 51, a terminal emulation module 52, and a command recognition module 53, wherein the command recognition module 53 includes an output content discriminating sub-module 54, an input discriminating sub-module 55, and a command library sub-module 56.
终端数据捕获模块 51 负责获取终端与主机之间的输入和输出数据 101 , 将获取的输入和输出数据 101分为输出数据 102和输入数据 103; 终端模拟模 块 52对输出数据 102模拟, 获取终端的输出内容 104, 所述输出内容包括显 示内容和终端状态; 命令识别模块 53结合输出内容 104和输入数据 103进行 命令行识别, 其中输出内容判别子模块 54, 查看输出内容 104, 模拟终端的输 出内容 104出现命令提示符时, 查看是否有输入^:据 103; 若无输入数据 103 则继续等待, 若终端有输入, 则记录模拟终端的输出内容, 并将命令提示符后 模拟终端显示的第一个字段与命令库子模块 56中的命令进行匹配; 若无匹配 的命令则继续查看输出内容 104并清除对第一个字段的记录;若有可以匹配的 命令, 则认为提示符后的模拟终端的输出内容 104的显示内容为命令行; 继续 记录提示符后的模拟终端的显示内容, 同时提示输入判别子模块 55; 输入判 别子模块 55查看输入数据 103 , 当输入数据 103 出现命令确认键、 命令执行 键或命令取消键时, 通知输出内容判别子模块 54—个命令行结束。 通过上述 步驟, 识別得到终端命令行】05。 The terminal data capture module 51 is responsible for acquiring input and output data 101 between the terminal and the host, and dividing the acquired input and output data 101 into output data 102 and input data 103; the terminal simulation module 52 simulates the output data 102, and acquires the terminal. Outputting content 104, the output content includes display content and terminal status; command recognition module 53 performs command line identification in combination with output content 104 and input data 103, wherein output content discriminating sub-module 54, viewing output content 104, and simulating output content of the terminal 104 When the command prompt appears, check if there is input ^: according to 103; if there is no input data 103, continue to wait, if the terminal has input, record the output content of the analog terminal, and display the first display of the analog terminal after the command prompt. The fields are matched with the commands in the command library sub-module 56; if there is no matching command, the output content 104 is continuously viewed and the record of the first field is cleared; if there is a command that can be matched, the simulated terminal after the prompt is considered The output content of the output content 104 is the command line; continue to record The display content of the analog terminal after the symbol is simultaneously prompted to input the discrimination sub-module 55; the input discrimination sub-module 55 views the input data 103, and when the input data 103 appears a command confirmation key, a command execution key or a command cancel key, the output content discriminator is notified. Module 54 - a command line ends. Through the above steps, the terminal command line is recognized.
实施例 5 Example 5
参照图 6、 8、 9、 10, 本实施例公开了一种识别终端命令行的方法的具体
方案。 步骤 S610, 获取终端与主机之间的输入辣据和输出数据。 步骤 S620, 将输出数据通过模拟终端进行模拟,获取输出内容,所述输出内容包括显示内 容和终端状态。 Referring to Figures 6, 8, 9, and 10, this embodiment discloses a specific method for identifying a command line of a terminal. Program. Step S610, acquiring input data and output data between the terminal and the host. Step S620: Simulate the output data through the analog terminal to obtain output content, where the output content includes display content and terminal status.
等待输入 据或输出内容; 当有输入时, 执行步骤 S630, 根据输入数据、 输出数据、 或者输入数据和输出数据来判定当前命令识别的状态; 步骤 S640, 当前命令识别状态为命令输入状态时 ,认为模拟终端的显示内容为命令行并对 其进行记录; 步骤 S650, 当输入数据出现命令确认键、 命令执行键或命令取 消键时, 则认为一个命令行结束并暂停记录; 步驟 S660, 按照所记录的内容 得到终端用户的命令行。 关于步骤 S630中判定当前命令识别的状态的方法包 括以下三种方法, 适用于不同的具体应用环境: Waiting for the input data or outputting the content; when there is an input, executing step S630, determining the state of the current command identification according to the input data, the output data, or the input data and the output data; Step S640, when the current command recognition state is the command input state, It is considered that the display content of the analog terminal is the command line and is recorded; in step S650, when the input data appears command confirmation key, the command execution key or the command cancel key, it is considered that one command line ends and the recording is suspended; step S660, according to The recorded content is obtained from the terminal user's command line. The method for determining the state of the current command identification in step S630 includes the following three methods, which are applicable to different specific application environments:
方法一, 参照图 8, 设缺省的状态为程序输出状态; 当收到任何输入数据 802时, 状态转为命令输入状态, 直至所收到的输入数据, 包括该输入数据或 之后的输入数据为命令确认字符、命令执行字符或命令取消字符 203时,状态 转为程序输出状态。 在方法一中, 根据输入数据来确定当前命令识别的状态。 Method 1, with reference to Figure 8, the default state is the program output state; when any input data 802 is received, the state is changed to the command input state until the received input data includes the input data or the subsequent input data. When the command confirmation character, the command execution character, or the command cancel character 203, the state is changed to the program output state. In the first method, the state of the current command identification is determined based on the input data.
为了便于理解本实施例中的方法一, 以下面的操作为例: 当用户在命令提 示符" [user@host dir]$,,之后, 输入命令" Is -1", 并按回车执行; 计算机执行 Is 程序, 显示输出结果, 然后再显示命令提示符" [user@host dir]$ "。 To facilitate the understanding of the first method in this embodiment, the following operation is taken as an example: When the user at the command prompt "[user@host dir]$,, enter the command "Is-1" and press Enter to execute; The computer executes the Is program, displays the output, and then displays the command prompt "[user@host dir]$".
对于上述命令输入,从用户按键开始,命令识别的状态从程序输出状态变 成命令输入状态。 这时终端模拟程序的显示内容为" [user@host dir]$ ", 同时记 录提示符长度为 17 (包括尾部的空格)。 等到用户按下回车键时, 终端模拟程 序的显示内容已经成为" [user@host dir]$ ls -l,,,这时就认为緩冲区内第 17个字 符后的显示内容就是用户输入的命令并予以记录;然后把命令识别的状态修改 为程序输出状态,此后显示的从该命令执行到下一个提示符出现前的终端输出 内容都看作程序的输出直接记录,但下一个提示符本身由于该行尚未被换行字 符终止所以不会立即输出。记录完识别的命令行,此时命令识别的状态又回到 程序输出状态, 等待识别下一个输入的命令行。 For the above command input, the status of the command recognition changes from the program output state to the command input state from the user's button. At this time, the terminal emulation program displays "[user@host dir]$" and the record prompt length is 17 (including the trailing spaces). When the user presses the Enter key, the display content of the terminal emulation program has become "[user@host dir]$ ls -l,,, then the display content after the 17th character in the buffer is the user input. The command is also recorded; then the status of the command recognition is changed to the program output state, and the output of the terminal displayed from the execution of the command until the next prompt appears as the output of the program is directly recorded, but the next prompt Since the line has not been terminated by the newline character, it will not be output immediately. After the recognized command line is recorded, the status of the command recognition returns to the program output state, waiting for the next input command line to be recognized.
如果上例的输入过程为, 首先输入" 1 -Γ, 然后按 CTRL-A组合键把光标 移动到行首再用右箭头键或 CTRL-F組合键把光标移动到第二格后按下 "s"然 后打回车运行。尽管会产生更复杂的终端控制序列,但最后由终端模拟程岸得
到的益示内容都是一样的, 命令行仍然可以被正确的识别。 If the input process of the above example is, first enter "1 -Γ, then press CTRL-A to move the cursor to the beginning of the line and then use the right arrow key or CTRL-F key combination to move the cursor to the second grid and press ""s" then hit enter to run. Although it will produce a more complex terminal control sequence, but finally by the terminal simulation The benefits are the same, and the command line can still be recognized correctly.
方法二: 参照图 9,缺省的状态为程序输出状态; 当收到输入数据 802时, 状态转为命令输入状态, 直至该输入数据或之后的输入数据为命令确认字符、 命令执行字符或命令取消字符 203时,状态转为程序输出状态; 当输入数据为 帮助字符 204时, 状态转为命令提示状态, 直至当输入数据为非帮助字符 902 时,状态转为命令输入状态。在命令提示状态下捕获的终端输出不作为命令行, 直到再次进入命令输入状态。在方法二中,根据输入数据来确定当前命令识别 的状态。 Method 2: Referring to FIG. 9, the default state is the program output state; when the input data 802 is received, the state is changed to the command input state until the input data or the subsequent input data is a command confirmation character, a command execution character or a command. When the character 203 is canceled, the state is changed to the program output state; when the input data is the help character 204, the state is changed to the command prompt state until the input data is the helpless character 902, and the state is changed to the command input state. The terminal output captured in the command prompt state is not used as the command line until the command input state is entered again. In method two, the status of the current command identification is determined based on the input data.
为了便于理解本实施例中的方法二,以下面的操作为例: 用户在输入完 "Is -1 R"后按下 Tab键, 此时 Tab键被操作系统定义为帮助键,操作系统会自动补 全后面的 "EADME,,五个字符, 然后用户直接按回车执行该命令。 In order to facilitate the understanding of the second method in this embodiment, the following operations are taken as an example: After the user inputs "Is -1 R", the user presses the Tab key, and the Tab key is defined as a help key by the operating system, and the operating system automatically Completing the "EADME," five characters, and then the user directly presses Enter to execute the command.
具体的识别过程是, 命令识别的状态在用户开始输入时进入命令输入状 态, 当终端在用户按下 TAB后显示的" EADME"自动进入终端模拟程序的緩冲 区, 此时显示内容为正确的命令 "Is -1 README"。 The specific recognition process is that the state of the command recognition enters the command input state when the user starts inputting, and the "EADME" displayed by the terminal after the user presses the TAB automatically enters the buffer of the terminal simulation program, and the display content is correct. Command "Is -1 README".
在上例中,如果当前目录下以 R开头的文件有 "README"和" RELEASES" 两个, 用户在输入完 "Is -1 R"后按 TAB键, 操作系统首先自动补充 E字符, 然 后换行显示" README"和" RELEASES"两个文件名,之后重新换行显示命令提 示符和已经完成的部分命令 "Is -1 RE",用户看到提示后输入 A字符并按下 TAB 键, 操作系统自动补全 "DME"字符形成完整命令" Is -1 README" In the above example, if the file starting with R in the current directory has two "README" and "RELEASES", the user presses the TAB key after inputting "Is -1 R", the operating system automatically replenishes the E character first, and then wraps the line. Display the "README" and "RELEASES" file names, then re-wrap the command prompt and the completed part of the command "Is -1 RE". After the user sees the prompt, enter the A character and press the TAB key. The operating system automatically Completing the "DME" character to form the complete command "Is -1 README"
具体的识别过程是, 系统在接收到用户输入 TAB字符时, 命令识别的状 态进入命令提示状态, 之后操作系统显示换行符、可选文件名提示并重新换行 显示未完成命令行,此时的终端输出会被记录到输出过程文件但不会被认为是 命令进行记录。 直到用户按下 A键和最后的回车键, 命令识别的状态再重新 进入命令输入状态, 因此完整命令" Is -1 README"能够被记录下。 The specific identification process is: when the system receives the TAB character input by the user, the status of the command recognition enters the command prompt state, and then the operating system displays a line feed, an optional file name prompt, and re-wraps the uncompleted command line, and the terminal at this time The output will be logged to the output process file but will not be considered a command for recording. Until the user presses the A key and the last enter key, the status of the command recognition re-enters the command input state, so the complete command "Is -1 README" can be recorded.
方法三: 参照图 10, 缺省的状态为程序输出状态; 当输出数据为进入交 互状态的特征序列 206时, 状态转为交互式应用状态, 直至当输出数据为退出 交互状态的特征序列 207时,状态转为程序输出状态;当收到输入数据 802时, 状态转为命令输入状态, 直至该数据或之后的输入数据为命令确认字符、命令 执行字符或命令取消字符 203时, 状态转为程序输出状态; 当输入数据为帮助
字符 204时, 状态转为命令提示状态, 直至当输入数据为非帮助字符 902时, 状态转为命令输入状态。在方法三中,根据输入数据和输出数据来确定当前命 令识别的状态。 Method 3: Referring to FIG. 10, the default state is the program output state; when the output data is the feature sequence 206 entering the interactive state, the state transitions to the interactive application state until the output data is the feature sequence 207 exiting the interactive state. The state is changed to the program output state; when the input data 802 is received, the state is changed to the command input state until the data or the subsequent input data is the command confirmation character, the command execution character or the command cancel character 203, and the state is changed to the program. Output status; when entering data for help At the time of character 204, the state transitions to the command prompt state until the input data is the helpless character 902, and the state transitions to the command input state. In method three, the state of the current command identification is determined based on the input data and the output data.
为了便于理解本实施例中的方法三,以下面的操作为例:用户使用命令 "vi README"运行 vi程序来编辑一个名为 EADME的文件。 他需要在文件末尾 加上内容为 "[user@host dir]$ hello"的一行,因此他先按 G键把光标移到文件尾 部, 再按 0键建立一个新行, 逐字打入该行内容后按回车, 然后按 ESC键, ZZ保存文件并退出。 To facilitate the understanding of the third method in this embodiment, the following operation is taken as an example: the user runs the vi program using the command "vi README" to edit a file named EADME. He needs to add a line with the content "[user@host dir]$ hello" at the end of the file, so he first presses the G key to move the cursor to the end of the file, then presses the 0 key to create a new line, and enters the line verbatim. Press Enter after the content, then press ESC, ZZ to save the file and exit.
具体的识別过程是, 在 VT102终端下, vi在进入交互编辑模式时会通过 显示状态的序列" ESC[?1049h,,切换到备用屏幕(alternative screen ), 在检测到 该序列后,命令识别的状态切换到交互式应用状态,接下来的操作都不会被记 录,直到用户退出 vi,终端输出显示状态的序列" ESC[?10491 "切换回原始屏幕, 检测到该序列后,命令识别的状态变为程序输出状态。等待终端用户的下一步 操作。 The specific recognition process is that under the VT102 terminal, vi enters the interactive editing mode by displaying the sequence of the state "ESC[?1049h,, switching to the alternate screen, after the sequence is detected, the command is recognized. The state is switched to the interactive application state, and the next operation will not be recorded until the user exits vi. The terminal outputs a sequence of display states "ESC[?10491" to switch back to the original screen. After detecting the sequence, the command recognizes The status changes to the program output status. Wait for the next step of the end user.
上述帮助字符 204为 Tab键或"? "键。上述普通字符为除了帮助字符或命 令确认字符或命令执行字符之外的输入字符。 上述进入交互状态的特征序列 206为: VT102及兼容终端的设置模式 47号, 和 /或 VT102及兼容终端的设置 模式 1047号,和 /或 VT102及兼容终端的设置模式 1049号,和 /或 VT100及兼 容终端的设置模式 1号。上述退出交互状态的特征序列 207为: VT102及兼容 终端的清除模式 47号, 和 /或 VT102及兼容终端的清除模式 1047号, 和 /或 VT102及兼容终端的清除模式 1049号,和 /或 VT100及兼容终端的清除模式 1 号。 The above help character 204 is a Tab key or a "?" key. The above ordinary characters are input characters other than the help character or the command confirmation character or the command execution character. The feature sequence 206 entering the interactive state is: setting mode 47 of VT102 and compatible terminal, and/or setting mode 1047 of VT102 and compatible terminal, and/or setting mode 1049 of VT102 and compatible terminal, and/or VT100. And the setting mode of the compatible terminal No. 1. The feature sequence 207 of the above-mentioned exit interaction state is: VT102 and compatible terminal clear mode No. 47, and/or VT102 and compatible terminal clear mode 1047, and/or VT102 and compatible terminal clear mode 1049, and/or VT100. And the clear mode of the compatible terminal No. 1.
方法四 ·. 参照图 11 , 缺省的状态为程序输出状态; 当收到输入数据 802 时, 状态转为命令输入状态, 直至该输入数据或之后的输入数据为命令取消字 符 203时, 状态转为程序输出状态; 在命令输入状态下, 当输入数据为命令确 认字符 208时,状态转为命令等待状态; 在命令等待状态下输出数据为换行字 符 209时,终端模拟缓冲区内的内容就是所识别的命令, 同时状态变为程序输 出状态;在命令等待状态下捕获的终端输出仍然属于命令行, 直到退出等待状 态。 在方法四中, 根据输入数据和输出数据来确定当前命令识别的状态。
当前命令识别状态为命令输入状态时,则认为模拟终端的显示内容为命令 行,记录输出内容; 当输入数据出现命令确认键、命令执行键或命令取消键时, 则认为一个命令行结束。 通过上述步骤, 可以方便、 准确地识别得到终端命令 行。 Method 4: Referring to Figure 11, the default state is the program output state; when the input data 802 is received, the state is changed to the command input state until the input data or the subsequent input data is the command cancel character 203, the state is turned In the command input state, when the input data is the command confirmation character 208, the state is changed to the command waiting state; when the output data is the newline character 209 in the command waiting state, the content in the terminal simulation buffer is the The recognized command, while the status changes to the program output state; the terminal output captured in the command wait state still belongs to the command line until the wait state is exited. In method four, the status of the current command identification is determined based on the input data and the output data. When the current command recognition status is the command input state, the display content of the analog terminal is regarded as the command line, and the output content is recorded; when the command data confirms the key, the command execution key or the command cancel key, the command line ends. Through the above steps, the terminal command line can be easily and accurately identified.
实施例 6 Example 6
参照图 7、 8、 9、 10, 这是一种基于实施例 5方案的识別终端命令行的装 置。 该装置包括终端数据捕获模块 71、 终端模拟模块 72和命令识别模块 73 , 其中命令识别模块 73包括获取命令行子模块 74、 输入判别子模块 75和命令 识别状态确定子模块 76。 Referring to Figures 7, 8, 9, and 10, this is an apparatus for identifying a terminal command line based on the scheme of Embodiment 5. The apparatus includes a terminal data capture module 71, a terminal simulation module 72, and a command recognition module 73, wherein the command recognition module 73 includes an acquisition command line sub-module 74, an input discrimination sub-module 75, and a command recognition status determination sub-module 76.
终端数据捕获模块 71 负责获取终端与主机之间的输入和输出数据 101 , 将获取的输入和输出数据 101分为输出数据 102和输入数据 103。 终端模拟模 块 72对输出数据 102进行模拟, 获取终端的输出内容 104, 所述输出内容包 括显示内容和终端状态。 命令识别模块 73结合输出内容 104和输入数据 103 进行命令行识别, 具体过程如下'. 输入判别子模块 75查看终端是否有输入, 当有输入时, 输入判别子模块 75提示命令识别状态确定子模块 76; 命令识别 状态确定子模块 76根据输入数据 103 , 也可以根据输出数据、 或者输入数据 103和输出数据 102来判定当前命令识別的状态, 关于判定当前命令识别的状 态的过程可以基于实施例 5中的四种判定当前命令识别的状态方法进行,当前 容为命令行, 命令识别状态确定子模块 76提示获取命令行子模块 74; 获取命 令行子模块 74记录输出内容 104; 当输入数据出现命令确认键、 命令执行键 或命令取消键时, 命令识別状态确定子模块 76将当前命令识别状态由命令输 入状态转入程序输出状态, 并通知获取命令行子模块 74—个命令行结束。 通 过上述步骤, 识別得到终端命令行 105。 The terminal data capture module 71 is responsible for acquiring input and output data 101 between the terminal and the host, and dividing the acquired input and output data 101 into output data 102 and input data 103. The terminal emulation module 72 simulates the output data 102 to obtain the output content 104 of the terminal, the output content including the display content and the terminal status. The command recognition module 73 performs command line identification in combination with the output content 104 and the input data 103. The specific process is as follows. The input discrimination sub-module 75 checks whether the terminal has an input. When there is an input, the input determination sub-module 75 prompts the command recognition status determination sub-module. The command recognition state determining sub-module 76 may determine the state of the current command identification based on the input data 103 or the input data 103 and the output data 102 according to the input data 103. The process of determining the state of the current command identification may be based on the embodiment. The four state determination methods of the current command are performed, the current command is the command line, the command recognition state determination sub-module 76 prompts to acquire the command line sub-module 74; the acquisition command line sub-module 74 records the output content 104; when the input data appears When the command confirmation key, the command execution key or the command cancel key is issued, the command recognition state determination sub-module 76 transfers the current command recognition state from the command input state to the program output state, and notifies the acquisition command line sub-module 74 that the command line ends. Through the above steps, the terminal command line 105 is identified.
以上对本发明所提供的一种识别终端命令行方法、装置,进行了详细介绍, 说明只是用于帮助理解本发明的方法及其核心思想; 同时,对于本领域的一般 技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处, 综上所述, 本说明书内容不应理解为对本发明的限制。
The method and device for identifying a terminal command line provided by the present invention are described in detail above, and the description is only for helping to understand the method and core idea of the present invention. Meanwhile, for those skilled in the art, according to the present invention, The present invention is not limited by the scope of the present invention.
Claims
1、 一种识别终端命令行的方法, 其特征在于, 包括: A method for identifying a command line of a terminal, comprising:
获取终端与主机之间的输入数据和输出数据; Obtaining input data and output data between the terminal and the host;
将输出数据通过模拟终端进行模拟, 获取终端的输出内容; The output data is simulated by the analog terminal to obtain the output content of the terminal;
才艮据输入数据识别输出内容中的终端命令行。 The terminal command line in the output content is identified based on the input data.
2、 根据权利要求 1所述的识别终端命令行的方法, 其特征在于, 所述获 取终端与主机之间的输入数据和输出数据包括: 通过网络侦听、通讯线路侦听 或代理转发来获取终端与主机之间的输入数据和输出数据。 The method for identifying a command line of a terminal according to claim 1, wherein the obtaining input data and output data between the terminal and the host comprises: acquiring by network interception, communication line interception or proxy forwarding Input data and output data between the terminal and the host.
3、 根据权利要求 1所述的识别终端命令行的方法, 其特征在于, 所述根 据输入数据识別输出内容中的终端命令行包括: 当输出内容出现命令行提示符 时, 记录输出内容作为命令行, 直至输入数据为命令确认键、 命令执行键或命 令取消键时该命令行结束。 The method for identifying a terminal command line according to claim 1, wherein the identifying the terminal command line in the output content according to the input data comprises: when the output content appears at the command line prompt, recording the output content as The command line ends when the input data is the command confirmation key, the command execution key, or the command cancel key.
4、 根据权利要求 3所述的识别终端命令行的方法, 其特征在于, 所述输 出内容包括显示内容和终端状态; The method for identifying a command line of a terminal according to claim 3, wherein the output content comprises display content and terminal status;
所述记录输出内容作为命令行进一步包括:将命令提示符后显示内容的笫 一个字段与命令库中的命令进行匹配; 若有可以匹配的命令, 则记录该字段与 其后的输出内容作为命令行, 直至输入数椐为命令确认键、命令执行键或命令 取消键时该命令行结束; 所述命令库中包含所述主机操作系统的所有命令。 The recording output content as a command line further includes: matching a field of the content displayed after the command prompt with a command in the command library; if there is a command that can be matched, recording the field and the output content thereof as a command line The command line ends when the input number is the command confirmation key, the command execution key, or the command cancel key; the command library contains all the commands of the host operating system.
5、 根据权利要求 1所述的识别终端命令行的方法, 其特征在于, 所述根 据输入 :据识别输出内容中的终端命令行包括:通过终端输入数据和输出内容 中的输出序列确定当前命令识别状态, 并按照命令识别状态识别终端命令行。 The method for identifying a command line of a terminal according to claim 1, wherein the determining, according to the input: the terminal command line in the output content comprises: determining the current command by using the terminal input data and the output sequence in the output content. Identify the status and identify the terminal command line by command status.
6、 根据权利要求 5所述的识别终端命令行的方法, 其特征在于, 所述根 据输入数据识别输出内容中的终端命令行包括: The method for identifying a command line of a terminal according to claim 5, wherein the identifying, according to the input data, the terminal command line in the output content comprises:
根据输入数据确定当前命令识别状态;所述命令识别状态包括命令输入状 态和程序输出状态; Determining a current command identification status based on the input data; the command identification status includes a command input status and a program output status;
在命令输入状态下,记录输出内容作为命令行, 直至由命令输入状态转入 程序输出状态时该命令行结束。 In the command input state, the output content is recorded as a command line until the command line ends when the command input state transitions to the program output state.
7、 根据权利要求 6所述的识别终端命令行的方法, 其特征在于, 所述根 据输入数据确定当前命令识别状态包括:在程序输出状态下有输入数据时转入
命令输入状态;在命令输入状态下输入数据为命令确认字符、命令执行字符或 命令取消字符时, 转入程序输出状态。 The method for identifying a command line of a terminal according to claim 6, wherein the determining the current command recognition state according to the input data comprises: transferring when there is input data in a program output state Command input status; when the input data is command confirmation character, command execution character or command cancel character in the command input state, it is transferred to the program output state.
8、 根据权利要求 Ί所述的识别终端命令行的方法, 其特征在于, 所述命 令识别状态还包括命令提示状态; 8. The method for identifying a command line of a terminal according to claim </ RTI>, wherein the command recognition state further comprises a command prompt state;
所述根据输入数据确定当前命令识别状态还包括:在命令输入状态下输入 数据为帮助字符时,转入命令提示状态; 在命令提示状态下输入数据为非帮助 字符时, 转入命令输入状态。 The determining the current command recognition state according to the input data further includes: when the input data is a help character in the command input state, the command prompt state is entered; when the input data is a non-help character in the command prompt state, the command input state is transferred.
9、 根据权利要求 7或 8所述的识别终端命令行的方法, 其特征在于, 所 述命令识别状态还包括命令等待状态; The method for identifying a command line of a terminal according to claim 7 or 8, wherein the command recognition state further comprises a command waiting state;
所述方法还包括: 在命令输入状态下输入数据为命令确认字符时,转入命 令等待状态; 在命令等待状态下输出数据为换行字符时, 转入程序输出状态; 所述识别输出内容中的终端命令行包括:在由命令等待状态转入程序输出 状态时, 终端模拟緩冲区内的输出内容即为终端命令行。 The method further includes: when the input data is a command confirmation character in the command input state, transferring to the command waiting state; when the output data is a newline character in the command waiting state, transferring to the program output state; The terminal command line includes: when the command wait state is transferred to the program output state, the output content in the terminal emulation buffer is the terminal command line.
10、根据权利要求 7或 8所述的识别终端命令行的方法, 其特征在于, 所 述命令识別状态还包括交互式应用状态; The method for identifying a command line of a terminal according to claim 7 or 8, wherein the command recognition status further comprises an interactive application state;
所述方法还包括:在程序输出状态下当输出数据为进入交互状态的特征序 列时,转入交互式应用状态; 在交互式应用状态下输出数据为退出交互状态的 特征序列时, 转入程序输出状态。 The method further includes: when the output data is a feature sequence entering the interactive state in the program output state, transferring to the interactive application state; when the output data is the feature sequence of the exiting interaction state in the interactive application state, the program is transferred to the program Output status.
11、根据权利要求 8所述的识别终端命令行的方法, 其特征在于, 所述帮 助字符为 TAB键或"? "键。 The method of identifying a command line of a terminal according to claim 8, wherein the help character is a TAB key or a "?" key.
12、 才艮据权利要求 10所述的识别终端命令行的方法, 其特征在于, 所述 进入交互状态的特征序列为: VT102及兼容终端的设置模式 47号,和 /或 VT102 及兼容终端的设置模式 1047号,和 /或 VT102及兼容终端的设置模式 1049号, 和 /或 VT100及兼容终端的设置模式 1号; 12. The method for identifying a command line of a terminal according to claim 10, wherein the sequence of characteristics entering the interactive state is: VT102 and a setting mode of the compatible terminal No. 47, and/or VT102 and a compatible terminal. Set mode No. 1047, and/or VT102 and compatible terminal setting mode No. 1049, and/or VT100 and compatible terminal setting mode No. 1;
所述退出交互状态的特征序列为: VT102及兼容终端的清除模式 47号, 和 /或 VT102及兼容终端的清除模式 1047号, 和 /或 VT102及兼容终端的清除 模式 1049号, 和 /或 VT100及兼容终端的清除模式 1号。 The sequence of characteristics of the exiting interaction state is: VT102 and compatible terminal clear mode No. 47, and/or VT102 and compatible terminal clear mode 1047, and/or VT102 and compatible terminal clear mode 1049, and/or VT100 And the clear mode of the compatible terminal No. 1.
13、 一种识别终端命令行的装置, 其特征在于, 包括: 13. A device for identifying a command line of a terminal, comprising:
终端数据捕获模块, 用于获取终端与主机之间的输入数据和输出数据;
终端模拟模块, 用于将输出数据通过模拟终端进行模拟, 获取输出内容; 命令识别模块, 用于根据输入数据在输出内容中识别终端命令行。 a terminal data capture module, configured to acquire input data and output data between the terminal and the host; The terminal simulation module is configured to simulate output data through the analog terminal to obtain output content, and the command recognition module is configured to identify the terminal command line in the output content according to the input data.
14、 根据权利要求 13所述的识别终端命令行的装置, 其特征在于, 所述 命令识别模块包括: The device for identifying a command line of a terminal according to claim 13, wherein the command recognition module comprises:
输出内容判别子模块,用于当模拟终端的输出内容出现命令提示符时,提 示输入判别子模块, 并将在出现命令提示符后、 收到输入判别子模块的通知前 记录的输出内容作为终端命令行; The output content discriminating sub-module is configured to prompt the input of the discriminating sub-module when the output content of the analog terminal appears, and the output content recorded before the notification of the input discriminating sub-module is received as the terminal after the command prompt appears. Command Line;
输入判别子模块, 用于在收到输出内容判别子模块的提示后查看输入数 据, 当输入数据出现命令确认键、命令执行键或命令取消键时, 通知输出内容 判别子模块一个命令行结束。 The input discriminating sub-module is configured to view the input data after receiving the prompt of the output content discriminating sub-module, and when the input data appears the command confirm key, the command execution key or the command cancel key, notify the output content that the sub-module ends a command line.
15、 根据权利要求 14所述的识别终端命令行的装置, 其特征在于, 所述 所述输出内容包括显示内容和终端状态; The device for identifying a command line of a terminal according to claim 14, wherein the output content comprises display content and terminal status;
所述命令识别模块还包括:命令库子模块, 用于存储所述主机操作系统的 所有命令; The command recognition module further includes: a command library submodule, configured to store all commands of the host operating system;
所述输出内容判别子模块在输出内容出现命令提示符时,将命令提示符后 显示内容的第一个字段与命令库子模块中的命令进行匹配,若匹配则提示输入 判别子模块, 并将在出现命令提示符后、收到输入判别子模块的通知前记录的 输出内容作为终端命令行。 The output content discriminating sub-module matches the first field of the content displayed after the command prompt with the command in the command library sub-module when the output content appears at the command prompt, and if yes, prompts to input the discriminating sub-module, and After the command prompt appears, the output of the record recorded before the notification of the input discrimination sub-module is received is used as the terminal command line.
16、 根据权利要求 13所述的识别终端命令行的装置, 其特征在于, 所述 命令识别模块包括: The device for identifying a command line of a terminal according to claim 13, wherein the command recognition module comprises:
输入判别子模块, 用于在终端有输入数据时提示命令识别状态确定子模 块; The input discriminating sub-module is configured to prompt the command to identify the status determining sub-module when the terminal has input data;
命令识别状态确定子模块,用于在收到输入判别子模块的提示后确定当前 命令识別状态, 所述命令识别状态包括命令输入状态和程序输出状态,并在由 程序输出状态转入命令输入状态时提示获取命令行子模块,在由命令输入状态 转入程序输出状态时通知获取命令行子模块一个命令行结束; The command recognition state determining submodule is configured to determine a current command recognition state after receiving the prompt of the input discriminating submodule, wherein the command recognizing state includes a command input state and a program output state, and is transferred to the command input by the program output state. When prompted, the command line submodule is obtained, and when the command input state is transferred to the program output state, the command line submodule is notified to end a command line;
获取命令行子模块, 用于根据收到命令识别状态确定子模块的提示,在命 令输入状态下记录输出内容, 作为命令行。 The command line sub-module is configured to determine the sub-module prompt according to the received command recognition status, and record the output content in the command input state as a command line.
17、 根据权利要求 16所述的识别终端命令行的装置, 其特征在于, 所述
程序输出状态表示终端正在产生程序的结果输出; , 17. The apparatus for identifying a command line of a terminal according to claim 16, wherein: The program output status indicates that the terminal is generating the result output of the program;
所述命令输入状态表示终端的输出数据为命令;在程序输出状态下有输入 数据时转入命令输入状态,在命令输入状态下输入数据为命令确认字符、命令 执行字符或命令取消字符时, 转入程序输出状态。 The command input state indicates that the output data of the terminal is a command; when the input data is input in the program output state, the command input state is entered, and when the command input state is the command confirmation character, the command execution character, or the command cancel character, the command input state Enter the program output status.
18、 根据权利要求 17所述的识别终端命令行的装置, 其特征在于, 所述 命令识别状态还包括命令提示状态, 表示处于命令补全的辅助命令输入状态; 在命令输入状态下输入数据为帮助字符时,转入命令提示状态; 在命令提示状 态下输入数据为非帮助字符时, 转入命令输入状态。 18. The apparatus for identifying a command line of a terminal according to claim 17, wherein the command recognition state further comprises a command prompt state, indicating an auxiliary command input state in which the command is completed; and inputting data in the command input state. When the help character is entered, the command prompt state is entered; when the input data is a non-help character in the command prompt state, the command input state is entered.
19、 根据权利要求 17或 18所迷的识别终端命令行的装置, 其特征在于, 所迷命令识別状态还包括命令等待状态;在命令输入状态下输入数据为命令确 认字符时,转入命令等待状态; 在命令等待状态下输出数据为换行字符时, 转 入程序输出状态; 19. The apparatus for identifying a command line of a terminal according to claim 17 or 18, wherein the command recognition state further comprises a command waiting state; and when the input data is a command confirmation character in the command input state, the command is transferred. Wait state; when the output data is a newline character in the command wait state, it is transferred to the program output state;
所述命令识别状态确定子模块在由命令等待状态转入程序输出状态时提 示获取命令行子模块将终端模拟緩冲区内的输出内容作为命令行。 The command recognition state determining sub-module prompts the acquisition command line sub-module to use the output content in the terminal emulation buffer as a command line when transitioning from the command waiting state to the program output state.
20、 根据权利要求 17或 18所述的识别终端命令行的装置, 其特征在于, 所迷命令识别状态还包括: 交互式应用状态, 表示处于运行交互程序的状态; 在程序输出状态下当输出数据为进入交互状态的特征序列时,转入交互式应用 状态;在交互式应用状态下输出数据为退出交互状态的特征序列时,转入程序 输出状态。
The device for identifying a command line of a terminal according to claim 17 or 18, wherein the command recognition state further comprises: an interactive application state indicating a state in which the interactive program is running; and outputting in a program output state. When the data enters the feature sequence of the interactive state, it enters the interactive application state; when the output data is the feature sequence of the exit interactive state in the interactive application state, the data is transferred to the program output state.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200610087243.9 | 2006-06-14 | ||
CNB2006100872439A CN100452706C (en) | 2006-06-14 | 2006-06-14 | Method and apparatus for identifying terminal command line |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2007147339A1 true WO2007147339A1 (en) | 2007-12-27 |
Family
ID=37578703
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2007/001872 WO2007147339A1 (en) | 2006-06-14 | 2007-06-14 | Method and device for identifying terminal command line |
Country Status (3)
Country | Link |
---|---|
CN (1) | CN100452706C (en) |
HK (1) | HK1098612A1 (en) |
WO (1) | WO2007147339A1 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102571774B (en) * | 2011-12-27 | 2015-10-21 | 浙江省电力公司 | A kind of character operating command identification method and device |
CN103258021B (en) * | 2013-05-03 | 2016-02-03 | 杭州安恒信息技术有限公司 | The character terminal characteristic extracting method that a kind of Behavior-based control is analyzed |
CN103744701B (en) * | 2014-01-06 | 2017-06-30 | 浪潮电子信息产业股份有限公司 | A kind of order completion intelligent under linux and the method for installation system |
CN103841115B (en) * | 2014-03-21 | 2017-02-08 | 成都安恒信息技术有限公司 | Character terminal command real-time approval method and application layer structure |
US11200078B1 (en) | 2020-11-06 | 2021-12-14 | International Business Machines Corporation | Facilitating use of an unfamiliar command line tool via a familiar command line tool |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4791566A (en) * | 1987-03-27 | 1988-12-13 | Digital Equipment Corporation | Terminal device session management protocol |
US5933621A (en) * | 1997-03-25 | 1999-08-03 | Lam Research Corporation | Method and Apparatus for terminal emulation in a semiconductor fabricating facility |
CN1534460A (en) * | 2003-03-28 | 2004-10-06 | 烽火通信科技股份有限公司 | Management method possessing real time helping function in insertion type system |
CN1960273A (en) * | 2005-11-01 | 2007-05-09 | 杭州帕拉迪网络科技有限公司 | Method for dynamic real time capturing logic commands input from UNIX terminal user |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100338604B1 (en) * | 2000-05-29 | 2002-05-27 | 배영주 | remote network management system via serial port |
CN1141659C (en) * | 2001-12-04 | 2004-03-10 | 上海复旦光华信息科技股份有限公司 | Remote user operation process recording and restoring method |
CN1556636A (en) * | 2004-01-02 | 2004-12-22 | 南京金鹰国际集团软件系统有限公司 | Character terminal monitoring system |
CN1674504A (en) * | 2004-03-24 | 2005-09-28 | 威达电股份有限公司 | Long-distance terminal machine emulation system and method |
-
2006
- 2006-06-14 CN CNB2006100872439A patent/CN100452706C/en active Active
-
2007
- 2007-06-04 HK HK07105875.2A patent/HK1098612A1/en unknown
- 2007-06-14 WO PCT/CN2007/001872 patent/WO2007147339A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4791566A (en) * | 1987-03-27 | 1988-12-13 | Digital Equipment Corporation | Terminal device session management protocol |
US5933621A (en) * | 1997-03-25 | 1999-08-03 | Lam Research Corporation | Method and Apparatus for terminal emulation in a semiconductor fabricating facility |
CN1534460A (en) * | 2003-03-28 | 2004-10-06 | 烽火通信科技股份有限公司 | Management method possessing real time helping function in insertion type system |
CN1960273A (en) * | 2005-11-01 | 2007-05-09 | 杭州帕拉迪网络科技有限公司 | Method for dynamic real time capturing logic commands input from UNIX terminal user |
Also Published As
Publication number | Publication date |
---|---|
CN1889442A (en) | 2007-01-03 |
CN100452706C (en) | 2009-01-14 |
HK1098612A1 (en) | 2007-07-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108600796B (en) | Control mode switch method, equipment and the computer-readable medium of smart television | |
US7184592B2 (en) | Information processing apparatus, method of controlling the same, and program for causing a computer to execute such a method | |
JP2020527753A (en) | View-based voice interaction methods, devices, servers, terminals and media | |
US20100002140A1 (en) | Television with integrated asynchronous/synchronous kvmp signal switch for console and peripheral devices | |
US8063884B2 (en) | Information processing apparatus, display control method, and program for controlling a display of the information processing apparatus based on an input received from a remote controller | |
WO2014051207A1 (en) | Electronic device, server and control method thereof | |
US20140071974A1 (en) | Information processing apparatus, information processing method and computer program | |
WO2007147339A1 (en) | Method and device for identifying terminal command line | |
TWI427965B (en) | Remote management system, kvm switch, and remote managing method | |
JP7017598B2 (en) | Data processing methods, devices, devices and storage media for smart devices | |
CN110992955A (en) | Voice operation method, device, equipment and storage medium of intelligent equipment | |
KR20210068333A (en) | Method and device for guiding operation of application program, equipment and readable storage medium | |
WO2018090720A1 (en) | Method and apparatus for plug and play screen mirroring | |
WO2018090722A1 (en) | Method and apparatus for realizing wired screen delivery | |
CN107948567B (en) | USB wired screen transmission method and device | |
US6031470A (en) | Method and device for transmitting key operation information and transmission-reception system | |
JP2007052480A (en) | Information processor, switcher, remote control system, scan code transmitting method and program | |
US10628031B2 (en) | Control instruction identification method and apparatus, and storage medium | |
CN102880416A (en) | Remote control unlocking method for mobile equipment in remote control protocol (RCP) communication process | |
WO2012065375A1 (en) | Method, apparatus, keyboard and terminal device for processing keyboard instructions | |
WO2018090724A1 (en) | Method and apparatus for wired screen transmission | |
WO2020248504A1 (en) | State indication method and apparatus for student tablet computer, and student tablet computer and storage medium | |
CN212647425U (en) | Display and keyboard and mouse switching system | |
KR102254873B1 (en) | KVM switching apparatus used in monitor with PBP function | |
CN110399080A (en) | A kind of output control method, terminal and more device systems |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 07721445 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 07721445 Country of ref document: EP Kind code of ref document: A1 |