CN113259432A - Communication method based on TCP (Transmission control protocol) and robot remote control system - Google Patents

Communication method based on TCP (Transmission control protocol) and robot remote control system Download PDF

Info

Publication number
CN113259432A
CN113259432A CN202110517047.5A CN202110517047A CN113259432A CN 113259432 A CN113259432 A CN 113259432A CN 202110517047 A CN202110517047 A CN 202110517047A CN 113259432 A CN113259432 A CN 113259432A
Authority
CN
China
Prior art keywords
client
server
parameter
wrong
timer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110517047.5A
Other languages
Chinese (zh)
Other versions
CN113259432B (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.)
Beijing Jiemai Polytron Technologies Inc
Original Assignee
Beijing Jiemai Polytron Technologies Inc
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 Beijing Jiemai Polytron Technologies Inc filed Critical Beijing Jiemai Polytron Technologies Inc
Priority to CN202110517047.5A priority Critical patent/CN113259432B/en
Publication of CN113259432A publication Critical patent/CN113259432A/en
Application granted granted Critical
Publication of CN113259432B publication Critical patent/CN113259432B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Communication Control (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a communication method based on a TCP protocol and a robot remote control system, wherein the method comprises the following steps: self-defining a message structure body of a TCP (transmission control protocol); carrying out initial assignment on parameters of a server side and a client side respectively; establishing communication connection between a server side and a client side through three-way handshake; and after the server and the client finish communication establishment and initial assignment, the server and the client interact based on the message structure and the initial assignment. The problems that delay is accumulated and data is delayed in the existing TCP protocol and long connection of the TCP protocol occupies resources are solved.

Description

Communication method based on TCP (Transmission control protocol) and robot remote control system
Technical Field
The invention relates to the technical field of remote control, in particular to a communication method based on a TCP (transmission control protocol) and a robot remote control system.
Background
The robot remote control technology is to connect the robot to the Internet, the control end communicates with the remote robot through the network, receives the video stream image of the robot and sends a control command. The webpage remote control track intelligent inspection robot has the advantages that the reliability is high in transmission of control commands, and a TCP (transmission control protocol) can be selected for transmission. However, when it is used in remote control, it has the following disadvantages to be optimized:
1. the control command is time-efficient and therefore has a requirement on real-time performance, and the flow control mechanism and retransmission mechanism of the TCP protocol accumulate delay when packet is lost, and the delay is increased under the condition that the internet is complicated.
2. Short connections are not suitable for frequent transmissions, and each connection setup will be time consuming and will also delay data.
And 3, long connection of the TCP occupies resources, the interval of a heartbeat mechanism of the TCP is too long, the response is too slow under extreme conditions such as network disconnection and the like, and the TCP cannot know in the first time when the network is disconnected, and packet-lost data can still be continuously retransmitted, so that buffer overflow or packet loss is caused finally.
There are currently several protocols based on tcp optimization:
RTMP/RTMFP protocol, which is a real-time transmission protocol based on TCP, has good reliability but needs to install an Adobe Flash plug-in when receiving data by using web, ios is not compatible and Adobe stops maintaining the Flash plug-in;
HLS is a real-time streaming protocol introduced by apple Inc. and is supported by only a few browsers;
the RTSP protocol is also TCP based real-time communication protocol supporting only the android system.
Still other protocols are mostly proprietary protocols that are not fully public or that cannot receive data directly on the web side requiring plug-ins to be downloaded.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the existing remote control of the robot generally transmits a control command through a TCP protocol, but a flow control mechanism and a retransmission mechanism of the TCP protocol accumulate delay when packet loss occurs, the delay is increased under the condition that the Internet is complicated, a short connection of the TCP protocol is not suitable for frequent transmission, time is consumed for establishing connection every time, data delay is also caused, a long connection of the TCP protocol occupies resources, the interval of a heartbeat mechanism of the robot is too long, the response is too slow under the extreme conditions of network disconnection and the like, the robot cannot know the data which are continuously retransmitted and lost when the connection is disconnected for the first time, and finally buffer overflow or packet loss is caused.
The invention is realized by the following technical scheme:
a communication method based on a TCP protocol comprises the following steps:
self-defining a message structure body of a TCP (transmission control protocol);
and respectively carrying out initial assignment on parameters of the server side and the client side: parameters of the server side: a first parameter wrung is 0 and represents the number of times of errors when the server communicates with the client, and a second parameter count is 0 and represents the number of cycles of the server; the parameters of the client are as follows: a third parameter wrong is 0, which represents the number of times of errors when the client communicates with the server, and a fourth parameter count is 0, which represents the number of cycles of the client;
establishing communication connection between a server side and a client side through three-way handshake;
and after the server and the client finish communication establishment and initial assignment, the server and the client interact based on the message structure body and the initial assignment.
The invention defines the message structure by user, combines the data packet and the heartbeat packet, simplifies the content of the message, does not need to worry about tcp subpackage problem, reduces the probability of packet loss, and reduces the times of message retransmission, thereby reducing the communication delay.
Specifically, the message structure includes a data packet and a heartbeat packet.
Specifically, when the message structure is sent as a heartbeat packet, the message structure is an empty packet; when the message structure is sent as a data packet, the message structure comprises a serial number of a control command, a storage address of the control command and a timestamp generated by the control command.
Specifically, when the server interacts with the client, the interaction process of the server includes the following steps:
the method comprises the steps that a first cycle is started, a second parameter count is added with 1, a first timer is reset, a server side starts to receive a data packet of a client side, if the server side receives the data packet of the client side, the data packet is processed and replied to the client side, otherwise, the server side judges whether a control command to be sent exists in a current queue, if the control command to be sent does not exist in the current queue of the server side, whether an accumulated value count + + of the second parameter count is larger than a first threshold value or not is judged, if the accumulated value count + + of the second parameter count is not larger than the first threshold value, the server side starts to enter a next round of first cycle after sleeping for a period of time;
if the accumulated value of the count + + is greater than the first threshold value, the server side sends a heartbeat packet to the client side and starts a first timer, if the server side does not receive a reply of the client side within the timing time of the first timer, a first parameter wrong value of the server side is added with 1, whether the wrong + + is greater than a second threshold value or not is judged, and if the wrong + + is greater than the second threshold value, the server side and the client side are reestablished to be connected; otherwise, the server starts to enter the next first cycle;
if the server receives the reply of the client within the timing time of the first timer, stopping timing of the first timer, and re-assigning a first parameter wrong and a second parameter count of the server, wherein the first parameter wrong is 0, the second parameter count is 0, and the server starts to enter a next round of first cycle after sleeping for a period of time;
if the current queue of the server side has a control command to be sent, the server side sends a data packet to the client side and starts a first timer, if the server side does not receive a reply of the client side within the timing time of the first timer, the first parameter wrong is added with 1, whether the accumulated value wrong + + of the first parameter wrong is larger than a second threshold value or not is judged, if the accumulated value wrong + + of the first parameter wrong is larger than the second threshold value, the server side and the client side are connected again, and if the accumulated value wrong + + of the first parameter wrong is larger than the second threshold value, the server side starts to enter the next round of first circulation;
and if the server receives the reply of the client within the timing time of the first timer, stopping timing of the first timer, and reassigning a first parameter wrung and a second parameter count of the server, wherein the first parameter wrung is 0, the second parameter count is 0, and the server starts to enter a next round of first cycle after sleeping for a period of time.
Specifically, when the server side interacts with the client side, the interaction process of the client side includes the following steps:
the second cycle starts, the fourth parameter count is added with 1, the second timer is reset, the client starts to receive the data packet of the server, if the client receives the data packet of the server, the data packet is processed and replied to the server, after the reply is finished, the client enters the dormancy, and after the dormancy is finished, the client enters the next second cycle;
if the client does not receive the data packet of the server, judging whether the accumulated value count + + of the fourth parameter count exceeds a first threshold value, if not, enabling the client to sleep for a period of time, and then entering a next second cycle; otherwise, the client sends a heartbeat packet to the server, and starts a second timer, if the client receives a reply from the server within the timing time of the second timer, the client stops timing of the second timer, and re-assigns a third parameter wrong and a fourth parameter count of the client, wherein the third parameter wrong is 0, the fourth parameter count is 0, and the client starts to enter a next second cycle after sleeping for a period of time; otherwise, adding 1 to the third parameter wrung, judging whether the accumulated value wrung + + of the third parameter wrung exceeds a second threshold value, and if the accumulated value wrung + + of the third parameter wrung exceeds the second threshold value, reestablishing connection between the server and the client;
if the wrong + + does not exceed the second threshold, entering a third cycle, the client continuously sends a heartbeat packet to the server, and starts a second timer, if the client receives a reply from the server within the timing time of the second timer, the client stops timing of the second timer, and re-assigns values to a third parameter wrong and a fourth parameter count of the client, wherein the third parameter wrong is 0, the fourth parameter count is 0, and the client starts to enter the next round of second cycle after sleeping for a period of time;
and if the client does not receive the reply of the server within the timing time of the second timer, adding 1 to the third parameter wrong, judging whether the accumulated value wrong + + of the third parameter wrong exceeds a second threshold value, if so, reestablishing the connection between the client and the server, and if not, entering a third cycle again until wrong + + exceeds the second threshold value, ending the third cycle, and reestablishing the connection between the client and the server.
According to the processing method of the server and the client, the server and the client can be dormant during conventional communication, so that system resources are saved; the heartbeat mechanism enables the TCP to keep long connection, and three-way handshake only occurs at the beginning of communication, so that time consumption is reduced, and communication delay is reduced; and when the server and the client do not receive the reply of the other party within the timing time of the corresponding timer, the server and the client can be immediately retransmitted, and when the values of the first parameter wrng and the third parameter wrng exceed the second threshold, the disconnection between the server and the client can be judged.
The data is time-efficient, that is, the data does not overflow, the data exceeding the time efficiency is directly discarded, and the data successfully sent and reliably replied is deleted in the buffer memory and is not accumulated until the data exceeds the capacity. The data to be sent is stored in the cache, when the error occurs and the communication needs to be reconnected, the data in the cache cannot be influenced, and when the reconnection is successful, the data in the cache is continuously sent; the buffer memory is guaranteed not to overflow, and the data with lost packets are better stored.
Specifically, the cycle time of the first cycle and the second cycle is both greater than 100ms and less than 500 ms. The heartbeat mechanism of the TCP is sent once within 2 hours, the response is too slow under the extreme conditions of network disconnection and the like, the lost data can still be continuously retransmitted in the first time when the network is disconnected, and finally the buffer overflow or the packet loss is caused, and the cycle time of the first cycle and the second cycle is both more than 100ms and less than 500ms, so the interval for sending the heartbeat packets is far less than 2 hours.
The remote control system of the robot adopts the communication method based on the TCP protocol when the server interacts with the robot.
The invention has the following advantages and beneficial effects:
according to the communication method based on the TCP protocol and the robot remote control system, the self-defined message structure body reduces the data volume of each sending task, and the sending success rate is improved by reducing the communication load; the long connection reduces the time consumption of frequent reconnection, and only the initial connection needs 3 times of handshaking, so that the delay is reduced; because the load of single sending is reduced, more frequent sending can be realized, the disconnection can be quickly detected, the self-defined reconnection setting ensures that the buffer memory cannot overflow, and the lost data can be better stored. The performance of the robot remote control system applying the communication method is better.
Drawings
The accompanying drawings, which are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the principles of the invention. In the drawings:
FIG. 1 is a flow chart of a server side according to the present invention.
Fig. 2 is a flow chart of the client according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to examples and accompanying drawings, and the exemplary embodiments and descriptions thereof are only used for explaining the present invention and are not meant to limit the present invention.
Example 1
A communication method based on a TCP protocol comprises the following steps:
self-defining a message structure body of a TCP (transmission control protocol);
and respectively carrying out initial assignment on parameters of the server side and the client side: parameters of the server side: a first parameter wrung is 0 and represents the number of times of errors when the server communicates with the client, and a second parameter count is 0 and represents the number of cycles of the server; the parameters of the client are as follows: a third parameter wrong is 0, which represents the number of times of errors when the client communicates with the server, and a fourth parameter count is 0, which represents the number of cycles of the client;
establishing communication connection between a server side and a client side through three-way handshake;
and after the server and the client finish communication establishment and initial assignment, the server and the client interact based on the message structure and the initial assignment.
The message structure body in the embodiment comprises a data packet and a heartbeat packet, and the message structure body is an empty packet when being sent as the heartbeat packet; when the data packet is sent, the data packet comprises a serial number of a control command, a storage address of the control command and a time stamp generated by the control command.
In this embodiment, the timing times of the first timer at the server side and the second timer at the client side are both set to 1s, and the cycle times of the first cycle and the second cycle are both 200 ms.
As shown in fig. 1, when the server interacts with the client, the interaction process of the server includes the following steps:
the method comprises the steps that a first cycle starts, 1 is added to a second parameter count, a first timer is reset, a server side starts to receive a data packet of a client side, if the server side receives the data packet of the client side, the data packet is processed, and the client side is replied, otherwise, the server side judges whether a control command to be sent exists in a current queue, if the control command to be sent does not exist in the current queue of the server side, whether the accumulated value count + + of the second parameter count is larger than 10 is judged, if the accumulated value count + + of the second parameter count is not larger than 10, the server side sleeps for 200ms, and the next round of first cycle starts to enter;
if the accumulated value of the count + + is greater than 10, the server side sends a heartbeat packet to the client side and starts a first timer, if the server side does not receive the reply of the client side within 1s, the first parameter wrong value of the server side is added with 1, whether wrong + + is greater than 3 or not is judged, and if the wrong + + is greater than 3, the server side and the client side are reestablished to be connected; otherwise, the server starts to enter the next first cycle;
if the server receives the reply of the client in 1s, stopping timing of the first timer, reassigning a first parameter wrung and a second parameter count of the server, wherein the first parameter wrung is 0, the second parameter count is 0, and the server starts to enter a next round of first cycle after sleeping for 200 ms;
if the current queue of the server side has a control command to be sent, the server side sends a data packet to the client side, a first timer is started, if the server side does not receive the reply of the client side within 1s, the first parameter wrong is added with 1, whether the accumulated value wrong + + of the first parameter wrong is larger than 3 or not is judged, if the accumulated value wrong + + of the first parameter wrong is larger than 3, the server side and the client side are connected again, and if the accumulated value wrong + + of the first parameter wrong is not larger than 3, the server side starts to enter the next first cycle;
and if the server receives the reply of the client in 1s, stopping timing of the first timer, and reassigning a first parameter wrong and a second parameter count of the server, wherein the first parameter wrong is 0, the second parameter count is 0, and the server starts to enter the next round of first cycle after sleeping for 200 ms.
As shown in fig. 2, when the server interacts with the client, the interaction process of the client includes the following steps:
the second cycle starts, the fourth parameter count is added with 1, the second timer is reset, the client starts to receive the data packet of the server, if the client receives the data packet of the server, the data packet is processed and replied to the server, after the reply is finished, the client enters the sleep mode, and after the sleep mode is 200ms, the client enters the next second cycle;
if the client does not receive the data packet of the server, judging whether the accumulated value count + + of the fourth parameter count exceeds 10, if not, enabling the client to sleep for a period of time, and then entering a next second cycle; otherwise, the client sends a heartbeat packet to the server, and starts a second timer, if the client receives a reply from the server within 1s, the client stops timing by the second timer, and re-assigns a third parameter wrong and a fourth parameter count of the client, wherein the third parameter wrong is 0, the fourth parameter count is 0, the client sleeps for 20ms, and starts to enter a next second cycle; otherwise, adding 1 to the third parameter wrng, judging whether the accumulated value wrng + + of the third parameter wrng exceeds 3, if so, reestablishing connection between the server and the client, if not, entering a third cycle, continuously sending heartbeat packets to the server by the client, starting a second timer, if the client receives a reply from the server within 1s, stopping timing by the client, reassigning the third parameter wrng and a fourth parameter count of the client, setting the third parameter wrng to 0, setting the fourth parameter count to 0, and after sleeping for 200ms, starting entering a next second cycle;
and if the client does not receive the reply of the server within 1s, adding 1 to the third parameter wrong, judging whether the accumulated value wrong + + of the third parameter wrong exceeds 3, if so, reestablishing the connection between the client and the server, and if not, entering the third cycle again until wrong + + exceeds 3, ending the third cycle, and reestablishing the connection between the client and the server.
In the self-defined message structure, the data packet and the heartbeat packet are combined, so that the content of the message is simplified, the tcp packet packaging problem is not needed to be worried about, the probability of packet loss is reduced, and the times of message retransmission are reduced, so that the communication delay is reduced.
According to the processing method of the server and the client, the server and the client can sleep for 200ms during conventional communication, so that system resources are saved; the heartbeat mechanism enables the TCP to keep long connection, and three-way handshake only occurs at the beginning of communication, so that time consumption is reduced, and communication delay is reduced; in the embodiment, the cycle time of the first cycle and the second cycle is 200ms, and a heartbeat packet is sent when the cycle exceeds 10 times, so that in the embodiment, a heartbeat packet is sent once every 2 seconds, while a heartbeat mechanism of the TCP is sent once every 2 hours, and the response is too slow.
Example 2
The traditional TCP protocol is used in the existing robot remote control, and the performance of the robot remote control is easily influenced due to the problems of the traditional TCP protocol.
In the remote control system of the robot, when the server interacts with the robot, the communication method based on the TCP protocol in embodiment 1 is adopted.
The process of the robot remote control comprises the following steps:
step 1: the C language realizes the interface and compiles into a dynamic library, and the dynamic library is respectively used in a server and a robot;
step 2: starting a server, starting the robot normally, and automatically connecting the robot to the server;
and step 3: and opening a browser to input a website to enter the remote control system, selecting an operation command, transmitting the operation command to the server, and controlling the robot to move by the server according to the operation command.
When the network is normal, the measured control command is issued to the robot within 1s of action interval; when the network signal is poor, the control command is issued to the robot at an action interval of 2s, the poor network which lasts for a period of time is considered to be disconnected, and reconnection is started quickly after the disconnection.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (7)

1. A communication method based on TCP protocol is characterized by comprising the following steps:
self-defining a message structure body of a TCP (transmission control protocol);
and respectively carrying out initial assignment on parameters of the server side and the client side: parameters of the server side: a first parameter wrung is 0 and represents the number of times of errors when the server communicates with the client, and a second parameter count is 0 and represents the number of cycles of the server; the parameters of the client are as follows: a third parameter wrong is 0, which represents the number of times of errors when the client communicates with the server, and a fourth parameter count is 0, which represents the number of cycles of the client;
establishing communication connection between a server side and a client side through three-way handshake;
and after the server and the client finish communication establishment and initial assignment, the server and the client interact based on the message structure body and the initial assignment.
2. The TCP protocol-based communication method according to claim 1, wherein the message structure comprises a data packet and a heartbeat packet.
3. The communication method according to claim 2, wherein the message structure is an empty packet when it is sent as a heartbeat packet; when the message structure is sent as a data packet, the message structure comprises a serial number of a control command, a storage address of the control command and a timestamp generated by the control command.
4. The communication method based on the TCP protocol according to claim 1, wherein when the server side interacts with the client side, the interaction process of the server side includes the following steps:
the method comprises the steps that a first cycle is started, a second parameter count is added with 1, a first timer is reset, a server side starts to receive a data packet of a client side, if the server side receives the data packet of the client side, the data packet is processed and replied to the client side, otherwise, the server side judges whether a control command to be sent exists in a current queue, if the control command to be sent does not exist in the current queue of the server side, whether an accumulated value count + + of the second parameter count is larger than a first threshold value or not is judged, if the accumulated value count + + of the second parameter count is not larger than the first threshold value, the server side starts to enter a next round of first cycle after sleeping for a period of time;
if the accumulated value of the count + + is greater than the first threshold value, the server side sends a heartbeat packet to the client side and starts a first timer, if the server side does not receive a reply of the client side within the timing time of the first timer, a first parameter wrong value of the server side is added with 1, whether the wrong + + is greater than a second threshold value or not is judged, and if the wrong + + is greater than the second threshold value, the server side and the client side are reestablished to be connected; otherwise, the server starts to enter the next first cycle;
if the server receives the reply of the client within the timing time of the first timer, stopping timing of the first timer, and re-assigning a first parameter wrong and a second parameter count of the server, wherein the first parameter wrong is 0, the second parameter count is 0, and the server starts to enter a next round of first cycle after sleeping for a period of time;
if the current queue of the server side has a control command to be sent, the server side sends a data packet to the client side and starts a first timer, if the server side does not receive a reply of the client side within the timing time of the first timer, the first parameter wrong is added with 1, whether the accumulated value wrong + + of the first parameter wrong is larger than a second threshold value or not is judged, if the accumulated value wrong + + of the first parameter wrong is larger than the second threshold value, the server side and the client side are connected again, and if the accumulated value wrong + + of the first parameter wrong is larger than the second threshold value, the server side starts to enter the next round of first circulation;
and if the server receives the reply of the client within the timing time of the first timer, stopping timing of the first timer, and reassigning a first parameter wrung and a second parameter count of the server, wherein the first parameter wrung is 0, the second parameter count is 0, and the server starts to enter a next round of first cycle after sleeping for a period of time.
5. The communication method based on the TCP protocol according to claim 1, wherein when the server side interacts with the client side, the interaction process of the client side includes the following steps:
the second cycle starts, the fourth parameter count is added with 1, the second timer is reset, the client starts to receive the data packet of the server, if the client receives the data packet of the server, the data packet is processed and replied to the server, after the reply is finished, the client enters the dormancy, and after the dormancy is finished, the client enters the next second cycle;
if the client does not receive the data packet of the server, judging whether the accumulated value count + + of the fourth parameter count exceeds a first threshold value, if not, enabling the client to sleep for a period of time, and then entering a next second cycle; otherwise, the client sends a heartbeat packet to the server, and starts a second timer, if the client receives a reply from the server within the timing time of the second timer, the client stops timing of the second timer, and re-assigns a third parameter wrong and a fourth parameter count of the client, wherein the third parameter wrong is 0, the fourth parameter count is 0, and the client starts to enter a next second cycle after sleeping for a period of time; otherwise, adding 1 to the third parameter wrung, judging whether the accumulated value wrung + + of the third parameter wrung exceeds a second threshold value, and if the accumulated value wrung + + of the third parameter wrung exceeds the second threshold value, reestablishing connection between the server and the client;
if the wrong + + does not exceed the second threshold, entering a third cycle, the client continuously sends a heartbeat packet to the server, and starts a second timer, if the client receives a reply from the server within the timing time of the second timer, the client stops timing of the second timer, and re-assigns values to a third parameter wrong and a fourth parameter count of the client, wherein the third parameter wrong is 0, the fourth parameter count is 0, and the client starts to enter the next round of second cycle after sleeping for a period of time;
and if the client does not receive the reply of the server within the timing time of the second timer, adding 1 to the third parameter wrong, judging whether the accumulated value wrong + + of the third parameter wrong exceeds a second threshold value, if so, reestablishing the connection between the client and the server, and if not, entering a third cycle again until wrong + + exceeds the second threshold value, ending the third cycle, and reestablishing the connection between the client and the server.
6. A communication method according to claim 1, wherein the cycle time of each of the first cycle and the second cycle is greater than 100ms and less than 500 ms.
7. A remote control system for a robot, wherein a server performs a communication method based on a TCP protocol according to any one of claims 1 to 6 when interacting with the robot.
CN202110517047.5A 2021-05-12 2021-05-12 Communication method based on TCP protocol and robot remote control system Active CN113259432B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110517047.5A CN113259432B (en) 2021-05-12 2021-05-12 Communication method based on TCP protocol and robot remote control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110517047.5A CN113259432B (en) 2021-05-12 2021-05-12 Communication method based on TCP protocol and robot remote control system

Publications (2)

Publication Number Publication Date
CN113259432A true CN113259432A (en) 2021-08-13
CN113259432B CN113259432B (en) 2022-07-08

Family

ID=77222991

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110517047.5A Active CN113259432B (en) 2021-05-12 2021-05-12 Communication method based on TCP protocol and robot remote control system

Country Status (1)

Country Link
CN (1) CN113259432B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006295847A (en) * 2005-04-14 2006-10-26 Nec Corp Retransmission control apparatus
JP2010141769A (en) * 2008-12-15 2010-06-24 Fujitsu Microelectronics Ltd Communication equipment
CN106027208A (en) * 2016-04-29 2016-10-12 中国科学院信息工程研究所 Feedback-based network code TCP (Transmission Control Protocol) decoding method and device
CN106254179A (en) * 2016-08-05 2016-12-21 深圳先进技术研究院 A kind of heartbeat packet asynchronous controlling method and device
WO2018132966A1 (en) * 2017-01-18 2018-07-26 华为技术有限公司 Aging latency detection method, device, data center, and system
CN110753035A (en) * 2019-09-27 2020-02-04 上海大学 FPGA (field programmable Gate array) ultralow-delay communication transmission method based on TCP (Transmission control protocol)
CN110958264A (en) * 2019-12-13 2020-04-03 电子科技大学中山学院 Server communication method based on TCP/IP protocol
CN112714113A (en) * 2020-12-23 2021-04-27 上海有个机器人有限公司 Robot network self-repairing method, device, terminal and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006295847A (en) * 2005-04-14 2006-10-26 Nec Corp Retransmission control apparatus
JP2010141769A (en) * 2008-12-15 2010-06-24 Fujitsu Microelectronics Ltd Communication equipment
CN106027208A (en) * 2016-04-29 2016-10-12 中国科学院信息工程研究所 Feedback-based network code TCP (Transmission Control Protocol) decoding method and device
CN106254179A (en) * 2016-08-05 2016-12-21 深圳先进技术研究院 A kind of heartbeat packet asynchronous controlling method and device
WO2018132966A1 (en) * 2017-01-18 2018-07-26 华为技术有限公司 Aging latency detection method, device, data center, and system
CN110753035A (en) * 2019-09-27 2020-02-04 上海大学 FPGA (field programmable Gate array) ultralow-delay communication transmission method based on TCP (Transmission control protocol)
CN110958264A (en) * 2019-12-13 2020-04-03 电子科技大学中山学院 Server communication method based on TCP/IP protocol
CN112714113A (en) * 2020-12-23 2021-04-27 上海有个机器人有限公司 Robot network self-repairing method, device, terminal and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
俞一帆等: "针对无线上行链路的TCP跨层改进机制", 《电路与系统学报》 *
胡志坤等: "基于改进心跳包机制的整流远程监控系统", 《计算机应用》 *

Also Published As

Publication number Publication date
CN113259432B (en) 2022-07-08

Similar Documents

Publication Publication Date Title
US7978599B2 (en) Method and system to identify and alleviate remote overload
KR101785483B1 (en) Method for acting as service agent, modem and terminal
EP3331197B1 (en) A method and system for monitoring a connection status of a device
KR100602651B1 (en) Apparatus and method of tcp connection management
CN112261142B (en) RDMA network data retransmission method, device and FPGA
JPH053941B2 (en)
CN103096271A (en) Information pushing system and information pushing method
CN112887063B (en) Data packet transmission method and device, storage medium and electronic equipment
CN112436994A (en) Data transmission method and electronic equipment
CN108924485B (en) Client real-time video stream interrupt processing method and system and monitoring system
US8943362B2 (en) Control and monitoring for fast millimeter-wave link using out-of-band wireless channel
EP1768312A1 (en) A method for data transmission between network apparatus
EP3125490A1 (en) A method and computer program products for probing the status of an ip-based communication connection in order to receive an incoming communication
CN113259432B (en) Communication method based on TCP protocol and robot remote control system
US11240138B2 (en) Management of network connections
CN110933470A (en) Video data sharing method
CN103001885B (en) data message transmission method and system
CN105406955A (en) Data output control method and system
CN101014121A (en) Method for controlling video transmission based on IEEE 1394b protocol and fiber
CN114125021B (en) Terminal information release system based on Netty message drive
US20180376326A1 (en) Reliable write command protocol for bluetooth le
CN110533897B (en) Socket-based coffee roasting communication method
CN114153781A (en) SSP connection management method and device
CN114363999B (en) Method, device and storage medium for sending downlink instructions of Internet of things
US20170142748A1 (en) Method and Apparatus for Managing Uplink Traffic from a Client Device in a Communication Network

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
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A Communication Method and Robot Remote Control System Based on TCP Protocol

Effective date of registration: 20230921

Granted publication date: 20220708

Pledgee: Zhongguancun Beijing technology financing Company limited by guarantee

Pledgor: Beijing Jiemai Polytron Technologies Inc.

Registration number: Y2023990000469

PC01 Cancellation of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Granted publication date: 20220708

Pledgee: Zhongguancun Beijing technology financing Company limited by guarantee

Pledgor: Beijing Jiemai Polytron Technologies Inc.

Registration number: Y2023990000469

PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A Communication Method and Robot Remote Control System Based on TCP Protocol

Granted publication date: 20220708

Pledgee: Beijing Bank Co.,Ltd. Beiyuan Road Branch

Pledgor: Beijing Jiemai Polytron Technologies Inc.

Registration number: Y2024990000101