Search Images Maps Play YouTube News Gmail Drive More »
Sign in
Screen reader users: click this link for accessible mode. Accessible mode has the same essential features but works better with your reader.

Patents

  1. Advanced Patent Search
Publication numberUS20050132043 A1
Publication typeApplication
Application numberUS 10/991,000
Publication dateJun 16, 2005
Filing dateNov 17, 2004
Priority dateDec 12, 2003
Publication number10991000, 991000, US 2005/0132043 A1, US 2005/132043 A1, US 20050132043 A1, US 20050132043A1, US 2005132043 A1, US 2005132043A1, US-A1-20050132043, US-A1-2005132043, US2005/0132043A1, US2005/132043A1, US20050132043 A1, US20050132043A1, US2005132043 A1, US2005132043A1
InventorsGong-Qian Wang, Tang He
Original AssigneeHon Hai Precision Industry Co., Ltd.
Export CitationBiBTeX, EndNote, RefMan
External Links: USPTO, USPTO Assignment, Espacenet
System and method for command line interface command processing
US 20050132043 A1
Abstract
A system (100) for CLI command processing is usable for configuring and administering electronic devices. The system includes: an I/O controlling module (110) for receiving input commands from a console or a terminal; a command parsing module (120) for parsing each character in the input commands, and separating the input commands into a job parent command and plural job child commands; a job controlling module (130) for executing the job parent command and job child commands; and a mode controlling module (140) for selecting an appropriate mode for inputting of commands by a user. The job controlling module comprises a job list (131), which stores the command information structures of the job parent command and job child commands. A related method is also provided.
Images(5)
Previous page
Next page
Claims(14)
1. A system for CLI (Command Line Interface) command processing, the system being usable for configuring and administering electronic devices, the system comprising:
an I/O (input/output) controlling module, for receiving input commands from a console or terminal;
a command parsing module, for parsing each character in the input commands, and separating the input commands into a job parent command and plural job child commands;
a job controlling module, for carrying out the job parent command and job child commands; and
a mode controlling module, for selecting an appropriate mode for inputting of commands by a user.
2. The system for CLI command processing as recited in claim 2, wherein the command parsing module builds up command information structures for the job parent command and the job child commands.
3. The system for CLI command processing as recited in claim 1, wherein the job controlling module comprises a tree format job list for storing the command information structures of the job parent command and the job child commands.
4. The system for CLI command processing as recited in claim 1, wherein the mode controlling module supports an execute mode, a privilege mode, a global configure mode, a DHCP (Dynamic Host Configuration Protocol) pool configure mode, and an interface configure mode.
5. The system for CLI command processing as recited in claim 4, wherein access to each of said modes is controlled by a respective password.
6. A method of CLI command processing, the method being usable for configuring and administering electronic devices, the method comprising the following steps:
receiving input commands from a console or terminal, and transmitting the input commands to a command parsing module;
checking whether there are special characters in the input commands;
separating the input commands into a job parent command and plural job child commands, and building up command information structures;
checking whether all the command information structures are valid;
transmitting the valid command information structures to a job controlling module, if all the command information structures are valid; and
executing tasks indicated by the valid command information structures.
7. The method of CLI command processing as recited in claim 6, further comprising the following step: assigning meanings to the special characters and then performing step (c), if the input commands include special characters.
8. The method of CLI command processing as recited in claim 6, further comprising the following step:
showing an error to one or more users, if there is any invalid command information structure.
9. The method of CLI command processing as recited in claim 6, wherein step (f) comprises the following steps:
(f1) receiving and storing the valid command information structures;
(f2) executing each of the valid command information structures, and building up a main process and plural child processes; and
(f3) making the main process check and control the child processes.
10. The method of CLI command processing as recited in claim 9, wherein step (f3) comprises the following steps:
(f31) checking whether a child process has exited;
(f32) transmitting a result of the child process to a next child process, and executing the next child process, if the child process has exited;
(f33) checking whether all of child processes have exited; and
(f34) showing one or more results to said users, if all of the child processes have exited.
11. The method of CLI command processing as recited in claim 10, further comprising the following step: waiting for the child process to exit, if the child process has not exited.
12. The method of CLI command processing as recited in claim 10, further comprising the following step: returning to step (f31) in respect of another child process, if there is any child process that has not exited.
13. A method of command line interface (CLI) command processing to configure and administer electronic devices, comprising the following steps:
acquiring input commands from a user via said CLI;
parsing said input commands into a plurality of electronic-device recognizable job commands and command information structures;
creating process check information based on said command information structures; and
executing said job commands and command information structures under a process check based on said process check information.
14. The method as recited in claim 13, further comprising the step of selecting working modes of said CLI command processing on an access-controlled basis.
Description
    BACKGROUND OF THE INVENTION
  • [0001]
    1. Field of the Invention
  • [0002]
    The present invention relates to a system and method for Command Line Interface (CLI) command processing; and more particularly to a system and method for CLI command processing, usable for configuring and administering electronic devices such as routers and switches.
  • [0003]
    2. Prior Art of the Invention
  • [0004]
    A user interface is a management tool supported by software. A typical user interface enables users to configure and monitor electronic devices. The user interface usually transmits commands input by the users to the electronic devices, whereupon the input commands are parsed by internal programs of the electronic devices. Subsequently, tasks indicated by the commands are executed. Nowadays there are two common kinds of user interfaces: one is the CLI, the other is a Graphical User Interface (GUI).
  • [0005]
    A GUI is a user interface based on graphics such as toolbars, menus, icons, buttons, and dialogue boxes. Users can input commands by clicking on the graphics using a computer mouse. A CLI is a user interface based on textual input and output. The users input keywords and parameters representing commands by use of a keyboard or similar input device. Then the commands are parsed and executed by corresponding internal programs of the electronic devices. Finally, results of the commands are output to the users on the CLI in the form of text.
  • [0006]
    Because GUI command processing uses a lot of controlling graphics, the memory needed to support GUI command processing is large compared to that of CLI command processing. When the above-mentioned controlling graphics of the GUI interface are invoked, additional memory is required. Therefore the speed of GUI command processing is slower than that of CLI command processing.
  • [0007]
    During CLI command processing, a mechanism for parsing commands is involved. The mechanism for parsing commands is usually a system that matches the input commands with attribute values, wherein the attribute values correspond to certain executers. The commands that are supported by the user interface include commands for configuring the electronic devices, and commands for retrieving information on states of the electronic devices. Therefore, for CLI command processing to be efficient, the mechanism for parsing commands must be efficient.
  • [0008]
    A method for parsing commands is disclosed in China Pat. No. 00125204.6, which issued on Feb. 20, 2002 and is entitled “Method of storage and parse of commands used for maintaining of routers.” The method employs a tree format list to store several segments of input commands. The mechanism used in the patent is quite different from random storage of commonly used parsing mechanisms. The tree format list used in the patent can quickly match the input commands with corresponding attribute values.
  • [0009]
    What is still needed is a system and method which efficiently process commands that are input through a CLI interface.
  • SUMMARY OF THE INVENTION
  • [0010]
    Accordingly, an object of the present invention is to provide an efficient system for CLI command processing, which enables users to configure, monitor and maintain electronic devices.
  • [0011]
    Another object of the present invention is to provide an efficient method of CLI command processing, which enables users to configure, monitor and maintain electronic devices.
  • [0012]
    In order to accomplish the first of the above-mentioned objects, a system for CLI command processing comprises an I/O (input/output) controlling module, a command parsing module, a job controlling module and a mode controlling module. The I/O controlling module is provided for receiving input commands from a console or a terminal. The command parsing module parses each character in the input commands, and assigns corresponding meanings to special characters. The job controlling module builds up a tree format list for storage of the input commands, and then executes the input commands. The mode controlling module provides different kinds of modes for inputting of commands, the modes being selectable according to user need.
  • [0013]
    In order to accomplish the second of the above-mentioned objects, a method of CLI command processing comprises the following steps: (a) receiving input commands from a console or terminal, and transmitting the input commands to the command parsing module; (b) checking whether there are special characters in the input commands; (c) separating the input commands into a job parent command and plural job child commands, and building up command information structures; (d) checking whether all the command information structures are valid; (e) transmitting the valid command information structures to a job controlling module, if all the command information structures are valid; and (f) executing tasks indicated by the valid command information structures.
  • [0014]
    Other objects, advantages and novel features of the present invention will be drawn from the following detailed description with the attached drawings, in which:
  • BRIEF DESCRIPTION OF THE DRAWINGS
  • [0015]
    FIG. 1 is a schematic diagram of a system for CLI command processing in accordance with a preferred embodiment of the present invention;
  • [0016]
    FIG. 2 is a flow chart of a preferred method of CLI command processing in accordance with the present invention.
  • [0017]
    FIG. 3 is a flow chart of details of one step of FIG. 2, namely executing tasks indicated by valid command information structures.
  • [0018]
    FIG. 4 is a flow chart of details of one step of FIG. 3, namely making a main process check and control each of child processes.
  • DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS OF THE INVENTION
  • [0019]
    FIG. 1 is a schematic diagram of a system 100 for CLI command processing in accordance with the preferred embodiment of the present invention, which is for users to configure, monitor, and maintain electronic devices. The system 100 comprises an I/O controlling module 110, a command parsing module 120, a job controlling module 130, and a mode controlling module 140. The job controlling module 130 comprises a job list 131. The I/O controlling module 110 is provided for receiving input commands from a console, a terminal or a remote client. The input commands may be command strings or special characters such as &, >, < etc.
  • [0020]
    The command parsing module 120 is provided for parsing each of characters among the input commands transmitted from the I/O controlling module 110. The command parsing module 120 performs the following tasks: (1) assigning certain meanings to the characters; (2) separating the command into a job parent command and a plurality of job child commands; and (3) building up corresponding command information structures for the job parent command and the job child commands, and subsequently checking their validity. The command information structures comprise plural parameters, which represent corresponding tasks.
  • [0021]
    The job controlling module 130 has the following functions: (1) receiving command information structures of the job parent command and the job child commands, and storing them in the job list 131 in a tree format; (2) executing tasks indicated by the command information structures; (3) building up a main process for the job parent command and child processes for each of the job child commands during operation; and (4) making the main process check and control each of the child processes. That is, the main process checks a status of each job child process. If the child process has exited, the main process transmits data from a previous child process to a next child process through a pipe or some redirect files. The pipe is a method of connecting the standard output of one process to the standard input of another process. The redirect files are provided for storing input data and output data of processes. Therefore the child processes are executed one by one under the control of the main process, such that the tasks indicated by the input commands are executed.
  • [0022]
    The mode controlling module 140 is provided for selecting a corresponding working mode according to requirements of the users. There are five kinds of working modes supported by the mode controlling module 140: an execute mode, a privilege mode, a global configure mode, a DHCP (Dynamic Host Configuration Protocol) pool configure mode, and an interface configure mode. Different passwords are provided by the mode controlling module 140 for access to the five kinds of working modes. Each mode provides different commands for the users to configure and maintain the electronic devices.
  • [0023]
    FIG. 2 is a flow chart of the preferred method of CLI command processing in accordance with the present invention. At step S210, the I/O controlling module 110 receives input commands (strings or characters) from the console, the terminal or the remote client, and then transmits them to the command parsing module 120. At step S220, the command parsing module 120 checks whether there are special characters in the input commands; if so, the procedure goes to step S230. Otherwise, the procedure goes directly to step S240. At step S230, the command parsing module 120 assigns special meanings to the special characters, whereupon the procedure goes to step S240. At step S240, the command parsing module 120 separates the command into a job parent command and several job child commands, and subsequently builds up command information structures for the job parent command and all of the job child commands. At step S250, the command parsing module 120 checks whether all of the command information structures are valid; if so, the procedure goes to step S270. Otherwise, the procedure goes to step S260. At step S260, the command parsing module 120 shows an error for each invalid command information structure to corresponding users, whereupon the procedure is finished. At step S270, the command parsing module 120 transmits the valid command information structures to the job controlling module 130. At step S280, the job controlling module 130 executes tasks indicated by the valid command information structures, whereupon the procedure is finished.
  • [0024]
    FIG. 3 is a flow chart of details of step S280 of FIG. 2, namely executing tasks indicated by the valid command information structures. At step S281, the job controlling module 130 receives the command information structures of the job parent command and job child commands, and stores these command information structures in the job list 131 in a tree format. At step S282, the job controlling module 130 executes each of the command information structures, and at the same time builds up a main process for the job parent command and child processes for all of the job child commands. At step S283, the job controlling module 130 makes the main process check and control each of the child processes.
  • [0025]
    FIG. 4 is a flow chart of details of step S283 of FIG. 3, namely making the main process check and control each of the child processes. At step S2831, the main process checks whether a child process has exited. If so, the procedure goes directly to step S2833. Otherwise, the procedure goes to step S2832. At step S2832, the main process waits for the child process to exit. Once the child process has exited, the procedure goes to step S2833. At step S2833, the main process transmits the result of the child process to a next child process, and executes the next child process. At step S2834, the main process checks whether all of the child processes have exited. If so, the procedure goes to step S2835. Otherwise, the procedure returns to step S2831 in respect of another child process. At step S2835, the job controlling module 130 shows results of input commands to corresponding users.
  • [0026]
    Although only a preferred embodiment and method of the present invention have been described in detail above, those skilled in the art will readily appreciate that many modifications to the preferred embodiment and method are possible without materially departing from the novel teachings and advantages of the present invention. Accordingly, all such modifications are deemed to be covered by the following claims and allowable equivalents of the claims.
Patent Citations
Cited PatentFiling datePublication dateApplicantTitle
US4891838 *Nov 4, 1985Jan 2, 1990Dental Data Service, Inc.Computer accessing system
US6405365 *Jul 2, 1999Jun 11, 2002Cisco Technology, Inc.Computer program command generator and parser
US6517002 *Jan 19, 1999Feb 11, 2003Portable Data Technologies, Inc.System and method for intelligent data input from a machine-readable medium
US6625590 *Aug 10, 1999Sep 23, 2003International Business Machines CorporationCommand line interface for reducing user input in a network management device
US6766471 *Dec 28, 2000Jul 20, 2004International Business Machines CorporationUser-level checkpoint and restart for groups of processes
Referenced by
Citing PatentFiling datePublication dateApplicantTitle
US7617492 *Nov 10, 2009Microsoft CorporationExtensible command line parsing
US7673227Sep 16, 2004Mar 2, 2010Microsoft CorporationUser interface for integrated spreadsheets and word processing tables
US7676843Mar 9, 2010Microsoft CorporationExecuting applications at appropriate trust levels
US7689929Mar 30, 2010Microsoft CorporationMethods and systems of providing information to computer users
US7692636Apr 6, 2010Microsoft CorporationSystems and methods for handwriting to a screen
US7712022Nov 15, 2004May 4, 2010Microsoft CorporationMutually exclusive options in electronic forms
US7721190Nov 16, 2004May 18, 2010Microsoft CorporationMethods and systems for server side form processing
US7725834Mar 4, 2005May 25, 2010Microsoft CorporationDesigner-created aspect for an electronic form template
US7743063Jun 22, 2010Microsoft CorporationMethods and systems for delivering software via a network
US7774620Aug 10, 2010Microsoft CorporationExecuting applications at appropriate trust levels
US7779027Aug 17, 2010Microsoft CorporationMethods, systems, architectures and data structures for delivering software via a network
US7818677Aug 12, 2004Oct 19, 2010Microsoft CorporationSingle window navigation methods and systems
US7836448 *Nov 16, 2010Emc CorporationSystem and methods for task management
US7865477Oct 15, 2007Jan 4, 2011Microsoft CorporationSystem and method for real-time validation of structured data files
US7900134Nov 8, 2006Mar 1, 2011Microsoft CorporationAuthoring arbitrary XML documents using DHTML and XSLT
US7913159Mar 22, 2011Microsoft CorporationSystem and method for real-time validation of structured data files
US7925621Apr 12, 2011Microsoft CorporationInstalling a solution
US7937651May 3, 2011Microsoft CorporationStructural editing operations for network forms
US7971139Oct 31, 2007Jun 28, 2011Microsoft CorporationCorrelation, association, or correspondence of electronic forms
US7979856Sep 1, 2005Jul 12, 2011Microsoft CorporationNetwork-based software extensions
US8001459Dec 5, 2005Aug 16, 2011Microsoft CorporationEnabling electronic documents for limited-capability computing devices
US8010515Aug 30, 2011Microsoft CorporationQuery to an electronic form
US8074217Dec 6, 2011Microsoft CorporationMethods and systems for delivering software
US8117552Dec 5, 2006Feb 14, 2012Microsoft CorporationIncrementally designing electronic forms and hierarchical schemas
US8200975Jun 29, 2005Jun 12, 2012Microsoft CorporationDigital signatures for network forms
US8429522Apr 23, 2013Microsoft CorporationCorrelation, association, or correspondence of electronic forms
US8487879Oct 29, 2004Jul 16, 2013Microsoft CorporationSystems and methods for interacting with a computer through handwriting to a screen
US8819072Feb 2, 2004Aug 26, 2014Microsoft CorporationPromoting data from structured data files
US8892993Feb 8, 2008Nov 18, 2014Microsoft CorporationTranslation file
US8913448Oct 25, 2012Dec 16, 2014Micron Technology, Inc.Apparatuses and methods for capturing data in a memory
US8918729Apr 2, 2008Dec 23, 2014Microsoft CorporationDesigning electronic forms
US8984320Mar 29, 2011Mar 17, 2015Micron Technology, Inc.Command paths, apparatuses and methods for providing a command to a data block
US8988966Aug 17, 2011Mar 24, 2015Micron Technology, Inc.Circuit, system and method for controlling read latency
US9000817Oct 4, 2013Apr 7, 2015Micron Technology, Inc.Apparatuses and methods for altering a forward path delay of a signal path
US9001594Jul 6, 2012Apr 7, 2015Micron Technology, Inc.Apparatuses and methods for adjusting a path delay of a command path
US9054675Jun 22, 2012Jun 9, 2015Micron Technology, Inc.Apparatuses and methods for adjusting a minimum forward path delay of a signal path
US9143404May 24, 2011Sep 22, 2015Zte CorporationNetwork data configuration method and network data configuration system
US9166579Jun 1, 2012Oct 20, 2015Micron Technology, Inc.Methods and apparatuses for shifting data signals to match command signal delay
US9210234Jun 13, 2011Dec 8, 2015Microsoft Technology Licensing, LlcEnabling electronic documents for limited-capability computing devices
US9229917Mar 18, 2011Jan 5, 2016Microsoft Technology Licensing, LlcElectronic form user interfaces
US9239821Oct 31, 2014Jan 19, 2016Microsoft Technology Licensing, LlcTranslation file
US9268760Apr 22, 2013Feb 23, 2016Microsoft Technology Licensing, LlcCorrelation, association, or correspondence of electronic forms
US9329623Aug 22, 2012May 3, 2016Micron Technology, Inc.Apparatuses, integrated circuits, and methods for synchronizing data signals with a command signal
US20040188558 *Mar 28, 2003Sep 30, 2004Brian MoonHose reel cart with elevated crank handle
US20050289525 *Jun 28, 2004Dec 29, 2005Microsoft CorporationExtensible command line parsing
US20060168527 *Nov 16, 2004Jul 27, 2006Microsoft CorporationMethods and systems for exchanging and rendering forms
US20070168322 *Sep 28, 2005Jul 19, 2007Siemens AktiengesellschaftAdministrable command line interface
US20080024450 *Jul 28, 2006Jan 31, 2008International Business Machines CorporationA system for command-line keyboard buffer viewing and editing
US20080201298 *Apr 29, 2008Aug 21, 2008Siemens Aktiengesellschaftadministrable command line interface
WO2007039546A1 *Sep 28, 2006Apr 12, 2007Nokia Siemens Networks Gmbh & Co. KgAn administrable command line interface
WO2012010011A1 *May 24, 2011Jan 26, 2012Zte CorporationNetwork data configuration method and network data configuration system
Classifications
U.S. Classification709/224
International ClassificationG06F15/173
Cooperative ClassificationG06F9/44505, G06F9/45512
European ClassificationG06F9/455B2B
Legal Events
DateCodeEventDescription
Nov 17, 2004ASAssignment
Owner name: HON HAI PRECISION INDUSTRY CO., LTD., TAIWAN
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:WANG, GONG-QIAN;HE, TANG;REEL/FRAME:016009/0247
Effective date: 20041110