CN105812406B - Information transferring method and device based on WEB emulation terminal system - Google Patents

Information transferring method and device based on WEB emulation terminal system Download PDF

Info

Publication number
CN105812406B
CN105812406B CN201410838422.6A CN201410838422A CN105812406B CN 105812406 B CN105812406 B CN 105812406B CN 201410838422 A CN201410838422 A CN 201410838422A CN 105812406 B CN105812406 B CN 105812406B
Authority
CN
China
Prior art keywords
websocket
client
management server
managed
connection
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
CN201410838422.6A
Other languages
Chinese (zh)
Other versions
CN105812406A (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.)
Beijing Shenzhou Taiyue Software Co Ltd
Original Assignee
Beijing Shenzhou Taiyue Software 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 Beijing Shenzhou Taiyue Software Co Ltd filed Critical Beijing Shenzhou Taiyue Software Co Ltd
Priority to CN201410838422.6A priority Critical patent/CN105812406B/en
Publication of CN105812406A publication Critical patent/CN105812406A/en
Application granted granted Critical
Publication of CN105812406B publication Critical patent/CN105812406B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention discloses a kind of information transferring method and device based on WEB emulation terminal system receives the log-on message and be managed host identification that client is sent by WebSocket connection this method comprises: establishing after WebSocket connect with client;By SSH connect to be managed host identification it is corresponding be managed host send log-on message, and by SSH connection reception be managed host send prompt information corresponding with log-on message;The prompt information sent to client is connected by WebSocket;The operational order that client is sent is received by WebSocket connection;By SSH connect to be managed host send operational order;The operating result for being managed host return is received by SSH connection, and is connected by WebSocket to client and sent operating result.The program saves the resource and network bandwidth of management server, avoids the serious wasting of resources.

Description

Information transferring method and device based on WEB emulation terminal system
Technical field
The present invention relates to network technique fields, more particularly to a kind of information based on webpage (WEB) emulation terminal system to pass Transmission method and device.
Background technique
With flourishing for the high speed development of online heterogeneous operating system, especially Linux/UNIX, daily use is given More, safer selection is provided, for example, for many hosts of enterprises, the operating system of installation may be Windows, Linux/UNIX, Solaris, OpenVMX, True64, FreeBSD etc..Simultaneously as the rapid development of network And the requirement of safety, user is often with host apart from far, it will usually a server (referred to as management service in addition be arranged Device) manage these hosts (being known as being managed host).For the ease of user using client and management server management by pipe Host is managed, WEB emulation terminal software comes into being.The software installation on the management server, to imitate on the management server Really go out a remote console logged on to by network and be managed on host as a remote terminal, to be managed host into Row management;Browser (Browser, B)/server (Server, S) framework, B/S frame are used between client and management server Structure be WEB rise after a kind of network structure mode, in this mode, only a browser need to be installed on the client, thus The communication between client and management server may be implemented.Above-mentioned client, management server and be managed host can group At webpage (WEB) emulation terminal system.
According to the existing information transferring method based on WEB emulation terminal system, built between client and management server Vertical hypertext transfer protocol (ypertext Transfer Protocol, HTTP) connection, client are connected by HTTP to pipe It manages server and sends the HTTP logging request for carrying log-on message;After management server receives the HTTP logging request, parsing Out log-on message and log in be managed host, receive be managed host feedback prompt information after cached;Client needs HTTP data acquisition request periodically is sent to management server;After management server receives the HTTP data acquisition request, If having cached prompt information, the HTTP data acquisition for carrying prompt information response is sent to client, if uncached prompt Information will also send the HTTP data acquisition response for not carrying prompt information to client;Client is connected by HTTP to pipe It manages server and sends the HTTP operation requests for carrying operational order;After management server receives the HTTP operation requests, parsing It operational order and is sent to out and is managed host;After being managed the outer operational order of host execution, sends and grasp to management server Make result;Management server receives the operating result and caches, when management server receives the HTTP number of client transmission After acquisition request, if having cached operating result, the HTTP for carrying operating result operation response is sent to client, if not Caching to client as a result, will also send the HTTP data acquisition response for not carrying operating result.
In the above-mentioned methods, client is managed information (prompt information and the operation knot of host return to get Fruit), it is necessary to HTTP data acquisition request periodically is sent to management server, management server will not actively be sent out to client It send, the HTTP data acquisition request for only receiving client transmission can just be sent, since client needs timing to take to management Business device sends HTTP data acquisition request, and management server needs each HTTP data acquisition request for client to make sound Answer, can thus occupy the resource and network bandwidth of management server, cause the serious wasting of resources, and client cannot and When receive be managed host return information, cause communication delay.
Summary of the invention
The embodiment of the present invention provides a kind of information transferring method and device based on WEB emulation terminal system, to solve The resource and network bandwidth existing in the prior art for occupying management server, causes the serious wasting of resources, and cause to lead to The problem of letter delay.
According to embodiments of the present invention, a kind of information transferring method based on WEB emulation terminal system is provided, the WEB is imitative True terminal system include client, management server and at least one be managed host, the client and the management service Browser B/ server S framework is used between device and establishes hypertext transfer protocol HTTP connection, the management server installation It WEB emulation terminal software and establishes Secure Shell SSH with described be managed between host and connect, which comprises
The management server and the client are established after WebSocket connect, and are connect by the WebSocket connection Receive the log-on message and be managed host identification that the client is sent;
It is connected by the SSH to the corresponding host that is managed of host identification that is managed and sends the log-on message, And the prompt information corresponding with the log-on message by being managed host transmission described in SSH connection reception;
It is connected by the WebSocket to the client and sends the prompt information;
The operational order that the client is sent is received by the WebSocket connection, the operational order is to work as institute Stating prompt information is when logining successfully information, the client show described in login successfully information after receive what user inputted;
It is connected by the SSH to the host that is managed and sends the operational order, so that the host that is managed is held The row operational order simultaneously returns to operating result;And
By being managed the operating result of host return described in SSH connection reception, and by described WebSocket is connected to the client and is sent the operating result.
It connect, specifically includes specifically, the management server establishes WebSocket with the client:
The management server receives the WebSocket connection that the client is sent and establishes request;
WebSocket connection establishment response is sent to the client;
By being managed the operating result of host return described in SSH connection reception, and by described WebSocket is connected to the client and is sent the operating result, is specifically included:
The management server starting first thread and the second thread;
The operating result returned using the first thread by being managed host described in SSH connection reception;
It is connected by the WebSocket to the client using second thread and sends the operating result.
Optionally, further includes:
Operational order described in the record management server and the operating result;And
The WebSocket connection that the client is sent, which is received, by the WebSocket connection disconnects request;
It is connected by the SSH to the host that is managed and sends SSH connection disconnection request;
After SSH connection by being managed host transmission described in SSH connection reception disconnects response, pass through WebSocket is connected to the client and is sent WebSocket connection disconnection response.
According to embodiments of the present invention, a kind of information transferring method based on WEB emulation terminal system, the WEB are also provided Emulation terminal system include client, management server and at least one be managed host, the client and management clothes Browser B/ server S framework is used between business device and establishes hypertext transfer protocol HTTP connection, the management server peace It dress WEB emulation terminal software and establishes Secure Shell SSH with described be managed between host and connect, which comprises
The client and the management server are established after WebSocket connect, by the WebSocket connect to The management server sends log-on message and is managed host identification, so that the management server is connected by the SSH The log-on message is sent to the corresponding host that is managed of host identification that is managed, by described in SSH connection reception It is managed the prompt information corresponding with the log-on message of host transmission, and is connected by the WebSocket to the visitor Family end sends the prompt information;
The prompt information that the management server is sent is received by the WebSocket connection, if the prompt Information is successful log-on message, is connected by the WebSocket to the management server and sends operational order, so that described Management server is connected to the host that is managed by the SSH and sends the operational order, so that described be managed host It executes the operational order and to return to operating result and the management server described by pipe by SSH connection reception The operating result that host returns is managed, and is connected by the WebSocket to the client and sends the operating result;
The operating result that the management server is sent is received by the WebSocket connection.
It connect, specifically includes specifically, the client establishes WebSocket with the management server:
The client sends WebSocket connection to the management server and establishes request;
Receive the WebSocket connection establishment response that the management server is sent;
The method also includes:
The client is connected to the management server by the WebSocket and sends WebSocket connection disconnection Request, so that the management server, which is connected by the SSH to the host that is managed, sends SSH connection disconnection request, and By the SSH connection receive described in be managed host transmission SSH connection disconnect respond after, by WebSocket connect to The client sends WebSocket connection and disconnects response;
It receives the management server and is disconnected by the WebSocket connection that the WebSocket connection is sent and rung It answers.
According to embodiments of the present invention, a kind of information carrying means based on WEB emulation terminal system, the WEB are also provided Emulation terminal system include client, management server and at least one be managed host, the client and management clothes Browser B/ server S framework is used between business device and establishes hypertext transfer protocol HTTP connection, the management server peace It dress WEB emulation terminal software and establishes Secure Shell SSH with described be managed between host and connect, described device includes:
Connection establishment unit is connect for establishing WebSocket with the client;
First receiving unit, for by the WebSocket connection receive log-on message that the client is sent and It is managed host identification;
First Transmit-Receive Unit is managed that host identification is corresponding to be managed host for connecting by the SSH to described The log-on message is sent, and by being managed the corresponding with the log-on message of host transmission described in SSH connection reception Prompt information;
First transmission unit sends the prompt information for connecting by the WebSocket to the client;
Second receiving unit, for receiving the operational order that the client is sent, institute by the WebSocket connection State operational order be when the prompt information is to login successfully information, the client show described in login successfully information and be followed by Receive user's input;
Second transmission unit sends the operational order for connecting by the SSH to the host that is managed, so that The host that is managed executes the operational order and returns to operating result;And
Second Transmit-Receive Unit, the operating result for being returned by being managed host described in SSH connection reception, And it is connected by the WebSocket to the client and sends the operating result.
Specifically, the connection establishment unit, is specifically used for:
It receives the WebSocket connection that the client is sent and establishes request;
WebSocket connection establishment response is sent to the client;
Second Transmit-Receive Unit, is specifically used for:
Start first thread and the second thread;
The operating result returned using the first thread by being managed host described in SSH connection reception;
It is connected by the WebSocket to the client using second thread and sends the operating result.
Optionally, further includes:
Recording unit, for recording the operational order and the operating result;And
Third receiving unit connects for receiving the WebSocket that the client is sent by the WebSocket connection Connect disconnection request;
Third transmission unit sends SSH connection disconnection request for connecting by the SSH to the host that is managed;
Third Transmit-Receive Unit is disconnected for the SSH connection by being managed host transmission described in SSH connection reception and being rung Ying Hou is connected to the client by WebSocket and is sent the WebSocket connection disconnection response.
According to embodiments of the present invention, a kind of information carrying means based on WEB emulation terminal system, the WEB are also provided Emulation terminal system include client, management server and at least one be managed host, the client and management clothes Browser B/ server S framework is used between business device and establishes hypertext transfer protocol HTTP connection, the management server peace It dress WEB emulation terminal software and establishes Secure Shell SSH with described be managed between host and connect, described device includes:
Connection establishment unit is connect for establishing WebSocket with the management server;
First transmission unit, for by the WebSocket connect to the management server send log-on message and It is managed host identification, so that the management server, which is connected by the SSH to described, is managed the corresponding quilt of host identification Managing main frame sends the log-on message, by being managed believing with the login for host transmission described in SSH connection reception Corresponding prompt information is ceased, and is connected by the WebSocket to the client and sends the prompt information;
Transmit-Receive Unit is believed for receiving the prompt that the management server is sent by the WebSocket connection Breath is connected by the WebSocket to management server transmission operation if the prompt information be successful log-on message Instruction, so that the management server, which is connected by the SSH to the host that is managed, sends the operational order, so that institute It states and is managed host and executes the operational order and return to operating result and the management server is connected by the SSH It is managed the operating result of host return described in reception, and is connected by the WebSocket to the client and is sent The operating result;
First receiving unit, for receiving the behaviour that the management server is sent by the WebSocket connection Make result.
Specifically, the connection establishment unit, is specifically used for:
WebSocket connection, which is sent, to the management server establishes request;
Receive the WebSocket connection establishment response that the management server is sent;
Described device further include:
Second transmission unit sends WebSocket company for connecting by the WebSocket to the management server Connect disconnection request so that the management server by the SSH connect to it is described be managed host send SSH connection disconnect ask It asks, and the SSH connection by being managed host transmission described in SSH connection reception disconnects after responding, and is connected by WebSocket It connects to the client and sends WebSocket connection disconnection response;
Second receiving unit passes through described in WebSocket connection transmission for receiving the management server WebSocket connection disconnects response.
The present invention has the beneficial effect that:
The embodiment of the present invention provides a kind of information transferring method and device based on WEB emulation terminal system, the management Server and the client are established after WebSocket connect, and are passed through the WebSocket connection and are received the client and send Log-on message and be managed host identification;It is connected by the SSH to described and is managed that host identification is corresponding to be managed master Machine sends the log-on message, and sending with the log-on message pair by being managed host described in SSH connection reception The prompt information answered;The prompt information sent to the client is connected by the WebSocket;By described WebSocket connection receives the operational order that the client is sent, and the operational order is when the prompt information is login When successful information, the client show described in login successfully and receive user's input after information;By the SSH connect to The host that is managed sends the operational order, so that the host that is managed executes the operational order and returns to operation As a result;And the operating result by being managed host return described in SSH connection reception, and by described WebSocket is connected to the client and is sent the operating result.In the program, established between management server and client After HTTP connection, WebSocket connection is also resettled, management server will be managed host by WebSocket connection and return The prompt information and operating result returned actively return to client, regularly send HTTP data acquisition request without client, manage Reason server is responded without each HTTP data acquisition request for client, to save the money of management server Source and network bandwidth avoid the serious wasting of resources, and client can timely receive the information for being managed host return, Guarantee real time communication.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, for those of ordinary skill in the art Speech, without any creative labor, is also possible to obtain other drawings based on these drawings.
Fig. 1 is the architecture diagram of WEB emulation terminal system in the embodiment of the present invention;
Fig. 2 is the information based on WEB emulation terminal system when executing subject is management server in the embodiment of the present invention The flow chart of transmission method;
Fig. 3 is the information transmission based on WEB emulation terminal system when executing subject is client in the embodiment of the present invention The flow chart of method;
Fig. 4 is the flow chart of information transferring method of the another kind based on WEB emulation terminal system in the embodiment of the present invention;
Fig. 5 is the structure of the information carrying means based on WEB emulation terminal system corresponding with Fig. 2 in the embodiment of the present invention Schematic diagram;
Fig. 6 is the structure of the information carrying means based on WEB emulation terminal system corresponding with Fig. 3 in the embodiment of the present invention Schematic diagram.
Specific embodiment
The serious wasting of resources is caused for the resource existing in the prior art for occupying management server and network bandwidth, And the problem of causing communication delay, the embodiment of the present invention provide a kind of information transferring method based on WEB emulation terminal system, The framework of the WEB emulation terminal system as shown in Figure 1, include client 11, management server 12 and at least one be managed master The case where machine 13, the quantity for being managed host can be configured according to actual needs, 3 are shown in Fig. 1 be managed host, B/S framework is used between client 11 and management server 12 and establishes HTTP connection, and management server 12 installs WEB emulation eventually It holds software and establishes Secure Shell (Secure Shell, SSH) connection with being managed between host 13, client can be a People's computer (Personal Computer, PC), tablet computer, smart phone etc., are equipped with browser in client.
When executing subject is management server, the process of the above-mentioned information transferring method based on WEB emulation terminal system As shown in Fig. 2, executing, steps are as follows:
S21: it is established after WebSocket connect with client, passes through WebSocket connection and receive the login that client is sent Information and it is managed host identification.
It is established after HTTP connect in management server and client, also to establish WebSocket connection, management server The subsequent information transmission between client is carried out based on WebSocket connection.It is built between management server and client The process of vertical WebSocket connection is that management server receives the WebSocket connection that client is sent and establishes request, to visitor Family end sends WebSocket connection establishment response, and WebSocket company is established between management server and client to realize It connects.
After establishing WebSocket connection between management server and client, user needs through client and management clothes Business device login is managed host, it is necessary first to log-on message are sent to management server with host identification is managed, log in letter Breath can be pre-assigned username and password, and being managed host identification can be the Internet protocol for being managed host The address (Internet Protocol, IP) and port.
S22: it is connected by SSH and sends log-on message to being managed the corresponding host that is managed of host identification, and pass through SSH Connection receives the prompt information corresponding with log-on message for being managed host transmission.
Due to management server with to be managed between host communicated by SSH connection, management server It can be connected by SSH to host transmission log-on message is managed, after being managed host according to the log-on message login received, It can will be prompted to information by SSH connection and be sent to management server.
S23: the prompt information sent to client is connected by WebSocket.
The prompt information received actively can be sent to client, nothing by WebSocket connection by management server Client is needed periodically to send HTTP data acquisition request, correspondingly, management server is not necessarily to each HTTP number for client It is responded according to acquisition request, to save the resource and network bandwidth of management server, avoids the serious wasting of resources.
The prompt information can show user in webpage, in order to which user carries out subsequent operation.
S24: the operational order that client is sent is received by WebSocket connection, operational order is when prompt information is When logining successfully information, client is shown login successfully information after receive user input.
The prompt information is for prompting login result, it may be possible to login successfully information, it is also possible to login failure letter Breath, when prompt information is to login successfully information, after client shows that this logins successfully information, user can input in client The operational order that user inputs is sent to management server and carries out pipe to being managed host to realize by operational order, client Reason, when prompt information is login failure information, after client shows the login failure information, user can not input in client Operational order can only log in again and be managed host.
Wherein, operational order, which can be, obtains the file that is managed under host catalog and file, deletion are managed host File or folder etc. under catalogue.
S25: it is connected by SSH and sends operational order to being managed host, so that being managed host executes operational order, simultaneously Return to operating result.
After being managed the operational order that host receives management transmission by SSH connection, the operational order can be executed, so Operating result is returned into management server afterwards.
S26: the operating result for being managed host return is received by SSH connection, and is connected by WebSocket to client End sends operating result.
After management server is managed the operating result of host return by SSH reception, it can be connected by WebSocket Operating result is sent to client, in order to which user learns the operating result.
Specifically, management server starting first thread and the second thread, receive quilt by SSH connection using first thread The operating result that managing main frame returns is connected to client by WebSocket using the second thread and sends operating result.
After establishing HTTP connection in the program, between management server and client, WebSocket company is also resettled It connects, management server is actively returned to the prompt information for being managed host return and operating result by WebSocket connection Client regularly sends HTTP data acquisition request without client, and management server is without for each of client HTTP data acquisition request responds, to save the resource and network bandwidth of management server, avoids serious resource wave Take, and client can timely receive the information for being managed host return, guarantees real time communication.
Optionally, the above-mentioned information transferring method based on WEB emulation terminal system further include: record management server operation Instruction and operating result.
Record management server operational order and operating result, consequently facilitating O&M service in the future, problem analysis reason, Trace question classification.
Optionally, the above-mentioned information transferring method based on WEB emulation terminal system further include:
The WebSocket connection that client is sent, which is received, by WebSocket connection disconnects request;
By SSH connect to be managed host send SSH connection disconnect request;
By SSH connection receive be managed host transmission SSH connection disconnect respond after, by WebSocket connect to Client sends WebSocket connection and disconnects response.
After user terminates to the management for being managed host, client can also be used to connect by WebSocket to pipe It manages server and sends WebSocket connection disconnection request, management server disconnects and be managed first the SSH connection of host, so It is connected afterwards by WebSocket to client and sends WebSocket connection disconnection response, to disconnect between client WebSocket saves Internet resources and bandwidth between client and management server, is managed when user needs to manage again When host, management server can establish WebSocket with client again and connect.
When executing subject is client, process such as Fig. 3 of the above-mentioned information transferring method based on WEB emulation terminal system Shown, steps are as follows for execution:
S31: it is established after WebSocket connect with management server, is connected by WebSocket to management server and sent Log-on message and be managed host identification so that management server connected by SSH it is corresponding by pipe to host identification is managed It manages host and sends log-on message, the prompt information corresponding with log-on message for being managed host transmission is received by SSH connection, and It is connected by WebSocket to client and sends prompt information.
S32: the prompt information that management server is sent is received by WebSocket connection, if prompt information is successfully to step on Record information, by WebSocket connect to management server send operational order so that management server by SSH connect to It is managed host and sends operational order, execute operational order so that being managed host and return to operating result and management service Device receives the operating result for being managed host return by SSH connection, and connects to send to client by WebSocket and operate As a result.
S33: the operating result that management server is sent is received by WebSocket connection.
After establishing HTTP connection in the program, between management server and client, WebSocket company is also resettled It connects, management server is actively returned to the prompt information for being managed host return and operating result by WebSocket connection Client regularly sends HTTP data acquisition request without client, and management server is without for each of client HTTP data acquisition request responds, to save the resource and network bandwidth of management server, avoids serious resource wave Take, and client can timely receive the information for being managed host return, guarantees real time communication.
Specifically, the client in above-mentioned S31 is established WebSocket with management server and connect, specifically include:
Client sends WebSocket connection to management server and establishes request;
Receive the WebSocket connection establishment response that management server is sent.
Optionally, further includes:
Client is connected to management server by WebSocket and sends WebSocket connection disconnection request, so that management Server by SSH connect to be managed host send SSH connection disconnect request, and by SSH connection receive be managed host After the SSH connection of transmission disconnects response, is connected by WebSocket to client and send WebSocket connection disconnection response;
It receives management server and response is disconnected by the WebSocket connection that WebSocket connection is sent.
The embodiment of the present invention provides a kind of information transferring method based on WEB emulation terminal system, and this method can be applied In WEB emulation terminal system as shown in Figure 1, management server and each be managed between host establish SSH connection, process As shown in figure 4, executing, steps are as follows:
S41: client establishes HTTP connection to management server and establishes request.
S42: management server sends HTTP connection establishment response to client.
HTTP connection is established between client and management server to realize.
S43: client sends the first user name and first password to management server.
S44: after management server the first user name of verifying and first password are legal, first is sent to client and is logined successfully Information.
S45: client sends WebSocket connection to management server and establishes request.
S46: management server sends WebSocket connection establishment response to client.
WebSocket connection is established between client and management server to realize.
S47: client is sent to management server to be carried second user name, the second password and is managed host IP address WebSocket logging request.
S48: management server to be managed host IP address it is corresponding be managed host send carry second user name and The SSH logging request of second password.
S49: be managed host acknowledgement second user name and the second password it is legal after, to management server send carry second Login successfully the SSH login response of information.
S50: management server is sent to client carries the second WebSocket login response for logining successfully information.
Management server can actively logining successfully information for second be sent to client, periodically sends without client HTTP data acquisition request, correspondingly, management server are not necessarily to make sound for each HTTP data acquisition request of client It answers, to save the resource and network bandwidth of management server, avoids the serious wasting of resources.
S51: it after client receives the operational order of user's input, is sent to server and carries operational order The request of WebSocket instruction execution.
Operational order can be the file that acquisition is managed under host catalog and file, deletion are managed under host catalog File or folder etc..
S52: management server sends the SSH instruction execution request of carrying operational order to host is managed.
S53: it is managed after host executes the operational order, the SSH instruction for carrying operating result is sent to management server Execute response.
S54: management server sends the WebSocket instruction execution response for carrying operating result to client.
S55: client sends WebSocket connection to management server and disconnects request.
S56: management server sends SSH connection disconnection request to host is managed.
S57: host is managed to management server and sends SSH connection disconnection response.
S58: management server sends WebSocket connection to client and disconnects response.
After user terminates to the management for being managed host, client can also be used to connect by WebSocket to pipe It manages server and sends WebSocket connection disconnection request, management server disconnects and be managed first the SSH connection of host, so It is connected afterwards by WebSocket to client and sends WebSocket connection disconnection response, to disconnect between client WebSocket saves Internet resources and bandwidth between client and management server, is managed when user needs to manage again When host, management server can establish WebSocket with client again and connect.
After establishing HTTP connection in the program, between management server and client, WebSocket company is also resettled It connects, management server is actively returned to the prompt information for being managed host return and operating result by WebSocket connection Client regularly sends HTTP data acquisition request without client, and management server is without for each of client HTTP data acquisition request responds, to save the resource and network bandwidth of management server, avoids serious resource wave Take, and client can timely receive the information for being managed host return, guarantees real time communication.
Based on the same inventive concept, the embodiment of the present invention provides a kind of information transmission dress based on WEB emulation terminal system It sets, which can be set in the management server, and structure is as shown in Figure 5, comprising:
Connection establishment unit 51 is connect for establishing WebSocket with client;
First receiving unit 52, for receiving the log-on message and be managed that client is sent by WebSocket connection Host identification;
First Transmit-Receive Unit 53, for by SSH connect to be managed host identification it is corresponding be managed host transmission step on Information is recorded, and receives the prompt information corresponding with log-on message for being managed host transmission by SSH connection;
First transmission unit 54 sends prompt information for connecting by WebSocket to client;
Second receiving unit 55, for receiving the operational order that client is sent, operational order by WebSocket connection Be when prompt information be login successfully information when, client show login successfully information after receive user input;
Second transmission unit 56, for being connected by SSH to host transmission operational order is managed, so as to be managed host It executes operational order and returns to operating result;And
Second Transmit-Receive Unit 57 for receiving the operating result for being managed host return by SSH connection, and passes through WebSocket is connected to client and is sent operating result.
After establishing HTTP connection in the program, between management server and client, WebSocket company is also resettled It connects, management server is actively returned to the prompt information for being managed host return and operating result by WebSocket connection Client regularly sends HTTP data acquisition request without client, and management server is without for each of client HTTP data acquisition request responds, to save the resource and network bandwidth of management server, avoids serious resource wave Take, and client can timely receive the information for being managed host return, guarantees real time communication.
Specifically, above-mentioned connection establishment unit 51, is specifically used for:
It receives the WebSocket connection that client is sent and establishes request;
WebSocket connection establishment response is sent to client.
Specifically, above-mentioned second Transmit-Receive Unit 57, is specifically used for:
Start first thread and the second thread;
The operating result for being managed host return is received by SSH connection using first thread;
It is connected by WebSocket to client using the second thread and sends operating result.
Optionally, the above-mentioned information carrying means based on WEB emulation terminal system further includes recording unit, is used for:
Record operational order and operating result.
Optionally, the above-mentioned information carrying means based on WEB emulation terminal system further include:
Third receiving unit is asked for receiving the WebSocket connection disconnection that client is sent by WebSocket connection It asks;
Third transmission unit, for by SSH connect to be managed host send SSH connection disconnect request;
Third Transmit-Receive Unit leads to after the SSH connection for being managed host transmission by SSH connection reception disconnects response WebSocket is crossed to connect to client transmission WebSocket connection disconnection response.
Based on the same inventive concept, the embodiment of the present invention provides a kind of information transmission dress based on WEB emulation terminal system It sets, which can be set in the client, and structure is as shown in Figure 6, comprising:
Connection establishment unit 61 is connect for establishing WebSocket with management server;
First transmission unit 62 sends log-on message and is managed for being connected by WebSocket to management server Host identification, so that management server is connected by SSH, to being managed, host identification is corresponding to be managed host transmission login letter Breath is received the prompt information corresponding with log-on message for being managed host transmission by SSH connection, and is connected by WebSocket It connects to client and sends prompt information;
Transmit-Receive Unit 63, for receiving the prompt information that management server is sent by WebSocket connection, if prompt letter Breath be successful log-on message, is connected by WebSocket to management server transmission operational order, so that management server passes through SSH is connected to host transmission operational order is managed, and is executed operational order so that being managed host and is returned to operating result, with And management server receives the operating result for being managed host return by SSH connection, and is connected by WebSocket to client End sends operating result;
First receiving unit 64, for receiving the operating result that management server is sent by WebSocket connection.
After establishing HTTP connection in the program, between management server and client, WebSocket company is also resettled It connects, management server is actively returned to the prompt information for being managed host return and operating result by WebSocket connection Client regularly sends HTTP data acquisition request without client, and management server is without for each of client HTTP data acquisition request responds, to save the resource and network bandwidth of management server, avoids serious resource wave Take, and client can timely receive the information for being managed host return, guarantees real time communication.
Specifically, above-mentioned connection establishment unit 61, is specifically used for:
WebSocket connection, which is sent, to management server establishes request;
Receive the WebSocket connection establishment response that management server is sent.
Optionally, the above-mentioned information carrying means based on WEB emulation terminal system further include:
Second transmission unit is asked for being connected by WebSocket to management server transmission WebSocket connection disconnection Ask so that management server by SSH connect to be managed host send SSH connection disconnect request, and pass through SSH connection reception After being managed the SSH connection disconnection response of host transmission, is connected by WebSocket to client and send WebSocket connection Disconnect response;
Second receiving unit, it is disconnected for receiving the WebSocket connection that management server is sent by WebSocket connection Open response.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
Although alternative embodiment of the invention has been described, created once a person skilled in the art knows basic Property concept, then additional changes and modifications may be made to these embodiments.So the following claims are intended to be interpreted as include can It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, those skilled in the art can carry out various modification and variations without departing from this hair to the embodiment of the present invention The spirit and scope of bright embodiment.In this way, if these modifications and variations of the embodiment of the present invention belong to the claims in the present invention And its within the scope of equivalent technologies, then the present invention is also intended to include these modifications and variations.

Claims (10)

1. a kind of information transferring method based on webpage WEB emulation terminal system, the WEB emulation terminal system includes client End, management server and at least one be managed host, between the client and the management server use browser B/ Server S framework and establish hypertext transfer protocol HTTP connection, the management server install WEB emulation terminal software and It establishes Secure Shell SSH with described be managed between host and connect, which is characterized in that the described method includes:
The management server and the client are established after WebSocket connect, and are passed through the WebSocket connection and are received institute It states the log-on message of client transmission and is managed host identification;
It is connected by the SSH to the corresponding host that is managed of host identification that is managed and sends the log-on message, and led to Cross the prompt information corresponding with the log-on message that host transmission is managed described in the SSH connection reception;
It is connected by the WebSocket to the client and sends the prompt information;
The operational order that the client is sent is received by the WebSocket connection, the operational order is mentioned when described Show that information is when logining successfully information, the client show described in login successfully information after receive what user inputted;
It is connected by the SSH to the host that is managed and sends the operational order, so that the host that is managed executes institute It states operational order and returns to operating result;And
By being managed the operating result of host return described in SSH connection reception, and connected by the WebSocket It connects to the client and sends the operating result.
2. the method as described in claim 1, which is characterized in that the management server and the client are established WebSocket connection, specifically includes:
The management server receives the WebSocket connection that the client is sent and establishes request;
WebSocket connection establishment response is sent to the client;
By being managed the operating result of host return described in SSH connection reception, and connected by the WebSocket It connects to the client and sends the operating result, specifically include:
The management server starting first thread and the second thread;
The operating result returned using the first thread by being managed host described in SSH connection reception;
It is connected by the WebSocket to the client using second thread and sends the operating result.
3. the method as described in claim 1, which is characterized in that further include:
Operational order described in the record management server and the operating result;And
The WebSocket connection that the client is sent, which is received, by the WebSocket connection disconnects request;
It is connected by the SSH to the host that is managed and sends SSH connection disconnection request;
After SSH connection by being managed host transmission described in SSH connection reception disconnects response, connected by WebSocket It connects to the client and sends WebSocket connection disconnection response.
4. a kind of information transferring method based on WEB emulation terminal system, the WEB emulation terminal system includes client, pipe Reason server is managed host at least one, and browser B/ server is used between the client and the management server S framework and establish hypertext transfer protocol HTTP connection, the management server install WEB emulation terminal software and with it is described It is managed between host and establishes Secure Shell SSH connection, which is characterized in that the described method includes:
The client and the management server are established after WebSocket connect, and are connected by the WebSocket to described Management server sends log-on message and is managed host identification, so that the management server is connected by the SSH to institute It states and is managed the corresponding host that is managed of host identification and sends the log-on message, it is described by pipe by SSH connection reception The prompt information corresponding with the log-on message that host is sent is managed, and is connected by the WebSocket to the client Send the prompt information;
The prompt information that the management server is sent is received by the WebSocket connection, if the prompt information For success log-on message, is connected by the WebSocket to the management server and send operational order, so that the management Server is connected to the host that is managed by the SSH and sends the operational order, so that described be managed host execution The operational order simultaneously returns to operating result and the management server by being managed master described in SSH connection reception The operating result that machine returns, and connected by the WebSocket to the client and send the operating result;
The operating result that the management server is sent is received by the WebSocket connection.
5. method as claimed in claim 4, which is characterized in that the client and the management server are established WebSocket connection, specifically includes:
The client sends WebSocket connection to the management server and establishes request;
Receive the WebSocket connection establishment response that the management server is sent;
The method also includes:
The client is connected to the management server by the WebSocket and sends WebSocket connection disconnection request, So that the management server, which is connected by the SSH to the host that is managed, sends SSH connection disconnection request, and pass through institute It states after being managed the SSH connection disconnection response of host transmission described in SSH connection reception, is connected by WebSocket to the visitor Family end sends WebSocket connection and disconnects response;
It receives the management server and response is disconnected by the WebSocket connection that the WebSocket connection is sent.
6. a kind of information carrying means based on WEB emulation terminal system, the WEB emulation terminal system includes client, pipe Reason server is managed host at least one, and browser B/ server is used between the client and the management server S framework and establish hypertext transfer protocol HTTP connection, the management server install WEB emulation terminal software and with it is described It is managed between host and establishes Secure Shell SSH connection, which is characterized in that described device includes:
Connection establishment unit is connect for establishing WebSocket with the client;
First receiving unit, for receiving the log-on message of the client transmission by the WebSocket connection and by pipe Manage host identification;
First Transmit-Receive Unit is sent for being connected by the SSH to the corresponding host that is managed of host identification that is managed The log-on message, and the mentioning corresponding with the log-on message by being managed host transmission described in SSH connection reception Show information;
First transmission unit sends the prompt information for connecting by the WebSocket to the client;
Second receiving unit, for receiving the operational order that the client is sent, the behaviour by the WebSocket connection Make instruction be when the prompt information be login successfully information when, the client show described in login successfully information after receive User's input;
Second transmission unit sends the operational order for connecting by the SSH to the host that is managed, so that described Host is managed to execute the operational order and return to operating result;And
Second Transmit-Receive Unit, the operating result for being returned by being managed host described in SSH connection reception, and lead to The WebSocket is crossed to connect to the client transmission operating result.
7. device as claimed in claim 6, which is characterized in that the connection establishment unit is specifically used for:
It receives the WebSocket connection that the client is sent and establishes request;
WebSocket connection establishment response is sent to the client;
Second Transmit-Receive Unit, is specifically used for:
Start first thread and the second thread;
The operating result returned using the first thread by being managed host described in SSH connection reception;
It is connected by the WebSocket to the client using second thread and sends the operating result.
8. device as claimed in claim 6, which is characterized in that further include:
Recording unit, for recording the operational order and the operating result;And
Third receiving unit, it is disconnected for receiving the WebSocket connection that the client is sent by the WebSocket connection Open request;
Third transmission unit sends SSH connection disconnection request for connecting by the SSH to the host that is managed;
Third Transmit-Receive Unit disconnects response for the SSH connection by being managed host transmission described in SSH connection reception Afterwards, it is connected by WebSocket to the client and sends WebSocket connection disconnection response.
9. a kind of information carrying means based on WEB emulation terminal system, the WEB emulation terminal system includes client, pipe Reason server is managed host at least one, and browser B/ server is used between the client and the management server S framework and establish hypertext transfer protocol HTTP connection, the management server install WEB emulation terminal software and with it is described It is managed between host and establishes Secure Shell SSH connection, which is characterized in that described device includes:
Connection establishment unit is connect for establishing WebSocket with the management server;
First transmission unit sends log-on message to the management server and by pipe for connecting by the WebSocket Host identification is managed, so that the management server, which is connected by the SSH to described, is managed that host identification is corresponding to be managed Host sends the log-on message, by the SSH connection receive described in be managed host sending with the log-on message pair The prompt information answered, and connected by the WebSocket to the client and send the prompt information;
Transmit-Receive Unit, for receiving the prompt information that the management server is sent by the WebSocket connection, if The prompt information is successful log-on message, is connected by the WebSocket to the management server and sends operational order, So that the management server, which is connected by the SSH to the host that is managed, sends the operational order, so that the quilt Managing main frame executes the operational order and returns to operating result and the management server and received by the SSH connection The operating result for being managed host return, and connected by the WebSocket to described in client transmission Operating result;
First receiving unit, for receiving the operation knot that the management server is sent by the WebSocket connection Fruit.
10. device as claimed in claim 9, which is characterized in that the connection establishment unit is specifically used for:
WebSocket connection, which is sent, to the management server establishes request;
Receive the WebSocket connection establishment response that the management server is sent;
Described device further include:
Second transmission unit, it is disconnected to management server transmission WebSocket connection for being connected by the WebSocket Request is opened, so that the management server, which is connected by the SSH to the host that is managed, sends SSH connection disconnection request, And after the SSH connection by being managed host transmission described in SSH connection reception disconnects response, connected by WebSocket WebSocket connection, which is sent, to the client disconnects response;
Second receiving unit passes through described in WebSocket connection transmission for receiving the management server WebSocket connection disconnects response.
CN201410838422.6A 2014-12-29 2014-12-29 Information transferring method and device based on WEB emulation terminal system Active CN105812406B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410838422.6A CN105812406B (en) 2014-12-29 2014-12-29 Information transferring method and device based on WEB emulation terminal system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410838422.6A CN105812406B (en) 2014-12-29 2014-12-29 Information transferring method and device based on WEB emulation terminal system

Publications (2)

Publication Number Publication Date
CN105812406A CN105812406A (en) 2016-07-27
CN105812406B true CN105812406B (en) 2019-05-03

Family

ID=56980840

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410838422.6A Active CN105812406B (en) 2014-12-29 2014-12-29 Information transferring method and device based on WEB emulation terminal system

Country Status (1)

Country Link
CN (1) CN105812406B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108924265A (en) * 2018-08-23 2018-11-30 河南思维轨道交通技术研究院有限公司 Data capture method, device and web page server
CN109768999B (en) * 2019-03-14 2021-08-20 成都安恒信息技术有限公司 WebSocket-based SSH multichannel TCP proxy method
CN112019477B (en) * 2019-05-29 2023-09-05 上海诺基亚贝尔股份有限公司 Method and device for establishing and managing SSH (secure socket connection)
CN111221665A (en) * 2019-12-25 2020-06-02 中科曙光国际信息产业有限公司 Container remote login method and device based on browser
CN111935276B (en) * 2020-08-07 2022-04-26 中国联合网络通信集团有限公司 Remote host access method, device and equipment
CN112134941A (en) * 2020-09-18 2020-12-25 北京达佳互联信息技术有限公司 Communication method, communication device, server and storage medium
CN113067834A (en) * 2021-04-09 2021-07-02 上海新炬网络信息技术股份有限公司 Method for remotely controlling server based on Web browser

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103268319A (en) * 2013-04-17 2013-08-28 北京航空航天大学 Cloud browser based on webpages
CN103281366A (en) * 2013-05-21 2013-09-04 山东地纬计算机软件有限公司 Embedded agency monitoring device and method supporting real-time operating state acquiring
CN103336780A (en) * 2013-05-30 2013-10-02 苏州畅达软件研发有限公司 Real-time monitoring system for equipment information

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8527774B2 (en) * 2009-05-28 2013-09-03 Kaazing Corporation System and methods for providing stateless security management for web applications using non-HTTP communications protocols

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103268319A (en) * 2013-04-17 2013-08-28 北京航空航天大学 Cloud browser based on webpages
CN103281366A (en) * 2013-05-21 2013-09-04 山东地纬计算机软件有限公司 Embedded agency monitoring device and method supporting real-time operating state acquiring
CN103336780A (en) * 2013-05-30 2013-10-02 苏州畅达软件研发有限公司 Real-time monitoring system for equipment information

Also Published As

Publication number Publication date
CN105812406A (en) 2016-07-27

Similar Documents

Publication Publication Date Title
CN105812406B (en) Information transferring method and device based on WEB emulation terminal system
CN105591819B (en) The method and device of Configuration network equipment
US20190349417A1 (en) Data transmission method and device
CN104796396B (en) The method and medium of network agent layer for the application proxy based on strategy are provided
CN109525461B (en) Network equipment testing method, device, equipment and storage medium
CN105610938A (en) Logging status synchronization method and system
EP3128713B1 (en) Page push method and system
CN112437047A (en) Remote server management method, system and related device
CN103825783A (en) Test method and device
WO2015131524A1 (en) Remote access server method and web server
CN108124007A (en) The method and apparatus of message data real-time Transmission
CN108924265A (en) Data capture method, device and web page server
CN1980232A (en) Telnet session maitenance method, telnet proxy and computer network system
CN111831513A (en) Log query method and device, electronic equipment and storage medium
CN105959174B (en) Testing method and device for intelligent equipment platform
CN110442506A (en) A kind of journal obtaining method, device, service server, system and storage medium
CN105721274B (en) The fusion method and device of one kind of multiple instant messagings
CN106303429A (en) Remote configuring method and device
WO2018072095A1 (en) Load testing management method and system
US10776062B2 (en) Cloud services activation for a printing device
CN109587210A (en) A kind of implementation method of the information push of more browser-safes
CN108989157B (en) Method and device for controlling intelligent equipment
US11196686B2 (en) Chatbot context setting using packet capture
TWI537743B (en) Remote management method and the apparatus thereof
CN115410580A (en) Voice recognition method, device, equipment and medium for command scheduling system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: Room 818, 8 / F, 34 Haidian Street, Haidian District, Beijing 100080

Patentee after: BEIJING ULTRAPOWER SOFTWARE Co.,Ltd.

Address before: 100107 Beijing city Haidian District wanquanzhuang Road No. 28 Wanliu new building block A Room 601

Patentee before: BEIJING ULTRAPOWER SOFTWARE Co.,Ltd.