CN111103834A - Method for reducing remote control delay of industrial control equipment based on KCP protocol - Google Patents

Method for reducing remote control delay of industrial control equipment based on KCP protocol Download PDF

Info

Publication number
CN111103834A
CN111103834A CN201911355322.7A CN201911355322A CN111103834A CN 111103834 A CN111103834 A CN 111103834A CN 201911355322 A CN201911355322 A CN 201911355322A CN 111103834 A CN111103834 A CN 111103834A
Authority
CN
China
Prior art keywords
kcp
protocol
client
function
parameter
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.)
Pending
Application number
CN201911355322.7A
Other languages
Chinese (zh)
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 Casicloud Co ltd
Original Assignee
Beijing Casicloud 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 Beijing Casicloud Co ltd filed Critical Beijing Casicloud Co ltd
Priority to CN201911355322.7A priority Critical patent/CN111103834A/en
Publication of CN111103834A publication Critical patent/CN111103834A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0428Safety, monitoring
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24024Safety, surveillance

Abstract

The invention discloses a method for reducing remote control delay of industrial control equipment based on a KCP protocol, which comprises the following steps: building supportKCPA client of the protocol; building supportKCPOf a protocolserverA terminal; sending a parameter modification control instruction to the client; acquiring and analyzing a modified parameter control instruction; sending a modified parameter control instruction to the sensor device; acquiring an instruction, modifying the operation state parameter data, and sending the operation state parameter data to the client; acquiring running state parameter data of the modified sensor equipment; to the direction ofserverTransmitting sensor equipment parameter data by a terminal; and acquiring and analyzing the received sensor equipment parameter data. By usingKCPThe protocol carries out bottom layer communication, thereby accelerating the communication speed, ensuring the communication quality and ensuring the accuracy, high efficiency and timeliness of the remote control of the industrial control equipment.

Description

Method for reducing remote control delay of industrial control equipment based on KCP protocol
Technical Field
The invention relates to the technical field of industrial Internet of things, in particular to a method for reducing remote control delay of industrial control equipment based on a KCP protocol.
Background
Based on the production and manufacturing development trend of the integration of the Internet of things and the Internet, related enterprises around the world accelerate the step of production structure transformation, and promote the research and development of intelligent and networked production and manufacturing equipment so as to meet the development requirements of the equipment manufacturing industry. Intelligent manufacturing is the core of the fourth industrial revolution, and the basic idea is that the manufacturing process has intelligent sensing and communication capability and can carry information required in the whole supply chain and product life cycle; production equipment required in the whole production process can realize self-organization, and a production plan is flexibly determined according to the current production condition; in the manufacturing process, the intelligent sensing, intercommunication interconnection and data integration of the manufacturing system are realized by integrating production equipment resources through the Internet of things; and the intelligent services such as real-time monitoring, equipment maintenance, scheduling management, quality control and the like in the manufacturing process are realized through real-time data analysis and prediction.
The remote control of the industrial control equipment is a key basis for realizing intelligent manufacturing, the number of times that production line workers need to operate on site can be reduced, the working efficiency of a production workshop is improved, and the labor intensity is reduced. With the continuous development of the manufacturing industry towards digitalization, intellectualization and networking, higher requirements are put forward on the real-time performance of the remote control of the industrial control equipment, and the real-time performance in the remote control has great influence on the use experience of a client user, the safety of machine tool machining and the like, so that a lot of industrial environments need time reaching the microsecond level. Most of the existing industrial communication protocols adopt a TCP/IP protocol as a bottom layer transmission protocol, and with the continuous development of requirements and new technologies, the defect that data is transmitted by adopting the TCP/IP protocol as the bottom layer transmission protocol is more and more obvious, and the requirement of the remote control service real-time performance of industrial control equipment cannot be supported.
Disclosure of Invention
Aiming at the technical problems in the related art, the invention provides a method for reducing the remote control delay of industrial control equipment based on a KCP protocol, which can overcome the defects in the prior art.
In order to achieve the technical purpose, the technical scheme of the invention is realized as follows:
a method for reducing remote control delay of industrial control equipment based on a KCP protocol comprises the following steps:
s1: building a client supporting a KCP protocol, wherein the client is an IOT gateway;
s2: building a server end supporting a KCP protocol;
s3: a server end sends a parameter modification control instruction to a client end by adopting a KCP protocol;
s4: the client side obtains and analyzes the modified parameter control instruction;
s5: the client sends a parameter modification control instruction to the sensor equipment;
s6: the sensor equipment acquires an instruction, modifies the operation state parameter data according to the modification parameter control instruction, and sends the operation state parameter data to the client;
s7: the client acquires the running state parameter data of the modified sensor equipment;
s8: transmitting sensor equipment parameter data to a server by a client side by adopting a KCP protocol;
s9: and the server terminal acquires and analyzes the received parameter data of the sensor equipment.
Further, the step S3 includes the following steps:
s31: creating a KCP object;
s32: setting a transmission callback function;
s33: calling an ikco _ update function to update the kcp state, wherein the ikco _ update function is an update function;
s34: inputting an application layer data packet;
s35: and sending the instruction to the client by adopting an ikcp _ send function, wherein the ikcp _ send function is a transmission data function.
Further, the step S31 further includes the following steps:
s311: initializing a KCP object;
s312: detecting consistency of conv of a server end and a client end, wherein conv is an integer representing a session number;
s313: and confirming the data packets of the server and the client.
Further, the step S4 includes the following steps:
s41: calling an ikcp _ recv function, and receiving a modification parameter control instruction data packet, wherein the ikcp _ recv function is a data receiving function;
s42: and decompressing and analyzing the modification parameter control instruction data packet.
Further, in the step S5, the sent modified parameter control command is encoded and confirmed.
Further, in step S33, the loop call interval time must be set before calling the ikco _ update function.
The invention has the beneficial effects that: the KCP protocol is applied to remote control of the industrial control equipment, and the KCP protocol is used as a bottom layer transmission protocol for data transmission, so that the delay time is reduced by more than three times, the quality of data transmission is guaranteed, the accuracy, the efficiency and the timeliness of communication are realized, the scene with high requirements on the remote control real-time performance and the reliability of the industrial control equipment is supported, and the technical support is provided for improving the digitalization, the networking and the intelligentization level of the development and manufacturing industry, and creating a new generation of information technology industry and a high-end equipment manufacturing industry.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a flow chart of a method for reducing remote control delay of industrial control equipment based on a KCP protocol according to an embodiment of the invention;
FIG. 2 is a KCP source code flow diagram of a method for reducing remote control delay of industrial control equipment based on a KCP protocol according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present invention.
As shown in fig. 1, a method for reducing remote control delay of an industrial control device based on a KCP protocol according to an embodiment of the present invention includes the following steps:
s1: building a client supporting a KCP protocol, wherein the client is an IOT gateway;
s2: building a server end supporting a KCP protocol;
s3: a server end sends a parameter modification control instruction to a client end by adopting a KCP protocol;
s4: the client side obtains and analyzes the modified parameter control instruction;
s5: the client sends a parameter modification control instruction to the sensor equipment;
s6: the sensor equipment acquires an instruction, modifies the operation state parameter data according to the modification parameter control instruction, and sends the operation state parameter data to the client;
s7: the client acquires the running state parameter data of the modified sensor equipment;
s8: transmitting sensor equipment parameter data to a server by a client side by adopting a KCP protocol;
s9: and the server terminal acquires and analyzes the received parameter data of the sensor equipment.
Step S3 includes the following steps:
s31: creating a KCP object;
s32: setting a transmission callback function;
s33: calling an ikco _ update function to update the kcp state, wherein the ikco _ update function is an update function;
s34: inputting an application layer data packet;
s35: and sending the instruction to the client by adopting an ikcp _ send function, wherein the ikcp _ send function is a transmission data function.
Step S31 further includes the steps of:
s311: initializing a KCP object;
s312: detecting consistency of conv of a server end and a client end, wherein conv is an integer representing a session number;
s313: and confirming the data packets of the server and the client.
Step S4 includes the following steps:
s41: calling an ikcp _ recv function, and receiving a modification parameter control instruction data packet, wherein the ikcp _ recv function is a data receiving function;
s42: and decompressing and analyzing the modification parameter control instruction data packet.
In an embodiment of the present invention, in the step S5, the sent modified parameter control command is encoded and confirmed.
In one embodiment of the present invention, in step S33, a loop call interval time must be set before calling the ikco _ update function.
In order to facilitate understanding of the above-described technical aspects of the present invention, the above-described technical aspects of the present invention will be described in detail below in terms of specific usage.
The advantages of adopting the KCP protocol:
with the rapid development of industrial internet of things, the requirements for the real-time performance and reliability of remote control of industrial control equipment are increasingly improved, a lot of industrial environments need microsecond-level time, the defect that data is transmitted by using TCP/IP as a bottom layer transmission protocol is more and more obvious, and the requirement for the real-time performance of remote control services of the industrial control equipment is difficult to support. Under the scene that the requirements on the real-time performance and the reliability of the remote control of the industrial control equipment are high, a KCP (KCP) protocol is considered to replace a TCP (transmission control protocol);
KCP is a fast and reliable protocol that can trade off the transmission effect of 30% -40% reduction in average delay and three times reduction in maximum delay at the cost of 10% -20% of the bandwidth wasted over TCP. TCP is designed for traffic (how many KB of data can be transmitted per second) and it is important to make full use of bandwidth. While KCP is designed for flow rate (how much time is required for a single packet to be sent from side to side), it trades off the cost of 10% -20% of bandwidth waste for 30% -40% faster transmission than TCP. The TCP channel is a large canal with very slow flow rate but large flow rate per second, while the KCP is a small torrent with rapid water flow.
The KCP takes a series of measures to improve the network transmission rate:
(1) RTO doubling vs is not doubled
The TCP timeout is calculated, so that three packets are continuously lost, and the KCP starts the fast mode, so that the transmission speed is greatly improved.
(2) Selective retransmission vs all retransmissions
When TCP loses packet, it will retransmit the data after the lost packet, KCP is selective retransmission, only retransmit the data packet really lost.
(3) Fast retransmission
The sending end sends 1, 2, 3, 4, 5 packets, and then receives the ACK from the far end: 1, 3, 4, 5, when receiving ACK3, KCP knows that 2 is skipped by 1 time, when receiving ACK4, KCP knows that 2 is skipped by 2 times, and at this moment, 2 can be considered lost, and No. 2 packet is directly retransmitted without waiting for overtime, thereby greatly improving the transmission speed when packet is lost.
(4) Delayed ACK vs non-delayed ACK
In order to fully utilize bandwidth, TCP delays sending ACK (no useful), so that timeout calculation calculates a larger RTT time, and the determination process of packet loss is prolonged. Whether the ACK of the KCP is delayed from being transmitted can be adjusted.
(5)UNA vs ACK+UNA
The ARQ model responses are two, UNA (all packets received before this numbering, such as TCP) and ACK (the numbered packet received), and using only UNA results in a total retransmission, and using only ACK results in a too high loss cost, which was the alternative to the previous protocol, whereas in the KCP protocol all packets have UNA information except for the ACK packet alone.
(6) Non-back-off flow control
The KCP normal mode uses a fair back-off rule like TCP, namely the size of a sending window is determined by four factors of sending buffer size, the size of the residual receiving buffer of a receiving end, packet loss back-off and slow start, but when small data with high requirement on timeliness is transmitted, two steps after skipping can be selected to be configured, and the sending frequency is controlled by only the first two items, so that the effect that BT can be smoothly transmitted is obtained at the expense of partial fairness and bandwidth utilization rate.
In summary, by means of the above technical solution of the present invention, a KCP protocol is applied to remote control of an industrial control device, and the KCP protocol is used as a bottom layer transmission protocol for data transmission, so that the delay time is reduced by more than three times, and the quality of data transmission is ensured, so that the communication is accurate, efficient and timely, a scenario with high requirements for real-time performance and reliability of remote control of the industrial control device is supported, and a technical support is provided for improving the digital, networked and intelligent levels of development and manufacturing industry, and creating a new generation of information technology industry and high-end equipment manufacturing industry.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (6)

1. A method for reducing remote control delay of industrial control equipment based on a KCP protocol is characterized by comprising the following steps:
s1: building supportKCPA client of the protocol, wherein the client isIOTA gateway;
s2: building supportKCPOf a protocolserverA terminal;
s3: by usingKCPThe protocol is such that the protocol is,serverthe terminal sends a parameter modification control instruction to the client;
s4: the client side obtains and analyzes the modified parameter control instruction;
s5: the client sends a parameter modification control instruction to the sensor equipment;
s6: the sensor equipment acquires an instruction, modifies the operation state parameter data according to the modification parameter control instruction, and sends the operation state parameter data to the client;
s7: the client acquires the running state parameter data of the modified sensor equipment;
s8: by usingKCPProtocol, client toserverTransmitting sensor equipment parameter data by a terminal;
s9: and the server terminal acquires and analyzes the received parameter data of the sensor equipment.
2. The method for reducing remote control delay of industrial control equipment based on KCP protocol as claimed in claim 1, wherein said step S3 includes the following steps:
s31: creatingKCPAn object;
s32: setting a transmission callback function;
s33: invokingikco_updateFunction, updatekcpThe state in which, among other things,ikco_updatethe function is an updating function;
s34: inputting an application layer data packet;
s35: by usingikcp_sendA function that sends instructions to the client, wherein,ikcp_sendthe function is a transfer data function.
3. The method for reducing remote control delay of industrial control equipment based on KCP protocol as claimed in claim 2, wherein said step S31 further comprises the steps of:
s311: initializationKCPAn object;
s312: detecting server and clientconvThe consistency of (a), wherein,convis an integer representing a session number;
s313: confirmationserverEnd and client data packets.
4. The method for reducing remote control delay of industrial control equipment based on KCP protocol as claimed in claim 2, wherein said step S4 includes the following steps:
s41: invokingikcp_recvA function that receives a modify parameter control instruction packet, wherein,ikcp_recvthe function is a data receiving function;
s42: and decompressing and analyzing the modification parameter control instruction data packet.
5. The method for reducing remote control delay of industrial control equipment based on KCP protocol as claimed in claim 2, wherein in step S5, the transmitted modified parameter control command is encoded and confirmed.
6. The method for reducing remote control delay of industrial control equipment based on KCP protocol as claimed in claim 2, wherein in step S33, call is madeikco_updateThe function must be preceded by a loop call interval time.
CN201911355322.7A 2019-12-25 2019-12-25 Method for reducing remote control delay of industrial control equipment based on KCP protocol Pending CN111103834A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911355322.7A CN111103834A (en) 2019-12-25 2019-12-25 Method for reducing remote control delay of industrial control equipment based on KCP protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911355322.7A CN111103834A (en) 2019-12-25 2019-12-25 Method for reducing remote control delay of industrial control equipment based on KCP protocol

Publications (1)

Publication Number Publication Date
CN111103834A true CN111103834A (en) 2020-05-05

Family

ID=70424767

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911355322.7A Pending CN111103834A (en) 2019-12-25 2019-12-25 Method for reducing remote control delay of industrial control equipment based on KCP protocol

Country Status (1)

Country Link
CN (1) CN111103834A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112019568A (en) * 2020-10-19 2020-12-01 北京太一星晨信息技术有限公司 Message forwarding method, device and communication method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107624231A (en) * 2016-12-02 2018-01-23 深圳前海达闼云端智能科技有限公司 Method, apparatus, server and the computer program product that data send, received
CN107682260A (en) * 2017-10-23 2018-02-09 深圳智多豚物联技术有限公司 A kind of fast and reliable network communication method of multipath
CN109474365A (en) * 2018-12-29 2019-03-15 深圳市柠檬互动科技有限公司 A kind of frame synchronization UDP network synchronization method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107624231A (en) * 2016-12-02 2018-01-23 深圳前海达闼云端智能科技有限公司 Method, apparatus, server and the computer program product that data send, received
CN107682260A (en) * 2017-10-23 2018-02-09 深圳智多豚物联技术有限公司 A kind of fast and reliable network communication method of multipath
CN109474365A (en) * 2018-12-29 2019-03-15 深圳市柠檬互动科技有限公司 A kind of frame synchronization UDP network synchronization method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
韦易笑: "KCP快速可靠网络传输协议", 《百度》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112019568A (en) * 2020-10-19 2020-12-01 北京太一星晨信息技术有限公司 Message forwarding method, device and communication method and system

Similar Documents

Publication Publication Date Title
CN102204182B (en) Method and apparatus for controlling congestion of data transmission
Hu A system architecture for software-defined industrial Internet of Things
CN104954279B (en) A kind of transfer control method, apparatus and system
Xu et al. CMT-NC: improving the concurrent multipath transfer performance using network coding in wireless networks
CN107624231B (en) Method, device, server and computer program product for transmitting and receiving data
US20020078164A1 (en) System and method for data transfer acceleration in a TCP network environment
JP2004343698A (en) Rate control of server base in multimedia streaming environment
EP2647175A1 (en) Facilitating device-to-device communication
JP2001186210A (en) Method and system for transmitting message, communicating method, deferred acknowledge communication system, process control system and method for communicating application information
CN106507024B (en) A kind of self-adaption code rate method of adjustment and device
CN111064792A (en) Method for accelerating data acquisition of sensor equipment based on QUIC protocol
CN101212401B (en) Grid-oriented configurable data transmission method and system
CN101459496A (en) Regulating method and apparatus for timeout interval for messages
CN102801508A (en) Control method for processing network packet loss
CA2445221A1 (en) Method of controlling loop-back process in ethernet passive optical network
CN103763073A (en) Method for retransmission of lost data packet and terminal
US8171313B2 (en) Communication device and power supply method
CN102447627A (en) Message encapsulation/decapsulation device and method
CN107172658A (en) A kind of jamming control method transmitted applied to Internet of Things
CN102571912A (en) Method for realizing unload protocol stack based on multi-core processor and hybrid operating system
CN112436924B (en) Data transmission method and electronic equipment
CN1225883C (en) Bandwidth-saving phonetic transmission method
CN111103834A (en) Method for reducing remote control delay of industrial control equipment based on KCP protocol
CN106453356A (en) Wireless network bilateral accelerated transmission method and system
CN102811451B (en) Method and device for controlling connection of control and provisioning of wireless access points (Capwap) tunnel

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200505

RJ01 Rejection of invention patent application after publication