CN114545860A - Remote PLC maintenance method based on gateway of Internet of things - Google Patents

Remote PLC maintenance method based on gateway of Internet of things Download PDF

Info

Publication number
CN114545860A
CN114545860A CN202210217345.7A CN202210217345A CN114545860A CN 114545860 A CN114545860 A CN 114545860A CN 202210217345 A CN202210217345 A CN 202210217345A CN 114545860 A CN114545860 A CN 114545860A
Authority
CN
China
Prior art keywords
internet
gateway
things
plc
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.)
Pending
Application number
CN202210217345.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.)
Hegang Digital Technology Co ltd
Original Assignee
Hegang Digital Technology 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 Hegang Digital Technology Co ltd filed Critical Hegang Digital Technology Co ltd
Priority to CN202210217345.7A priority Critical patent/CN114545860A/en
Publication of CN114545860A publication Critical patent/CN114545860A/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/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • G05B19/054Input/output
    • 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/10Plc systems
    • G05B2219/13Plc programming
    • G05B2219/13142Debugging, tracing
    • 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

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a remote PLC maintenance method based on an Internet of things gateway, which comprises the following steps: s1, building a VPN server on a server with a fixed public network IP; s2, connecting the maintenance system and the gateway of the Internet of things to a VPN server through a VPN, configuring by taking the gateway of the Internet of things as a VPN client, and establishing an encryption channel; s3, realizing network address conversion in the gateway of the Internet of things through an iptables instruction; and S4, the maintenance system sends a connection instruction to the IP of the Internet of things gateway, the Internet of things gateway forwards the instruction to the PLC equipment, the two-way connection between the maintenance system and the PLC equipment is realized, and the PLC equipment is remotely maintained. The invention takes a network as a medium, connects the gateway of the Internet of things in a factory with the maintenance system by establishing a communication encryption channel, and realizes the remote maintenance of the PLC equipment by opening the network channel between the maintenance system and the PLC equipment by configuring a gateway network.

Description

Remote PLC maintenance method based on gateway of Internet of things
Technical Field
The invention relates to the field of computers and automation, in particular to a method for remotely maintaining a PLC (programmable logic controller) based on an Internet of things gateway.
Background
At present, the industrial industry of China is continuously and rapidly increased, and the automation and digitization degrees are continuously improved. In the field of industrial automation, most of automatic systems can be controlled by a PLC (programmable logic controller), the PLC has the advantages of convenience in operation, capability of flexibly combining control systems with different requirements, strong anti-interference capability, high reliability and stability in severe industrial environments and the like, is successfully applied to various fields of machinery, metallurgy, petroleum, chemical industry, textile, traffic, electric power, military and the like, and becomes one of four pillars of an industrial automation technology.
With the development of the industrial internet of things, the traditional PLC maintenance can be replaced by a new method, i.e., a remote scheme, in which an authorized user uses a computer or a mobile terminal device to monitor, control and manage the remote field working device and the working environment through a wired or wireless network transmission technology, and diagnoses, intervenes and maintains the remote field working device and the working environment as necessary.
Therefore, a fast and efficient method for remotely maintaining the PLC is urgently needed to improve the informatization level of the factory and reduce the maintenance cost.
Disclosure of Invention
The invention provides a method for remotely maintaining a PLC (programmable logic controller) based on an Internet of things gateway, aiming at the defects of the prior art, which takes a network as a medium, connects the Internet of things gateway and a maintenance system in a factory by establishing a communication encryption channel, and gets through the network channel between the maintenance system and a PLC device by configuring a gateway network so as to realize the remote maintenance of the PLC device.
In order to solve the above technical problems, the present invention comprises:
a method for remotely maintaining a PLC (programmable logic controller) based on an Internet of things gateway comprises the following steps:
s1, building a VPN server on a server with a fixed public network IP;
s2, connecting the maintenance system and the gateway of the Internet of things to a VPN server through VPN, configuring by taking the gateway of the Internet of things as a VPN client, and establishing an encryption channel;
s3, network address conversion is realized in the Internet of things gateway through an iptables instruction;
and S4, the maintenance system sends a connection instruction to the IP of the Internet of things gateway, the Internet of things gateway forwards the instruction to the PLC equipment, the two-way connection between the maintenance system and the PLC equipment is realized, and the PLC equipment is remotely maintained.
Further, the VPN server is an IPsec/L2TP type VPN server.
Further, in step S1, a tunnel scheme, an encryption algorithm, an authentication method, and a key management method are specified on the VPN server.
Further, in step S1, the construction of the VPN server specifically includes the following steps:
s1-1, detecting the running environment, determining the system type by using a linux system instruction lsb _ release, determining the system architecture by using a uname instruction, checking os-release determination system information, and judging the support condition of the current system;
s1-2, configuring the user, setting the user name, the user password and the IPsecPSK code with more than 20 bits;
s1-3, installing and configuring librescan to build a VPN server;
s1-4, configuring IP allocated network segment, server IP and DNS analysis address on VPN server; agreement protocol encryption mode, agreement protocol port and configuration of iptables to realize network flow control of the protocol;
and S1-5, creating system service through the instruction, and starting the system.
Further, in step S2, configuring the internet of things gateway as a VPN client, specifically including the following steps:
s2-1, installing VPN related tools comprising strongswan, xl2tpd and net-tools;
s2-2, configuring channel parameters including protocol type, encryption algorithm and server port; configuring an xl2tpd parameter, wherein the parameter comprises a virtual network card name, a VPN server address, IPSec _ PSK, a user name and a password;
s2-3, creating an xl2tpd control file, restarting strongswan and xl2tpd services, and connecting ipsec by using a configuration file;
s2-4, configuring a routing table, configuring the next hop address of the VPN server as the current default route, and modifying the default route to ppp 0;
s2-5, accessing IP address checking website, checking whether IP has been modified to VPN server address, checking whether VPN works normally.
Further, in step S3, configuring network address translation of the internet of things gateway, specifically including:
s3-1, starting a Linux system forwarding mode;
s3-2, modifying the header information of the inbound and outbound data, forwarding data of a certain port entering the external network card to a protocol port of the PLC, and forwarding the received PLC protocol data to a certain port of the external network card, thereby realizing the access of the external network to the internal network PLC.
Further, in step S4, for the PLC device based on network communication, the PLC communication interface is mapped to the external network by modifying the port of the network mapping, and the maintenance system is connected to the PLC device by accessing the address of the external network.
The invention has the beneficial effects that:
the invention constructs a virtual local area network crossing the network by a fixed IP server, and communicates the devices in different networks; the network communication uses an encryption channel to encrypt and transmit data, so that the data and connection safety are ensured; the network address conversion technology is used in the gateway to transmit data among different network cards and connect different local area networks; by using the gateway equipment of the internet of things with the capability of accessing the external network, the maintenance system can be networked with the gateway through the VPN, and further realize the maintenance function through a communication protocol.
According to the invention, through establishing the channel between the remote maintenance system and the PLC equipment, the problem that the existing equipment is out of order and can only be solved by personnel in a workshop is converted into the problem of mobilizing external human resources to carry out remote diagnosis and remote maintenance, the informatization level of a factory can be improved, the production cost is reduced, the production efficiency and the safety and reliability are improved, and considerable economic benefits are created for enterprises.
Drawings
Fig. 1 is a network diagram shown according to an embodiment of the present invention.
Detailed Description
For the purpose of promoting an understanding of the invention, reference will now be made in detail to the present embodiments of the invention, examples of which are illustrated in the accompanying drawings. It should be understood by those skilled in the art that the examples are only for the understanding of the present invention and should not be construed as the specific limitations of the present invention.
The invention provides a remote PLC maintenance method based on an Internet of things gateway, which comprises the following steps:
step S1, building IPsec/L2TP type VPN server on the server with fixed public network IP; a tunnel scheme, an encryption algorithm, an authentication mode, a key management mode and the like are specified on the VPN server.
The construction of the VPN server specifically comprises the following steps:
s1-1, detecting the operation environment: the VPN server supports systems above Debian8 or Ubuntu16.04 or CentOS7, determines the system type by using linux system instructions lsb _ release, determines the system architecture by using uname instructions, checks os-release determination system information and judges the support condition of the current system;
s1-2, performing user configuration: the VPN server supports multiple users, and sets a user name, a user password and an IPsecPSK code with more than 20 bits;
s1-3, installing and configuring librescan to build a VPN server: the VPN service installs libreswan based on an open source VPN library (libreswan), writes Makefile documents, and specifies the installation directory and information using make.
S1-4, in the using process, a set of virtual local area network is established by the VPN, each terminal has a unique IP identification, and a network segment allocated by the IP, a server IP and a DNS analysis address are configured on the VPN server to realize the function of the local area network; agreement protocol encryption mode, agreement protocol port and configuration of iptables to realize network flow control of the protocol;
and S1-5, creating system service through the instruction, and starting the system.
And step S2, connecting the maintenance system and the Internet of things gateway to a VPN server through VPN, configuring by taking the Internet of things gateway as a VPN client, and establishing an encryption channel.
The method comprises the following steps of configuring by taking an internet of things gateway as a VPN client, specifically:
s2-1, installing VPN related tools comprising strongswan, xl2tpd and net-tools;
s2-2, configuring channel parameters including protocol type, encryption algorithm and server port; configuring an xl2tpd parameter, which comprises a virtual network card name, a VPN server address, IPSec _ PSK, a user name and a password;
s2-3, creating an xl2tpd control file, restarting strongswan and xl2tpd services, and connecting ipsec by using a configuration file;
s2-4, configuring a routing table, configuring the next hop address of the VPN server as the current default route, and modifying the default route to ppp 0;
s2-5, accessing IP address checking website, checking whether IP has been modified to VPN server address, checking whether VPN works normally.
And step S3, realizing network address conversion in the gateway of the Internet of things through an iptables instruction.
Configuring Network Address Translation (NAT) of an Internet of things gateway, specifically comprising:
s3-1, starting a Linux system forwarding mode;
s3-2, modifying the header information of the inbound and outbound data, forwarding data of a certain port entering the external network card to a protocol port of the PLC, and forwarding the received PLC protocol data to a certain port of the external network card, thereby realizing the access of the external network to the internal network PLC.
A strategy for setting data filtering or processing data packets in linux is called a rule, and a plurality of rules are combined into a chain called a rule chain. The source and target IP addresses or ports in the data packet can be modified through the rule chain, and the access of the outer network maintenance system to the inner network PLC is realized.
And step S4, the maintenance system sends a connection instruction to the IP of the Internet of things gateway, the Internet of things gateway forwards the instruction to the PLC equipment, the two-way connection between the maintenance system and the PLC equipment is realized, and the PLC equipment is maintained remotely.
Aiming at the PLC equipment based on network communication, a PLC communication interface is mapped to an external network by modifying a port of network mapping, and a maintenance system is connected with the PLC equipment by accessing an external network address.
The invention fully utilizes network resources, realizes the connection between the maintenance system and the PLC among different networks by using the gateway of the Internet of things and the VPN server, integrates the functions of PLC data acquisition, VPN routing and NAT into a whole, and improves the factory informatization level and reduces the maintenance cost compared with the traditional VPN routing mode.
As shown in fig. 1, the network diagram according to the embodiment of the present invention is implemented by the method including:
(1) and (3) establishing a VPN server: and building a VPN server based on IPsec/L2TP on the Aliskiu platform ECS. As shown in fig. 1, the VPN server has an independent external network IP address 60.205.214.28 (the IP address is a VPN client connection address), and creates a class C network 192.168.42.0/24, and the address in the network is 192.168.42.1, and the devices in the same network segment form a virtual private network, and the devices can communicate with each other through the network.
(2) The maintenance system and the internet gateway are connected with the VPN server: connecting the maintenance system and the internet gateway with a VPN server, wherein the IP of a local area network of the maintenance system is 192.168.50.129, and after the maintenance system and the internet gateway are connected with the VPN server, a virtual network card is added, and the address is 192.168.42.10; the internet gateway is provided with double network cards, the network card eth0 is connected with the internet through a route, the IP is 192.168.28.30, after the VPN server is connected, a virtual network card is added, and the address is 192.168.42.11; through VPN networking, terminals in two different networks can access each other through a VPN server.
(3) And configuring network address conversion of the internet gateway to realize the intercommunication of the data of the double network cards. By configuring a rule chain in the Linux system, the network card eth0(192.168.28.30) and the network card eth1(192.168.200.1) can forward data from the internet to the PLC device (192.168.200.2), meanwhile, data of the PLC device can enter a gateway through eth1, and the data is converted in address and sent to the internet through eth1, so that data exchange of different network cards is realized.
(4) Remote operation and maintenance: after the steps, the maintenance system can access the gateway in a virtual local area network mode, access the PLC equipment through network address conversion, and complete remote access and maintenance of the PLC equipment through a communication protocol of the PLC.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (7)

1. A method for remotely maintaining a PLC (programmable logic controller) based on an Internet of things gateway is characterized by comprising the following steps: the method comprises the following steps:
s1, building a VPN server on a server with a fixed public network IP;
s2, connecting the maintenance system and the gateway of the Internet of things to a VPN server through VPN, configuring by taking the gateway of the Internet of things as a VPN client, and establishing an encryption channel;
s3, network address conversion is realized in the Internet of things gateway through an iptables instruction;
and S4, the maintenance system sends a connection instruction to the IP of the Internet of things gateway, the Internet of things gateway forwards the instruction to the PLC equipment, the two-way connection between the maintenance system and the PLC equipment is realized, and the PLC equipment is remotely maintained.
2. The method for remotely maintaining the PLC based on the gateway of the Internet of things of claim 1, wherein: the VPN server is an IPsec/L2TP type VPN server.
3. The method for remotely maintaining the PLC based on the gateway of the Internet of things of claim 1, wherein: in step S1, a tunnel scheme, an encryption algorithm, an authentication method, and a key management method are specified on the VPN server.
4. The method for remotely maintaining the PLC based on the gateway of the Internet of things of claim 1, wherein: in step S1, the construction of the VPN server specifically includes the following steps:
s1-1, detecting the running environment, determining the system type by using a linux system instruction lsb _ release, determining the system architecture by using a uname instruction, checking os-release determination system information, and judging the support condition of the current system;
s1-2, configuring the user, setting the user name, the user password and the IPsecPSK code with more than 20 bits;
s1-3, installing and configuring librescan to build a VPN server;
s1-4, configuring IP allocated network segment, server IP and DNS analysis address on VPN server; agreement protocol encryption mode, agreement protocol port and configuration of iptables to realize network flow control of the protocol;
and S1-5, creating system service through the instruction, and starting the system.
5. The method for remotely maintaining the PLC based on the gateway of the Internet of things of claim 1, wherein: in step S2, configuring the internet of things gateway as a VPN client, specifically including the following steps:
s2-1, installing VPN related tools including strongswan, xl2tpd and net-tools;
s2-2, configuring channel parameters including protocol type, encryption algorithm and server port; configuring an xl2tpd parameter, wherein the parameter comprises a virtual network card name, a VPN server address, IPSec _ PSK, a user name and a password;
s2-3, creating an xl2tpd control file, restarting strongswan and xl2tpd services, and connecting ipsec by using a configuration file;
s2-4, configuring a routing table, configuring the next hop address of the VPN server as the current default route, and modifying the default route to ppp 0;
s2-5, accessing IP address checking website, checking whether IP has been modified to VPN server address, checking whether VPN works normally.
6. The method for remotely maintaining the PLC based on the gateway of the Internet of things of claim 1, wherein: in step S3, configuring network address translation of the internet of things gateway, specifically including:
s3-1, starting a Linux system forwarding mode;
s3-2, modifying the header information of the inbound and outbound data, forwarding data of a certain port entering the external network card to a protocol port of the PLC, and forwarding the received PLC protocol data to a certain port of the external network card, thereby realizing the access of the external network to the internal network PLC.
7. The method for remotely maintaining the PLC based on the gateway of the Internet of things of claim 1, wherein: in step S4, for the PLC device based on network communication, the PLC communication interface is mapped to the external network by modifying the port of the network mapping, and the maintenance system is connected to the PLC device by accessing the address of the external network.
CN202210217345.7A 2022-03-07 2022-03-07 Remote PLC maintenance method based on gateway of Internet of things Pending CN114545860A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210217345.7A CN114545860A (en) 2022-03-07 2022-03-07 Remote PLC maintenance method based on gateway of Internet of things

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210217345.7A CN114545860A (en) 2022-03-07 2022-03-07 Remote PLC maintenance method based on gateway of Internet of things

Publications (1)

Publication Number Publication Date
CN114545860A true CN114545860A (en) 2022-05-27

Family

ID=81664061

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210217345.7A Pending CN114545860A (en) 2022-03-07 2022-03-07 Remote PLC maintenance method based on gateway of Internet of things

Country Status (1)

Country Link
CN (1) CN114545860A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116886466A (en) * 2023-07-21 2023-10-13 安全邦(北京)信息技术有限公司 Remote operation and maintenance diagnosis system, equipment and method capable of meeting end-to-end safety

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104811496A (en) * 2015-04-29 2015-07-29 芜湖科达新铭丰机电有限公司 Remote maintenance system of electrical equipment of aerated concrete production line
CN106533880A (en) * 2016-11-02 2017-03-22 天脉聚源(北京)传媒科技有限公司 Method and apparatus for erecting VPN service on cloud server
CN110891008A (en) * 2019-11-21 2020-03-17 成都云智天下科技股份有限公司 IP proxy method based on L2TP/IPSEC
CN111381553A (en) * 2020-02-19 2020-07-07 北京航天智造科技发展有限公司 VPN technology-based equipment and method and system for remotely maintaining PLC
CN111786873A (en) * 2020-07-13 2020-10-16 浙江捷创方舟数字技术有限公司 Remote control method, system and gateway supporting PLC redundancy
CN114137894A (en) * 2021-10-19 2022-03-04 广州鲁邦通物联网科技股份有限公司 VPN-based PLC remote diagnosis system and technology

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104811496A (en) * 2015-04-29 2015-07-29 芜湖科达新铭丰机电有限公司 Remote maintenance system of electrical equipment of aerated concrete production line
CN106533880A (en) * 2016-11-02 2017-03-22 天脉聚源(北京)传媒科技有限公司 Method and apparatus for erecting VPN service on cloud server
CN110891008A (en) * 2019-11-21 2020-03-17 成都云智天下科技股份有限公司 IP proxy method based on L2TP/IPSEC
CN111381553A (en) * 2020-02-19 2020-07-07 北京航天智造科技发展有限公司 VPN technology-based equipment and method and system for remotely maintaining PLC
CN111786873A (en) * 2020-07-13 2020-10-16 浙江捷创方舟数字技术有限公司 Remote control method, system and gateway supporting PLC redundancy
CN114137894A (en) * 2021-10-19 2022-03-04 广州鲁邦通物联网科技股份有限公司 VPN-based PLC remote diagnosis system and technology

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116886466A (en) * 2023-07-21 2023-10-13 安全邦(北京)信息技术有限公司 Remote operation and maintenance diagnosis system, equipment and method capable of meeting end-to-end safety

Similar Documents

Publication Publication Date Title
EP1479008B1 (en) Method and system for resolving addressing conflicts based on tunnel information
EP1817882B1 (en) Home network bridge-based communications method and apparatus
CN102325197B (en) Method for communication between intranet equipment and internet equipment and network address transformation equipment
CA3021367C (en) Using wlan connectivity of a wireless device
EP2530900B1 (en) Network security parameter generation and distribution
US9699270B2 (en) Method for commissioning and joining of a field device to a network
FI123551B (en) Procedure and arrangement for the implementation of remote control in real estate
CN102209360B (en) Communication relay device, communication relay method
US20190089741A1 (en) Network asset characterization, classification, grouping and control
US9143480B2 (en) Encrypted VPN connection
US20090049164A1 (en) Peer-to-peer communication method and system enabling call and arrival
US8611358B2 (en) Mobile network traffic management
KR101880346B1 (en) Relay device, communication scheme selection method, and storage medium for storing program
US8400990B1 (en) Global service set identifiers
ES2894243T3 (en) Method, communication web service, web server and client for providing network communication service between IP devices over the Internet
CN102859968B (en) Method for operating, monitoring and/or configuring an automation system of a technical plant
CN114545860A (en) Remote PLC maintenance method based on gateway of Internet of things
CN101459532A (en) Method and apparatus for automatic networking by multi-port equipment
CN103067216A (en) Reverse communication method of crossing safety zone, device and system
MX2013013745A (en) Device arrangement for implementing remote control of properties.
CN103023722A (en) Cross-safe-area forward communication method, device and system
CN103036901A (en) ETS remote programming method
Ziegler et al. Towards a global IPv6 addressing model for the internet of things
US20070058654A1 (en) Arrangement and coupling device for securing data access
EP2770672A2 (en) System of wireless communication, and method of management

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