CN103457761B - Cross-platform command line configuration interface implementation method - Google Patents

Cross-platform command line configuration interface implementation method Download PDF

Info

Publication number
CN103457761B
CN103457761B CN201310300889.0A CN201310300889A CN103457761B CN 103457761 B CN103457761 B CN 103457761B CN 201310300889 A CN201310300889 A CN 201310300889A CN 103457761 B CN103457761 B CN 103457761B
Authority
CN
China
Prior art keywords
order
command
command line
order line
agent
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310300889.0A
Other languages
Chinese (zh)
Other versions
CN103457761A (en
Inventor
任杰
喻强
于鹏飞
陈伟
黄治
吴军民
张刚
黄辉
黄在朝
张增华
王向群
李春龙
孙晓艳
王鹤
于海
虞跃
姚启桂
邓辉
吴鹏
王玮
沈文
侯功
陶静
刘川
陈磊
闫磊
李雪梅
任建伟
赵庆杞
钟长青
姜明元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Corp of China SGCC
China Electric Power Research Institute Co Ltd CEPRI
State Grid Jibei Electric Power Co Ltd
State Grid Liaoning Electric Power Co Ltd
State Grid Shanghai Electric Power Co Ltd
Smart Grid Research Institute of SGCC
Original Assignee
State Grid Corp of China SGCC
China Electric Power Research Institute Co Ltd CEPRI
Global Energy Interconnection Research Institute
State Grid Jibei Electric Power Co Ltd
State Grid Liaoning Electric Power Co Ltd
State Grid Shanghai Electric Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Corp of China SGCC, China Electric Power Research Institute Co Ltd CEPRI, Global Energy Interconnection Research Institute, State Grid Jibei Electric Power Co Ltd, State Grid Liaoning Electric Power Co Ltd, State Grid Shanghai Electric Power Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN201310300889.0A priority Critical patent/CN103457761B/en
Publication of CN103457761A publication Critical patent/CN103457761A/en
Application granted granted Critical
Publication of CN103457761B publication Critical patent/CN103457761B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a cross-platform command line configuration interface implementation method. The cross-platform command line configuration interface implementation method comprises the following steps: 1 constructing a command line sub-agency in each managed task process, 2 constructing a command line agency server on a main processor, 3 building a communication channel between the command line proxy server and the command line sub-agency, and 4 analyzing a command line. A command line configuration interface implemented through the method supports cross-platform operation and can be applied to the situation that the managed task process is dispersed on different processors and different operation platforms. In the cross-platform command line configuration interface implementation method, the process of registering command nodes is formed by using a script program to automatically conduct analysis in the compiling stage, the development efficiency is improved, and the registering time in operation is shortened. According to the cross-platform command line configuration interface implementation method, united command line configuration channels are provided for a user, meanwhile, relative independence of the managed task process is kept, and the system robust performance is improved.

Description

A kind of implementation method of Cross-platform command line configuration interface
Technical field
The invention belongs to communication technical field is and in particular to the life of cross-platform operation is supported in a kind of application in a communications device The implementation method of order row configuration interface.
Background technology
Order line configures a kind of way to manage that interface is that commercialization network communication equipment generally provides.It uses keyboard defeated Enter order to realize the management to system and maintenance, and the response of reception system.Compare the graphical network based on SNMP, Web Way to manage, the script function that it provides is applied and can be saved the substantial amounts of time when needing the many repetitive operation of execution.This Outward, work as network failure, when network managing mode cannot have access to managed device, local keeper can also pass through serial ports Diagnosed using order line and troubleshooting.Therefore, relative graphical network managing mode, order line configuration interface provides more Complete management function.
Subscriber Interface Module SIM and order line resolver are generally simultaneously embedded in when realizing by current order line configuration interface By in pipe task process, increased the degree of coupling of command line interface and task process, simplify overall call flow.But work as and be When having multiple tasks process to need to be managed in system simultaneously, adopt cannot provide the user in this way a unified configuration lead to Road, simultaneously development process also seem loaded down with trivial details, be not easy to safeguard and debug.Especially apply in distributed environment, by pipe task Process is disperseed on the different processors, and when operation platform is also not quite similar, this inferior position is particularly evident.It is therefore desirable to design A kind of order line configuration interface supporting multitask process, cross-platform operation.
Content of the invention
In order to overcome the above-mentioned deficiencies of the prior art, the present invention provides a kind of realization side of Cross-platform command line configuration interface Method, to support that providing a user with order line that is unified, being easy to debug and safeguard in multitask process and distributed environment joins Put interface.
In order to realize foregoing invention purpose, the present invention adopts the following technical scheme that:
A kind of implementation method of Cross-platform command line configuration interface is it is characterised in that the method comprises the following steps:
(5)Order line sub-agent is built in each task process by pipe;
(6)Order line proxy server is built on primary processor;
(7)Set up the communication port of described order line proxy server and described order line sub-agent;
(8)Resolve command row.
Preferably, described order line sub-agent is used for defining by the order subtree of pipe task process;Described step(1)Including Following steps:
(1-3)By the required command node of pipe task process definition;
(1-4)Command node is pressed function classification, is divided to different command modes, formed by the order of pipe task process Subtree;
Described command node includes:Command string, power function, Permission Levels and help information;Described help information For explaining the function of order.
Preferably, described order line proxy server is used for integrating each order subtree by pipe task process, to have been formed Whole system command tree;Described step(2)Including:Analyze the order section in each order line sub-agent source program using perl script Point definition statement and command mode division statements, effective order therein are carried out in order line proxy server unify to determine Justice, row mode of going forward side by side is integrated, to form described system command tree.
Preferably, described communication port is used for receiving the configuration order of order line server distribution and return command executes knot Really;This communication port includes:UNIX domain socket and web socket.
Preferably, described step(4)Comprise the following steps:
(4-1)Order line proxy server receives the configuration order from user, carries out pre-parsed to it, mates this order Affiliated order line sub-agent;
(4-2)The order completing to mate is sent to corresponding filial generation by order line proxy server by described communication port Reason process;
(4-3)Order line sub-agent is parsed completely to the order receiving, including:Keyword match, character escape and Parameter validity checking, calls the power function of this task process to execute this order after successfully resolved;
(4-4)Order line sub-agent is by command execution results return command row proxy server.
Preferably, described step(4-2)In send commands to during sub-agent process adopt specific message format;This disappears Breath includes:Functional mode belonging to the command key value that draws during message-length, command string, pre-parsed, order and life The Permission Levels of order.
Preferably, described step(4-4)The order that middle order line sub-agent returns to order line proxy server executes knot Fruit includes:The character string indicate the order Boolean whether running succeeded, displaying to the user that Query Result or error message.
Compared with prior art, the beneficial effects of the present invention is:
1. the order line configuration interface that the present invention realizes supports cross-platform operation, can apply and disperseed by pipe task process Situation in different processor, different operation platforms.
2. in the present invention, order line sub-agent is by compiling rank to the process of order line server registration command node Section automatically analyzes generation using shell script, improves development efficiency, decreases hour of log-on during operation.
3. the present invention, while providing the user unified command line collocation channel, maintains relative by pipe task process Independent, when wherein operation troubles in certain task process, the collocation channel of other task process is still unimpeded, improves and is System robustness.
Brief description
Fig. 1 is the overview flow chart of the present invention;
Fig. 2 is system command tree Organization Chart in the present invention.
Specific embodiment
Below in conjunction with the accompanying drawings the present invention is described in further detail.
As shown in figure 1, the present invention comprises the following steps:
Step 1:Build order line sub-agent in each task process by pipe, for defining by order of pipe task process Tree.
Step 2:Build order line proxy server on the host processor, for integrating each of the order by pipe task process Tree, forms system command tree, as shown in Figure 2.
Step 3:Set up the communication port of order line proxy server and order line sub-agent, for receiving order line service The configuration order of device distribution and return command implementing result.
Step 4:Order line parses, for being analyzed according to specific syntax rule to the configuration order of user input and Check, the correct order for form, call corresponding power function, the order of mistake returns error message.
In step 1, the required command node of definition, including command string, power function, Permission Levels and help Information.And command node is pressed function classification, it is divided to different command modes, formed by the order subtree of pipe task process.
In step 2, analyze command node definition statement and the life in each order line sub-agent source program using perl script Make mode division sentence, effective order therein is carried out unified definition in order line proxy server, row mode of going forward side by side is whole Close, form complete system command tree.
In step 3, communication port can be to select any one interprocess communication mode, including UNIX domain socket to support Order line proxy server and situation about being in by pipe task process in same processor, and web socket is to support order Row proxy server and different processor, the situation on different operation platforms are distributed in by pipe task process.
In step 4, first, order line proxy server carries out pre-parsed, coupling life to receiving the user configuring order coming Order line sub-agent belonging to order;And the order completing to mate is sent to corresponding sub-agent by the communication port of structure Process.Adopt specific message format during transmission, divide including message-length, command string and during pre-parsed Command key value, order subordinate mode and the command authority rank separating out.
Then, order line sub-agent is parsed completely to the order receiving, including keyword match, character escape and ginseng Number validity checking, calls the power function of this task process to execute order, finally returns command execution results after successfully resolved Return order line proxy server.Wherein result not only includes indicating the Boolean whether order runs succeeded, and also can comprise character String, displays to the user that Query Result or error message.
Finally it should be noted that:Above example is only not intended to limit in order to technical scheme to be described, to the greatest extent Pipe has been described in detail to the present invention with reference to above-described embodiment, and those of ordinary skill in the art should be understood:Still The specific embodiment of the present invention can be modified or equivalent, and any without departing from spirit and scope of the invention Modification or equivalent, it all should be covered in the middle of scope of the presently claimed invention.

Claims (1)

1. a kind of implementation method of Cross-platform command line configuration interface, the method comprises the following steps:
(1) build order line sub-agent in each task process by pipe;
(2) order line proxy server is built on primary processor;
(3) set up the communication port of described order line proxy server and described order line sub-agent;
(4) resolve command row;
Described order line proxy server is used for integrating each order subtree by pipe task process, to form complete system command Tree;Described step (2) includes:Using perl script analyze each order line sub-agent source program in command node definition statement and Command mode division statements, effective order therein is carried out unified definition in order line proxy server,
Row mode of going forward side by side is integrated, to form described system command tree;Described order line sub-agent is used for defining by pipe task process Order subtree;Described step (1) comprises the steps:
(1-1) command node needed for the definition of pipe task process;
(1-2) command node is pressed function classification, be divided to different command pattern, formed by pipe task process order subtree;
Described command node includes:Command string, power function, Permission Levels and help information;Described help information is used for Explain the function of order;Described communication port is used for receiving the configuration order of order line server distribution and return command executes knot Really;This communication port includes:UNIX domain socket and web socket;
Described step (4) comprises the following steps:
(4-1) order line proxy server receives the configuration order from user, carries out pre-parsed to it, mates belonging to this order Order line sub-agent;
(4-2) order completing to mate is sent to enter to corresponding sub-agent by order line proxy server by described communication port Journey;
(4-3) order line sub-agent is parsed completely to the order receiving, including:Keyword match, character escape and parameter Validity checking, calls the power function of this task process to execute this order after successfully resolved;
(4-4) order line sub-agent is by command execution results return command row proxy server;
Send commands to adopt specific message format in described step (4-2) during sub-agent process;This message includes:
Functional mode belonging to the command key value that draws during message-length, command string, pre-parsed, order and order Permission Levels;The command execution results that in described step (4-4), order line sub-agent returns to order line proxy server include: The character string indicate the order Boolean whether running succeeded, displaying to the user that Query Result or error message.
CN201310300889.0A 2013-07-17 2013-07-17 Cross-platform command line configuration interface implementation method Active CN103457761B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310300889.0A CN103457761B (en) 2013-07-17 2013-07-17 Cross-platform command line configuration interface implementation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310300889.0A CN103457761B (en) 2013-07-17 2013-07-17 Cross-platform command line configuration interface implementation method

Publications (2)

Publication Number Publication Date
CN103457761A CN103457761A (en) 2013-12-18
CN103457761B true CN103457761B (en) 2017-02-08

Family

ID=49739748

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310300889.0A Active CN103457761B (en) 2013-07-17 2013-07-17 Cross-platform command line configuration interface implementation method

Country Status (1)

Country Link
CN (1) CN103457761B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148349A (en) * 2020-07-03 2020-12-29 上海金融期货信息技术有限公司 System for cross-platform instruction and configuration unified interface

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107707581A (en) * 2015-06-26 2018-02-16 中兴通讯股份有限公司 Document handling method and device
CN105099665A (en) * 2015-09-15 2015-11-25 浪潮(北京)电子信息产业有限公司 Command line interface CLI privilege management method and system
CN105204862A (en) * 2015-09-29 2015-12-30 上海斐讯数据通信技术有限公司 Method for processing CLI commands in concentrated mode
CN106227821B (en) * 2016-07-21 2019-08-06 新华三技术有限公司 A kind for the treatment of method and apparatus of order line command
CN106254335B (en) * 2016-07-29 2019-03-29 北京赛佰特科技有限公司 Cross-platform program interface call method based on Internet of Things
CN106656599A (en) * 2016-12-22 2017-05-10 浙江鹏信信息科技股份有限公司 Method and system for sending network data configuration instruction
CN107483567B (en) * 2017-08-03 2021-08-10 广州华多网络科技有限公司 Distributed log searching method and system
CN111526048B (en) * 2020-04-16 2023-04-18 深圳市风云实业有限公司 Unified management language adaptation method for multi-model switch

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101009588A (en) * 2006-01-24 2007-08-01 华为技术有限公司 Method and system for configuring the distributed proxy server information
CN101110703A (en) * 2007-06-28 2008-01-23 中兴通讯股份有限公司 Made-to-order command line implementing method and system
CN101183973A (en) * 2007-12-06 2008-05-21 中兴通讯股份有限公司 Method of implementing command line configuration distribution in distributed system
CN102243583A (en) * 2011-06-09 2011-11-16 深圳市共进电子有限公司 Method for realizing parameter configuration by using command line

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101009588A (en) * 2006-01-24 2007-08-01 华为技术有限公司 Method and system for configuring the distributed proxy server information
CN101110703A (en) * 2007-06-28 2008-01-23 中兴通讯股份有限公司 Made-to-order command line implementing method and system
CN101183973A (en) * 2007-12-06 2008-05-21 中兴通讯股份有限公司 Method of implementing command line configuration distribution in distributed system
CN102243583A (en) * 2011-06-09 2011-11-16 深圳市共进电子有限公司 Method for realizing parameter configuration by using command line

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WAG54G路由器Unnumbered IP功能和命令行配置的实现;徐旭彬;《中国优秀硕士学位论文全文数据库 信息科技辑》;20060415;第23-31页 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148349A (en) * 2020-07-03 2020-12-29 上海金融期货信息技术有限公司 System for cross-platform instruction and configuration unified interface
CN112148349B (en) * 2020-07-03 2024-03-15 上海金融期货信息技术有限公司 Cross-platform instruction and system for configuring unified interface

Also Published As

Publication number Publication date
CN103457761A (en) 2013-12-18

Similar Documents

Publication Publication Date Title
CN103457761B (en) Cross-platform command line configuration interface implementation method
US20230244454A1 (en) Software defined network controller
Sung et al. Robotron: Top-down network management at facebook scale
US9893940B1 (en) Topologically aware network device configuration
CN102037677B (en) Computer readable medium, northbound interface uniform platform and starting method thereof
CN105224466A (en) A kind of integration test method based on Docker and system
US10057131B1 (en) System and method for topology-aware configuration generation
CN105052076B (en) Network element management system and network element management method based on cloud computing
CN102387043B (en) Alarm analysis method, workstation and system based on simple network management protocol
Mogul et al. Experiences with modeling network topologies at multiple levels of abstraction
CN112099919B (en) Application service visualization rapid deployment method based on cloud computing API
CN108717362A (en) It is a kind of based on can be after the network equipments configuration model and configuration method of bearing structure
US10942785B2 (en) Integration of software applications with infrastructure
US8244844B2 (en) Tool for data generation for simple network management protocol (SNMP)
CN104239114A (en) Application compiling method and device
CN103023702A (en) Method for processing batched management information bases (MIB)
EP3051750B1 (en) Collection adaptor management method and system
CN111984561A (en) IPMI command processing method, system, device and medium for BMC
CN105897884B (en) Android phone based on XMPP protocol pushes platform
CN102750143A (en) Digital signal processing (DSP) developing method based on matrix laboratory (MATLAB) component object model (COM) component calling
CN102904754A (en) Method and system for managing server
WO2016197688A1 (en) Data collection method and device
US20070220157A1 (en) Simple network management protocol (SNMP) agent system and method
CN104104546A (en) SNMP network management system based on scripts
CN104486137A (en) Data collecting method applied to network monitoring

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20160516

Address after: 100031 Xicheng District West Chang'an Avenue, No. 86, Beijing

Applicant after: State Grid Corporation of China

Applicant after: China Electric Power Research Institute

Applicant after: State Grid Smart Grid Institute

Applicant after: State Grid Shanghai Municipal Electric Power Company

Applicant after: State Grid Jibei Electric Power Company Limited

Applicant after: State Grid Liaoning Electric Power Co., Ltd.

Address before: 100031 Xicheng District West Chang'an Avenue, No. 86, Beijing

Applicant before: State Grid Corporation of China

Applicant before: China Electric Power Research Institute

Applicant before: State Grid Shanghai Municipal Electric Power Company

Applicant before: State Grid Jibei Electric Power Company Limited

Applicant before: State Grid Liaoning Electric Power Co., Ltd.

CB02 Change of applicant information

Address after: 100031 Xicheng District West Chang'an Avenue, No. 86, Beijing

Applicant after: State Grid Corporation of China

Applicant after: China Electric Power Research Institute

Applicant after: GLOBAL ENERGY INTERCONNECTION RESEARCH INSTITUTE

Applicant after: State Grid Shanghai Municipal Electric Power Company

Applicant after: State Grid Jibei Electric Power Company Limited

Applicant after: State Grid Liaoning Electric Power Co., Ltd.

Address before: 100031 Xicheng District West Chang'an Avenue, No. 86, Beijing

Applicant before: State Grid Corporation of China

Applicant before: China Electric Power Research Institute

Applicant before: State Grid Smart Grid Institute

Applicant before: State Grid Shanghai Municipal Electric Power Company

Applicant before: State Grid Jibei Electric Power Company Limited

Applicant before: State Grid Liaoning Electric Power Co., Ltd.

COR Change of bibliographic data
C14 Grant of patent or utility model
GR01 Patent grant