CN113794772B - Method and system for remotely accessing built-in page of terminal equipment - Google Patents
Method and system for remotely accessing built-in page of terminal equipment Download PDFInfo
- Publication number
- CN113794772B CN113794772B CN202111080845.2A CN202111080845A CN113794772B CN 113794772 B CN113794772 B CN 113794772B CN 202111080845 A CN202111080845 A CN 202111080845A CN 113794772 B CN113794772 B CN 113794772B
- Authority
- CN
- China
- Prior art keywords
- terminal equipment
- request
- page
- browser
- built
- 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 31
- 238000012544 monitoring process Methods 0.000 claims description 28
- 238000004891 communication Methods 0.000 claims description 20
- 238000012545 processing Methods 0.000 claims description 10
- 230000007547 defect Effects 0.000 description 3
- 238000004806 packaging method and process Methods 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
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/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
-
- 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/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- 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
-
- 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/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
-
- 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/163—In-band adaptation of TCP data exchange; In-band control procedures
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Medical Informatics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention provides a method and a system for remotely accessing a built-in page of terminal equipment.A TCP server receives an HTTP request sent by a browser; the TCP server judges the terminal equipment according to the obtained domain name, adds a message ID to the received request data and then sends the message ID to a long connection channel of the corresponding terminal equipment; the TCP server receives built-in page data transmitted from the terminal equipment through the long connection channel, finds out corresponding browser connection according to the equipment identification code and the message ID after judging that the terminal equipment is correct, and sends the page data to the browser; the invention realizes remote and rapid access to the built-in page of the terminal equipment, and solves the problem of inconvenient parameter configuration of the terminal equipment of the Internet of things in a remote and severe environment.
Description
Technical Field
The disclosure relates to the technical field of communication control, in particular to a method and a system for remotely accessing a built-in page of terminal equipment.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
In order to facilitate parameter configuration of terminal equipment of the internet of things such as a serial port server, PLCNET cloud gateways, RTU (Remote Terminal Unit, remote measurement and control terminal), DTU (DATA TRANSFER unit, data transmission terminal) and the like, most of the terminal equipment can integrate built-in pages, and the user can conveniently configure the parameters of the terminal equipment due to the built-in pages. But these terminal equipment built-in pages can only be accessed in the local area network at present, i.e. the IP of the user's configuration equipment (such as a computer, etc.) and the IP of the terminal equipment must be in the same network segment. Because the default IP of the terminal device when leaving the factory is not necessarily in the same network segment with the IP of the user, the client cannot directly access the built-in page of the terminal device to perform parameter configuration, so that the client is very inconvenient to configure the terminal device. In addition, the local area network has a distance limitation, and if the distance between the user and the terminal equipment is long or the use environment of the terminal equipment is bad, the configuration of the parameters of the terminal equipment is very inconvenient.
There are two methods that are currently more commonly used to solve the problem of cross-segment configuration: the first method is realized by broadcasting configuration instructions in a UDP broadcast mode, the configuration is completed after equipment in a local area network receives the broadcast instructions, a state information cross-network section transmission method (publication number CN 107682165A) and a cross-network section equipment searching and communication method (publication number CN 107888711A) patent application in an electric power automation system are both realized by adopting the method, and the method has the defects that broadcast storm is caused under the condition that the configuration instructions are relatively large, the network environment is influenced, the dependence on configuration software is not flexible enough, and the UDP is easy to lose packets to cause high configuration failure rate. Secondly, IP configuration instructions are broadcast through UDP, different network segment equipment IPs in the same local area network are modified into the same network segment, then equipment is configured through TCP or HTTP, and the configuration method is adopted by a quick search connection method (publication number CN 104796484A) and a network IP address automatic allocation method (publication number CN 106506720A) based on a display screen control system, but the method has the defect that the target equipment IP needs to be temporarily changed, and the normal network function of the target equipment can be influenced in the configuration process.
Disclosure of Invention
In order to solve the defects of the prior art, the present disclosure provides a method and a system for remotely accessing a built-in page of terminal equipment, breaks through the limitation of a local area network, realizes remote and rapid access of the built-in page of the terminal equipment, and solves the problem of inconvenient parameter configuration of the terminal equipment of the Internet of things in a long-distance and severe environment.
In order to achieve the above purpose, the present disclosure adopts the following technical scheme:
The first aspect of the present disclosure provides a method for remotely accessing a built-in page of a terminal device.
A method for remotely accessing a built-in page of terminal equipment is applied to a TCP server and comprises the following steps:
The TCP server receives an HTTP request sent by a browser;
The TCP server analyzes the HTTP request, acquires the domain name of the terminal equipment, judges the terminal equipment according to the domain name, adds a message ID to the received request data and then sends the message ID to a long connecting channel of the corresponding terminal equipment;
the TCP server receives built-in page data transmitted from the terminal equipment through the long connection channel, finds out corresponding browser connection according to the equipment identification code and the message ID after judging that the terminal equipment is correct, and sends the page data to the browser.
Further, the TCP server is further configured to: and monitoring a request for opening the built-in page sent by the browser, analyzing the request content of the browser after receiving the request, and sending the service address and the port to the corresponding terminal equipment so that the terminal equipment and the service establish a TCP channel and carry out data communication through a specified protocol.
Still further, the TCP server is further configured to:
Monitoring and opening a built-in page request of a designated device through an MQTT (Message Queuing Telemetry Transport, message queue telemetry transport), and forwarding the request to a terminal device through the MQTT, wherein the request comprises an IP (Internet protocol) and a port of a TCP server;
receiving a long connection request generated by the terminal equipment according to the IP address and the port, so that a TCP server and the terminal equipment establish long connection;
And generating a domain name according to the identification code of the terminal equipment, establishing a corresponding relation between the domain name and the long connection channel, and sending the domain name to the browser through the MQTT so that the browser opens the page by using the new domain name address.
A second aspect of the present disclosure provides a TCP server.
A TCP server comprising a processing module;
the processing module is configured to:
receiving an HTTP request sent by a browser;
Resolving the HTTP request, obtaining the domain name of the terminal equipment, judging the terminal equipment according to the domain name, adding a message ID to the received request data, and then sending the request data to a long connection channel of the corresponding terminal equipment;
and receiving built-in page data transmitted from the terminal equipment through the long connection channel, finding out corresponding browser connection according to the equipment identification code and the message ID after judging that the terminal equipment is correct, and sending the page data to the browser.
Further, the processing module is further configured to: and monitoring a request for opening the built-in page sent by the browser, analyzing the request content of the browser after receiving the request, and sending the service address and the port to the corresponding terminal equipment so that the terminal equipment and the service establish a TCP channel and carry out data communication through a specified protocol.
Still further, the processing module is further configured to:
Monitoring and opening a built-in page request of the designated equipment through the MQTT, forwarding the request to the terminal equipment through the MQTT, and packaging the IP and the port of the TCP server;
receiving a long connection request generated by the terminal equipment according to the IP address and the port, so that a TCP server and the terminal equipment establish long connection;
And generating a domain name according to the identification code of the terminal equipment, establishing a corresponding relation between the domain name and the long connection channel, and sending the domain name to the browser through the MQTT so that the browser opens the page by using the new domain name address.
A third aspect of the present disclosure provides a remote opening method of a built-in page of a terminal device.
A method for remotely accessing a built-in page of a terminal device comprises the following steps:
The TCP server receives an HTTP request sent by a browser;
The TCP server analyzes the HTTP request, acquires the domain name of the terminal equipment, judges the terminal equipment according to the domain name, adds a message ID to the received request data and then sends the message ID to a long connecting channel of the corresponding terminal equipment;
after receiving the data content of the long connection channel, the TCP client in the terminal equipment removes the message ID and sends the data to the built-in page WEB server of the terminal equipment;
The built-in page WEB server replies built-in page data, adds a message ID and forwards the message ID to the TCP server through the TCP client;
the TCP server receives built-in page data transmitted from the terminal equipment through the long connection channel, finds out corresponding browser connection according to the equipment identification code and the message ID after judging that the terminal equipment is correct, and sends the page data to the browser.
Further, the TCP client monitors the MQTT message, after receiving the request, sends a long connection registration packet request to the TCP server according to the IP address and the port in the request, and after successful registration, the long connection channel data is acquired.
Further, the TCP server is configured to:
Monitoring and opening a built-in page request of the designated equipment through the MQTT, forwarding the request to the terminal equipment through the MQTT, and packaging the IP and the port of the TCP server;
receiving a long connection request generated by the terminal equipment according to the IP address and the port, so that a TCP server and the terminal equipment establish long connection;
And generating a domain name according to the identification code of the terminal equipment, establishing a corresponding relation between the domain name and the long connection channel, and sending the domain name to the browser through the MQTT so that the browser opens the page by using the new domain name address.
Further, the TCP client is configured to:
and monitoring whether the connection of the message sent to the built-in page WEB server is disconnected, and sending a disconnection request to the TCP server when the connection is disconnected, so that the TCP server disconnects the browser request.
A fourth aspect of the present disclosure provides a system for remotely accessing a built-in page of a terminal device.
A system for remotely accessing a built-in page of terminal equipment comprises a TCP server and a TCP client, wherein the TCP client is arranged in the terminal equipment, the TCP server is in communication connection with a browser, the TCP server is in communication connection with the TCP client, and the TCP client is in communication connection with a built-in page WEB server;
The TCP server receives an HTTP request sent by a browser;
The TCP server analyzes the HTTP request, acquires the domain name of the terminal equipment, judges the terminal equipment according to the domain name, adds a message ID to the received request data and then sends the message ID to a long connecting channel of the corresponding terminal equipment;
after receiving the data content of the long connection channel, the TCP client in the terminal equipment removes the message ID and sends the data to the built-in page WEB server of the terminal equipment;
The built-in page WEB server replies built-in page data, adds a message ID and forwards the message ID to the TCP server through the TCP client;
the TCP server receives built-in page data transmitted from the terminal equipment through the long connection channel, finds out corresponding browser connection according to the equipment identification code and the message ID after judging that the terminal equipment is correct, and sends the page data to the browser.
Further, the TCP client monitors the MQTT message, after receiving the request, sends a long connection registration packet request to the TCP server according to the IP address and the port in the request, and after successful registration, the long connection channel data is acquired.
Further, the TCP server is configured to:
Monitoring and opening a built-in page request of the designated equipment through the MQTT, forwarding the request to the terminal equipment through the MQTT, and packaging the IP and the port of the TCP server;
receiving a long connection request generated by the terminal equipment according to the IP address and the port, so that a TCP server and the terminal equipment establish long connection;
And generating a domain name according to the identification code of the terminal equipment, establishing a corresponding relation between the domain name and the long connection channel, and sending the domain name to the browser through the MQTT so that the browser opens the page by using the new domain name address.
Further, the TCP client is configured to:
and monitoring whether the connection of the message sent to the built-in page WEB server is disconnected, and sending a disconnection request to the TCP server when the connection is disconnected, so that the TCP server disconnects the browser request.
Compared with the prior art, the beneficial effects of the present disclosure are:
1. The method and the system for remotely accessing the built-in page of the terminal equipment break through the local area network limitation of the built-in page of the terminal equipment, realize remote quick access of the built-in page of the terminal equipment, and solve the problem of inconvenient parameter configuration of the terminal equipment of the Internet of things in a long-distance and severe environment.
2. According to the method and the system for remotely accessing the built-in page of the terminal equipment, the terminal equipment corresponds to the browser, the TCP long connection channel page data transfer working mode is established, and the access efficiency of the built-in page of the terminal equipment is greatly improved.
Additional aspects of the disclosure will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the disclosure.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure, illustrate and explain the exemplary embodiments of the disclosure and together with the description serve to explain the disclosure, and do not constitute an undue limitation on the disclosure.
Fig. 1 is a schematic flow chart of an interaction method for establishing a channel according to embodiment 1 of the present disclosure.
Fig. 2 is a schematic flow chart of a channel data transfer operation mode provided in embodiment 1 of the present disclosure.
Detailed Description
The disclosure is further described below with reference to the drawings and examples.
It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the present disclosure. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments in accordance with the present disclosure. As used herein, the singular is also intended to include the plural unless the context clearly indicates otherwise, and furthermore, it is to be understood that the terms "comprises" and/or "comprising" when used in this specification are taken to specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof.
Embodiments of the present disclosure and features of embodiments may be combined with each other without conflict.
Example 1:
As shown in fig. 1 and 2, embodiment 1 of the present disclosure provides a method for remotely accessing a built-in page of a terminal device, including the following two contents:
s1: TCP server:
Monitoring a request of opening a built-in page by a user, analyzing the request content of a browser after receiving the request, transmitting the service address and the port to corresponding terminal equipment, establishing a TCP channel between the terminal equipment and the service, and carrying out data communication through a designated protocol.
S1.1: monitoring a built-in page request of a designated device which a user wants to open through an MQTT, and forwarding the request to terminal equipment through the MQTT, wherein the request comprises an IP and a port of a TCP server;
s1.2: after receiving the request, the terminal equipment sends a long connection request to a TCP server according to an IP address and a port in the request;
S1.3: after the TCP server establishes a long connection with the terminal equipment, generating a three-level domain name according to a terminal equipment identification code (SN), making a corresponding relation between the three-level domain name and the long connection, and sending the domain name to a browser through an MQTT;
S1.4: the browser receives the domain name address, directly opens the page with the new address (the new address corresponds to a service in the TCP server), the TCP server receives the HTTP request sent by the browser, judges which device the browser belongs to according to the domain name, adds a message ID on the data, and sends the data to a long connection channel of the appointed terminal device;
s1.5: the TCP server receives the data reply from the long connection of the terminal equipment, judges the terminal equipment to which the data reply belongs, finds the corresponding browser connection according to the equipment identification code and the message ID, and sends the data to the browser.
S2: TCP client
The module needs to be embedded into the terminal equipment, monitors the MQTT information from the server, and sends a registration channel command to the server after receiving a request for opening the built-in page. After the channel is established successfully, the received data from the server is directly transferred to the internal built-in page WEB server, and any data replied by the internal built-in page WEB server is also sent to the server through the channel
S2.1: monitoring MQTT information, after receiving a request, sending a long connection registration packet request to a TCP server according to an IP address and a port in the request
S2.2: after the registration is successful, the data content of the long connection channel is received, the message ID is removed, and the data is directly sent to a WEB server in the terminal equipment.
S2.3: the terminal equipment WEB server replies the message, adds the ID of the sending message and sends the message to the TCP server.
S2.4: and monitoring whether the connection of the message sent to the WEB server is disconnected, and sending a disconnection request to the TCP server when the connection is disconnected, so that the TCP server disconnects the browser request.
The method of the embodiment can be used for terminal communication equipment with built-in pages and supporting the protocol, and comprises a serial server, an RTU, a DTU, a cloud gateway and the like.
Example 2:
The embodiment 2 of the disclosure provides a system for remotely accessing a built-in page of terminal equipment, which comprises a TCP server, a TCP client and a browser, wherein the TCP server is arranged in the terminal equipment and is in communication connection with the browser, the TCP server is in communication connection with the TCP client, and the TCP client is in communication connection with a built-in page WEB server;
The TCP server receives an HTTP request sent by a browser, and the request content at least comprises a domain name generated according to an identification code of terminal equipment;
The TCP server analyzes the HTTP request, acquires the domain name of the terminal equipment, judges the terminal equipment according to the domain name, adds a message ID to the received request data and then sends the message ID to a long connecting channel of the corresponding terminal equipment;
after receiving the data content of the long connection channel, the TCP client in the terminal equipment removes the message ID and sends the data to the built-in page WEB server of the terminal equipment;
The built-in page WEB server replies built-in page data, adds a message ID and forwards the message ID to the TCP server through the TCP client;
the TCP server receives built-in page data transmitted from the terminal equipment through the long connection channel, finds out corresponding browser connection according to the equipment identification code and the message ID after judging that the terminal equipment is correct, and sends the page data to the browser.
A TCP server configured to:
Monitoring a request of opening a built-in page by a user, analyzing the request content of a browser after receiving the request, transmitting the service address and the port to corresponding terminal equipment, establishing a TCP channel between the terminal equipment and the service, and carrying out data communication through a designated protocol.
S1.1: monitoring a built-in page request of a designated device which a user wants to open through an MQTT, and forwarding the request to terminal equipment through the MQTT, wherein the request comprises an IP and a port of a TCP server;
s1.2: after receiving the request, the terminal equipment sends a long connection request to a TCP server according to an IP address and a port in the request;
s1.3: after the TCP server establishes long connection with the terminal equipment, generating a three-level domain name according to the terminal equipment identification code, making a corresponding relation between the three-level domain name and the long connection, and sending the domain name to the browser through the MQTT;
S1.4: the browser receives the domain name address, directly opens the page with the new address (the new address corresponds to a service in the TCP server), the TCP server receives the HTTP request sent by the browser, judges which device the browser belongs to according to the domain name, adds a message ID on the data, and sends the data to a long connection channel of the appointed terminal device;
s1.5: the TCP server receives the data reply from the long connection of the terminal equipment, judges the terminal equipment to which the data reply belongs, finds the corresponding browser connection according to the equipment identification code and the message ID, and sends the data to the browser.
A TCP client configured to:
the module needs to be embedded into the terminal equipment, monitors the MQTT information from the server, and sends a registration channel command to the server after receiving a request for opening the built-in page. After the channel is established successfully, the received data from the server is directly transferred to the internal built-in page WEB server, and any data replied by the internal built-in page WEB server is also sent to the server through the channel.
S2.1: monitoring an MQTT message, and after receiving a request, sending a long connection registration packet request to a TCP server according to an IP address and a port in the request;
s2.2: after successful registration, the data content of the long connection channel is received, the message ID is removed, and the data is directly sent to a WEB server in the terminal equipment;
S2.3: the terminal equipment WEB server replies a message, adds an ID of the transmitted message and transmits the message to the TCP server;
s2.4: and monitoring whether the connection of the message sent to the WEB server is disconnected, and sending a disconnection request to the TCP server when the connection is disconnected, so that the TCP server disconnects the browser request.
Example 3:
The embodiment 3 of the disclosure provides a method for remotely accessing a built-in page of terminal equipment, which is applied to a TCP server and comprises the following steps:
The TCP server receives an HTTP request sent by a browser, and the request content at least comprises a domain name generated according to an identification code of terminal equipment;
The TCP server analyzes the HTTP request, acquires the domain name of the terminal equipment, judges the terminal equipment according to the domain name, adds a message ID to the received request data and then sends the message ID to a long connecting channel of the corresponding terminal equipment;
the TCP server receives built-in page data transmitted from the terminal equipment through the long connection channel, finds out corresponding browser connection according to the equipment identification code and the message ID after judging that the terminal equipment is correct, and sends the page data to the browser.
More specifically, the TCP server is configured to:
Monitoring a request of opening a built-in page by a user, analyzing the request content of a browser after receiving the request, transmitting the service address and the port to corresponding terminal equipment, establishing a TCP channel between the terminal equipment and the service, and carrying out data communication through a designated protocol.
S1.1: monitoring a built-in page request of a designated device which a user wants to open through an MQTT, and forwarding the request to terminal equipment through the MQTT, wherein the request comprises an IP and a port of a TCP server;
s1.2: after receiving the request, the terminal equipment sends a long connection request to a TCP server according to an IP address and a port in the request;
s1.3: after the TCP server establishes long connection with the terminal equipment, generating a three-level domain name according to the terminal equipment identification code, making a corresponding relation between the three-level domain name and the long connection, and sending the domain name to the browser through the MQTT;
S1.4: the browser receives the domain name address, directly opens the page with the new address (the new address corresponds to a service in the TCP server), the TCP server receives the HTTP request sent by the browser, judges which device the browser belongs to according to the domain name, adds a message ID on the data, and sends the data to a long connection channel of the appointed terminal device;
s1.5: the TCP server receives the data reply from the long connection of the terminal equipment, judges the terminal equipment to which the data reply belongs, finds the corresponding browser connection according to the equipment identification code and the message ID, and sends the data to the browser.
Example 4:
Embodiment 4 of the present disclosure provides a TCP server, including a processing module;
the processing module is configured to:
receiving an HTTP request sent by a browser, wherein the request content at least comprises a domain name generated according to an identification code of terminal equipment;
The TCP server analyzes the HTTP request, acquires the domain name of the terminal equipment, judges the terminal equipment according to the domain name, adds a message ID to the received request data and then sends the message ID to a long connecting channel of the corresponding terminal equipment;
and receiving built-in page data transmitted from the terminal equipment through the long connection channel, finding out corresponding browser connection according to the equipment identification code and the message ID after judging that the terminal equipment is correct, and sending the page data to the browser.
More specifically, the processing module is configured to:
Monitoring a request of opening a built-in page by a user, analyzing the request content of a browser after receiving the request, transmitting the service address and the port to corresponding terminal equipment, establishing a TCP channel between the terminal equipment and the service, and carrying out data communication through a designated protocol.
S1.1: monitoring a built-in page request of a designated device which a user wants to open through an MQTT, and forwarding the request to terminal equipment through the MQTT, wherein the request comprises an IP and a port of a TCP server;
s1.2: after receiving the request, the terminal equipment sends a long connection request to a TCP server according to an IP address and a port in the request;
s1.3: after the TCP server establishes long connection with the terminal equipment, generating a three-level domain name according to the terminal equipment identification code, making a corresponding relation between the three-level domain name and the long connection, and sending the domain name to the browser through the MQTT;
S1.4: the browser receives the domain name address, directly opens the page with the new address (the new address corresponds to a service in the TCP server), the TCP server receives the HTTP request sent by the browser, judges which device the browser belongs to according to the domain name, adds a message ID on the data, and sends the data to a long connection channel of the appointed terminal device;
s1.5: the TCP server receives the data reply from the long connection of the terminal equipment, judges the terminal equipment to which the data reply belongs, finds the corresponding browser connection according to the equipment identification code and the message ID, and sends the data to the browser.
The foregoing description of the preferred embodiments of the present disclosure is provided only and not intended to limit the disclosure so that various modifications and changes may be made to the present disclosure by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure should be included in the protection scope of the present disclosure.
Claims (6)
1. A method for remotely accessing a built-in page of terminal equipment is characterized by comprising the following steps: the method is applied to the TCP server and comprises the following steps:
The TCP server receives an HTTP request sent by a browser;
The TCP server analyzes the HTTP request, acquires the domain name of the terminal equipment, judges the terminal equipment according to the domain name, adds a message ID to the received request data and then sends the message ID to a long connecting channel of the corresponding terminal equipment;
The TCP server receives built-in page data transmitted from the terminal equipment through the long connection channel, finds out corresponding browser connection according to the equipment identification code and the message ID after judging that the terminal equipment is correct, and sends the page data to the browser;
Wherein the TCP server is further configured to: monitoring a request for opening a built-in page sent by a browser, analyzing the request content of the browser after receiving the request, and sending a service address and a port to corresponding terminal equipment so that the terminal equipment and the service establish a TCP channel and carry out data communication through a designated protocol;
Monitoring and opening a built-in page request of the designated equipment through the MQTT, and forwarding the request to the terminal equipment through the MQTT, wherein the request comprises an IP and a port of a TCP server;
receiving a long connection request generated by the terminal equipment according to the IP address and the port, so that a TCP server and the terminal equipment establish long connection;
And generating a domain name according to the identification code of the terminal equipment, establishing a corresponding relation between the domain name and the long connection channel, and sending the domain name to the browser through the MQTT so that the browser opens the page by using the new domain name address.
2. A TCP server comprising a processing module;
the processing module is configured to:
receiving an HTTP request sent by a browser;
Resolving the HTTP request, obtaining the domain name of the terminal equipment, judging the terminal equipment according to the domain name, adding a message ID to the received request data, and then sending the request data to a long connection channel of the corresponding terminal equipment;
The built-in page data transmitted from the terminal equipment through the long connecting channel is received, after judging that the terminal equipment is correct, the corresponding browser connection is found according to the equipment identification code and the message ID, and the page data is sent to the browser;
wherein the processing module is further configured to: monitoring a request for opening a built-in page sent by a browser, analyzing the request content of the browser after receiving the request, and sending a service address and a port to corresponding terminal equipment so that the terminal equipment and the service establish a TCP channel and carry out data communication through a designated protocol;
Monitoring and opening a built-in page request of the designated equipment through the MQTT, and forwarding the request to the terminal equipment through the MQTT, wherein the request comprises an IP and a port of a TCP server;
receiving a long connection request generated by the terminal equipment according to the IP address and the port, so that a TCP server and the terminal equipment establish long connection;
And generating a domain name according to the identification code of the terminal equipment, establishing a corresponding relation between the domain name and the long connection channel, and sending the domain name to the browser through the MQTT so that the browser opens the page by using the new domain name address.
3. A method for remotely accessing a built-in page of terminal equipment is characterized by comprising the following steps: the method comprises the following steps:
The TCP server receives an HTTP request sent by a browser;
The TCP server analyzes the HTTP request, acquires the domain name of the terminal equipment, judges the terminal equipment according to the domain name, adds a message ID to the received request data and then sends the message ID to a long connecting channel of the corresponding terminal equipment;
after receiving the data content of the long connection channel, the TCP client in the terminal equipment removes the message ID and sends the data to the built-in page WEB server of the terminal equipment;
The built-in page WEB server replies built-in page data, adds a message ID and forwards the message ID to the TCP server through the TCP client;
the TCP server receives built-in page data transmitted from the terminal equipment through the long connection channel, finds out corresponding browser connection according to the equipment identification code and the message ID after judging that the terminal equipment is correct, and sends the page data to the browser.
4. A method for remotely accessing a built-in page of a terminal device as recited in claim 3, wherein:
The TCP client monitors the MQTT message, sends a long connection registration packet request to the TCP server according to an IP address and a port in the request after receiving the request, and acquires long connection channel data after successful registration;
a TCP server configured to:
Monitoring and opening a built-in page request of the designated equipment through the MQTT, and forwarding the request to the terminal equipment through the MQTT, wherein the request comprises an IP and a port of a TCP server;
receiving a long connection request generated by the terminal equipment according to the IP address and the port, so that a TCP server and the terminal equipment establish long connection;
Generating a domain name according to the identification code of the terminal equipment, establishing a corresponding relation between the domain name and the long connection channel, and sending the domain name to the browser through the MQTT so that the browser opens a page by using a new domain name address;
A TCP client configured to:
and monitoring whether the connection of the message sent to the built-in page WEB server is disconnected, and sending a disconnection request to the TCP server when the connection is disconnected, so that the TCP server disconnects the browser request.
5. A system for remotely accessing a built-in page of a terminal device, comprising: the system comprises a TCP server and a TCP client, wherein the TCP client is arranged in terminal equipment, the TCP server is in communication connection with a browser, the TCP server is in communication connection with the TCP client, and the TCP client is in communication connection with a built-in page WEB server;
The TCP server receives an HTTP request sent by a browser;
The TCP server analyzes the HTTP request, acquires the domain name of the terminal equipment, judges the terminal equipment according to the domain name, adds a message ID to the received request data and then sends the message ID to a long connecting channel of the corresponding terminal equipment;
after receiving the data content of the long connection channel, the TCP client in the terminal equipment removes the message ID and sends the data to the built-in page WEB server of the terminal equipment;
The built-in page WEB server replies built-in page data, adds a message ID and forwards the message ID to the TCP server through the TCP client;
the TCP server receives built-in page data transmitted from the terminal equipment through the long connection channel, finds out corresponding browser connection according to the equipment identification code and the message ID after judging that the terminal equipment is correct, and sends the page data to the browser.
6. The system for remotely accessing a built-in page of a terminal device of claim 5, wherein:
The TCP client monitors the MQTT message, sends a long connection registration packet request to the TCP server according to an IP address and a port in the request after receiving the request, and acquires long connection channel data after successful registration;
a TCP server configured to:
Monitoring and opening a built-in page request of the designated equipment through the MQTT, and forwarding the request to the terminal equipment through the MQTT, wherein the request comprises an IP and a port of a TCP server;
receiving a long connection request generated by the terminal equipment according to the IP address and the port, so that a TCP server and the terminal equipment establish long connection;
Generating a domain name according to the identification code of the terminal equipment, establishing a corresponding relation between the domain name and the long connection channel, and sending the domain name to the browser through the MQTT so that the browser opens a page by using a new domain name address;
A TCP client configured to:
and monitoring whether the connection of the message sent to the built-in page WEB server is disconnected, and sending a disconnection request to the TCP server when the connection is disconnected, so that the TCP server disconnects the browser request.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111080845.2A CN113794772B (en) | 2021-09-15 | 2021-09-15 | Method and system for remotely accessing built-in page of terminal equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111080845.2A CN113794772B (en) | 2021-09-15 | 2021-09-15 | Method and system for remotely accessing built-in page of terminal equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113794772A CN113794772A (en) | 2021-12-14 |
CN113794772B true CN113794772B (en) | 2024-05-07 |
Family
ID=78878379
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111080845.2A Active CN113794772B (en) | 2021-09-15 | 2021-09-15 | Method and system for remotely accessing built-in page of terminal equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113794772B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20100052435A (en) * | 2010-04-01 | 2010-05-19 | 세창인스트루먼트(주) | Internet service system in associated with an accessed website and the method for the same |
CN102833323A (en) * | 2012-08-14 | 2012-12-19 | 新浪网技术(中国)有限公司 | Method and system for remote control of controlled terminal by server |
CN104135501A (en) * | 2013-06-28 | 2014-11-05 | 腾讯科技(深圳)有限公司 | Page sharing method, device and system |
CN108717285A (en) * | 2018-04-14 | 2018-10-30 | 张著岳 | The programmable logic controller (PLC) programmed by built-in web |
CN109639749A (en) * | 2018-10-16 | 2019-04-16 | 平安科技(深圳)有限公司 | Access method, device, equipment and the storage medium of cloud desktop |
-
2021
- 2021-09-15 CN CN202111080845.2A patent/CN113794772B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20100052435A (en) * | 2010-04-01 | 2010-05-19 | 세창인스트루먼트(주) | Internet service system in associated with an accessed website and the method for the same |
CN102833323A (en) * | 2012-08-14 | 2012-12-19 | 新浪网技术(中国)有限公司 | Method and system for remote control of controlled terminal by server |
CN104135501A (en) * | 2013-06-28 | 2014-11-05 | 腾讯科技(深圳)有限公司 | Page sharing method, device and system |
CN108717285A (en) * | 2018-04-14 | 2018-10-30 | 张著岳 | The programmable logic controller (PLC) programmed by built-in web |
CN109639749A (en) * | 2018-10-16 | 2019-04-16 | 平安科技(深圳)有限公司 | Access method, device, equipment and the storage medium of cloud desktop |
Also Published As
Publication number | Publication date |
---|---|
CN113794772A (en) | 2021-12-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7269148B2 (en) | Scheme for adaptive control of transport layer connection in communications via radio and wire networks | |
EP2415224B1 (en) | Methods and apparatus for routing data to nodes | |
US8499083B2 (en) | Relay device and communication system | |
US8190773B2 (en) | System and method for accessing a web server on a device with a dynamic IP-address residing behind a firewall | |
US20060136987A1 (en) | Communication apparatus | |
US7987273B2 (en) | Server apparatus, mobile terminal, electric appliance, communication system, communication method, and program | |
US20120087255A1 (en) | Relay apparatus and method therefor | |
EP3809222B1 (en) | Vehicle remote diagnosis method and system | |
CN101582925A (en) | Network address translation method and system | |
CN107623752B (en) | Network management method and device based on link layer | |
CN105933435A (en) | Real-time query method based on Internet of Things | |
CN104967613A (en) | Data transmission system and method under mobile network environments | |
CN113518134A (en) | Method and device for accessing main router through domain name under MESH networking | |
US9699139B2 (en) | Communications system | |
CN113794772B (en) | Method and system for remotely accessing built-in page of terminal equipment | |
CN102075588B (en) | Method and system for realizing network address translation (NAT) transversing and equipment | |
CN104735073A (en) | IPv4-IPv6 transitional protocol dispatching method and device | |
US20080209003A1 (en) | Monitoring device and monitoring method | |
US20040117473A1 (en) | Proxy network control apparatus | |
JP4591338B2 (en) | Communications system | |
EP2124397A1 (en) | A method for transfering the ip transmission session and the equipment whereto | |
CN112202780B (en) | Data transmission method, device, equipment and medium based on double sockets | |
CN105556921A (en) | A mobile-device based proxy for browser-originated procedures | |
CN116471163A (en) | Method for accessing web configuration page of wireless repeater based on fixed ip | |
CN116708285A (en) | Network management method, device and system |
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 |