CN103905579B - The communication means of platform and terminal room, communication system, platform and relevant device - Google Patents

The communication means of platform and terminal room, communication system, platform and relevant device Download PDF

Info

Publication number
CN103905579B
CN103905579B CN201210589743.8A CN201210589743A CN103905579B CN 103905579 B CN103905579 B CN 103905579B CN 201210589743 A CN201210589743 A CN 201210589743A CN 103905579 B CN103905579 B CN 103905579B
Authority
CN
China
Prior art keywords
terminal
platform
address
communication
network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210589743.8A
Other languages
Chinese (zh)
Other versions
CN103905579A (en
Inventor
陈心昕
李建坤
常辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201210589743.8A priority Critical patent/CN103905579B/en
Publication of CN103905579A publication Critical patent/CN103905579A/en
Application granted granted Critical
Publication of CN103905579B publication Critical patent/CN103905579B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Small-Scale Networks (AREA)

Abstract

The invention discloses a kind of platform and the communication means of terminal room, including:Network address translation(NAT)Equipment receives the communication request from platform, the communication request carried terminal private network IP address and terminal number;The communication request is transmitted to terminal corresponding to the terminal private network IP address or terminal number by the NAT device, afterwards, the communication link that the terminal is established between the platform, based on the communication link interaction message message.The present invention also accordingly discloses a kind of communication system, platform and relevant device.Using scheme of the present invention, even if terminal, in private network, after the connection disconnection of platform and terminal room, platform actively can also communicate with terminal, so as to improve communication efficiency.

Description

Communication method, communication system, platform and related equipment between platform and terminal
Technical Field
The present invention relates to the field of data communication, and in particular, to a method, a system, a platform, and a related device for communication between a platform and a terminal.
Background
At present, the communication mechanism between the platform and the terminal mainly includes:
1) the terminal actively communicates with the platform. Specifically, a platform IP address and a communication port are generally preset or configured in the terminal, or a platform communication URL/DNS address is preset or configured, when the terminal is powered on or needs to exchange a message, a connection request is actively initiated to the platform, the terminal IP address is carried in the exchanged message, and the platform responds to the message initiated by the terminal according to the terminal IP address. Under the mechanism, the terminal sends a heartbeat packet to the platform as required to inform the platform that the terminal is on line, so that long connection with the platform is kept, and based on the long connection, the terminal can actively communicate with the platform, and the platform can also actively communicate with the terminal. The platform is used as a server side, a request initiated by a terminal needs to be monitored on a communication port, and when the terminal has the request to reach the platform, the platform immediately carries out processing and interaction.
2) The platform actively communicates with the terminal. Specifically, the platform actively initiates a request to the terminal according to the IP address of the terminal, or when the terminal has the capability of receiving and sending short messages, the platform sends a data connection pull-up short message to the terminal, and after receiving the pull-up short message, the terminal establishes data connection and actively initiates a communication request and exchanges messages with the platform. Under the mechanism, a terminal is used as a server side, a request initiated by a platform needs to be monitored on a communication port, and when the platform has the request to reach the terminal, the terminal immediately carries out processing and interaction. In order to reduce the complexity of terminal processing, when the platform is required to actively communicate with the terminal, the issued message is a message of a fixed message, and the terminal sends a message interaction request message after receiving the message; alternatively, the platform may also send a User Datagram Protocol (UDP) message, requesting the terminal to initiate a connection request.
However, for the above communication mechanism, if the long connection between the terminal and the platform is disconnected due to an abnormal condition, the terminal cannot recognize the abnormal condition, so that the connection between the terminal and the platform cannot be restored in time, which affects the communication efficiency; in addition, if the IP address of the terminal is a private network address and the terminal does not have the function of short message communication, the platform cannot find the terminal after the connection between the platform and the terminal is disconnected, so that communication cannot be performed.
Disclosure of Invention
In view of the above, the main objective of the present invention is to provide a method, a system, a platform and a related device for communication between a platform and a terminal, wherein after the platform is disconnected from the terminal having a private IP address, the platform can find the terminal and communicate with the terminal, thereby improving communication efficiency.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a communication method between a platform and a terminal comprises the following steps:
a Network Address Translation (NAT) device receives a communication request from a platform, wherein the communication request carries a terminal private network IP address and a terminal number;
and the NAT equipment forwards the communication request to a terminal corresponding to the terminal private network IP address or the terminal number, and then the terminal establishes a communication link with the platform and interacts a message based on the communication link.
The NAT equipment forwards the communication request to the terminal corresponding to the terminal private network IP address or the terminal number:
when the IP address allocation mode of the NAT equipment is static allocation, the communication request is forwarded to a port corresponding to the private network IP address; and when the IP address allocation mode of the NAT equipment is dynamic allocation, sending a broadcast message carrying the terminal number on each port, and then forwarding the communication request to a port responding to the broadcast message.
The method further comprises the following steps:
after the platform and the terminal exchange message messages, the terminal sends heartbeat packets to the platform at regular time, keeps the communication link connected, polls and detects the network connection state at regular time, and initiates and establishes a communication link with the platform when detecting abnormal network disconnection.
When the terminal detects one or more of the following conditions, the terminal determines that the network is abnormally disconnected:
the upper layer is applied to message communication, does not complete message response and cannot communicate with the platform;
if the dialing program runs and the program is not normally disconnected, the IP layer detects the network disconnection;
the disconnection of the network port is not detected, but the IP layer can not be connected.
A communication method between a platform and a terminal comprises the following steps:
when a platform needs to communicate with a terminal in a private network, acquiring a public network address, a terminal private network IP address and a terminal number when the terminal establishes connection last time;
and the platform sends a communication request to corresponding NAT equipment according to the public network address, and establishes a communication link with the terminal, wherein the communication request carries the terminal private network IP address and the terminal number.
A NAT device comprising: the device comprises a receiving module and a sending module; wherein,
the receiving module is used for receiving a communication request from a platform, wherein the communication request carries a terminal private network IP address and a terminal number;
and the sending module is used for forwarding the received communication request to a terminal corresponding to the terminal private network IP address or the terminal number so as to establish a communication link between the terminal and the platform and exchange message messages based on the communication link.
The NAT device also includes an IP address assignment determination module,
the IP address allocation mode determining module is used for determining the IP address allocation mode of the NAT equipment according to the NAT equipment configuration;
the sending module is specifically configured to forward the communication request to a port corresponding to the private network IP address when the IP address allocation manner determining module determines that the IP address allocation manner of the NAT device is static allocation; and when the IP address allocation mode determining module determines that the IP address allocation mode of the NAT equipment is dynamic allocation, sending a broadcast message carrying the terminal number on each port, and then forwarding the communication request to a port responding to the broadcast message.
A terminal, comprising: the device comprises a receiving module, a matching module and a sending module; wherein,
the receiving module is used for receiving a communication request forwarded by the NAT equipment and a broadcast message sent by the NAT equipment, wherein the broadcast message carries a terminal number;
the matching module is used for matching the terminal number carried by the broadcast message with the terminal number of the terminal to which the matching module belongs after the receiving module receives the broadcast message;
and the sending module is used for returning a response message when the matching module is successfully matched.
The terminal further includes: the device comprises a detection module and a connection establishing module; wherein,
the detection module is used for polling and detecting the network connection state at regular time when the platform and the terminal exchange message is finished but the communication link is kept connected;
and the connection establishing module is used for initiating and establishing a communication link with the platform when the detection module detects abnormal network disconnection.
The detection module is specifically configured to determine that the network is abnormally disconnected when one or more of the following are detected:
the upper layer is applied to message communication, does not complete message response and cannot communicate with the platform;
if the dialing program runs and the program is not normally disconnected, the IP layer detects the network disconnection;
the disconnection of the network port is not detected, but the IP layer can not be connected.
A communication system includes a platform, a NAT device, and a terminal, wherein,
the platform is used for acquiring a public network address, a terminal private network IP address and a terminal number when the terminal establishes connection last time when the terminal needs to communicate with a terminal in a private network; then, a communication request is sent to corresponding NAT equipment according to the public network address, a communication link with the terminal is established, and the communication request carries the terminal private network IP address and the terminal number;
the NAT equipment is used for forwarding the communication request to a terminal corresponding to the terminal private network IP address or the terminal number so that the terminal can establish a communication link with the platform and exchange message messages based on the communication link;
the terminal is used for receiving the communication request forwarded by the NAT equipment and the broadcast message sent by the NAT equipment; and after receiving the broadcast message, matching the terminal number carried by the broadcast message with the terminal number of the broadcast message, and returning a response message when the matching is successful.
The NAT device is specifically used for forwarding a communication request from a platform to a port corresponding to the private network IP address when the IP address allocation mode is static allocation, and establishing a communication link between the platform and a terminal corresponding to the private network IP address; and when the IP address allocation mode is dynamic allocation, sending a broadcast message carrying the terminal number on each port, then forwarding a communication request from the platform to a port responding to the broadcast message, and establishing a communication link between the platform and the terminal corresponding to the terminal number.
The terminal is also used for sending heartbeat packets to the platform at regular time after the platform and the terminal exchange message are finished, keeping the communication link connected, polling and detecting the network connection state at regular time, initiating and establishing the communication link with the platform when abnormal network disconnection is detected,
when the terminal detects one or more of the following conditions, the terminal determines that the network is abnormally disconnected:
the upper layer is applied to message communication, does not complete message response and cannot communicate with the platform;
if the dialing program runs and the program is not normally disconnected, the IP layer detects the network disconnection;
the disconnection of the network port is not detected, but the IP layer can not be connected.
The invention relates to a communication method, a communication system, a platform and related equipment between a platform and a terminal.A Network Address Translation (NAT) device receives a communication request from the platform, wherein the communication request carries a terminal private network IP address and a terminal number; and the NAT equipment forwards the communication request to a terminal corresponding to the terminal private network IP address or the terminal number, and then the terminal establishes a communication link with the platform and interacts a message based on the communication link. By adopting the scheme of the invention, even if the terminal is in a private network, the platform can actively communicate with the terminal after the connection between the platform and the terminal is disconnected, thereby improving the communication efficiency; in addition, after the long connection between the terminal and the platform is disconnected due to abnormal conditions, the terminal can identify various abnormal conditions and timely recover the connection between the terminal and the platform, so that the communication efficiency is further improved.
Drawings
Fig. 1 is a schematic flowchart of a communication method between a platform and a terminal according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating a communication method between a platform and a terminal according to another embodiment of the present invention;
fig. 3 is a schematic structural diagram of a NAT device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a terminal according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of another terminal according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a communication system according to an embodiment of the present invention;
fig. 7 is a flowchart illustrating a communication method between a platform and a terminal according to embodiment 1 of the present invention;
fig. 8 is a flowchart illustrating a communication method between a platform and a terminal according to embodiment 2 of the present invention;
fig. 9 is a flowchart illustrating a communication method between a platform and a terminal according to embodiment 3 of the present invention.
Detailed Description
The basic idea of the invention is: NAT equipment receives a communication request from a platform, wherein the communication request carries a terminal private network IP address and a terminal number; and the NAT equipment forwards the communication request to a terminal corresponding to the terminal private network IP address or the terminal number, and then the terminal establishes a communication link with the platform and interacts a message based on the communication link.
Fig. 1 is a schematic flowchart of a communication method between a platform and a terminal according to an embodiment of the present invention, as shown in fig. 1, the method includes:
step 101: NAT equipment receives a communication request from a platform, wherein the communication request carries a terminal private network IP address and a terminal number;
step 102: and the NAT equipment forwards the communication request to a terminal corresponding to the terminal private network IP address or the terminal number, and then the terminal establishes a communication link with the platform and interacts a message based on the communication link.
Optionally, forwarding, by the NAT device, the communication request to the terminal corresponding to the terminal private network IP address or the terminal number is: when the IP address allocation mode of the NAT equipment is static allocation, the communication request is forwarded to a port corresponding to the private network IP address; and when the IP address allocation mode of the NAT equipment is dynamic allocation, sending a broadcast message carrying the terminal number on each port, and then forwarding the communication request to a port responding to the broadcast message.
Optionally, the method further includes:
after the platform and the terminal exchange message messages, the terminal sends heartbeat packets to the platform at regular time, keeps the communication link connected, polls and detects the network connection state at regular time, and initiates and establishes a communication link with the platform when detecting abnormal network disconnection.
Optionally, when the terminal detects one or more of the following, it determines that the network is abnormally disconnected:
the upper layer is applied to message communication, does not complete message response and cannot communicate with the platform;
if the dialing program runs and the program is not normally disconnected, the IP layer detects the network disconnection;
the disconnection of the network port is not detected, but the IP layer can not be connected.
It should be noted that the method for detecting abnormal network disconnection by the terminal is not limited to be applied to the scenario of establishing connection and interacting message messages and then maintaining long connection according to steps 101 and 102, but may also be applied to the scenario of establishing connection and interacting message messages and then maintaining long connection separately, so as to recover the connection between the terminal and the platform in time, for example, a certain service function requires the terminal to actively communicate with the platform, and after a session is ended, the terminal still maintains communication with the platform, when the connection between the terminal and the platform is disconnected, the platform actively communicates according to the IP address of the terminal obtained last time, and if the platform fails to communicate with the IP address of the terminal obtained last time, the communication with the terminal is realized according to the communication methods described in steps 101 and 102.
The embodiment of the present invention also correspondingly provides a method for communication between a platform and a terminal, as shown in fig. 2, the method includes:
step 201: when a platform needs to communicate with a terminal in a private network, acquiring a public network address, a terminal private network IP address and a terminal number when the terminal establishes connection last time;
step 202: and the platform sends a communication request to corresponding NAT equipment according to the public network address, and establishes a communication link with the terminal, wherein the communication request carries the terminal private network IP address and the terminal number.
The embodiment of the invention also correspondingly provides the NAT equipment, which comprises: a receiving module 31 and a transmitting module 32; wherein,
a receiving module 31, configured to receive a communication request from a platform, where the communication request carries a terminal private network IP address and a terminal number;
and the sending module 32 is configured to forward the received communication request to a terminal corresponding to the terminal private network IP address or the terminal number, so that the terminal establishes a communication link with the platform, and interacts a message based on the communication link.
Optionally, as shown in fig. 3, the NAT device further includes an IP address allocation determining module 33,
an IP address allocation mode determining module 33, configured to determine, according to NAT device configuration, an IP address allocation mode of the NAT device;
a sending module 32, configured to forward the communication request to a port corresponding to the private network IP address when the IP address allocation manner determining module 33 determines that the IP address allocation manner of the NAT device is static allocation; when the IP address allocation mode determining module 33 determines that the IP address allocation mode of the NAT device is dynamic allocation, a broadcast message carrying the terminal number is sent on each port, and then the communication request is forwarded to a port responding to the broadcast message.
The embodiment of the present invention further provides a terminal accordingly, as shown in fig. 4, the terminal includes: a receiving module 41, a matching module 42 and a transmitting module 43; wherein,
a receiving module 41, configured to receive a communication request forwarded by the NAT device and a broadcast message sent by the NAT device, where the broadcast message carries a terminal number;
a matching module 42, configured to match, after the receiving module 41 receives the broadcast message, a terminal number carried in the broadcast message with a terminal number of a terminal to which the receiving module belongs;
and the sending module 43 is configured to return a response message when the matching module 42 succeeds in matching.
Optionally, as shown in fig. 5, the terminal further includes: a detection module 51 and a connection establishment module 52; wherein,
the detection module 51 is configured to perform polling detection on a network connection state at regular time when the platform and the terminal interact with each other and the message is ended but the communication link is kept connected;
and the connection establishing module 52 is configured to initiate and establish a communication link with the platform when the detection module 51 detects an abnormal network outage.
Optionally, the detecting module 51 is specifically configured to determine that the network is abnormally disconnected when one or more of the following is detected:
the upper layer is applied to message communication, does not complete message response and cannot communicate with the platform;
if the dialing program runs and the program is not normally disconnected, the IP layer detects the network disconnection;
the disconnection of the network port is not detected, but the IP layer can not be connected.
It should be noted that the terminal may be physically integrated with the NAT device, and support the NAT device functions, including the functions of port mapping, IP address mapping, and the like.
Correspondingly, the embodiment of the present invention further provides a communication system, as shown in fig. 6, the communication system includes a platform 61, a NAT device 62, and a terminal 63, wherein,
the platform 61 is used for acquiring a public network address, a terminal private network IP address and a terminal number when the terminal establishes connection last time when the terminal needs to communicate with the terminal in a private network; then, a communication request is sent to corresponding NAT equipment according to the public network address, a communication link with the terminal is established, and the communication request carries the terminal private network IP address and the terminal number;
the NAT device 62 is configured to forward the communication request to a terminal corresponding to the terminal private network IP address or the terminal number, so that the terminal establishes a communication link with the platform and interacts a message based on the communication link;
the terminal 63 is used for receiving the communication request forwarded by the NAT device and the broadcast message sent by the NAT device; and after receiving the broadcast message, matching the terminal number carried by the broadcast message with the terminal number of the broadcast message, and returning a response message when the matching is successful.
Optionally, the NAT device 62 is specifically configured to, when the IP address allocation manner is static allocation, forward the communication request from the platform 61 to a port corresponding to the private network IP address, and establish a communication link between the platform 61 and a terminal corresponding to the private network IP address; when the IP address allocation manner is dynamic allocation, a broadcast message carrying the terminal number is sent on each port, and then a communication request from the platform 61 is forwarded to a port responding to the broadcast message, so as to establish a communication link between the platform 61 and the terminal corresponding to the terminal number.
Optionally, the terminal 63 is further configured to send a heartbeat packet to the platform at regular time after the platform and the terminal exchange message are finished, keep the communication link connected, poll and detect a network connection state at regular time, initiate and establish a communication link with the platform when an abnormal network disconnection is detected,
optionally, when the terminal 63 detects one or more of the following, it determines that the network is abnormally disconnected:
the upper layer is applied to message communication, does not complete message response and cannot communicate with the platform;
if the dialing program runs and the program is not normally disconnected, the IP layer detects the network disconnection;
the disconnection of the network port is not detected, but the IP layer can not be connected.
The technical solution of the present invention is further described in detail by the following specific examples.
Example 1
In the embodiment, the terminal initiates a connection request, the platform checks and authenticates the terminal, establishes long connection with the terminal, detects whether the network is abnormally disconnected after the long connection is established, and immediately reestablishes the connection if the network is abnormally disconnected.
As shown in fig. 7, the flow of the communication method between the platform and the terminal according to this embodiment specifically includes:
step 701: the terminal initiates connection to the platform, establishes TCP/IP connection, and the platform obtains the terminal IP address.
Step 702: and after the terminal establishes connection with the platform, acquiring a temporary Token.
In the connection, the temporary Token needs to be carried by the subsequent terminal for exchanging the message with the platform every time, and the temporary Token is used as an authentication field for the communication connection and the message exchange.
Specifically, the platform binds the temporary Token with the IP address and port carried by the TCP/IP connection initiated by the terminal one by one, and when the connection is disconnected, the temporary Token is expired.
The temporary Token is calculated and obtained by the platform according to a certain algorithm according to a terminal number (pre-stored by the platform or pre-stored with a logic number bound with the terminal number), an IP address, a port and a random number generated by the platform reported by the terminal. The security of long-connection communication can be guaranteed by using Token.
Step 703: and the terminal and the platform interact message messages to complete related logic operation.
Step 704: and finishing the message interaction. The platform does not disconnect the TCP/IP connection and keeps the session connection, and the terminal does not actively disconnect the TCP/IP connection.
Step 705: the terminal sends heartbeat packets to the platform at regular time, and the platform receives the heartbeat packets at regular time to keep the connection.
Step 706: the terminal detects whether the network is abnormally disconnected, if the network is abnormally disconnected, the terminal and the platform are disconnected, the terminal needs to actively send a connection request to the platform again, and the platform and the terminal are reestablished to be connected.
Here, after the detection process is started, the terminal may periodically poll and detect the network connection status under PPP connection or IP connection. Specifically, the abnormal network disconnection may be determined according to the following conditions:
the upper layer is applied to message communication, does not complete message response and cannot communicate with the platform;
if the dialing program runs and the program is not normally disconnected, the IP layer detects the network disconnection;
the disconnection of the network port is not detected, but the IP layer can not be connected.
It should be noted that the connection program is an operating system level process after the terminal detects the network status and the network is disconnected, the operating system is started after being started, and cannot be suspended, closed or modified.
After the connection is reestablished, the platform can send interactive messages to the terminal at any time to carry out various operations and configurations.
Example 2
This embodiment describes a process in which a platform is disconnected from a TCP/IP connection of a terminal and the platform actively connects to the terminal for communication when the terminal is in a private network and a private network address is not changed.
Fig. 8 is a schematic flowchart of a communication method between a platform and a terminal in embodiment 2 of the present invention, and as shown in fig. 8, the flowchart specifically includes:
step 801: and the terminal sends a message packet carrying the private network IP address of the terminal and the number fixedly allocated to the terminal by the NAT equipment in the process of actively initiating communication with the platform.
Step 802: and after the terminal is disconnected from the platform, the platform unlocks the NAT traversal message sent in the TCP/IP connection established by the terminal last time, and obtains the IP address of the private network of the terminal and the terminal number.
Here, the NAT traversal message, i.e., a message unrelated to the service logic, is sent before the service message interaction is performed.
Step 803: the platform sends a communication request to NAT equipment (corresponding to a public network address), wherein the communication request carries a terminal private network IP address and a terminal number.
Step 804: the NAT equipment which is distributed in a static mode receives a communication request sent by the platform, and forwards a message sent to a public network address to a port bound by a private network address, so that a communication link between the platform and a terminal is established, and the message is interacted.
Example 3
This embodiment describes a process in which a platform is disconnected from a TCP/IP connection of a terminal and the platform actively connects to the terminal for communication when the terminal is in a private network and a private network address changes.
Fig. 9 is a schematic flowchart of a communication method between a platform and a terminal in embodiment 3 of the present invention, and as shown in fig. 9, the flowchart specifically includes:
step 901: and the terminal sends a message packet carrying the private network IP address of the terminal and the number fixedly allocated to the terminal by the NAT equipment in the process of actively initiating communication with the platform.
Step 902: and after the terminal is disconnected from the platform, the platform unlocks the NAT traversal message sent in the TCP/IP connection established by the terminal last time, and obtains the IP address of the private network of the terminal and the terminal number.
Here, the NAT traversal message, i.e., a message unrelated to the service logic, is sent before the service message interaction is performed.
Step 903: the platform sends a communication request to NAT equipment (corresponding to a public network address), wherein the communication request carries a terminal private network IP address and a terminal number.
Step 904: the distribution mode is that dynamically distributed NAT equipment receives a communication request sent by a platform, and then sends broadcast messages on each port, wherein the broadcast messages at least carry a terminal number, when a terminal receives the broadcast messages, the terminal number is matched with the terminal number, if the terminal matched with the terminal number (the Token carried before the disconnection can be carried is carried out authentication and verification) responds to the broadcast messages, the NAT equipment forwards the messages sent by the platform to the port according to the responded port, the terminal responds to the message messages sent by the platform, and the platform establishes a communication link with the terminal according to the response.
Specifically, the communication request sent by the platform may also carry one or more of the following items of information: and informing the numbered terminal to establish connection with the platform, message type (such as connection message) and platform IP address, and carrying Token carried before disconnection, and carrying new Token after reestablishment.
And the broadcast message forwarded by the NAT equipment informs the platform that the numbered terminal establishes connection with the platform, and the message comprises the terminal number.
For the condition that the IP address of the terminal is the IP address of the public network, if the IP address of the terminal does not change, the platform can be actively connected with the terminal for communication only by remembering the IP address of the terminal for each communication; if the IP address of the terminal changes (namely the IP address obtained by the terminal initiating the PPP connection each time changes), as long as the PPP connection is not disconnected, the platform can find the terminal according to the IP address allocated by the terminal this time, if the PPP connection is disconnected, the terminal can reinitiate the PPP connection request to establish a new connection with the platform, and if the PPP connection is not disconnected, the long connection can be maintained between the terminal and the platform, so that the PPP connection is maintained.
The scheme of the invention can be applied to services (such as intelligent home, terminal remote management and other services) which require the platform to actively communicate with the terminal, and by the invention, the terminal keeps long connection after interacting with the platform, and if the long connection is disconnected, the terminal carries out various abnormal processing and initiates connection; if the terminal fails to diagnose the abnormity and the connection between the terminal and the platform is disconnected, the platform can actively establish communication connection with the terminal and exchange messages, therefore, even if the platform and the terminal are not in the same network segment, the platform can still actively find the terminal and initiate various messages to the terminal to carry out various operations and configurations.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.

Claims (11)

1. A method for communication between a platform and a terminal, the method comprising:
the NAT equipment receives a communication request from a platform, wherein the communication request carries a terminal private network IP address and a terminal number, and the communication request also carries one or more of the following items of information: informing a terminal with a terminal number to establish connection, a message type and a platform IP address with a platform;
the NAT equipment forwards the communication request to a terminal corresponding to the terminal private network IP address or the terminal number, and then the terminal establishes a communication link with the platform and interacts a message based on the communication link;
after the platform and the terminal exchange message messages, the terminal sends heartbeat packets to the platform at regular time, keeps the communication link connected, polls the network connection state at regular time, and initiates and establishes a communication link with the platform when detecting abnormal network disconnection.
2. The method of claim 1, wherein the forwarding of the communication request to the terminal corresponding to the terminal private network IP address or the terminal number by the NAT device is:
when the IP address allocation mode of the NAT equipment is static allocation, the communication request is forwarded to a port corresponding to the private network IP address; and when the IP address allocation mode of the NAT equipment is dynamic allocation, sending a broadcast message carrying the terminal number on each port, and then forwarding the communication request to a port responding to the broadcast message.
3. The method according to claim 1, wherein the terminal determines an abnormal network outage when detecting one or more of the following:
the upper layer is applied to message communication, does not complete message response and cannot communicate with the platform;
if the dialing program runs and the program is not normally disconnected, the IP layer detects the network disconnection;
the disconnection of the network port is not detected, but the IP layer can not be connected.
4. A method for communication between a platform and a terminal, the method comprising:
when a platform needs to communicate with a terminal in a private network, acquiring a public network address, a terminal private network IP address and a terminal number when the terminal establishes connection last time;
the platform sends a communication request to corresponding NAT equipment according to the public network address, and establishes a communication link with the terminal, wherein the communication request carries the terminal private network IP address and the terminal number, and the communication request also carries one or more of the following information: informing a terminal with a terminal number to establish connection, a message type and a platform IP address with a platform;
after the platform and the terminal exchange message messages, the terminal sends heartbeat packets to the platform at regular time, keeps the communication link connected, polls the network connection state at regular time, and initiates and establishes a communication link with the platform when detecting abnormal network disconnection.
5. A NAT device, comprising: the device comprises a receiving module and a sending module; wherein,
the receiving module is used for receiving a communication request from a platform, wherein the communication request carries a terminal private network IP address and a terminal number, and the communication request also carries one or more of the following items of information: informing the numbered terminal to establish connection, message type and platform IP address with the platform;
the sending module is used for forwarding the received communication request to a terminal corresponding to the terminal private network IP address or the terminal number so as to establish a communication link between the terminal and the platform and exchange message messages based on the communication link;
after the platform and the terminal exchange message messages, the terminal sends heartbeat packets to the platform at regular time, keeps the communication link connected, polls the network connection state at regular time, and initiates and establishes a communication link with the platform when detecting abnormal network disconnection.
6. The NAT device of claim 5, wherein the NAT device further comprises an IP address assignment determination module,
the IP address allocation mode determining module is used for determining the IP address allocation mode of the NAT equipment according to the NAT equipment configuration;
the sending module is specifically configured to forward the communication request to a port corresponding to the private network IP address when the IP address allocation manner determining module determines that the IP address allocation manner of the NAT device is static allocation; and when the IP address allocation mode determining module determines that the IP address allocation mode of the NAT equipment is dynamic allocation, sending a broadcast message carrying the terminal number on each port, and then forwarding the communication request to a port responding to the broadcast message.
7. A terminal, characterized in that the terminal comprises: the device comprises a receiving module, a matching module and a sending module; wherein,
the receiving module is configured to receive a communication request forwarded by the NAT device and a broadcast message sent by the NAT device, where the broadcast message carries a terminal number, and the communication request carries one or more of the following information: informing a terminal with a terminal number to establish connection, a message type and a platform IP address with a platform;
the matching module is used for matching the terminal number carried by the broadcast message with the terminal number of the terminal to which the matching module belongs after the receiving module receives the broadcast message;
the sending module is used for returning a response message when the matching module is successfully matched;
wherein, this terminal station still includes: the device comprises a detection module and a connection establishing module; wherein,
the detection module is used for polling and detecting the network connection state at regular time when the platform and the terminal exchange message is finished but the communication link is kept connected;
and the connection establishing module is used for initiating and establishing a communication link with the platform when the detection module detects abnormal network disconnection.
8. The terminal according to claim 7, wherein the detecting module is specifically configured to determine that the network is abnormally disconnected when one or more of the following are detected:
the upper layer is applied to message communication, does not complete message response and cannot communicate with the platform;
if the dialing program runs and the program is not normally disconnected, the IP layer detects the network disconnection;
the disconnection of the network port is not detected, but the IP layer can not be connected.
9. A communication system comprising a platform, a NAT device and a terminal, wherein,
the platform is used for acquiring a public network address, a terminal private network IP address and a terminal number when the terminal establishes connection last time when the terminal needs to communicate with a terminal in a private network; then, a communication request is sent to the corresponding NAT equipment according to the public network address, a communication link with the terminal is established, the communication request carries the terminal private network IP address and the terminal number, and the communication request also carries one or more of the following information: informing a terminal with a terminal number to establish connection, a message type and a platform IP address with a platform;
the NAT equipment is used for forwarding the communication request to a terminal corresponding to the terminal private network IP address or the terminal number so that the terminal can establish a communication link with the platform and exchange message messages based on the communication link;
the terminal is used for receiving the communication request forwarded by the NAT equipment and the broadcast message sent by the NAT equipment; after receiving the broadcast message, matching the terminal number carried by the broadcast message with the terminal number of the broadcast message, and returning a response message when the matching is successful; and the system is also used for sending heartbeat packets to the platform at regular time after the platform and the terminal exchange message are finished, keeping the communication link connected, polling and detecting the network connection state at regular time, and initiating and establishing the communication link with the platform when abnormal network disconnection is detected.
10. The system of claim 9,
the NAT device is specifically used for forwarding a communication request from a platform to a port corresponding to the private network IP address when the IP address allocation mode is static allocation, and establishing a communication link between the platform and a terminal corresponding to the private network IP address; and when the IP address allocation mode is dynamic allocation, sending a broadcast message carrying the terminal number on each port, then forwarding a communication request from the platform to a port responding to the broadcast message, and establishing a communication link between the platform and the terminal corresponding to the terminal number.
11. The system of claim 9 or 10,
when the terminal detects one or more of the following conditions, the terminal determines that the network is abnormally disconnected:
the upper layer is applied to message communication, does not complete message response and cannot communicate with the platform;
if the dialing program runs and the program is not normally disconnected, the IP layer detects the network disconnection;
the disconnection of the network port is not detected, but the IP layer can not be connected.
CN201210589743.8A 2012-12-28 2012-12-28 The communication means of platform and terminal room, communication system, platform and relevant device Active CN103905579B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210589743.8A CN103905579B (en) 2012-12-28 2012-12-28 The communication means of platform and terminal room, communication system, platform and relevant device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210589743.8A CN103905579B (en) 2012-12-28 2012-12-28 The communication means of platform and terminal room, communication system, platform and relevant device

Publications (2)

Publication Number Publication Date
CN103905579A CN103905579A (en) 2014-07-02
CN103905579B true CN103905579B (en) 2018-01-30

Family

ID=50996733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210589743.8A Active CN103905579B (en) 2012-12-28 2012-12-28 The communication means of platform and terminal room, communication system, platform and relevant device

Country Status (1)

Country Link
CN (1) CN103905579B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104468380A (en) * 2014-11-14 2015-03-25 上海斐讯数据通信技术有限公司 Interface communication method of access point device and server interaction
CN104570755A (en) * 2015-01-21 2015-04-29 苏州奥莱维信息技术有限公司 Intelligent home control method based on mobile phone
CN105227692B (en) * 2015-09-17 2019-05-03 青岛海信电器股份有限公司 A kind of NAT through method and gateway
CN106453533B (en) * 2016-09-28 2019-07-02 深圳市讯方技术股份有限公司 Learning control mode and system based on cloud desktop
CN106911508B (en) * 2017-02-28 2020-03-06 杭州迪普科技股份有限公司 DNS configuration recovery method and device
CN110445883A (en) * 2018-05-03 2019-11-12 海信集团有限公司 A kind of communication means and device of Internet of Things
CN108881511A (en) * 2018-06-11 2018-11-23 天津卓越信通科技有限公司 A kind of homogeneous network communication means
CN108881510A (en) * 2018-06-11 2018-11-23 天津卓越信通科技有限公司 A kind of homogeneous network domain name management method
CN110597192A (en) * 2019-08-09 2019-12-20 工业互联网创新中心(上海)有限公司 Workflow execution method, system and storage medium
CN111917451B (en) * 2020-07-10 2022-09-06 华力智芯(成都)集成电路有限公司 Data transmission method and device, satellite module and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1516409A (en) * 2003-08-26 2004-07-28 中兴通讯股份有限公司 Method for making medium stream pass through network address converter
CN1561061A (en) * 2004-02-27 2005-01-05 Ut斯达康通讯有限公司 Method for two-way access by NAT
CN101043447A (en) * 2007-04-23 2007-09-26 重庆大学 Method for mapping dynamically inside and outside network of server based on DDNS and NAT
CN102281335A (en) * 2010-06-09 2011-12-14 北京和信锐智科技有限公司 Method for keeping NAT (Network Address Translation) binding

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW574805B (en) * 2002-07-25 2004-02-01 Leadtek Research Inc Network address translation system and method thereof
CN100486176C (en) * 2006-04-27 2009-05-06 中兴通讯股份有限公司 Method for managing user side equipment through network address translation gateway
CN101141420B (en) * 2007-09-05 2012-07-11 杭州华三通信技术有限公司 Method and system for performing data communication between private network and public network
CN101478493B (en) * 2009-02-10 2011-02-02 杭州华三通信技术有限公司 Method and device for NAT through communication
CN102281334B (en) * 2010-06-11 2015-08-12 中兴通讯股份有限公司 A kind of management control method of catv terminal and system and access server
CN101909284B (en) * 2010-07-16 2013-06-05 深圳市融创天下科技股份有限公司 Data transmission method and system for mobile terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1516409A (en) * 2003-08-26 2004-07-28 中兴通讯股份有限公司 Method for making medium stream pass through network address converter
CN1561061A (en) * 2004-02-27 2005-01-05 Ut斯达康通讯有限公司 Method for two-way access by NAT
CN101043447A (en) * 2007-04-23 2007-09-26 重庆大学 Method for mapping dynamically inside and outside network of server based on DDNS and NAT
CN102281335A (en) * 2010-06-09 2011-12-14 北京和信锐智科技有限公司 Method for keeping NAT (Network Address Translation) binding

Also Published As

Publication number Publication date
CN103905579A (en) 2014-07-02

Similar Documents

Publication Publication Date Title
CN103905579B (en) The communication means of platform and terminal room, communication system, platform and relevant device
US9729501B2 (en) System and data card for stateless automatic configuration of IPv6 address and method for implementing the same
JP5402926B2 (en) COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION CONTROL PROGRAM
JP5364671B2 (en) Terminal connection status management in network authentication
CN101453495B (en) Method, system and equipment for preventing authentication address resolution protocol information loss
JP4727537B2 (en) Relay agent device and proxy address lending device
US8130671B2 (en) Method and system for establishing bidirectional tunnel
US8667339B2 (en) Internet server apparatus and program causing a server apparatus to implement functions of preparation processing for direct connection of an appliance in a private network and a mobile terminal outside the private network
EP2986042B1 (en) Client, server, and remote authentication dial in user service capability negotiation method and system
EP2012485A1 (en) Management method, apparatus and system of session connection
CN105471983B (en) A kind of method and system for establishing Internet of Things communication
CN101510902A (en) Method, system and equipment for preventing wireless client terminal from disconnection during internet process
CN102917082B (en) Penetrate information push method and the system of network address translation
CN102938715B (en) Based on off-line checking method and the equipment of MAC address authentication
CN107566213B (en) Keep-alive detection method and device
CN106131177B (en) Message processing method and device
WO2012014931A1 (en) Communications control device, communications system, and program
JP2005204189A (en) Access user management system and device
JP5357619B2 (en) Communication failure detection system
CN101335652A (en) Status detection method, apparatus and system of dynamic host configuring protocol
CN102244620A (en) Method and system for determining association relationship between gateway and equipment
CN107454178B (en) Data transmission method and device
CN103856571B (en) A kind of adaptive networking connection method and system
US20220086048A1 (en) Communication management system, management server, vpn server, terminal, communication management method, and program
CN112839392B (en) Method, device and system for reestablishing control and configuration protocol session of wireless access point

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant