CN105847044A - Command line processing apparatus and method based on JavaScript - Google Patents
Command line processing apparatus and method based on JavaScript Download PDFInfo
- Publication number
- CN105847044A CN105847044A CN201610159937.2A CN201610159937A CN105847044A CN 105847044 A CN105847044 A CN 105847044A CN 201610159937 A CN201610159937 A CN 201610159937A CN 105847044 A CN105847044 A CN 105847044A
- Authority
- CN
- China
- Prior art keywords
- user terminal
- javascript
- command
- order line
- http message
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/02—Standardisation; Integration
- H04L41/0246—Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols
- H04L41/0266—Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols using meta-data, objects or commands for formatting management information, e.g. using eXtensible markup language [XML]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/02—Standardisation; Integration
- H04L41/0246—Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols
- H04L41/0253—Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols using browsers or web-pages for accessing management information
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephonic Communication Services (AREA)
Abstract
The embodiment of the invention discloses a command line processing apparatus and method based on JavaScript. The apparatus comprises a request receiving module used for receiving a login request sent by a user terminal through a browser; a page returning module used for returning an HTML page to the user terminal, wherein the page contains a JavaScript script of a command line function; a command line receiving module used for receiving command line data input by the user terminal through the JavaScript script; and a result returning module used for returning a processing result of the command line data to the user terminal. By adopting the embodiment of the invention, the network congestion can be reduced, and multiple users are supported to remotely manage a network device at the same time without taking up too many system resources of the network device.
Description
Technical field
The present embodiments relate to computer network field, particularly relate to a kind of life based on JavaScript
Make row processing means and method.
Background technology
Order line is a kind of equipment control mode used widely, can be used to the network equipment (such as
Switch, router etc.) it is managed.Its advantage is: powerful, convenient, but very light and handy, fortune
Quickly, by webmaster, personnel are favored line speed.
At present command line mode the most on the market has three kinds, and: telnet, ssh and directly being logged on by Serial Port Line is set
Standby order line.Wherein equipment can be managed by telnet, ssh to use remote access mode, and it is excellent
Point is that webmaster need not on equipment side, does not has the restriction of physical location, the most most widely used.But
In this long-range way to manage, the network equipment needs to set up a session process for each user, works as number of users
Process can be caused to take too much system resource when measuring the biggest.And user often inputs a character, network sets
Standby being required for sends a message to subscriber equipment, and the content of message is exactly this character, and this result also in net
Network congested.
Summary of the invention
The embodiment of the present invention provides a kind of order line processing means based on JavaScript and method, for real
Now reduce network congestion, support that multiple user remotely manages the network equipment simultaneously, and this network will not be taken
The goal of the invention of the too many system resource of equipment.
For achieving the above object, the technical scheme that the embodiment of the present invention uses is: provide a kind of base
In the order line processing means of JavaScript, this device includes asking receiver module, is used for receiving user eventually
The logging request that end is sent by browser;The page returns module, for returning HTML to described user terminal
The page, the described page comprises the JavaScript script with order line function;Order line receiver module, uses
In receiving the described user terminal command-line data by the input of described JavaScript script;Result returns mould
Block, for returning the result processing described command-line data to described user terminal.
For achieving the above object, another technical scheme that the embodiment of the present invention uses is: provide one
Order line processing method based on JavaScript, the method includes that receiving user terminal is sent out by browser
The logging request sent;Returning html page to described user terminal, the described page comprises and has order line function
JavaScript script;Receive the order that described user terminal is inputted by described JavaScript script
Row data;The result that described command-line data is processed is returned to described user terminal.
It is different from prior art, the order line processing means based on JavaScript of the embodiment of the present invention, connect
Receive the logging request that user terminal is sent by browser;Html page, institute is returned to described user terminal
State the page and comprise the JavaScript script with order line function;Receive described user terminal by described
The command-line data of JavaScript script input;Return to described command-line data to described user terminal
The result of reason;It is thus possible to minimizing network congestion, support that multiple user remotely manages the network equipment simultaneously, and
And the too many system resource of this network equipment will not be taken.
Accompanying drawing explanation
Fig. 1 is the structure of the first embodiment of embodiment of the present invention order line based on JavaScript processing means
Schematic diagram;
Fig. 2 is the structure of the second embodiment of embodiment of the present invention order line based on JavaScript processing means
Schematic diagram;
Fig. 3 is the flow process of the first embodiment of embodiment of the present invention order line based on JavaScript processing method
Schematic diagram.
Detailed description of the invention
Make to describe in more detail further to technical scheme below in conjunction with detailed description of the invention.Obviously,
Described embodiment is only a part of embodiment of the present invention rather than whole embodiments.Based on this
Embodiment in invention, those of ordinary skill in the art are obtained on the premise of not making creative work
Every other embodiment, all should belong to the scope of protection of the invention.
It is the order line processing means based on JavaScript that the embodiment of the present invention provides refering to Fig. 1, Fig. 1
The structural representation of the first embodiment.Described device is the network equipment needing to be typically administered remotely, such as
Switch, router.
Should order line processing means 100 based on JavaScript include: request receiver module 110, the page
Return module 120, order line receiver module 130 and result and return module 140.
Wherein, ask receiver module 110, for receiving the logging request that user terminal is sent by browser.
Concrete, when NMS user needs to be managed the network equipment, open browser, input appoints in advance
The reference address of the network equipment in a browser is preset in the reference address of the fixed network equipment or click,
Thus send logging request to this network equipment.This logging request can comprise identity and the password of user.
The page returns module 120, for returning HyperText Markup Language (HyperText to described user terminal
Markup Language, HTML) page, the described page comprises the JavaScript with order line function
Script.
Concrete, after the network equipment receives this logging request, determine this be one from legal NMS user
Request, will comprise order line function JavaScript script insert html page, then to this user
Terminal returns this html page.
Order line receiver module 130, is used for receiving described user terminal defeated by described JavaScript script
The command-line data entered.
Concrete, after user terminal receives this html page, show this page to user, and according to
JavaScript script shows order line to user.When user inputs complete order in the order line shown
And when submitting, i.e. submitted by enter key, this command-line data is sent to the network equipment by user terminal.
For example, it is possible to be packaged in HTML (Hypertext Markup Language) (HyperText Transfer Protocol, HTTP)
In be sent to the network equipment.
Result returns module 140, for returning the knot processing described command-line data to described user terminal
Really.
Concrete, the command-line data received is processed by the network equipment, then the result of process is returned
Back to user terminal.Because being just sent to the network equipment by user terminal after user inputs complete order,
The network equipment need not receive each character and returns once result, therefore decreases network interaction number of times,
Avoid network congestion.And in this programme, the network equipment uses WEB mode and user terminal to interact,
Avoid and set up independent session process for each user, thus avoid the too much consumption of system resource.
It is different from prior art, the order line processing means based on JavaScript of the embodiment of the present invention, connect
Receive the logging request that user terminal is sent by browser;Html page, institute is returned to described user terminal
State the page and comprise the JavaScript script with order line function;Receive described user terminal by described
The command-line data of JavaScript script input;Return to described command-line data to described user terminal
The result of reason;It is thus possible to minimizing network congestion, support that multiple user remotely manages the network equipment simultaneously, and
And the too many system resource of this network equipment will not be taken.
It is the order line processing means based on JavaScript that the embodiment of the present invention provides refering to Fig. 2, Fig. 2
The structural representation of the second embodiment.
Should order line processing means 200 based on JavaScript include: request receiver module 210, the page
Return module 220, order line receiver module 230 and result and return module 240.
Wherein, ask receiver module 210, for receiving the logging request that user terminal is sent by browser.
Concrete, when NMS user needs to be managed the network equipment, open browser, input appoints in advance
The reference address of the network equipment in a browser is preset in the reference address of the fixed network equipment or click,
Thus send logging request to this network equipment.This logging request can comprise identity and the password of user.
The page returns module 220, and for returning html page to described user terminal, the described page comprises tool
There is the JavaScript script of order line function.Optionally, this module 220 comprises order line and returns unit 221,
For returning the order line using JavaScript script edit to described user.
Concrete, after the network equipment receives this logging request, determine this be one from legal NMS user
Request, such as correctly judge it is legal webmaster according to identity and the password authentification of user, will adopt
Insert html page by the order line of JavaScript script edit, then return this HTML to this user terminal
The page.
Order line receiver module 230 includes that HTTP message receives unit 231, for receiving described
After the command-line data that user inputs is packaged into HTTP message by JavaScript script, described user terminal returns
The described HTTP message returned.
Concrete, after user terminal receives this html page, show this page to user, and according to
JavaScript script shows order line to user.When user inputs complete order in the order line shown
And when submitting, i.e. submitted by enter key, this command-line data is packaged into HTTP message by user terminal
It is sent to the network equipment.
Result returns module 240 and includes that order line processing unit 241, encapsulation unit 242 and HTTP message are sent out
Unit 243, described order line processing unit 241 is sent to be used for described command-line data is processed, described envelope
Dress unit 242 is for being encapsulated in the result of described process in HTTP message, and described HTTP message sends single
Unit 243 is for returning to described user terminal by the described HTTP message comprising result.
Optionally, the HTTP message that HTTP message reception unit 231 receives comprises heading and message content,
Described message content comprises described command-line data;Described order line receiver module 230 also includes HTTP message
Resolution unit 232, for parsing described command-line data from the message content of described HTTP message.
Because being just sent to the network equipment, the network equipment by user terminal after user inputs complete order
Order line processing unit 241 be that whole order is processed, it is not necessary to receive each character and return
Once result, therefore decrease network interaction number of times, it is to avoid network congestion.And in this programme, network
Equipment uses WEB mode and user terminal to interact, it is to avoid set up independent session for each user
Process, thus avoid the too much consumption of system resource.
It is different from prior art, the order line processing means based on JavaScript of the embodiment of the present invention, connect
Receive the logging request that user terminal is sent by browser;Html page, institute is returned to described user terminal
State the page and comprise the JavaScript script with order line function;Receive described user terminal by described
The command-line data of JavaScript script input;Return to described command-line data to described user terminal
The result of reason;It is thus possible to minimizing network congestion, support that multiple user remotely manages the network equipment simultaneously, and
And the too many system resource of this network equipment will not be taken.
It is the order line processing method based on JavaScript that the embodiment of the present invention provides refering to Fig. 3, Fig. 3
The schematic flow sheet of the first embodiment.
The step of the method includes:
S301: receive the logging request that user terminal is sent by browser.
Concrete, when NMS user needs to be managed the network equipment, open browser, input appoints in advance
The reference address of the network equipment in a browser is preset in the reference address of the fixed network equipment or click,
Thus send logging request to this network equipment.This logging request can comprise identity and the password of user.
S302: return html page to described user terminal, the described page comprises and has order line function
JavaScript script.
Concrete, after the network equipment receives this logging request, determine this be one from legal NMS user
Request, such as correctly judge it is legal webmaster according to identity and the password authentification of user, will bag
JavaScript script containing order line function inserts html page, then returns this HTML to this user terminal
The page.
Optionally, the html page of described return comprises the order line using JavaScript script edit.
S303: receive the described user terminal command-line data by the input of described JavaScript script.
This step is specifically as follows: receive command-line data user inputted at described JavaScript script
After being packaged into HTTP message, described user terminal return described HTTP message.
Optionally, the HTTP message that described user terminal returns comprises heading and message content, described message
Content comprises described command-line data.Wrap further after receiving the HTTP message that described user terminal returns
Include: from the message content of described HTTP message, parse described command-line data.
Such as, after user terminal receives this html page, show this page to user, and according to
JavaScript script shows order line to user.When user inputs complete order in the order line shown
And when submitting, i.e. submitted by enter key, this command-line data is sent to the network equipment by user terminal.
S304: return the result that described command-line data is processed to described user terminal.
This step is specifically as follows: the result processing data command-line data be encapsulated in HTTP message,
To the HTTP message comprising result described in the return of described user terminal.
Because being just sent to the network equipment, the network equipment by user terminal after user inputs complete order
Need not receive each character and return once result, therefore decrease network interaction number of times, it is to avoid net
Network is congested.And in this programme, the network equipment uses WEB mode and user terminal to interact, it is to avoid
Set up independent session process for each user, thus avoid the too much consumption of system resource.
It is different from prior art, the order line processing method based on JavaScript of the embodiment of the present invention, connect
Receive the logging request that user terminal is sent by browser;Html page, institute is returned to described user terminal
State the page and comprise the JavaScript script with order line function;Receive described user terminal by described
The command-line data of JavaScript script input;Return to described command-line data to described user terminal
The result of reason;It is thus possible to minimizing network congestion, support that multiple user remotely manages the network equipment simultaneously, and
And the too many system resource of this network equipment will not be taken.
The foregoing is only the embodiment of the embodiment of the present invention, not thereby limit the special of the embodiment of the present invention
Profit scope, every equivalent structure utilizing embodiment of the present invention description and accompanying drawing content to be made or equivalence flow process
Conversion, or directly or indirectly it is used in other relevant technical fields, the most in like manner it is included in the embodiment of the present invention
Scope of patent protection in.
Claims (8)
1. an order line processing means based on JavaScript, it is characterised in that including:
Request receiver module, for receiving the logging request that user terminal is sent by browser;
The page returns module, and for returning html page to described user terminal, the described page comprises and has life
Make the JavaScript script of row function;
Order line receiver module, for receiving described user terminal by the input of described JavaScript script
Command-line data;
Result returns module, for returning the result processing described command-line data to described user terminal.
Order line processing means based on JavaScript the most according to claim 1, it is characterised in that:
Described order line receiver module includes that HTTP message receives unit, for receiving at described JavaScript
After the command-line data that user inputs is packaged into HTTP message by script, described in the return of described user terminal
HTTP message;
Described result returns module and includes order line processing unit, encapsulation unit and HTTP message transmitting element,
Described order line processing unit is for processing described command-line data, and described encapsulation unit is for by institute
The result stating process is encapsulated in HTTP message, and described HTTP message transmitting element is for comprising knot by described
The HTTP message of fruit returns to described user terminal.
Order line processing means based on JavaScript the most according to claim 2, it is characterised in that:
The HTTP message that described HTTP message reception unit receives comprises heading and message content, described
Message content comprises described command-line data;
Described order line receiver module also includes HTTP message resolution unit, for from described HTTP message
Message content parses described command-line data.
Order line processing means based on JavaScript the most according to claim 1, it is characterised in that:
The described page returns module and comprises order line return unit, for returning employing to described user
The order line of JavaScript script edit.
5. an order line processing method based on JavaScript, it is characterised in that including:
Receive the logging request that user terminal is sent by browser;
Returning html page to described user terminal, the described page comprises and has order line function
JavaScript script;
Receive the described user terminal command-line data by the input of described JavaScript script;
The result that described command-line data is processed is returned to described user terminal.
Order line processing method based on JavaScript the most according to claim 5, it is characterised in that
The described user terminal of described reception by described JavaScr i pt script input command-line data particularly as follows:
Receive after the command-line data that user inputs is packaged into HTTP message by described JavaScr i pt script,
The described HTTP message that described user terminal returns.
Described return, to described user terminal, result that described command-line data is processed particularly as follows:
The result processing data command-line data is encapsulated in HTTP message, returns to described user terminal
The described HTTP message comprising result.
Order line processing method based on JavaScr i pt the most according to claim 6, it is characterised in that
The HTTP message that described user terminal returns comprises heading and message content, and described message content comprises described
Command-line data;
Farther include after the described HTTP message receiving the return of described user terminal: from described HTTP
The message content of message parses described command-line data.
Order line processing method based on JavaScr i pt the most according to claim 5, it is characterised in that
The described page comprises and has the JavaScr i pt script of order line function particularly as follows: the described page comprises employing
The order line of JavaScr i pt script edit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610159937.2A CN105847044A (en) | 2016-03-21 | 2016-03-21 | Command line processing apparatus and method based on JavaScript |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610159937.2A CN105847044A (en) | 2016-03-21 | 2016-03-21 | Command line processing apparatus and method based on JavaScript |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105847044A true CN105847044A (en) | 2016-08-10 |
Family
ID=56587597
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610159937.2A Pending CN105847044A (en) | 2016-03-21 | 2016-03-21 | Command line processing apparatus and method based on JavaScript |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105847044A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1845507A (en) * | 2005-10-27 | 2006-10-11 | 华为技术有限公司 | Multi-class device normalization network maintaining method and system |
CN104216707A (en) * | 2014-08-18 | 2014-12-17 | 山东超越数控电子有限公司 | Unified management method supporting multiple management modes |
US8954998B1 (en) * | 2008-12-17 | 2015-02-10 | Cisco Technology, Inc. | Application of an embedded instrumentation interface definition language |
CN104360899A (en) * | 2014-11-03 | 2015-02-18 | 上海斐讯数据通信技术有限公司 | Process management system and management method |
CN104461574A (en) * | 2014-12-23 | 2015-03-25 | 上海斐讯数据通信技术有限公司 | XML-based command line and command line program processing method thereof |
-
2016
- 2016-03-21 CN CN201610159937.2A patent/CN105847044A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1845507A (en) * | 2005-10-27 | 2006-10-11 | 华为技术有限公司 | Multi-class device normalization network maintaining method and system |
US8954998B1 (en) * | 2008-12-17 | 2015-02-10 | Cisco Technology, Inc. | Application of an embedded instrumentation interface definition language |
CN104216707A (en) * | 2014-08-18 | 2014-12-17 | 山东超越数控电子有限公司 | Unified management method supporting multiple management modes |
CN104360899A (en) * | 2014-11-03 | 2015-02-18 | 上海斐讯数据通信技术有限公司 | Process management system and management method |
CN104461574A (en) * | 2014-12-23 | 2015-03-25 | 上海斐讯数据通信技术有限公司 | XML-based command line and command line program processing method thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102153645B1 (en) | Data transmission method and apparatus | |
CN105591819B (en) | The method and device of Configuration network equipment | |
CN104158808B (en) | Portal authentication method and its device based on APP applications | |
US9223746B2 (en) | Data card and method for internet access of data card | |
US10003629B2 (en) | Method and system for using JSON with a CLI for managing network devices | |
CN104009938B (en) | The long method and system connected based on route aspect | |
CN108616606B (en) | Internet of things communication method and device | |
CN102684899B (en) | Method, ACS (auto-configuration server) and system for obtaining equipment status based on TR069 protocol | |
CN101741846B (en) | File downloading method, file downloading device and file downloading system | |
CN104010001B (en) | In mobile terminal, the method and system connecting communication is carried out in similar networking request | |
CN110505188B (en) | Terminal authentication method, related equipment and authentication system | |
CN105516061A (en) | Remote server access method and web server | |
CN105430012A (en) | Method and device for synchronously logging in multiple sites | |
CN102790693A (en) | Network configuration management method and device | |
CN106878260B (en) | Single sign-on realization method and device | |
EP3119044B1 (en) | Page insertion method and device | |
CN104202432B (en) | Remote web management system and management method | |
US9654334B2 (en) | System and method for fast compatibility verification of REST API based on REST Chart | |
CN103384246A (en) | Safety supervision system login assistant method | |
CN109379339A (en) | A kind of portal authentication method and device | |
CN111831513A (en) | Log query method and device, electronic equipment and storage medium | |
CN106789884A (en) | A kind of portal authentication method and system | |
CN105847044A (en) | Command line processing apparatus and method based on JavaScript | |
CN105162780A (en) | URL (Uniform Resource Locator) filter address setting method and URL filter address setting system | |
CN102970212A (en) | System used for sending information in closed subscriber group |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160810 |
|
RJ01 | Rejection of invention patent application after publication |