Patent ID: 8250186

Claim:
A method of smart detection and recovery, being implemented in a terminal to detect a status of a host, wherein the terminal retrieves from the host in advance an IP address currently used and an MAC address currently used by the host, and the terminal comprising: a transmission interface, being configured to connect with an external host and transmit data; a device circuit, being configured to perform various operations and functions of the terminal; a registration module, being configured to send a connection establishment request to the host via the transmission interface, and retrieve an IP address currently used by the host and an MAC address currently used by the host; a memory, being configured to store at least the IP address currently used and the MAC address currently used; a data processing module, being configured to receive at least one datagram from the outside via the transmission interface and interpret data included in the datagram; and an analysis module, being configured to analyze data of the datagram, which has been interpreted by the data processing module, against the IP address currently used and the MAC address currently used, and decide whether the registration module shall send the connection establishment request again to the host according to the analysis result; wherein, the method comprising the analysis module analyzes data of the datagram by the following steps: (A) receiving a datagram; (B) determining whether a size of the datagram is consistent with a predetermined size, and if yes, then executing step (C), and otherwise, executing step (G); (C) determining whether an MAC header included in the datagram complies with a predetermined format, and if yes, then executing step (D), and otherwise, executing step (G); (D) determining whether an IP address included in the datagram is identical to the IP address currently used, and if no, then executing step (E), and otherwise, executing step (F); (E) executing an address altering procedure in which the IP address included in the datagram is used as a new address and reconnection or redirection to the new address is made; (F) processing the received datagram through a normal procedure and returning to the step (A); and (G) omitting the datagram and returning to the step (A).