CN114928524B - Interaction method, device and medium of WEB terminal and switch - Google Patents
Interaction method, device and medium of WEB terminal and switch Download PDFInfo
- Publication number
- CN114928524B CN114928524B CN202210548724.4A CN202210548724A CN114928524B CN 114928524 B CN114928524 B CN 114928524B CN 202210548724 A CN202210548724 A CN 202210548724A CN 114928524 B CN114928524 B CN 114928524B
- Authority
- CN
- China
- Prior art keywords
- terminal
- component
- server
- web
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 230000003993 interaction Effects 0.000 title claims abstract description 36
- 238000012544 monitoring process Methods 0.000 claims abstract description 26
- 230000008859 change Effects 0.000 claims abstract description 16
- 230000004044 response Effects 0.000 claims abstract description 14
- 238000013515 script Methods 0.000 claims abstract description 13
- 230000006870 function Effects 0.000 claims description 89
- 230000002452 interceptive effect Effects 0.000 claims description 4
- 238000012795 verification Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 8
- 238000004590 computer program Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000008602 contraction Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 230000003044 adaptive effect Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
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/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
-
- 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/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0823—Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
- H04L67/025—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/321—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority
- H04L9/3213—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority using tickets or tokens, e.g. Kerberos
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Information Transfer Between Computers (AREA)
- Telephonic Communication Services (AREA)
Abstract
The application discloses a method, equipment and medium for interaction between a WEB terminal and a switch, which are applied to an interaction system between the WEB terminal and the switch, wherein the interaction system comprises the WEB terminal and a service terminal, and the method comprises the following steps: monitoring a specified operation aiming at the Modal component through a monitor in the Modal component; triggering a resizeChange callback function in response to the specified operation; triggering a fit adjustment function in the Terminal component through a resize change callback function to adjust the size of the Terminal component through the fit adjustment function; the Modal component and the Terminal component are positioned at the WEB end; establishing a WebSocket connection between the Terminal component and the server, determining a current switch Terminal to be connected through the WebSocket connection, and sending a specified event message generated by the Terminal component to the server so that the server can adjust the corresponding shell script according to the specified event message.
Description
Technical Field
The application relates to the technical field of communication, in particular to an interaction method, interaction equipment and interaction media of a WEB terminal and a switch.
Background
In an SDN network architecture, network administrators may configure and manage the network through SDN network applications (i.e., control planes). However, in some specific scenarios, the function of the SDN network application in a certain version may have a certain limitation, for example, more detailed information of the switch needs to be acquired, but the SDN network application is limited by the version and does not have the function of displaying the information, and meanwhile, some unknown scenarios may be encountered, so that a user has to perform tasks with some more complicated operations. In this scenario, it is generally necessary to use third party terminal software, such as xshell, to interact with the switch, which is complex to operate, and if the SDN network application interface is changed, data is easily lost.
Disclosure of Invention
In order to solve the above problems, the present application proposes an interaction method of a WEB terminal and an exchange, which is applied to an interaction system between the WEB terminal and the exchange, where the interaction system includes a WEB terminal and a service terminal, and the method includes:
monitoring a specified operation aiming at the Modal component through a monitor in the Modal component;
triggering a resizeChange callback function in response to the specified operation;
triggering a fit adjustment function in a Terminal component through the resize change callback function so as to adjust the size of the Terminal component through the fit adjustment function; the Modal component and the Terminal component are positioned at the WEB Terminal;
establishing a WebSocket connection between the Terminal component and the server, determining a switch Terminal to be connected currently through the WebSocket connection, and sending a specified event message generated by the Terminal component to the server so that the server can adjust a shell script corresponding to the specified event message according to the specified event message.
In one implementation manner of the present application, triggering a fit adjustment function in a Terminal component to adjust a size of the Terminal component through the fit adjustment function specifically includes:
creating a Terminal instance and a FitAddon instance in the Terminal component;
based on the FitAddon instance, calling a fit adjustment function in response to a trigger operation for the resizeChange callback function;
and adjusting component parameters of the Terminal instance according to the fit adjustment function to adjust the size of the Terminal component.
In one implementation manner of the present application, the specified event message includes a typing message and an adjustment message, and is characterized in that the sending, to the server, the specified event message generated by the Terminal component specifically includes:
initializing a WebSocket instance in the Terminal component;
monitoring the keying message transmitted by the WEB Terminal through the Terminal instance, and monitoring the adjustment message transmitted by the fit adjustment function through the FitAddon instance;
and transmitting the typing information and the adjustment information to the WebSocket instance, and sending the typing information and the adjustment information to the server through the WebSocket instance.
In an implementation manner of the present application, determining, through the WebSocket connection, a switch terminal to be connected currently specifically includes:
sending a connection message to the server through the WebSocket connection, so that the server determines a current switch terminal to be connected according to the connection message; and the connection message carries the information of the switch terminal connected with the interactive system.
In one implementation manner of the present application, after establishing the WebSocket connection between the Terminal component and the server, the method further includes:
under the condition that the WEB end keys in a command, a key-in message carrying the key-in command is sent to the server through the WebSocket connection;
and acquiring a return message sent by the server for the key-in message, and writing the return message into the Terminal component according to the return message so as to realize the completion operation or the line feed operation of the key-in command.
In one implementation of the present application, the method further includes:
and initializing a Terminal instance based on a timeout function set in the monitor, and executing the resizeChange callback function after the Terminal instance is initialized.
In one implementation manner of the present application, establishing a WebSocket connection between the Terminal component and the server specifically includes:
and adding a security token on a protocol field corresponding to the WebSocket connection, so as to carry out access verification on the WEB terminal and the server terminal through the security token.
In one implementation manner of the present application, monitoring the typing message incoming from the WEB side specifically includes:
monitoring a typing event transmitted by the WEB Terminal through a preset typing event monitoring function in the Terminal example;
and after the typing event is acquired, acquiring typing data corresponding to the typing event through a data monitoring function.
The embodiment of the application provides interaction equipment of a WEB terminal and a switch, wherein the equipment comprises:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
monitoring a specified operation aiming at the Modal component through a monitor in the Modal component;
triggering a resizeChange callback function in response to the specified operation;
triggering a fit adjustment function in a Terminal component through the resize change callback function so as to adjust the size of the Terminal component through the fit adjustment function; the Modal component and the Terminal component are positioned at a WEB end;
establishing a WebSocket connection between the Terminal component and the server, determining a switch Terminal to be connected currently through the WebSocket connection, and sending a specified event message generated by the Terminal component to the server so that the server can adjust a shell script corresponding to the specified event message.
An embodiment of the present application provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to:
monitoring a specified operation aiming at the Modal component through a monitor in the Modal component;
triggering a resizeChange callback function in response to the specified operation;
triggering a fit adjustment function in a Terminal component through the resize change callback function so as to adjust the size of the Terminal component through the fit adjustment function; the Modal component and the Terminal component are positioned at a WEB end;
establishing a WebSocket connection between the Terminal component and the server, determining a switch Terminal to be connected currently through the WebSocket connection, and sending a specified event message generated by the Terminal component to the server so that the server can adjust a shell script corresponding to the specified event message.
The interaction method of the WEB terminal and the switch provided by the application can bring the following beneficial effects:
the method can be embedded into the interaction system, an operator can interact with the switch directly at the WEB end of the interaction system, and the switch terminal is not required to be connected through third-party software, so that the network operation and maintenance efficiency is improved; the Terminal component size arranged at the WEB end can be adaptively adjusted by monitoring the appointed operation aiming at the Modal component, and then the appointed time information of the WEB end is transmitted to the service end through the WebSocket connection between the Terminal component and the service end so as to adjust the shell script of the service end, thereby ensuring that the front end command format is consistent with the back end command format, and avoiding the conditions of data loss and the like caused by the expansion of the WEB end component.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
fig. 1 is a flow chart of an interaction method between a WEB end and a switch provided in an embodiment of the present application;
fig. 2 is a flow chart of another interaction method between a WEB end and a switch according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an interaction device of a WEB end and a switch according to an embodiment of the present application.
Detailed Description
For the purposes, technical solutions and advantages of the present application, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The following describes in detail the technical solutions provided by the embodiments of the present application with reference to the accompanying drawings.
As shown in fig. 1, the interaction method between a WEB end and a switch provided in the embodiments of the present application is applied to an interaction system between a WEB end and a switch, where the interaction system includes a WEB end (i.e. client end) and a server end (i.e. server end), and includes:
s101: the designated operation for the Modal component is listened to by a listener in the Modal component.
As shown in FIG. 1, the WEB end is provided with a Modal component and a Terminal component, wherein the Modal component is an outer wrapping component and is mainly used for controlling the expansion and the contraction and the dragging movement of the Terminal component. The Terminal component is a Terminal main body, and after the Terminal component inputs a command, corresponding feedback of the system background on the execution command can be obtained.
The Modal component is provided with a Resizer bserver monitor and a dragcable instance. When the user drags the Modal component, the dragable component controls the location to move the Modal to the specified location without exceeding the WEB-side interface. The resize bserver, after initializing, may monitor a specified operation for the Modal component, which may be a resizing operation. When a user changes the size of a Modal component, a Resizer Observer listener is used to monitor the scalable size of the Modal component.
S102: in response to the specified operation, a resizeChange callback function is triggered.
And the WEB terminal triggers a resize change callback function in response to the designated operation performed in the S101. The resize change callback function is used for transferring parameters in the interaction process, a setTimeout mechanism is adopted for anti-shake, and particularly, a setTimeout function is arranged in the resize unserver, so that performance consumption caused by frequently calling the resize change and frequently sending data through WebSocket can be avoided, on the one hand, the timeout function can enable the callback function of the resize unserver to enter the next macro task when being initialized, the callback function can be skipped to execute when running codes, the initialization of a Terminal instance is carried out in the Terminal component, the length and the width of the Terminal component are automatically expanded through initialization, when the macro task of the round is executed, the callback function in the resize unserver is executed, and the length and the width of the shape parameters in the callback function are the length and the width after being expanded by the Terminal, so that the size of the Terminal component is prevented from being changed manually. That is, only the front-end style of the Modal component is changed after the Modal component is scaled, and specific setting parameters thereof are automatically obtained by executing a callback function after the Ternmetal embodiment is initialized.
S103: triggering a fit adjustment function in the Terminal component through a resize change callback function to adjust the size of the Terminal component through the fit adjustment function; the Modal component and the Terminal component are located at the client.
While triggering the ressizeChange callback function, the Terminal component will initialize the Terminal instance in xterm. Js and the FitAddon instance of xterm-addon-fit accordingly. The FitAddon is a plug-in which can be used for Terminal size adaptation, and calls a fit adjustment function in response to a trigger operation for a resizeChange callback function, so that a Terminal component is automatically adapted to the size of an outer-layer Modal component through the fit function, component parameters of the Terminal instance are adjusted, and adaptive expansion and contraction of the Terminal component are achieved.
S104: establishing a WebSocket connection between the Terminal component and the server, determining a current switch Terminal to be connected through the WebSocket connection, and sending a specified event message generated by the Terminal component to the server so that the server can adjust the corresponding shell script according to the specified event message.
Because the command typed in the Terminal component needs to be transmitted to the background server, after the size of the Terminal component is adaptively adjusted, webSocket connection between the Terminal component and the server is also required to be established, the adjustment information of the front-end component interface is output, and the uniform rank number of shell scripts of the WEB end and the server is ensured, thereby avoiding the problem of data loss or data line feed caused by dynamic expansion of the front-end Terminal component.
It should be noted that WebSocket is a protocol for performing full duplex communication on a single TCP connection, and when the WebSocket connection is established, a token security token needs to be added to a corresponding protocol field, and access verification can be performed on a WEB end and a server end through a token, so that malicious access is prevented, and interaction security is ensured.
After the WebSocket connection between the Terminal component and the server is established, initializing a WebSocket instance in the Terminal component, wherein the WebSocket instance can receive the appointed event message transmitted by the Terminal component by monitoring a message event. The appointed event message comprises a typing message and an adjustment message, wherein the typing message is obtained by the Terminal instance after a command is typed on the Terminal interface, for example, a line of command is typed on the Terminal interface, and the Terminal instance can monitor the typing message transmitted by the WEB Terminal; the adjustment message is a data message correspondingly acquired by the FitAddon instance when the Terminal component is resized. The Terminal instance and the FitAddon instance can both transmit the keying message and the adjustment message into the WebSocket instance so as to be transmitted to the server through the WebSocket connection.
WebSocket can realize three types of data transmission, namely messages with op of connect, command and restore respectively. Before acquiring the appointed event message generated by the Terminal component, the server side is required to send a connect message first, so that the server side determines the switch Terminal which needs to establish the interactive connection. The connect message carries the switch terminal information of the interactive system connection and connection information such as host, username and password.
When a command is input on a WEB Terminal, namely a Terminal interface, the server can correspondingly receive command input information carrying the input command through the WebSocket connection between the WEB Terminal and the server. The Terminal instance listens for typing events, such as keyboard inputs, copy and paste operations, etc., through the onKey typing event listening function while listening for typing messages incoming to the WEB side, and obtains typing data through the onData data listening function, the typing data representing data prior to the command being completely written. The typing event listening function is executed before the data listening function, and the typing event listening function is capable of listening to a copy paste operation, a terminal. For example, when a telnet command is typed, a user manually types tel at the WEB terminal, and at this time, the typing event monitoring function can monitor that a typing event occurs at the WEB terminal, and at this time, the data monitoring function needs to be invoked to acquire the typing data tel.
The server is provided with Node-pty, node-pty is a pseudo terminal file, and can return a terminal object allowing reading and writing. In the embodiment of the application, the method is used for transmitting the appointed event message transmitted by the WEB terminal to the shell script, and then transmitting the data returned by the shell back to the WEB terminal through WebSocket connection. After the WEB Terminal obtains the return message of the keying message, the return message is written into the Terminal component, so that normal use of line feed operation can be ensured, and completion operation of the keying command can be realized through Tab.
After the Terminal component is adjusted in size, in order to ensure that the front end interface and the rear end interface are kept consistent, a resize message can be sent to the server to adjust the number of rows and columns of the shell of the server.
Fig. 2 is a schematic flow chart of another interaction method between a WEB terminal and a switch. As shown in FIG. 2, the WEB Terminal comprises a Modal component and a Terminal component, wherein a Resizer Observer monitor in the Modal component is used for monitoring the expansion condition of the Modal component, and after expansion, a resizer Change callback function which is transmitted to the Terminal component is triggered. And calling a fit function through a resize change callback function to adaptively adjust the size of the Terminal component so as to adapt to an external Modal component. The size adjustment data resize data of the Terminal component and the command key data entered by the WEB Terminal can be respectively transmitted into the WebSocket instance in real time through the FitAddon instance and the Terminal instance, and then transmitted to the service Terminal through WebSocket connection established between the WEB Terminal and the service Terminal. The Node-pty in the server transmits the appointed event message to the shell through the Node-pty, and the shell returns the result message and then transmits the result message back to the Terminal component through the WebSocket, so that the data interaction between the WEB Terminal and the server is completed. The method can be embedded in any system that requires a switch to be connected through a Terminal.
The foregoing is a method embodiment presented herein. Based on the same thought, some embodiments of the present application further provide a device and a non-volatile computer storage medium corresponding to the above method.
Fig. 3 is a schematic structural diagram of an interaction device of a WEB end and a switch according to an embodiment of the present application. As shown in fig. 3, includes:
at least one processor; the method comprises the steps of,
at least one processor in communication with the memory; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
monitoring a specified operation aiming at the Modal component through a monitor in the Modal component;
triggering a resizeChange callback function in response to the specified operation;
triggering a fit adjustment function in the Terminal component through a resize change callback function to adjust the size of the Terminal component through the fit adjustment function; the Modal component and the Terminal component are positioned at the WEB end;
and establishing a WebSocket connection between the Terminal component and the server, determining a current switch Terminal to be connected through the WebSocket connection, and sending a specified event message generated by the Terminal component to the server so that the server can adjust the corresponding shell script according to the specified event message.
The embodiment of the application provides a nonvolatile computer storage medium, which stores computer executable instructions, wherein the computer executable instructions are configured to:
monitoring a specified operation aiming at the Modal component through a monitor in the Modal component;
triggering a resizeChange callback function in response to the specified operation;
triggering a fit adjustment function in the Terminal component through a resize change callback function to adjust the size of the Terminal component through the fit adjustment function; the Modal component and the Terminal component are positioned at the WEB end;
establishing a WebSocket connection between the Terminal component and the server, determining a current switch Terminal to be connected through the WebSocket connection, and sending a specified event message generated by the Terminal component to the server so that the server can adjust the corresponding shell script according to the specified event message.
All embodiments in the application are described in a progressive manner, and identical and similar parts of all embodiments are mutually referred, so that each embodiment mainly describes differences from other embodiments. In particular, for the apparatus and medium embodiments, the description is relatively simple, as it is substantially similar to the method embodiments, with reference to the section of the method embodiments being relevant.
The devices and media provided in the embodiments of the present application are in one-to-one correspondence with the methods, so that the devices and media also have similar beneficial technical effects as the corresponding methods, and since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media are not described in detail herein.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.
Claims (9)
1. The interaction method of the WEB terminal and the switch is characterized by being applied to an interaction system between the WEB terminal and the switch, wherein the interaction system comprises the WEB terminal and a service terminal, and the method comprises the following steps:
monitoring a specified operation aiming at the Modal component through a monitor in the Modal component;
triggering a resizeChange callback function in response to the specified operation;
triggering a fit adjustment function in a Terminal component through the resize change callback function so as to adjust the size of the Terminal component through the fit adjustment function; the Modal component and the Terminal component are positioned at the WEB Terminal;
establishing a WebSocket connection between the Terminal component and the server, determining a switch Terminal to be connected currently through the WebSocket connection, and sending a specified event message generated by the Terminal component to the server so that the server can adjust a corresponding shell script according to the specified event message;
the method further comprises the steps of:
and initializing a Terminal instance based on a timeout function set in the monitor, and executing the resizeChange callback function after the Terminal instance is initialized.
2. The interaction method between a WEB Terminal and a switch according to claim 1, wherein triggering a fit adjustment function in a Terminal component to adjust a size of the Terminal component by the fit adjustment function specifically comprises:
creating a Terminal instance and a FitAddon instance in the Terminal component;
based on the FitAddon instance, calling a fit adjustment function in response to a trigger operation for the resizeChange callback function;
and adjusting component parameters of the Terminal instance according to the fit adjustment function to adjust the size of the Terminal component.
3. The interaction method of the WEB Terminal and the switch according to claim 2, wherein the specified event message comprises a typing message and an adjustment message, and is characterized in that the specified event message generated by the Terminal component is sent to the service Terminal, and specifically comprises:
initializing a WebSocket instance in the Terminal component;
monitoring the keying message transmitted by the WEB Terminal through the Terminal instance, and monitoring the adjustment message transmitted by the fit adjustment function through the FitAddon instance;
and transmitting the typing information and the adjustment information to the WebSocket instance, and sending the typing information and the adjustment information to the server through the WebSocket instance.
4. The interaction method between a WEB terminal and a switch according to claim 1, wherein determining, by the WebSocket connection, a switch terminal to be connected currently specifically includes:
sending a connection message to the server through the WebSocket connection, so that the server determines a current switch terminal to be connected according to the connection message; and the connection message carries the information of the switch terminal connected with the interactive system.
5. The interaction method between a WEB side and a switch according to claim 3, wherein after establishing a WebSocket connection between the Terminal component and the server side, the method further comprises:
under the condition that the WEB end keys in a command, a key-in message carrying the key-in command is sent to the server through the WebSocket connection;
and acquiring a return message sent by the server for the key-in message, and writing the return message into the Terminal component according to the return message so as to realize the completion operation or the line feed operation of the key-in command.
6. The interaction method of a WEB side and a switch according to claim 1, wherein establishing WebSocket connection between the Terminal component and the server side specifically includes:
and adding a security token on a protocol field corresponding to the WebSocket connection, so as to carry out access verification on the WEB terminal and the server terminal through the security token.
7. The interaction method between a WEB terminal and a switch according to claim 3, wherein monitoring the key-in message transmitted from the WEB terminal specifically comprises:
monitoring a typing event transmitted by the WEB Terminal through a preset typing event monitoring function in the Terminal example;
and after the typing event is acquired, acquiring typing data corresponding to the typing event through a data monitoring function.
8. Interaction equipment of WEB terminal and switch, characterized in that, the equipment includes:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
monitoring a specified operation aiming at the Modal component through a monitor in the Modal component;
triggering a resizeChange callback function in response to the specified operation;
triggering a fit adjustment function in a Terminal component through the resize change callback function so as to adjust the size of the Terminal component through the fit adjustment function; the Modal component and the Terminal component are positioned at a WEB end;
establishing a WebSocket connection between the Terminal component and a server, determining a switch Terminal to be connected currently through the WebSocket connection, and sending a specified event message generated by the Terminal component to the server so that the server can adjust a corresponding shell script according to the specified event message;
further comprises: and initializing a Terminal instance based on a timeout function set in the monitor, and executing the resizeChange callback function after the Terminal instance is initialized.
9. A non-transitory computer storage medium storing computer-executable instructions, the computer-executable instructions configured to:
monitoring a specified operation aiming at the Modal component through a monitor in the Modal component;
triggering a resizeChange callback function in response to the specified operation;
triggering a fit adjustment function in a Terminal component through the resize change callback function so as to adjust the size of the Terminal component through the fit adjustment function; the Modal component and the Terminal component are positioned at a WEB end;
establishing a WebSocket connection between the Terminal component and a server, determining a switch Terminal to be connected currently through the WebSocket connection, and sending a specified event message generated by the Terminal component to the server so that the server can adjust a corresponding shell script according to the specified event message;
further comprises: and initializing a Terminal instance based on a timeout function set in the monitor, and executing the resizeChange callback function after the Terminal instance is initialized.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210548724.4A CN114928524B (en) | 2022-05-20 | 2022-05-20 | Interaction method, device and medium of WEB terminal and switch |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210548724.4A CN114928524B (en) | 2022-05-20 | 2022-05-20 | Interaction method, device and medium of WEB terminal and switch |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114928524A CN114928524A (en) | 2022-08-19 |
CN114928524B true CN114928524B (en) | 2024-03-26 |
Family
ID=82808974
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210548724.4A Active CN114928524B (en) | 2022-05-20 | 2022-05-20 | Interaction method, device and medium of WEB terminal and switch |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114928524B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20090056504A (en) * | 2007-11-30 | 2009-06-03 | 주식회사 케이티 | Proxy, terminal, method for processing the document object model events for modalities |
CN101467139A (en) * | 2006-06-09 | 2009-06-24 | 微软公司 | Dragging and dropping objects between local and remote modules |
CN104714989A (en) * | 2013-12-12 | 2015-06-17 | 南宁市磁汇科技有限公司 | Method for dynamically storing and visually editing WEB page in browser |
CN105204748A (en) * | 2014-06-27 | 2015-12-30 | 阿里巴巴集团控股有限公司 | Terminal interaction method and device |
KR20190037598A (en) * | 2017-09-29 | 2019-04-08 | 이정민 | Method, apparatus and computer-readable medium for contents size control for displaying a full-sizeed web page |
CN109840209A (en) * | 2019-01-18 | 2019-06-04 | 深圳壹账通智能科技有限公司 | Application performance collecting method, terminal, computer equipment and storage medium |
CN111552901A (en) * | 2019-02-11 | 2020-08-18 | 福建省天奕网络科技有限公司 | Method and storage medium for H5 cross-engine client data automation updating |
CN113010170A (en) * | 2021-03-31 | 2021-06-22 | 中国建设银行股份有限公司 | Page rendering method, device, medium and electronic equipment based on Vue3 component |
-
2022
- 2022-05-20 CN CN202210548724.4A patent/CN114928524B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101467139A (en) * | 2006-06-09 | 2009-06-24 | 微软公司 | Dragging and dropping objects between local and remote modules |
KR20090056504A (en) * | 2007-11-30 | 2009-06-03 | 주식회사 케이티 | Proxy, terminal, method for processing the document object model events for modalities |
CN104714989A (en) * | 2013-12-12 | 2015-06-17 | 南宁市磁汇科技有限公司 | Method for dynamically storing and visually editing WEB page in browser |
CN105204748A (en) * | 2014-06-27 | 2015-12-30 | 阿里巴巴集团控股有限公司 | Terminal interaction method and device |
KR20190037598A (en) * | 2017-09-29 | 2019-04-08 | 이정민 | Method, apparatus and computer-readable medium for contents size control for displaying a full-sizeed web page |
CN109840209A (en) * | 2019-01-18 | 2019-06-04 | 深圳壹账通智能科技有限公司 | Application performance collecting method, terminal, computer equipment and storage medium |
CN111552901A (en) * | 2019-02-11 | 2020-08-18 | 福建省天奕网络科技有限公司 | Method and storage medium for H5 cross-engine client data automation updating |
CN113010170A (en) * | 2021-03-31 | 2021-06-22 | 中国建设银行股份有限公司 | Page rendering method, device, medium and electronic equipment based on Vue3 component |
Non-Patent Citations (2)
Title |
---|
Modal scaling in operational modal analysis using a finite element model;M.L. Aenlle;《International Journal of Mechanical Sciences》;20131130;全文 * |
一种多服务端HTML5 Web Worker迁移系统设计与实现;王昭;邓浩江;胡琳琳;郭志川;;计算机应用与软件;20180912(第09期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN114928524A (en) | 2022-08-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10802906B2 (en) | Monitoring method and apparatus of server, and storage medium | |
US10594768B2 (en) | Method and apparatus of performing remote command dispatching | |
KR102121358B1 (en) | Data transmission method and device | |
US9363157B2 (en) | Remotely controlling devices and processing asynchronous events for testing | |
CN110049090B (en) | Method and system for configuring adaptive breaker chain in micro-service architecture | |
CN110413329A (en) | IOT equipment remote debugging method, apparatus and system | |
CN113645150A (en) | Transmission rate control method, device, electronic equipment and readable storage medium | |
US20170331912A1 (en) | Multi-account login and communication | |
CN114928524B (en) | Interaction method, device and medium of WEB terminal and switch | |
CN112153146B (en) | Operation notification method and apparatus, storage medium, and electronic apparatus | |
CN117240898A (en) | Communication method, device, electronic equipment and storage medium | |
CN103955153A (en) | Motion control system and method | |
CN104954223B (en) | Data processing method and device based on Virtual Private Network | |
CN110928944B (en) | Data processing method and device | |
CN110955446A (en) | CPLD firmware updating method, system and device | |
CN107783722B (en) | Data transmission method and data forwarding device | |
CN113949684B (en) | Video transmission method, device, medium and computing equipment | |
CN113938475B (en) | Data transmission method | |
Považan et al. | Communication interface libraries as an extension to the debugging framework for DSP applications | |
US20180248759A1 (en) | Troubleshooting in remote management services | |
CN112422566B (en) | Remote call processing method and device, storage medium and electronic device | |
US11245767B1 (en) | Multi-route communication system and route selection system | |
CN111240868B (en) | Instance processing and calling method, device, system and storage medium | |
CN115129284A (en) | Control method and device of LED display equipment, storage medium and electronic equipment | |
CN113949684A (en) | Video transmission method, device, medium and computing equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |