CN115484300A - Message transmission method, electronic device and storage medium - Google Patents
Message transmission method, electronic device and storage medium Download PDFInfo
- Publication number
- CN115484300A CN115484300A CN202210913658.6A CN202210913658A CN115484300A CN 115484300 A CN115484300 A CN 115484300A CN 202210913658 A CN202210913658 A CN 202210913658A CN 115484300 A CN115484300 A CN 115484300A
- Authority
- CN
- China
- Prior art keywords
- message transmission
- transmission channel
- client
- operation instruction
- server
- 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.)
- Granted
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 195
- 238000000034 method Methods 0.000 title claims abstract description 87
- 238000004891 communication Methods 0.000 claims abstract description 38
- 230000004044 response Effects 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 8
- 238000012544 monitoring process Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 description 12
- 238000012545 processing Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 230000009471 action Effects 0.000 description 4
- 238000001514 detection method Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000008447 perception Effects 0.000 description 1
Images
Classifications
-
- 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/14—Session management
- H04L67/141—Setup of application sessions
-
- 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/22—Parsing or analysis of headers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computer And Data Communications (AREA)
Abstract
The embodiment of the invention relates to a message transmission method, electronic equipment and a storage medium, wherein the method comprises the following steps: after determining that the client establishes communication connection with the server through the first message transmission channel, waiting for an operation instruction transmitted by the client through the first message transmission channel; analyzing the operation instruction to obtain an analyzed operation instruction; when an operation result is generated after the analyzed operation instruction is executed, switching the first message transmission channel to the second message transmission channel; and transmitting the operation result to the client through a second message transmission channel. The information can be acquired at any time through vty of the virtual terminal equipment. The virtual terminal vty is configured with a command analysis environment in advance, the command analysis environment is the same as that of the console, the operation command is analyzed in the environment, subsequent configuration and cloud wall debugging management are completed according to the analyzed operation command, cloud wall states or printing information is received, the problem solving efficiency is improved, and the cloud wall is easy to use and reliable.
Description
Technical Field
The embodiment of the invention relates to the technical field of software development, in particular to a message transmission method, electronic equipment and a storage medium.
Background
The cloud wall configuration commands are managed by the controller, because of the real-time state of the cloud wall, various printed information cannot be sent to the controller in time, and even many commands cannot be sent to the controller, so that the controller is inconvenient to debug the cloud wall.
A simpler way is to use a console (console) to control and debug the cloud wall, but when the cloud wall is started, the console is not necessarily opened synchronously, and even if the cloud wall is opened, the connection may be lost over time.
Therefore, a method for connecting the cloud wall and acquiring cloud wall information at any time is needed to ensure real-time intercommunication between the cloud wall and the console, so that the controller can conveniently debug and manage the cloud wall.
Disclosure of Invention
The application provides a message transmission method, an electronic device and a storage medium, which are used for solving the technical problems of part or all of the above in the prior art.
In a first aspect, the present application provides a message transmission method, where the method is executed by a server-side virtual port of a virtual terminal device, and the method includes:
after determining that the client establishes communication connection with the server through the first message transmission channel, waiting for an operation instruction transmitted by the client through the first message transmission channel;
analyzing the operation instruction to obtain an analyzed operation instruction;
when an operation result is generated after the analyzed operation instruction is executed, switching the first message transmission channel to the second message transmission channel;
and transmitting the operation result to the client through a second message transmission channel.
In a second aspect, the present application provides a message transmission method, where the method is performed by a client virtual port of a virtual terminal device, and the method includes:
when detecting that a first object accesses the cloud wall through a virtual port of the virtual terminal device, sending an operation instruction written by the first object through a first message transmission channel established with a server;
or after the second message transmission channel monitors the operation result fed back by the server, the operation result is read and displayed, wherein the first message transmission channel and the second message transmission channel form a message transmission channel pair.
A third aspect provides an electronic device, where the electronic device carries a virtual terminal device, the virtual terminal device includes a virtual port of a router or a switch for remote login, the virtual port includes a server and a client, and the electronic device includes a processor, a communication interface, a memory and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor, configured to implement the steps of the message transmission method according to any one of the embodiments of the first aspect when executing a program stored in a memory;
alternatively, the steps of the message transmission method of any embodiment of the second aspect are implemented.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the message transmission method as defined in any one of the embodiments of the first aspect;
alternatively, the steps of a message transmission method as embodied in any of the second aspects are implemented.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
according to the method provided by the embodiment of the application, the client and the server transmit the message through the message transmission channel, the message comprises the operation instruction, and the operation result is generated according to the operation instruction. The information can be acquired at any time through the vty of the virtual terminal equipment. The virtual terminal vty is configured with a command analysis environment in advance, the command analysis environment is the same as that of the console, the operation command is analyzed in the environment, subsequent configuration and cloud wall debugging management are completed according to the analyzed operation command, cloud wall states or printing information is received, the problem solving efficiency is improved, and the cloud wall is easy to use and reliable.
Drawings
Fig. 1 is a schematic flow chart of a message transmission method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of another message transmission method according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a method for realizing single-user access to a cloud wall according to the present invention;
FIG. 4 is a block diagram of the overall process flow of server-side threads, client-side threads, and user input/output provided by the present invention;
fig. 5 is a schematic structural diagram of a message transmission apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of another message transmission apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
For the convenience of understanding of the embodiments of the present invention, the following description will be further explained with reference to specific embodiments, which are not to be construed as limiting the embodiments of the present invention.
To solve the technical problem mentioned in the background art, an embodiment of the present application provides a message transmission method, specifically referring to fig. 1, where fig. 1 is a schematic flow diagram of a message transmission method provided in an embodiment of the present invention, and the method is executed by a server-side virtual port of a virtual terminal device. Before the method steps are introduced, some preparatory tasks that need to be performed will first be explained.
Specifically, it is necessary to configure the same command parsing environment as a console (console) in a virtual port of the virtual terminal device, to configure a debug management cloud wall, to receive cloud wall status or print information, and the like. The virtual ports are remote login virtual ports vty and vty of a router or a switch, and each virtual port comprises a client and a server. The client is configured with an executable file that is independent of the cloud wall. When the cloud wall is operated, the server side can open a channel to wait for connection of the client side. The channel referred to here is the first message transmission channel.
Therefore, before the following steps are performed, the following operations need to be performed at the server:
creating a thread for performing the following operations:
1 message transmission channel pair is created, which in an alternative example may be a first-in-first-out queue fifo (named pipe) pair, including a first message transmission channel, and a second message transmission channel. In a specific example, the first message transmission channel is client-to-server (c 2 s), and the second message transmission channel is server-to-client (s 2 c). After creation, the fifo pair is opened, waiting for client connection in c2 s.
The created thread is also used to perform the following method steps:
Specifically, the operation instruction is written after the user accesses the cloud wall through the virtual port of the client, and the operation instruction is transmitted to the server through c2 s.
And step 120, analyzing the operation instruction to obtain the analyzed operation instruction.
In a specific example, for the parsing of the operation instruction, the client command may be read character by character and parsed.
Of course, if there is a preset character (special character) in the operation instruction, for example, 'tab'? ' then, response operations are performed on the special character. Specific response operations include, but are not limited to, operations such as a prompt operation, a correlation operation, or an autocomplete operation.
In a specific example, for example, the operation commands are secpolarity add xx, secpolarity delete xxx and secpolarity ad-mod xxx, and after executing secpolarity and then spacing, input? Prompt operation is executed, for example, three pieces of information add delete ad-mod are prompted for subsequent selection of keywords;
continuing to execute secpolarity ad to tap tab, the association operation is executed: associating add and ad-mod for selecting specific keywords;
secpolicy ad-continues to be executed, and tab keys are hit, so that an automatic incomplete operation, such as an automatic completion of the keyword ad-mod, is executed because the keyword only has ad-mod at this time.
Specifically, if the analyzed operation instruction is executed, a corresponding operation result is generated. Then the operation result also needs to be fed back to the client. Therefore, it is necessary to switch the first message transmission channel to the second message transmission channel.
Further optionally, after the communication connection between the client and the server is established, c2s and s2c may be replaced by 0 (stdin) and 1 (stdout). And in the subsequent execution process, the switching process between the first message transmission channel and the second message transmission channel is completed by switching between 0 (stdin) and 1 (stdout). So doing, the code can be multiplexed with existing console commands without any modification. The trouble of workers is avoided, and the operation is more convenient and quicker.
It should be further noted that, in this embodiment, the client does not need to parse any command, all command parsing is performed at the server, and similarly, no code needs to be added, so that additional work of a worker is not added.
And step 140, transmitting the operation result to the client through a second message transmission channel.
Specifically, after the operation result is transmitted to the client through the second message transmission channel, the user is displayed through the client. When the operation result is transmitted to the client through the second message transmission channel, the batch transmission mode is adopted to improve the working efficiency. For example 1024 bytes at a time.
In an alternative example, the information sent by the server to the client uses vt100 standard, so that the user can obtain the same result as the console through vty.
According to the message transmission method provided by the embodiment of the invention, the client and the server transmit the message through the message transmission channel, and the message comprises the operation instruction and the operation result generated according to the operation instruction. The information can be acquired at any time through vty of the virtual terminal equipment. The virtual terminal vty is configured with a command analysis environment in advance, wherein the command analysis environment is the same as that of the console, and is used for analyzing the operation command in the environment, completing subsequent configuration and debugging management of the cloud wall according to the analyzed operation command, receiving the cloud wall state or printing information and the like, and therefore the efficiency of solving the problem is improved, and the cloud wall is easier and more reliable to use.
Further optionally, on the basis of the foregoing embodiment, after the operation result is transmitted to the client through the second message transmission channel, the method further includes:
if the client needs to be informed whether the operation result is transmitted or not, or if the operation result of the server active high-speed client is transmitted or not, the following method steps can be executed:
all message transmission channels in the current message transmission channel pair are closed.
And informing the client that the transmission of the operation result is finished by closing all the message transmission channels in the message transmission channel pair.
Further optionally, if the communication connection with the client needs to be established again, the method may further include:
and reopening the message transmission channel pair when establishing the communication connection next time;
and each time the message transmission channel pair is opened again, configuring a new name for the message transmission channel in the message transmission channel pair according to the preconfigured message transmission channel naming rule so as to distinguish the new name from the name of the message transmission channel when the message transmission channel pair is opened last time.
In a specific example, the new c2s and the old c2s are named differently, namely c2s _ e and c2s _ o, e stands for even, o stands for odd, and 0 is used as a starting sequence number, and the new c2s and the old c2s are incremented by 1 each time, namely, the new c2s is opened for the first time to be c2s _ e (0), the new c2s is opened for the second time to be c2s _ o (1), the third time to be c2s _ e (2), the fourth time to be c2s _ o (3), and so on.
Different c2s/s2c pairs are opened through the odd-even sequence number, and the boundary perception from the server side to the client side information is achieved.
Further optionally, when it is detected that the client disconnects the communication connection with the server, the names of the message transmission channels in the message transmission channel pairs are reinitialized.
That is, after the client is disconnected, the server resets the starting sequence number 0, and waits for the client to connect again.
In another embodiment of the present application, another message transmission method is further provided, specifically referring to fig. 2, fig. 2 is a schematic flow chart of a message transmission method provided by an embodiment of the present invention, where the method is executed by a client virtual port of a virtual terminal device, and before introducing steps of the method, a preparation operation executed at a client is first described, where the preparation operation includes: creating a thread for the following:
the method comprises the following steps: 2 threads are created, one thread is used for reading in a user command and sending the command to a server side through c2s fifo; and the other is used for reading in the server-side execution result through s2c fifo and displaying the server-side execution result.
In particular, see the following method steps:
Specifically, as described above, the client is an executable file that is independent of the cloud wall and is run to connect to the cloud wall. Therefore, when the first object opens the client virtual port, the cloud wall is already opened, and the cloud wall can be accessed. And after the first object writes the operation instruction, the client sends the operation instruction written by the first object through a first message transmission channel established with the server. The client reads the user commands one by one, and sends the commands to the server through c2s, and the client can be used for realizing prompting, association or completion functions.
Or, in step 220, after the operation result fed back by the server end is monitored in the second message transmission channel, the operation result is read and displayed.
Wherein the first message transmission channel and the second message transmission channel form a message transmission channel pair.
Specifically, after reading the operation instruction, the client uses a batch reading mode, for example, 1024 bytes are read at a time, and the result is displayed (stdout), and the batch reading mode is used to provide work efficiency.
The message transmission method provided by the embodiment of the invention monitors whether an object accesses the cloud wall through the virtual port of the client of the virtual terminal device in real time, and sends the operation instruction written by the first object through the first message transmission channel established with the server after detecting that the first object accesses the cloud wall through the virtual port of the virtual terminal device. Or, after the operation result fed back by the server end is monitored in the second message transmission channel, the operation result is read and displayed. By the method, the user can easily access the cloud wall through the virtual port of the virtual terminal device, and the operation is convenient. The client and the server establish a communication link through the message transmission channel pair, so that a transmission channel which is simple, convenient and efficient and can be used for transmitting a large amount of data is provided.
Based on the foregoing embodiment, further optionally, after detecting that the first object accesses the cloud wall through the virtual port of the virtual end device, the method further includes the following method steps, which are specifically shown in fig. 3.
In step 310, a first markup file corresponding to a first object is obtained.
And step 340, controlling the first object to exit the access, allowing the second object to access the cloud wall, and storing the second identification file in a preset position.
Specifically, in order to simplify the implementation and the problem of multi-user concurrent access, the vty only allows a single user to log in and is implemented by using a pid file. That is, when the user 1 opens vty to access the cloud wall, the pid of vty is written into a specific file, when the user 2 tries to open vty, it is detected that another process pid is accessing, the user 1 is forcibly quitted, a prompt is given at the user 1 terminal, the user 2 process pid is written into the pid file, and finally, the cloud wall is accessed.
The cloud wall management is generally performed by a controller, vty is convenient to debug, and most users are developers, so that the cloud wall management is designed to be in a single-user mode, and the implementation process is simplified.
Further optionally, as described above, since the client does not perform any processing on the user input command, but only performs a relay function, the ctrl + c is used as a method for exiting vty, and a corresponding signal processing function is set.
Further optionally, the method further comprises:
the termios attribute, - (ICANON | ECHO) is set, the former makes the user input in the non-line mode, the latter removes the playback, i.e. the user input is only played back after the server-side processing.
Further optionally, corresponding to the server side, at the client side, the execution process is summarized as follows:
firstly, a fifo pair is opened according to a starting sequence number (the initial value is 0), connection is established with a server terminal, and user input (stdin) is waited. Reading user commands one by one, and sending the commands to a server through c2 s; waiting for the server to respond; read s2c server-side response, 1024 bytes at a time, and display the result (stdout). And continuously waiting for the input of the user, and repeatedly executing the process.
Certainly, if the client needs to acquire result transmission completion information, the read returns to 0 after the reading is completed, because the server closes the current s2c and opens the new s2c, the client does the same action at this time, closes the current s2c/c2s, updates the starting sequence number, opens the new s2c/c2s to establish connection with the server, and repeatedly executes subsequent operations after the connection is established.
When the client disconnects, the termios attribute is restored and the current c2s and s2c are closed.
Fig. 4 illustrates the whole flow blocks of the server-side thread, the client-side thread, and the user input/output, etc., because the above processes are described in detail in the foregoing, they are not described in detail here.
In the above, for several embodiments of the message transmission method provided in the present application, other embodiments of the message transmission provided in the present application are described below, and specifically refer to the following.
Fig. 5 is a schematic structural diagram of a message transmission apparatus according to an embodiment of the present invention, where the apparatus includes: a communication connection module 501, a determination module 502, a processing module 503, an execution module 504, a channel switching module 505, and a transmission module 506.
A communication connection module 501, configured to establish a communication connection between a client and a server through a first message transmission channel;
a determining module 502, configured to wait for an operation instruction transmitted by a client through a first message transmission channel after determining that a communication connection is established between the client and a server through the first message transmission channel;
the processing module 503 is configured to analyze the operation instruction, and obtain an analyzed operation instruction;
an execution module 504, configured to execute the parsed operation instruction;
a channel switching module 505, configured to switch the first message transmission channel to the second message transmission channel when an operation result is generated after the analyzed operation instruction is executed;
and a transmission module 506, configured to transmit the operation result to the client through the second message transmission channel.
Optionally, the processing module 503 is specifically configured to perform a response operation on the preset character, where the response operation includes, but is not limited to, performing a prompt operation, an association operation, or an automatic completion operation on the preset character.
Optionally, the apparatus further comprises: a building module 507;
the constructing module 507 is configured to construct a message transmission channel pair, where the message transmission channel pair includes a first message transmission channel and a second message transmission channel, and the message transmission channels in the message transmission channel pair are first-in-first-out queues.
Optionally, the processing module 503 is further configured to close all message transmission channels in the current message transmission channel pair after the operation result is transmitted to the client through the second message transmission channel, so as to inform the client that the operation result has been transmitted;
and reopening the message transmission channel pair when the communication connection is established next time;
and each time the message transmission channel pair is opened again, configuring a new name for the message transmission channel in the message transmission channel pair according to the preconfigured message transmission channel naming rule so as to distinguish the new name from the name of the message transmission channel when the message transmission channel pair is opened last time.
Optionally, the processing module 503 is further configured to, when it is detected that the client disconnects the communication connection with the server, reinitialize the name of the message transmission channel in the message transmission channel pair.
The functions executed by each component in the message transmission device provided in the embodiment of the present invention have been described in detail in any of the above method embodiments, and therefore, are not described herein again.
According to the message transmission device provided by the embodiment of the invention, the client and the server transmit the message through the message transmission channel, and the message comprises the operation instruction and the operation result generated according to the operation instruction. The information can be acquired at any time through vty of the virtual terminal equipment. The virtual terminal vty is configured with a command analysis environment in advance, wherein the command analysis environment is the same as that of the console, and is used for analyzing the operation command in the environment, completing subsequent configuration and debugging management of the cloud wall according to the analyzed operation command, receiving the cloud wall state or printing information and the like, and therefore the efficiency of solving the problem is improved, and the cloud wall is easier and more reliable to use.
Fig. 6 is a message transmission apparatus according to an embodiment of the present invention, where the apparatus includes: the device comprises a detection module 601, an acquisition module 602, a sending module 603, a monitoring module 604, a reading module 605 and a display module 606.
The detection module 601 is configured to detect whether an object accesses the cloud wall through a virtual port of the virtual terminal device;
an obtaining module 602, configured to obtain an operation instruction written by a first object;
a sending module 603, configured to send, after detecting that the first object accesses the cloud wall through the virtual port of the virtual terminal device, an operation instruction written by the first object through a first message transmission channel established with the server;
a monitoring module 604, configured to monitor an operation result fed back by the server in the second message transmission channel;
a reading module 605, configured to read an operation result after monitoring the operation result fed back by the server end in the second message transmission channel;
a display module 606, configured to display an operation result, where the first message transmission channel and the second message transmission channel form a message transmission channel pair.
Optionally, the apparatus further comprises: a processing module 607;
the obtaining module 602 is further configured to obtain a first identifier file corresponding to the first object;
the processing module 607 is configured to store the first identifier file in a preset location;
the obtaining module 602 is further configured to obtain a second identification file corresponding to the second object when the detecting module 601 detects that the second object accesses the cloud wall through the virtual port of the virtual terminal device again;
the processing module 607 is further configured to control the first object to exit from the access, allow the second object to access the cloud wall, and store the second identification file in a preset location.
Optionally, the reading module 605 is specifically configured to read the operation instruction and/or the operation result in a word-by-word reading manner.
The functions executed by each component in the message transmission apparatus provided in the embodiment of the present invention have been described in detail in any of the above method embodiments, and therefore are not described in detail here.
The message transmission device provided by the embodiment of the invention monitors whether an object accesses the cloud wall through the virtual port of the client of the virtual terminal device in real time, and sends the operation instruction written by the first object through the first message transmission channel established with the server after detecting that the first object accesses the cloud wall through the virtual port of the virtual terminal device. Or, after the operation result fed back by the server end is monitored in the second message transmission channel, the operation result is read and displayed. By the method, the user can easily access the cloud wall through the virtual port of the virtual terminal device, and the operation is convenient. The client and the server establish a communication link through the message transmission channel pair, so that a transmission channel which is simple, convenient and efficient and can be used for transmitting a large amount of data is provided.
As shown in fig. 7, an embodiment of the present application provides an electronic device, where a virtual terminal device is loaded in the electronic device, the virtual terminal device includes a virtual port of a router or a switch for remote login, the virtual port includes a server and a client, and the electronic device includes a processor 111, a communication interface 112, a memory 113, and a communication bus 114, where the processor 111, the communication interface 112, and the memory 113 complete communication with each other through the communication bus 114.
A memory 113 for storing a computer program;
in an embodiment of the present application, when the processor 111 is configured to execute a program stored in the memory 113, the message transmission method provided in any one of the foregoing method embodiments is implemented, including:
after determining that the client establishes communication connection with the server through the first message transmission channel, waiting for an operation instruction transmitted by the client through the first message transmission channel;
analyzing the operation instruction to obtain an analyzed operation instruction;
when an operation result is generated after the analyzed operation instruction is executed, switching the first message transmission channel to the second message transmission channel;
and transmitting the operation result to the client through a second message transmission channel.
Optionally, when the operation instruction includes the preset character, the operation instruction is analyzed, and the analyzed operation instruction is obtained, including:
and performing response operation on the preset character, wherein the response operation comprises but is not limited to prompt operation, association operation or automatic completion operation on the preset character.
Optionally, after determining that the client and the server establish a communication connection through the first message transmission channel, before waiting for an operation instruction transmitted by the client through the first message transmission channel, the method further includes:
and constructing a message transmission channel pair, wherein the message transmission channel pair comprises a first message transmission channel and a second message transmission channel, and the message transmission channels in the message transmission channel pair are first-in first-out queues.
Optionally, after the operation result is transmitted to the client through the second message transmission channel, the method further includes:
closing all message transmission channels in the current message transmission channel pair to inform the client that the operation result is transmitted;
and reopening the message transmission channel pair when the communication connection is established next time;
and each time the message transmission channel pair is opened again, configuring a new name for the message transmission channel in the message transmission channel pair according to the preconfigured message transmission channel naming rule so as to distinguish the new name from the name of the message transmission channel when the message transmission channel pair is opened last time.
Optionally, when it is detected that the client disconnects communication with the server, the name of the message transmission channel in the message transmission channel pair is reinitialized.
Alternatively, it comprises: when detecting that a first object accesses the cloud wall through a virtual port of the virtual terminal device, sending an operation instruction written by the first object through a first message transmission channel established with a server;
or after the second message transmission channel monitors the operation result fed back by the server, the operation result is read and displayed, wherein the first message transmission channel and the second message transmission channel form a message transmission channel pair.
Optionally, after it is detected that the first object accesses the cloud wall through the virtual port of the virtual terminal device, the method further includes:
acquiring a first identification file corresponding to a first object;
storing the first identification file in a preset position;
when it is detected that the second object accesses the cloud wall through the virtual port of the virtual terminal device again, a second identification file corresponding to the second object is obtained;
and controlling the first object to exit the access, allowing the second object to access the cloud wall, and storing the second identification file in a preset position.
Optionally, the client reads the operation instruction and/or the operation result in a word-by-word reading manner.
The present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the message transmission method provided in any one of the foregoing method embodiments.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
1. A message transmission method, wherein the method is executed by a server-side virtual port of a virtual terminal device, and the method comprises:
after determining that a client establishes communication connection with a server through a first message transmission channel, waiting for an operation instruction transmitted by the client through the first message transmission channel;
analyzing the operation instruction to obtain an analyzed operation instruction;
when an operation result is generated after the analyzed operation instruction is executed, switching the first message transmission channel to a second message transmission channel;
and transmitting the operation result to the client through a second message transmission channel.
2. The method according to claim 1, wherein when the operation instruction includes a preset character, the analyzing the operation instruction to obtain the analyzed operation instruction comprises:
and performing response operation on the preset character, wherein the response operation comprises but is not limited to performing prompt operation, association operation or automatic completion operation on the preset character.
3. The method according to claim 1 or 2, wherein after determining that the client and the server establish the communication connection through the first message transmission channel, before waiting for the operation instruction transmitted by the client through the first message transmission channel, the method further comprises:
and constructing a message transmission channel pair, wherein the message transmission channel pair comprises the first message transmission channel and the second message transmission channel, and the message transmission channels in the message transmission channel pair are first-in first-out queues.
4. The method of claim 3, wherein after transmitting the operation result to the client through a second message transmission channel, the method further comprises:
closing all message transmission channels in the current message transmission channel pair to inform the client that the operation result is transmitted;
and reopening the message transmission channel pair when establishing communication connection next time;
and each time the message transmission channel pair is reopened, configuring a new name for the message transmission channel in the message transmission channel pair according to a preconfigured message transmission channel naming rule so as to distinguish the new name from the name of the message transmission channel when the message transmission channel pair was reopened.
5. The method according to claim 4, wherein the name of the message transmission channel in the message transmission channel pair is reinitialized when it is detected that the client disconnects the communication connection with the server.
6. A message transmission method, characterized in that the method is performed by a client virtual port of a virtual terminal device, the method comprising:
when detecting that a first object accesses a cloud wall through a virtual port of virtual terminal equipment, sending an operation instruction written by the first object through a first message transmission channel established with a server;
or after monitoring an operation result fed back by the server side in a second message transmission channel, reading and displaying the operation result, wherein the first message transmission channel and the second message transmission channel form a message transmission channel pair.
7. The method of claim 6, wherein after detecting that the first object accesses the cloud wall through the virtual port of the virtual end device, the method further comprises:
acquiring a first identification file corresponding to the first object;
storing the first identification file in a preset position;
when it is detected again that a second object accesses the cloud wall through the virtual port of the virtual terminal device, a second identification file corresponding to the second object is obtained;
and controlling the first object to exit the access, allowing the second object to access the cloud wall, and storing the second identification file in the preset position.
8. The method according to claim 6 or 7, wherein the client reads the operation instruction and/or the operation result by reading word by word.
9. An electronic device is characterized in that a virtual terminal device is loaded in the electronic device, the virtual terminal device comprises a virtual port of a router or a remote login of a switch, the virtual port comprises a server end and a client end, the electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
a processor for implementing the steps of the message transmission method according to any one of claims 1 to 5 when executing the program stored in the memory;
or implementing the steps of the message transmission method according to any of claims 6-8.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the message transmission method according to any one of claims 1 to 5;
or implementing the steps of the message transmission method according to any of claims 6-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210913658.6A CN115484300B (en) | 2022-07-29 | 2022-07-29 | Message transmission method, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210913658.6A CN115484300B (en) | 2022-07-29 | 2022-07-29 | Message transmission method, electronic device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115484300A true CN115484300A (en) | 2022-12-16 |
CN115484300B CN115484300B (en) | 2024-08-02 |
Family
ID=84420928
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210913658.6A Active CN115484300B (en) | 2022-07-29 | 2022-07-29 | Message transmission method, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115484300B (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102868728A (en) * | 2012-08-23 | 2013-01-09 | 福建升腾资讯有限公司 | Network proxy method based on virtual channel in virtual desktop infrastructure (VDI) environment |
US20130117521A1 (en) * | 2011-11-04 | 2013-05-09 | Sheng Li | Managing Chip Multi-Processors Through Virtual Domains |
CN105471907A (en) * | 2015-12-31 | 2016-04-06 | 云南大学 | Openflow based virtual firewall transmission control method and system |
CN110365697A (en) * | 2019-07-26 | 2019-10-22 | 新华三大数据技术有限公司 | A kind of virtual firewall setting method, device, electronic equipment and storage medium |
EP3675432A1 (en) * | 2018-12-26 | 2020-07-01 | Citrix Systems Inc. | Intelligent and dynamic overlay tunnel formation via automatic discovery of citrivity/sdwan peer in the datapath in a pure plug and play environment with zero networking configuration |
CN111711536A (en) * | 2020-06-05 | 2020-09-25 | 北京计算机技术及应用研究所 | Method for constructing firewall test environment under cloud architecture |
CN113014571A (en) * | 2021-02-22 | 2021-06-22 | 腾讯科技(深圳)有限公司 | Method, device and storage medium for processing access request |
CN113810381A (en) * | 2021-08-23 | 2021-12-17 | 杭州安恒信息技术股份有限公司 | Crawler detection method, web application cloud firewall, device and storage medium |
CN114095280A (en) * | 2022-01-20 | 2022-02-25 | 苏州浪潮智能科技有限公司 | Cloud platform server communication channel construction method, communication method, device and server |
CN114489594A (en) * | 2021-12-27 | 2022-05-13 | 天翼云科技有限公司 | Method for constructing command parser, method and device for processing command parsing |
-
2022
- 2022-07-29 CN CN202210913658.6A patent/CN115484300B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130117521A1 (en) * | 2011-11-04 | 2013-05-09 | Sheng Li | Managing Chip Multi-Processors Through Virtual Domains |
CN102868728A (en) * | 2012-08-23 | 2013-01-09 | 福建升腾资讯有限公司 | Network proxy method based on virtual channel in virtual desktop infrastructure (VDI) environment |
CN105471907A (en) * | 2015-12-31 | 2016-04-06 | 云南大学 | Openflow based virtual firewall transmission control method and system |
EP3675432A1 (en) * | 2018-12-26 | 2020-07-01 | Citrix Systems Inc. | Intelligent and dynamic overlay tunnel formation via automatic discovery of citrivity/sdwan peer in the datapath in a pure plug and play environment with zero networking configuration |
CN110365697A (en) * | 2019-07-26 | 2019-10-22 | 新华三大数据技术有限公司 | A kind of virtual firewall setting method, device, electronic equipment and storage medium |
CN111711536A (en) * | 2020-06-05 | 2020-09-25 | 北京计算机技术及应用研究所 | Method for constructing firewall test environment under cloud architecture |
CN113014571A (en) * | 2021-02-22 | 2021-06-22 | 腾讯科技(深圳)有限公司 | Method, device and storage medium for processing access request |
CN113810381A (en) * | 2021-08-23 | 2021-12-17 | 杭州安恒信息技术股份有限公司 | Crawler detection method, web application cloud firewall, device and storage medium |
CN114489594A (en) * | 2021-12-27 | 2022-05-13 | 天翼云科技有限公司 | Method for constructing command parser, method and device for processing command parsing |
CN114095280A (en) * | 2022-01-20 | 2022-02-25 | 苏州浪潮智能科技有限公司 | Cloud platform server communication channel construction method, communication method, device and server |
Non-Patent Citations (6)
Title |
---|
FOUAD AMINE GUENANE: "Autonomous architecture for managing firewalling Cloud-based service", IEEE, 11 June 2015 (2015-06-11) * |
JACKY, CHOW;MARYSA, NOTARO;ADITI, PRABHAKAR;STEPHEN J, FREE;PAUL J, CULLEN: "Impact of Fungal MAPK Pathway Targets on the Cell Wall.", vol. 4, no. 3, 31 December 2018 (2018-12-31) * |
王伟;王进;刘易;: "基于物联网技术的医用气体供应监视系统", 物联网技术, no. 07, 20 July 2016 (2016-07-20) * |
王月红;: "数据中心虚拟化环境的安全挑战", 信息安全与通信保密, no. 08, 10 August 2013 (2013-08-10) * |
郭建伟: "使用云防火墙实现安全访问", 网络安全和信息化, 5 February 2019 (2019-02-05) * |
魏金太;高穹: "面向云服务的混合防火墙技术研究", 湖北民族学院学报(自然科学版), 31 May 2018 (2018-05-31) * |
Also Published As
Publication number | Publication date |
---|---|
CN115484300B (en) | 2024-08-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6119247A (en) | Remote debugging of internet applications | |
US9836723B2 (en) | Exchanging messages during a chat session | |
CN112492442A (en) | Connection switching method, device, equipment and storage medium of Bluetooth headset | |
CN111475417A (en) | Automatic testing method, device, equipment and storage medium | |
WO2010001871A1 (en) | Application extension system, extension method, extension program | |
CN111866160B (en) | Multi-machine control method, device, equipment and storage medium | |
JPH0644239B2 (en) | Computer test apparatus and method | |
CN101460925A (en) | Method and apparatus for processing remote shell commands | |
CN112437047A (en) | Remote server management method, system and related device | |
CN110806965A (en) | Automatic test method, device, equipment and medium | |
JPH11195062A (en) | Remote supporting system and its device | |
CN103513858A (en) | Remote assistance method and device | |
CN107769952B (en) | Remote management system and method thereof | |
US20160292245A1 (en) | Method and Device for Implementing Matching Between Acquisition System and Analysis System | |
CN115484300A (en) | Message transmission method, electronic device and storage medium | |
JP4293169B2 (en) | Network equipment control system | |
CN113923146B (en) | Visual block chain consensus algorithm performance test method | |
TWI537743B (en) | Remote management method and the apparatus thereof | |
CN112671814B (en) | Cross-platform equipment development method, device and system | |
CN114615223B (en) | Examination unmanned monitoring instant messaging method, examination unmanned monitoring instant messaging equipment, examination unmanned monitoring instant messaging system and storage medium | |
CN107391354B (en) | Method and system for automatically monitoring terminal performance and storage device | |
WO2016206587A1 (en) | Shell processing method and device | |
CN114281563A (en) | Application program reconstruction method and device | |
CN112437161A (en) | Network agent control method, device and computer readable storage medium | |
JP3662492B2 (en) | Remote operation system, apparatus and recording medium |
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 |