Disclosure of Invention
The invention aims to provide a remote web management system and a remote web management method, wherein the remote web management system and the remote web management method are characterized in that a terminal device is communicated with an embedded device, the terminal device sends a first http request message with command line request data to the embedded device, the embedded device processes the command line request data in the first http request message, and returns a processing result to the terminal device through a second http request message in a command line data form. The user can input command line data through a web browser of the terminal equipment, and the command line login management of the embedded equipment is realized. The problem that in the prior art, the terminal equipment needs to manage the embedded equipment through the remote web by developing a whole set of web service system is avoided; the invention can reduce the development cost and realize the remote web management method at low cost.
In order to achieve the purpose, the invention is realized by the following technical scheme:
the invention provides a remote web management method, which is characterized by comprising the following steps:
s1, the user initiates an http request to the embedded device through the terminal device;
s2, the web process processing module of the embedded device controls the web process therein, the console process processing module controls the console process therein to receive and process the http request respectively;
and S3, the embedded device sends the processed http request to the terminal device.
Preferably, the step S1 includes the following steps:
a user inputs an IP address and command line request data of the embedded equipment through a web browser of the terminal equipment;
and the terminal equipment encapsulates the IP address and the command line request data into a first http request message and sends the first http request message to the embedded equipment.
Preferably, the step S2 includes the following steps:
s2.1, the web process processing module controls a web process in the web process processing module to receive and process the first http request message, and sends processed command line request data to the console process processing module;
s2.2, the console process processing module controls the console process in the console process processing module to receive and process command line request data sent by the web process processing module, and sends request result data to the web process processing module.
Preferably, said step S2.1 comprises the steps of:
the web process processing module receives a first http request message;
and the web process processing module controls a web process in the web process processing module to analyze the first http request message, acquires command line request data in the first http request message, and sends the command line request data to the console process processing module.
Preferably, said step S2.2 comprises the steps of:
and the console process processing module controls the console process to process the command in the command line request data and sends the processing result as command line request result data to the web process processing module.
Preferably, the step S3 includes the following steps:
the web process processing module acquires command line request result data, takes the command line request result data as command line request data, and encapsulates the command line request result data and other information in the first http request message to form a second http request message;
and the embedded equipment sends the second http request message to the terminal equipment, so that the command line request result of the first http request message is displayed to the terminal equipment.
Preferably, the step S1 further includes the following steps:
and when the terminal equipment communicates with the embedded equipment for the first time, the user only encapsulates the IP address of the embedded equipment into a first http request message.
Preferably, the step S2 further includes the following steps:
when the web process of the web process processing module receives and processes the first http request message of the terminal equipment and when the first http request message is analyzed to have no command line request data, the terminal equipment is judged to be communicated with the embedded equipment for the first time;
the web process processing module takes the sent first communication character as command line request data to the console process processing module;
the console process processing module receives the command line request data, checks the content of the command line request data as a first communication character, and returns information with a command line login webpage as command line request result data to the web process processing module.
Preferably, the step S3 further includes the following steps:
the web process processing module acquires command line request result data, takes information with a command line login webpage as command line request data, and encapsulates the command line request data and other information in the first http request message to form a second http request message;
and the embedded equipment sends the second http request message to the terminal equipment, so that a login webpage with a command line is displayed to the terminal equipment.
The invention also provides a remote web management system, which is characterized by comprising the following components:
a terminal device;
the embedded equipment is communicated with the terminal equipment;
the embedded device is internally provided with a web process processing module and a console process processing module which are connected in sequence; and the terminal equipment is communicated with the web process processing module.
Compared with the prior art, the invention has the following advantages:
the remote web management system and the management method provided by the invention can enable a user to input command line data through a web browser of the terminal equipment, thereby realizing the command line login management of the embedded equipment. The problem that in the prior art, the terminal equipment needs to manage the embedded equipment through the remote web by developing a whole set of web service system is avoided; the invention can reduce the development cost and efficiently realize the remote web management method.
Detailed Description
The present invention will now be further described by way of the following detailed description of a preferred embodiment thereof, taken in conjunction with the accompanying drawings.
A remote web management system, the system comprising: a terminal device; the embedded equipment is communicated with the terminal equipment;
the embedded device is internally provided with a web process processing module and a console process processing module which are connected in sequence; the terminal device communicates with the web process processing module.
In the invention, the terminal equipment can adopt a mobile terminal, such as a mobile phone, a tablet personal computer and the like, and can also adopt a desktop computer. The embedded device may employ a router or a switch.
As shown in fig. 1, one embodiment of a remote web management method of the present invention is as follows:
and S1, the user initiates an http request to the embedded device through the terminal device. The step S1 includes the following steps:
the user inputs the IP address and the command line request data of the embedded device through the web browser of the terminal device.
And the terminal equipment encapsulates the IP address and the command line request data into a first http request message and sends the first http request message to the embedded equipment.
In this embodiment, the first http request packet includes: a request line, a request header, and request data; and the user inputs the command line request data into the request data of the first http request message through the web browser of the terminal equipment.
The command line request data in this embodiment includes: and setting command line data of the embedded equipment by the terminal equipment according to actual user requirements, such as port security setting, port mode setting, loop detection setting and the like.
The port security can be set to single user or multi-user, the port mode can be set to Access or Trunk, and the loop detection can be set to be on or off. In this embodiment, the user sets the port security to a single user, the port mode to Access, and the loop detection to off.
In actual use, the setting information of the terminal device is not limited to the above port security setting, port mode setting, and loop detection setting, but may also include other setting information.
S2, the web process processing module of the embedded device controls its internal web process, and the console process processing module controls its internal console process to receive and process the http request. The step S2 includes the following steps:
s2.1, the web process processing module controls a web process in the web process processing module to receive and process the first http request message, and sends processed command line request data to the console process processing module; this step S2.1 comprises the following steps:
a web process of the embedded equipment receives a first http request message;
and the web process processing module controls a web process in the web process processing module to analyze the first http request message, acquires command line request data in the first http request message, and sends the command line request data to the console process processing module.
In this embodiment, the web process extracts command line request data including port security setting, port mode setting, and loop detection setting in the first http request packet, and sends the data including the setting-required information to the console process.
S2.2, the console process processing module controls the console process in the console process processing module to receive and process the command line request data sent by the web process processing module, and sends the request result data to the web process processing module. This step S2.2 comprises the following steps:
and the console process processing module controls the console process to process the command in the command line request data and sends the processing result as command line request result data to the web process processing module.
In this embodiment, when the port security required by the terminal device is set to be a single user, the port mode is set to be Access, and the loop detection is set to be closed, the console process performs processing according to the setting requirement of the terminal device. When the console process can realize that the port security in the first http request message is set as a single user, the port mode is set as Access, and the loop detection cannot be realized and the loop detection is set as closed, the request result data of the returned command line is as follows: the information of successful port security setting, successful port mode setting and failed loop detection setting.
And S3, the embedded device sends the processed http request to the terminal device. The step S3 includes the following steps:
and the web process processing module acquires the command line request result data, takes the command line request result data as command line request data, and encapsulates the command line request result data and the rest information in the first http request message to form a second http request message.
And the embedded equipment sends the second http request message to the terminal equipment, so that the command line request result of the first http request message is displayed to the terminal equipment.
In this embodiment, the information of "successful port security setting, successful port mode setting, and failed loop detection setting" processed by the console process is used as the command line request data, and is encapsulated with the IP address and other information of the embedded device included in the first http request message to form the second http request message.
And sending the second http request message to the terminal device, and displaying that the port security setting is successful, the port mode setting is successful, and the loop detection setting is failed in a web browser of the terminal device.
The second embodiment of the remote web management method of the present invention is as follows:
when the terminal equipment communicates with the embedded equipment for the first time, the user only encapsulates the IP address of the embedded equipment into a first http request message.
And when the web process of the web process processing module receives and processes the first http request message of the terminal equipment and analyzes that no command line request data exists in the first http request message, judging that the terminal equipment is communicated with the embedded equipment for the first time.
And the web process processing module sends the first communication character as command line request data to the console process processing module.
In this embodiment, the web process processing module controls the web process to send a carriage return character as a first communication character to the console process module.
The console process receives the command line request data, and returns information with a command line login webpage as command line request result data to the web process when the content of the command line request data is checked to be the first communication character.
In this embodiment, when the command line request data is checked to be the enter character by the console process, the information command line request result data with the command line login webpage is sent to the web process.
And the web process processing module acquires the command line request result data, takes the information with the command line login webpage as the command line request data, and encapsulates the command line request data and the rest information in the first http request message to form a second http request message.
And the embedded equipment sends the second http request message to the terminal equipment, so that a login webpage with a command line is displayed to the terminal equipment.
In this embodiment, when the terminal device logs in the embedded device for the first time and communicates with the embedded device, the embedded device returns the web login page to the web browser of the terminal device, so that the user can input the setting information into the web login page according to specific needs to perform subsequent communication with the embedded device.
While the present invention has been described in detail with reference to the preferred embodiments, it should be understood that the above description should not be taken as limiting the invention. Various modifications and alterations to this invention will become apparent to those skilled in the art upon reading the foregoing description. Accordingly, the scope of the invention should be determined from the following claims.