A PLC networking data acquisition system and method based on an edge gateway
Through SDN controller and deep packet detection technology, virtual IP is automatically allocated, combined with FPGA hardware analysis protocol, the acquisition strategy is dynamically adjusted, solving the problems of IP conflicts and complex configuration of PLC equipment, and achieving efficient and secure PLC network data acquisition.
Patent Information
- Application Number
- CN202510400840.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-01
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-04-01
AI Technical Summary
The IP address conflicts and configuration complexity of PLC devices in existing industrial networks, which leads to difficulty in network expansion. Traditional methods require manual IP address setting and re-planning, which is prone to errors and complexity.
The SDN controller and deep packet detection technology are used to automatically identify and allocate virtual IP, isolate PLC devices through virtual switches and routers, combine FPGA hardware accelerated parsing protocol, dynamically adjust the acquisition cycle and optimization strategy, and synchronize the acquisition strategy using the improved Raft consensus algorithm.
It realizes conflict-free communication of PLC devices in the same network, reduces network configuration complexity, improves communication security and data acquisition efficiency, adapts to network changes, and meets the real-time requirements of industrial networks.
Smart Images

Figure CN119906736B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication transmission technology, and more specifically, the present invention relates to a PLC networking data acquisition system and method based on an edge gateway. Background Art
[0002] A patent with the publication number CN116055525A discloses a data acquisition system based on edge computing. The system includes a PLC that connects to and controls industrial devices, an edge gateway that connects to industrial devices or the PLC, a cloud platform that connects to the edge gateway, and a client that interacts with the cloud platform. Among them, the cloud platform is used to generate data acquisition tasks and send the generated data acquisition tasks to the edge gateway; the edge gateway is used to perform data acquisition through the industrial devices or PLCs connected to it according to the received data acquisition tasks, preprocess the acquired data, and then forward it to the cloud platform. In the data acquisition system based on edge computing provided in this application, the cloud platform centrally manages the edge gateway, realizes the dynamic distribution of data acquisition tasks, reduces the workload of setting data acquisition for devices, and improves the acquisition efficiency of device data.
[0003] The existing PLC networking data acquisition system and method based on an edge gateway mainly have the following problems:
[0004] In order to reduce costs and unify equipment standards, industrial enterprises may purchase the same model of PLC devices in batches. These PLC devices generally default to the same IP address when leaving the factory, so that they can be quickly identified and used during factory testing or initial configuration. At the same time, in order to simplify the installation and commissioning process, equipment suppliers may also set the IP address of the PLC device to a common default value for users to customize before use. However, many enterprise users did not have the need to build an industrial Internet network in the early stage and did not modify the IP address of the PLC device in time after the device was installed, which would result in multiple PLC devices using the same IP address. In addition, many enterprises lack foresight when building an industrial Internet network. Initially, only the PLC devices and upper computers in the same workshop are enabled to communicate with each other, and there is no unified IP address planning for the entire factory workshop. As the company's business expands rapidly, there may be conflicts in the IP address segments of multiple workshops.
[0005] Traditional industrial network configuration requires manual setting of parameters such as IP addresses, subnet masks, gateways, etc. for each device, and configuring corresponding routing and firewall rules. The process is cumbersome and error-prone, especially in large industrial networks. And under the traditional network architecture, network expansion usually requires adding physical devices and re-planning IP address allocation. The expansion process is complex and prone to introducing configuration errors. Therefore, how to achieve centralized collection of PLC networking data without changing the existing network architecture and the IP addresses of PLC devices is an urgent problem to be solved.
[0006] In view of this, the present invention proposes a PLC networking data collection system based on an edge gateway to solve the above problems. Summary of the Invention
[0007] To overcome the above defects of the prior art and to achieve the above object, the present invention provides the following technical solution: A PLC networking data collection system based on an edge gateway, comprising:
[0008] A dynamic virtual isolation module, by deploying an SDN controller and using deep packet inspection technology, identifies and classifies different PLC devices, and automatically assigns them to virtual subnets to obtain virtual IPs; each virtual subnet isolates PLC devices with the same IP address through a virtual switch and a virtual router; a mapping table is used to record the virtual IPs of PLC devices and the actual physical network interface information, and a network topology view is established.
[0009] A multi-protocol parsing module, based on the network topology view, connects the edge gateway and the PLC device, and performs protocol parsing by integrating a PLC communication protocol library and using FPGA hardware acceleration to read PLC networking data from the PLC device in real time.
[0010] An AI intelligent scheduling module, based on the PLC networking data, reads the real-time status of the PLC, dynamically adjusts the collection period, and optimizes the collection strategy according to the CPU load of the edge gateway and the network congestion condition.
[0011] A gateway collaborative perception module, based on an improved Raft consensus algorithm, synchronizes the optimized collection strategy between edge gateways, and uses a heartbeat mechanism to detect the status of edge gateways, isolates faulty edge gateways, and automatically updates the network topology view; uses the updated network topology view to re-read PLC networking data from the PLC device in real time.
[0012] A data transmission module, through a standardized data access interface, transmits the read PLC networking data to a collection server.
[0013] Preferably, the method for obtaining the virtual IP includes:
[0014] Deploy an SDN controller at the edge gateway to centrally manage virtual switches and virtual routers, and configure the connection between the SDN controller and the physical network interfaces of the edge gateway; Define virtual switches and virtual routers in the SDN controller as the boundaries of logically isolated virtual subnets;
[0015] The SDN controller captures network data packets through a mirror port, uses DPI technology to parse the data packet payload, and extracts key features; The key features include protocol header fields, function codes, and device identifiers; Preset a device fingerprint library, and the elements of the device fingerprint library include protocol features, manufacturer identifiers, and device models; Identify and classify PLC devices of different brands and protocol types based on the preset device fingerprint library to obtain a classification result;
[0016] Define virtual subnet division policies according to the classification results. The virtual subnet division policies include isolation by brand, isolation by protocol, and isolation by functional group; The SDN controller automatically creates virtual subnets according to the classification results, binds them to the corresponding virtual switches, and configures the access control list of the virtual routers to restrict cross-subnet communication;
[0017] Deploy a lightweight DHCP server inside the virtual subnet to assign a unique virtual IP to each PLC. For each PLC device, manually bind the virtual IP to the physical network interface through the SDN controller; Configure NAT rules in the virtual router to map the physical IP of the PLC to a globally unique virtual IP.
[0018] Preferably, the method for isolating PLC devices with the same IP address includes:
[0019] In the SDN controller, assign independent virtual switches and virtual routers to each virtual subnet; Each virtual switch acts as the entry or exit of PLC devices within the virtual subnet and controls the traffic forwarding of PLC devices within the virtual subnet; Preset configuration flow table rules, and the virtual switch controls traffic through the configuration flow table rules, only allowing communication between PLC devices within the same virtual subnet; The preset configuration flow table rules include ingress traffic matching rules, default discard rules, VLAN isolation rules, NAT conversion rules, access control list rules, and AI adaptive flow table rules; For different virtual subnets, the virtual switch isolates traffic within different subnets based on VLAN tags;
[0020] Each virtual subnet performs routing and forwarding of data packets through a virtual router; The virtual router only allows legal cross-subnet data transmission according to network policies and configurations. For devices with the same IP address but belonging to different virtual subnets, illegal cross-subnet communication is blocked by configuring access control policies.
[0021] Preferably, the method for obtaining the network topology view includes:
[0022] The SDN controller scans all the connected PLC devices, manually binds the virtual IP of the PLC devices to the corresponding physical network interfaces, and generates a PLC device mapping table; the virtual IP, physical IP, MAC address, and connected physical network interface information of each PLC device are recorded through the PLC device mapping table; with the edge gateway as the central node, a network topology view is constructed based on the PLC device mapping table, and the topological drawing tool Graphviz is used to visually display the network topology view.
[0023] Preferably, the method for connecting the edge gateway and the PLC device based on the network topology view includes:
[0024] The edge gateway reads the virtual IP of each PLC device and its corresponding actual physical network interface information according to the obtained network topology view, and establishes a virtual communication link with the PLC device;
[0025] The frame formats, field definitions, check algorithms, and state machine logics of various PLC communication protocols are abstracted and encapsulated into a unified PLC communication protocol library; based on the PLC communication protocol library, a data request command is generated and sent to the PLC device through the virtual communication link; the PLC device responds to the received data request command and transmits the original data packet to the edge gateway through the virtual communication link; the edge gateway captures the original data packet transmitted through the virtual communication link and performs protocol decoding and data extraction through the FPGA hardware, thereby obtaining the PLC networking data.
[0026] Preferably, the PLC networking data includes device ID, communication protocol, timestamp, device status data, sensor data, and device alarm data.
[0027] Preferably, the method for dynamically adjusting the acquisition period includes:
[0028] Based on the PLC networking data, the real-time status of the PLC is read, and the fuzzy logic is used to perform multi-dimensional analysis on the real-time status of the PLC to obtain the device status classification; according to the device status classification, the data acquisition period is dynamically allocated; the acquisition period is adjusted in real time based on the sliding time window. When the data change rate exceeds the preset data change rate threshold, the acquisition period is automatically shortened to increase the acquisition density.
[0029] Preferably, the method for optimizing the acquisition strategy includes:
[0030] The CPU usage rate of the edge gateway is collected in real time through the API to obtain the CPU load of the edge gateway; when the CPU load of the edge gateway exceeds the preset edge gateway CPU load threshold, the polling interval of the PLC networking data is extended, and at the same time, the number of concurrently collected PLC devices is reduced, and the PLC networking data acquisition task of non-critical PLC devices is suspended;
[0031] Real-time monitor the bandwidth utilization rate of the network interface, obtain the network congestion status, and use a lightweight compression algorithm to compress the collected PLC networking data.
[0032] Preferably, the method for synchronizing the optimized acquisition strategy between edge gateways based on the improved Raft consensus algorithm includes:
[0033] Run the improved Raft consensus algorithm on the edge gateway nodes. The improved Raft consensus algorithm includes a dynamic timeout mechanism. Real-time monitor the network quality parameters through the dynamic timeout mechanism, establish an edge gateway cluster and complete the initial Leader election; the network quality parameters include round-trip delay, packet loss rate, and network jitter index; calculate the comprehensive network quality index through weighted average of the network quality parameters; dynamically adjust the election timeout time and log replication timeout time of the improved Raft algorithm based on the comprehensive network quality index through an exponential decay model;
[0034] Synchronize the optimized acquisition strategy to each edge gateway node through the improved Raft consensus algorithm; the improved Raft consensus algorithm for synchronizing the optimized acquisition strategy includes maintaining an independent log replication success probability model for each gateway node,
[0035] Dynamically adjust the retry interval to the optimal value according to the current round-trip delay and packet loss rate; each edge gateway node performs network topology data acquisition according to the optimized acquisition strategy; synchronize the collected topology data to the Leader node through the improved Raft consensus mechanism; the Leader node merges the topology data of each gateway node; automatically update the network topology view and synchronize the updated network topology view to each edge gateway node.
[0036] A PLC networking data acquisition method based on edge gateways includes:
[0037] S1. By deploying an SDN controller, using deep packet inspection technology, identify and classify different PLC devices, and automatically assign them to virtual subnets to obtain virtual IPs; each virtual subnet isolates PLC devices with the same IP address through a virtual switch and a virtual router; record the virtual IPs of PLC devices and the actual physical network interface information through a mapping table to establish a network topology view;
[0038] S2. Based on the network topology view, connect the edge gateways to the PLC devices, and perform protocol parsing by integrating a PLC communication protocol library and using FPGA hardware acceleration to read PLC networking data from the PLC devices in real time;
[0039] S3. Based on the PLC networking data, read the real-time status of the PLC, dynamically adjust the acquisition period, and optimize the acquisition strategy according to the CPU load of the edge gateway and the network congestion status;
[0040] S4. Based on the improved Raft consensus algorithm, synchronize the optimized acquisition strategy among edge gateways, and use the heartbeat mechanism to detect the status of edge gateways, isolate faulty edge gateways, and automatically update the network topology view; use the updated network topology view to re-read the PLC networking data from PLC devices in real time;
[0041] S5. Transmit the read PLC networking data to the acquisition server through a standardized data access interface.
[0042] Compared with the prior art, the present invention has the following beneficial effects:
[0043] Through the virtual IP allocation and NAT mapping mechanism, the present invention effectively solves the problem of possible IP address conflicts of PLC devices in industrial sites, enabling heterogeneous PLC devices with duplicate private addresses to coexist and communicate normally in the same physical network; the virtual subnet isolation technology based on SDN realizes the logical isolation between PLC devices of different brands, different protocols or different functional groups; through automated device identification and virtual subnet division, the complexity of industrial network configuration is greatly reduced, and manual operation errors are reduced; the virtualization technology enables network topology and policy adjustment to no longer depend on physical connection changes, and the virtual subnet division and access control policies can be dynamically adjusted through the SDN controller to adapt to the changing industrial network requirements.
[0044] Through the combined architecture of virtual switches and virtual routers, complete logical isolation between different virtual subnets is achieved, enabling PLC devices with the same IP address to operate independently in their respective virtual subnets without modifying the original IP configuration of the devices, solving the core problem in industrial network integration; the multi-level access control mechanism based on preset configuration flow table rules realizes all-round security protection from the data link layer to the application layer, and can accurately control communication permissions according to protocol characteristics, device types and service requirements; the standardized virtual switch and virtual router configuration templates greatly reduce the complexity of network deployment. Network administrators only need to focus on policy definition rather than underlying implementation details, reducing the risk of configuration errors and improving deployment efficiency.
[0045] Through the dynamic timeout mechanism, the system can adaptively adjust the parameters of the Raft algorithm, effectively deal with delay fluctuations, packet loss and network jitter in the edge network environment, and significantly improve the stability of the consensus algorithm under harsh network conditions. The improved Raft algorithm intelligently extends the timeout time when the network quality decreases, effectively reducing the number of unnecessary Leader elections caused by network fluctuations, reducing the computing burden of the edge gateway, and reducing system resource consumption; the optimal retry interval calculation based on network quality makes the timing of sending log replication requests more reasonable, accelerates consensus when the network is good, avoids invalid retries when the network is congested, and improves the overall efficiency of collection strategy synchronization. Through the adaptive detection frequency adjustment mechanism, the system actively reduces the frequency of topology data collection when the network quality is poor, reduces the transmission burden of the edge network, and prevents the deterioration of network congestion; through the optimized consensus mechanism and topology synchronization strategy, the system can maximize the real-time performance of data while ensuring data consistency, and meet the strict requirements of edge computing scenarios for data timeliness. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A schematic diagram of the structure of a PLC networking data acquisition system based on an edge gateway of the present invention;
[0047] Figure 2 A schematic diagram of a PLC networking data collection method based on an edge gateway according to the present invention;
[0048] Figure 3 This is a flowchart of the gateway collaborative perception provided by the present invention. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] Example 1
[0051] See also Figure 1 and Figure 3 As shown, this embodiment 1 further describes a PLC networking data acquisition system based on an edge gateway proposed by the present invention, including:
[0052] Dynamic virtual isolation module, by deploying an SDN controller and adopting deep packet inspection technology, identifies and classifies different PLC devices, automatically assigns them to virtual subnets, and obtains virtual IPs; each virtual subnet isolates PLC devices with the same IP address through a virtual switch and a virtual router; records the virtual IPs of PLC devices and the actual physical network interface information through a mapping table, and establishes a network topology view;
[0053] Multi-protocol parsing module, based on the network topology view, connects the edge gateway and PLC devices, and through integrating the PLC communication protocol library and adopting FPGA hardware acceleration for protocol parsing, reads PLC networking data from PLC devices in real time;
[0054] AI intelligent scheduling module, based on the PLC networking data, reads the real-time status of the PLC, dynamically adjusts the acquisition period, and optimizes the acquisition strategy according to the CPU load of the edge gateway and network congestion conditions;
[0055] Gateway collaborative awareness module, based on the improved Raft consensus algorithm, synchronizes the optimized acquisition strategy among edge gateways, and uses a heartbeat mechanism to detect the status of edge gateways, isolates faulty edge gateways, and automatically updates the network topology view; uses the updated network topology view to read PLC networking data from PLC devices in real time again;
[0056] Data transmission module, through a standardized data access interface, transmits the read PLC networking data to the acquisition server.
[0057] The method for obtaining virtual IPs includes:
[0058] Deploy an SDN controller (such as OpenDaylight, ONOS or Ryu) on the edge gateway, centrally manage the virtual switch and virtual router, configure the connection between the SDN controller and the physical network interface of the edge gateway to ensure that the controller can perceive the underlying network topology; define the virtual switch and virtual router in the SDN controller as the boundaries of the logically isolated virtual subnets;
[0059] The SDN controller captures network packets through a mirror port, uses DPI technology to parse the packet payload, and extracts key features; the key features include protocol header fields, function codes and device identifiers; preset a device fingerprint library, and the elements of the device fingerprint library include protocol features, manufacturer identifiers and device models; identify and classify PLC devices of different brands and protocol types based on the preset device fingerprint library to obtain a classification result;
[0060] Define the virtual subnet division strategy according to the classification results. The virtual subnet division strategy includes isolation by brand, isolation by protocol, and isolation by functional group. Isolation by brand means allocating PLCs of the same brand (such as Siemens, Rockwell) to independent subnets. Isolation by protocol means allocating PLCs with the same protocol (such as Modbus TCP, Profinet) to the same subnet. Isolation by functional group means dividing control PLCs (such as master stations) and data acquisition PLCs (slave stations) into different subnets. The SDN controller automatically creates virtual subnets according to the classification results, binds them to the corresponding virtual switches, and configures the access control list of the virtual router to restrict cross-subnet communication.
[0061] Deploy a lightweight DHCP server within the virtual subnet to assign a unique virtual IP to each PLC. For each PLC device, manually bind the virtual IP to the physical network interface through the SDN controller. Configure NAT rules in the virtual router to map the physical IP (possibly conflicting private address) of the PLC to a globally unique virtual IP.
[0062] A lightweight DHCP server is a Dynamic Host Configuration Protocol (DHCP) server with low resource consumption, easy to configure and manage, suitable for small networks, embedded systems, or resource-constrained environments. Deploying a lightweight DHCP server within the virtual subnet can assign a unique virtual IP address to each PLC device. This helps simplify network management, avoid IP address conflicts, and ensure that each device can communicate correctly.
[0063] Common lightweight DHCP servers include:
[0064] Dnsmasq: Integrates functions such as DNS caching, DHCP, and TFTP, commonly used in routers and embedded systems, with simple configuration and high flexibility, suitable for small networks.
[0065] udhcpd: This is a lightweight DHCP server in the BusyBox project, specifically for environments with limited resources, suitable for embedded Linux systems such as OpenWRT and other small routing devices.
[0066] Using these lightweight DHCP servers within the virtual subnet can effectively assign a unique virtual IP address to each PLC device, ensuring network stability and reliability.
[0067] Methods for isolating PLC devices with the same IP address include:
[0068] In the SDN controller, an independent virtual switch and virtual router are assigned to each virtual subnet; each virtual switch serves as the entry or exit for PLC devices within the virtual subnet, controls the traffic forwarding of PLC devices within the virtual subnet, ensures the interconnection and communication of devices within the subnet, and at the same time prevents cross-subnet communication; preset configuration flow table rules, and the virtual switch controls the traffic through the configuration flow table rules, only allowing communication between PLC devices within the same virtual subnet; the preset configuration flow table rules include an entry traffic matching rule, a default discard rule, a VLAN isolation rule, a NAT conversion rule, an access control list rule, and an AI adaptive flow table rule; for different virtual subnets, the virtual switch isolates the traffic within different subnets based on the VLAN tag, preventing direct communication between PLC devices with IP conflicts.
[0069] It should be noted that the entry traffic matching rule includes matching fields: source MAC address, source IP address, VLAN ID, protocol type (such as Modbus TCP, Profinet). The application scenario of this entry traffic matching rule is that when a PLC device is first connected, the SDN controller performs matching and classification based on the DPI analysis result. For example, the OpenFlow rule; the role of the default discard rule is to prevent unauthorized traffic from entering the network and improve security. The role of the VLAN isolation rule is to logically isolate PLC devices in different subnets through VLANs, avoiding direct communication between PLCs with the same IP address.
[0070] For example, VLAN Tagging (tagging) can match the field VLAN ID; for example, add VLAN 10 to Modbus TCP devices and VLAN 20 to Profinet devices.
[0071] VLAN access control. The role of VLAN access control is to prohibit direct communication between PLC devices in different VLANs, and they must go through the virtual router.
[0072] The role of the NAT conversion rule is to solve the conflict when PLC devices with the same IP address communicate across subnets. For example, source NAT (SNAT), whose role is to convert the source IP to a unique virtual IP when a PLC device accesses an external subnet. Destination NAT (DNAT), whose role is to map the virtual IP of an external access back to the actual physical IP of the PLC.
[0073] The role of the access control list rule is to restrict cross-subnet communication and prevent unauthorized access. For example, prohibit direct communication between cross-subnet PLCs, such as prohibiting Modbus TCP VLAN 10 from accessing Profinet VLAN 20; allow specific traffic (master-slave communication), for example, allow the master PLC to access the slave PLC, and the protocol is Modbus TCP.
[0074] The function of the AI adaptive flow table rules is to dynamically adjust the flow table rules and optimize network load balancing and security. For example, dynamic NAT based on traffic load. For instance, when a certain traffic exceeds 100 Mbps, the NAT rule is switched; AI detects abnormal traffic and blocks it. For example, when it is found that a PLC device scans a large number of IP addresses within a short period of time, it is automatically blocked.
[0075] Each virtual subnet routes and forwards data packets through a virtual router. The virtual router has an access control list (ACL) function to control the communication between different virtual subnets; according to network policies and configurations, the virtual router only allows legal cross-subnet data transmission. For devices with the same IP address but belonging to different virtual subnets, by configuring access control policies, illegal cross-subnet communication is blocked;
[0076] It should be noted that the access control policy here is different from the virtual subnet division policy. The virtual subnet division policy is a rule determined at the SDN controller level and is used to initially divide the virtual subnets of PLC devices; it mainly divides subnets based on different brands, protocol types, or function groups to ensure that similar devices are assigned to corresponding virtual subnets. This belongs to the network architecture design stage and determines which devices belong to which subnet. The access control policy is the specific traffic control carried out at the virtual router level, determining which traffic can cross subnets and which traffic needs to be blocked; it mainly relies on the ACL (access control list) to determine the flow direction of data packets. This is the actual traffic management stage, which is executed after the subnet division is completed to ensure that the communication between different virtual subnets is restricted.
[0077] The methods for obtaining the network topology view include:
[0078] The SDN controller scans all the connected PLC devices, manually binds the virtual IP of the PLC devices to the corresponding physical network interfaces, and generates a PLC device mapping table; the PLC device mapping table records the virtual IP, physical IP, MAC address, and the information of the connected physical network interfaces of each PLC device; with the edge gateway as the central node, a network topology view is constructed based on the PLC device mapping table, and the topology drawing tool Graphviz is used to visually display the network topology view. For example:
[0079] Table Mapping Table
[0080] Device MAC Address Physical IP Physical Network Interface Virtual IP Virtual Switch Virtual Subnet PLC_A 00:1A:2B:3C:4D:5E 192.168.1.10 eth1 10.0.0.1 vSwitch1 Subnet_A PLC_B 00:1A:2B:3C:4D:5F 192.168.1.11 eth2 10.0.0.2 vSwitch1 Subnet_A PLC_C 00:1A:2B:3C:4D:60 192.168.2.20 Eth3 10.0.1.1 vSwitch2 Subnet_B
[0081] The functions of this mapping table include binding the physical network interface (ethX) of the PLC to the virtual IP (10.0.X.X) to ensure network isolation; dynamically maintaining through the SDN controller to support state changes such as online, offline, and migration of devices; avoiding IP conflicts, so that even if different PLC devices use the same private IP, they can be distinguished by the virtual IP.
[0082] The method for connecting the edge gateway and PLC devices based on the network topology view includes:
[0083] Based on the obtained network topology view, the edge gateway reads the virtual IP of each PLC device and its corresponding actual physical network interface information, and establishes a virtual communication link with the PLC device to ensure that the data transmission path is correct and conflict-free; the virtual IP of each PLC device and its corresponding actual physical network interface information represent the location and connection relationship of the PLC device in the industrial control network.
[0084] Through the network topology view, the virtual IP of the PLC device and its corresponding actual physical network interface information can be clearly described, enabling the edge gateway to quickly establish a virtual communication link, realizing the unified management of PLC devices in different factories and with different protocols, improving the visualization, management efficiency, and flexibility of the industrial control network. At the same time, it also avoids communication failures caused by address conflicts or link errors in traditional industrial control networks, ensuring the correct data transmission path.
[0085] Abstract the frame format, field definition, check algorithm, and state machine logic of various PLC communication protocols, and encapsulate them into a unified PLC communication protocol library; generate a data request command based on the PLC communication protocol library and send the data request to the PLC device through the virtual communication link; the PLC device responds to the received data request command and transmits the original data packet to the edge gateway through the virtual communication link; the edge gateway captures the original data packet transmitted through the virtual communication link and performs protocol decoding and data extraction through the FPGA hardware to obtain the PLC networking data.
[0086] The edge gateway generates a data request command through the unified PLC communication protocol library and efficiently collects data from the PLC device through the virtual communication link, ensuring the high real-time and high reliability of the data transmission link, and meeting the requirements of the industrial control system for low-latency and quasi-real-time data interaction; realizing protocol decoding and data extraction through the FPGA hardware significantly improves the decoding efficiency and data processing ability. Compared with the traditional software decoding scheme, the hardware-level processing method has lower latency and higher data throughput, ensuring the performance requirements of large-scale data concurrent collection and processing.
[0087] Common PLC communication protocols include Modbus RTU, Profinet, S7, etc. Suppose we need to support Modbus RTU, Profinet, and S7 protocols simultaneously. We can abstract and encapsulate them in the following ways:
[0088] Unified protocol frame abstraction: We can define a general "PLC protocol frame" data structure, which contains the following fields:
[0089] Frame start identifier: Used to identify the start of the frame, such as the low-level start bit of Modbus RTU, the Ethernet frame header of Profinet, and the dedicated start code of S7.
[0090] Device address: Identifies the unique address of the PLC device.
[0091] Function code / command code: Indicates the specific operation or command type.
[0092] Data field: Contains the actual data content, with variable length.
[0093] Checksum: Such as the CRC of Modbus RTU, the FCS of Profinet, or the error check in S7.
[0094] Frame end identifier: Identifies the end of the data frame.
[0095] Taking Modbus RTU as an example:
[0096] Frame format: [Start bit] + [Device address] + [Function code] + [Register data] + [CRC check] + [Stop bit];
[0097] Parsing steps: Detect the start using the start bit; extract the device address, function code, and data field; calculate the CRC for the data field and compare it with the CRC in the frame to verify the data correctness; confirm the end of the frame through the stop bit.
[0098] Device address: 0x01 (device number 1)
[0099] Function code: 0x04 (read input register)
[0100] Number of data bytes: 0x02 (indicating 2 bytes of data)
[0101] Register data:
[0102] 0x00 0x64 (decimal 100, corresponding to the temperature sensor reading)
[0103] 0x00 0xC8 (decimal 200, corresponding to the pressure sensor reading)
[0104] Data extraction is performed through standardized data format mapping to obtain PLC network data:
[0105] "Device ID": "PLC_001",
[0106] "Communication protocol": "ModbusRTU",
[0107] "Timestamp": "2025-xx-xx 10:15:30",
[0108] "Device status": "Normal",
[0109] "Sensor data": {"Temperature": 100, "Pressure": 200}
[0110] "Alarm information": null.
[0111] PLC network data includes device ID, communication protocol, timestamp, device status data, sensor data, and device alarm data.
[0112] PLC network data is a comprehensive dataset that contains the following specific information:
[0113] Device ID: The device ID is the unique identifier for each PLC device, used to distinguish different PLC devices in the network;
[0114] Communication protocol: Indicates the specific communication standard used by the PLC device. Understanding the communication protocol is crucial for correctly parsing the data received from the PLC device;
[0115] Timestamp: Records the exact time when the data was collected, in the format of date and time, which is very useful for analyzing the operation trend of the device, diagnosing problems, and performing time series analysis;
[0116] Device status data: Includes the operating status of the PLC device, such as running, stopped, faulty, etc. This type of data helps operators understand the real-time status of the device for maintenance and troubleshooting;
[0117] Sensor data: Collected by sensors on the PLC device, including parameters such as temperature, pressure, humidity, flow rate, etc., which is crucial for monitoring the production process and environmental conditions;
[0118] Device alarm data: Contains any abnormal or warning information that occurs during the operation of the PLC device, which can help operators quickly identify potential problems and take corresponding measures.
[0119] Methods for dynamically adjusting the acquisition period include:
[0120] Read the real-time status of the PLC based on the PLC networking data, perform multi-dimensional analysis on the real-time status of the PLC using fuzzy logic, and obtain the equipment status classification; according to the equipment status classification, dynamically allocate the data acquisition period; adjust the acquisition period in real time based on the sliding time window, and automatically shorten the acquisition period when the data change rate exceeds the preset data change rate threshold to improve the acquisition density.
[0121] Example of fuzzy logic:
[0122] Divide the input parameters into fuzzy sets (high, medium, low)
[0123] Rule example:
[0124] IF (equipment alarm status = abnormal) AND (equipment importance = high) → THEN (status level = first level);
[0125] IF (data change rate = high) AND (equipment importance = medium) → THEN (status level = second level);
[0126] Table Explanation of equipment levels
[0127] Level Trigger Condition Level 1 The device has a fault / alarm and the device is of high importance Level 2 The device status is stable, the device importance is medium, but the data change rate is high (frequent operations or adjustments) Level 3 The device status is stable, with small fluctuations, the device importance is low, and it is a non-critical control unit (such as an auxiliary actuator)
[0128] For example:
[0129] Table Equipment status acquisition table
[0130] Device Operating Status Data Change Rate Alarm Status Communication Status Importance PLC-001 Running High Normal Normal Medium PLC-002 Standby Low Normal Normal Low PLC-003 Fault High Alarm High Latency High
[0131] Equipment status classification:
[0132] PLC-003: First level (alarm + fault + high importance);
[0133] PLC-001: Second level (normal operation status + high data change rate + medium importance);
[0134] PLC-002: Third level (normal operation status + low data change rate + low importance, non-critical);
[0135] Use the obtained equipment status classification as the key decision factor for the dynamic acquisition frequency:
[0136] Table Acquisition frequency allocation table
[0137] Device Status Classification Collection Period Example Level 1 High-Frequency Collection Collection period of 500ms - 1s Level 2 Medium-Frequency Collection Collection period of 1s - 1min Level 3 Low-Frequency Collection / On Demand Collection period of 1min - 10min or event-triggered collection
[0138] Set a sliding time window, such as 10 sampling points within the past 5 minutes, calculate the data change rate within this time window, and automatically shorten the acquisition period when the data change rate exceeds the preset threshold (such as the change rate is greater than 20%);
[0139] For example: Initial state: PLC-004: Secondary device, 2-second acquisition cycle;
[0140] State after 5 minutes: PLC-004: Data fluctuation increases, data change rate is greater than 25% → Acquisition cycle is adjusted to 1 second.
[0141] Methods for optimizing the acquisition strategy include:
[0142] Real-time collect the CPU usage rate of the edge gateway through the API to obtain the edge gateway CPU load; when the edge gateway CPU load exceeds the preset edge gateway CPU load threshold, extend the PLC network data polling interval (such as from 1 second to 2 seconds), and at the same time reduce the number of concurrently collected PLC devices, and pause the PLC network data acquisition tasks of non-critical PLC devices;
[0143] Real-time monitor the bandwidth utilization rate of the network interface to obtain the network congestion status, and use lightweight compression algorithms (such as gzip, LZ4) to compress the collected PLC network data to reduce the occupied transmission bandwidth.
[0144] Methods for synchronizing the optimized acquisition strategy between edge gateways based on the improved Raft consensus algorithm include:
[0145] Run the improved Raft consensus algorithm on the edge gateway nodes. The improved Raft consensus algorithm includes a dynamic timeout mechanism. Real-time monitor the network quality parameters through the dynamic timeout mechanism, establish an edge gateway cluster and complete the initial Leader election; the network quality parameters include round-trip delay, packet loss rate, and network jitter metrics; calculate the network quality comprehensive index through the weighted average network quality parameters, and the network quality comprehensive index is: ; where represents the network quality comprehensive index at the current time ; represents the round-trip delay at the current time ; represents the preset reference round-trip delay; represents the packet loss rate at the current time ; represents the network jitter at the current time ; represents the current time; represents the weight coefficient of the round-trip delay; represents the weight coefficient of the packet loss rate; represents the weight coefficient of the network jitter; and ; Dynamically adjust the election timeout and log replication timeout of the improved Raft algorithm through an exponential decay model based on the comprehensive network quality index, and at the same time apply a smoothing factor to avoid drastic fluctuations in the timeout;
[0146] The election timeout is: ; where represents the adjusted election timeout; represents the preset benchmark timeout; represents the maximum extension factor; represents the sensitivity parameter;
[0147] When the network quality deteriorates, the timeout will increase exponentially; when the network quality is good, the timeout approaches the benchmark value. To avoid drastic fluctuations in the timeout, a smoothing factor mechanism is introduced to make the new timeout the weighted average of the current calculated value and the historical value, ensuring the stability of the system during network fluctuations.
[0148] Synchronize the optimized acquisition strategy to each edge network node through the improved Raft consensus algorithm; the improved Raft consensus algorithm for synchronizing the optimized acquisition strategy includes maintaining an independent log replication success probability model for each network node,
[0149] Dynamically adjust the retry interval to the optimal value according to the current round-trip delay and packet loss rate. The optimal retry interval is: ; where represents the optimal retry interval for the network node at the current time , that is, the time value that the Leader node should wait before resending the request after not receiving the log replication confirmation from this node; represents the current time to the network node round-trip delay; represents the network node at the current time packet loss rate, which represents the proportion of packets sent that did not successfully reach the destination and is a dimensionless value between 0 and 1;
[0150] The design principle of this formula is as follows: the benchmark retry time should be proportional to the current round-trip delay. The higher the packet loss rate, the retry interval should be appropriately extended to avoid network congestion; the logarithmic function is used to make the adjustment smoother, especially in the case of low packet loss rates; the retry interval is extended when the network quality is poor and shortened when the network quality is good to improve the consensus efficiency; each edge gateway node performs network topology data collection according to the optimized collection strategy; a preset benchmark detection frequency and a preset network quality threshold are set, and the detection frequency is dynamically adjusted according to the current network quality. When the network quality is less than the preset network quality threshold, the detection frequency is reduced; when the network quality is greater than or equal to the preset network quality threshold, the detection is performed at the benchmark frequency; the collected topology data is synchronized to the Leader node through an improved Raft consensus mechanism; the Leader node merges the topology data of each gateway node, calculates the topology consistency metric, and evaluates the accuracy of the global view. This metric calculates the average of the ratio of the intersection to the union of the local topology of each gateway and the global topology, reflecting the degree of consistency of the topology information. A preset consistency metric threshold is set. When the consistency metric is lower than the preset consistency metric threshold, the system will trigger an additional topology synchronization process; when the network partition is restored, the system needs to merge the possibly conflicting topology information. A credibility-based edge filtering mechanism is used to merge the topology information. The credibility of an edge is jointly determined by the proportion of gateways that observe the edge and the timeliness of the edge information. The higher the proportion of observing gateways, the higher the credibility; the newer the information, the higher the credibility. This mechanism ensures that the merged topology reflects the consensus of most gateways and gives priority to retaining the latest network state information. A preset credibility threshold is set, and only the edges whose credibility exceeds the preset credibility threshold are included in the merged topology;
[0151] The running state of the edge gateway is monitored by periodically sending heartbeat messages. When a gateway fails to respond to the heartbeat or responds abnormally for several consecutive times, the Leader node marks it as a suspicious state and increases the monitoring frequency; for example, when a gateway fails to respond to the heartbeat or responds abnormally 20 consecutive times, the Leader node marks it as a suspicious state and increases the monitoring frequency; if there is still no effective response within the preset fault confirmation time window, the system will officially mark the gateway as a faulty state, automatically update the cluster member configuration to isolate it, and at the same time trigger a topology reconstruction process, recalculate the network path, and broadcast the updated cluster state information to other normal gateways; the isolated faulty gateway will no longer participate in the consensus decision and data synchronization until it resumes normal and rejoins the cluster through the rejoin protocol. The whole process requires no manual intervention, ensuring the high availability and self-healing ability of the edge network; automatically update the network topology view and synchronize the updated network topology view to each edge gateway node.
[0152] The preset data change rate threshold is set by the staff based on the historical data analysis results. This historical analysis process includes the system collecting the change rates of multiple data points and calculating their average value as a reference. Similarly, the preset edge gateway CPU load threshold, preset network quality threshold, preset consistency index threshold, and preset credibility threshold are also set by the staff according to the system historical operation data and the requirements of specific application scenarios. These preset thresholds can be adjusted by the staff during the system operation according to the actual situation.
[0153] In this embodiment, through the virtual IP allocation and NAT mapping mechanism, the problem of IP address conflicts that may exist in industrial field PLC devices is effectively solved, enabling heterogeneous PLC devices with duplicate private addresses to coexist and communicate normally in the same physical network. The virtual subnet isolation technology based on SDN realizes the logical isolation between PLC devices of different brands, different protocols, or different functional groups. Through automated device identification and virtual subnet division, the complexity of industrial network configuration is greatly reduced, and manual operation errors are reduced. The virtualization technology makes the adjustment of network topology and policies no longer dependent on physical connection changes, and the virtual subnet division and access control policies can be dynamically adjusted through the SDN controller to adapt to the changing industrial network requirements.
[0154] Through the combined architecture of virtual switches and virtual routers, complete logical isolation between different virtual subnets is achieved, enabling PLC devices with the same IP address to operate independently in their respective virtual subnets without modifying the original IP configuration of the devices, thus solving the core problem in industrial network integration. The multi-level access control mechanism based on the preset configuration flow table rules realizes comprehensive security protection from the data link layer to the application layer, and can precisely control communication permissions according to protocol characteristics, device types, and service requirements. The standardized configuration templates for virtual switches and virtual routers greatly reduce the complexity of network deployment. Network administrators only need to focus on policy definition rather than the details of underlying implementation, reducing the risk of configuration errors and improving the deployment efficiency.
[0155] Through the dynamic timeout mechanism, the system can adaptively adjust the Raft algorithm parameters, effectively cope with latency fluctuations, packet loss, and network jitter problems in the edge network environment, and significantly improve the stability of the consensus algorithm under poor network conditions. When the network quality deteriorates, the improved Raft algorithm intelligently extends the timeout time, effectively reducing the unnecessary number of Leader elections caused by network fluctuations, alleviating the computing burden on the edge gateway, and reducing system resource consumption; based on the optimal retry interval calculation of network quality, the sending timing of log replication requests is more reasonable, accelerating consensus reaching when the network is good and avoiding ineffective retries when the network is congested, improving the overall efficiency of collection strategy synchronization. Through the adaptive detection frequency adjustment mechanism, the system actively reduces the topology data collection frequency when the network quality is poor, alleviating the transmission burden on the edge network and preventing network congestion from deteriorating; through the optimized consensus mechanism and topology synchronization strategy, the system can ensure the real-time nature of data to the greatest extent while ensuring data consistency, meeting the strict requirements for data timeliness in edge computing scenarios.
[0156] Embodiment 2
[0157] Please refer to Figure 2 As shown, for the parts not described in detail in this embodiment, refer to the description content of Embodiment 1. A PLC networking data collection method based on an edge gateway is provided, including:
[0158] S1. By deploying an SDN controller and adopting deep packet inspection technology, different PLC devices are identified and classified, and automatically assigned to virtual subnets to obtain virtual IPs; each virtual subnet isolates PLC devices with the same IP address through a virtual switch and a virtual router; the virtual IPs of PLC devices and the actual physical network interface information are recorded through a mapping table to establish a network topology view;
[0159] S2. Based on the network topology view, the edge gateway is connected to the PLC device. By integrating the PLC communication protocol library and using FPGA hardware acceleration for protocol parsing, PLC networking data is read from the PLC device in real time;
[0160] S3. Based on the PLC networking data, the real-time status of the PLC is read, the collection period is dynamically adjusted, and the collection strategy is optimized according to the CPU load of the edge gateway and the network congestion status;
[0161] S4. Based on the improved Raft consensus algorithm, the optimized collection strategy is synchronized between edge gateways, and a heartbeat mechanism is used to detect the status of edge gateways, isolate faulty edge gateways, and automatically update the network topology view; using the updated network topology view, PLC networking data is read from the PLC device in real time again;
[0162] S5. Transmit the read PLC networking data to the acquisition server through a standardized data access interface.
[0163] Since the electronic device introduced in this embodiment is the electronic device adopted in the PLC networking data acquisition system based on an edge gateway in the embodiments of the present application, based on the PLC networking data acquisition system based on an edge gateway introduced in the embodiments of the present application, those skilled in the art can understand the specific implementation manners and various variations of the electronic device in this embodiment. Therefore, the specific implementation of how this electronic device realizes the method in the embodiments of the present application will not be described in detail here. As long as those skilled in the art implement the electronic device adopted in the PLC networking data acquisition system based on an edge gateway in the embodiments of the present application, it falls within the scope of protection of the present application.
[0164] The above formulas are all dimensionless and take their numerical values for calculation. The formulas are obtained by collecting a large amount of data for software simulation to obtain a formula closest to the actual situation. The preset parameters and threshold selection in the formulas are set by those skilled in the art according to the actual situation.
[0165] The above are only the preferred implementation manners of the present invention. The protection scope of the present invention is not limited to the above embodiments. All technical solutions falling within the idea of the present invention belong to the protection scope of the present invention. It should be noted that for those ordinary technical operators in the technical field, several improvements and refinements made without departing from the principle of the present invention should also be regarded as within the protection scope of the present invention.
Claims
1. A PLC networking data acquisition system based on an edge gateway, characterized in that Including: A dynamic virtual isolation module, which deploys an SDN controller, adopts deep packet inspection technology, identifies and classifies different PLC devices, automatically assigns them to virtual subnets, and obtains virtual IPs; each virtual subnet isolates PLC devices with the same IP address through a virtual switch and a virtual router, enabling PLC devices with the same IP address to operate independently in their respective virtual subnets; a mapping table is used to record the virtual IPs of PLC devices and the actual physical network interface information, and a network topology view is established; A multi-protocol parsing module, which connects the edge gateway and PLC devices based on the network topology view, integrates a PLC communication protocol library and uses FPGA hardware acceleration for protocol parsing, and reads PLC networking data from PLC devices in real time; An AI intelligent scheduling module, which reads the real-time status of PLCs based on PLC networking data, dynamically adjusts the acquisition period, and optimizes the acquisition strategy according to the CPU load of the edge gateway and network congestion conditions; A gateway collaborative awareness module, which synchronizes the optimized acquisition strategy among edge gateways based on the improved Raft consensus algorithm, uses a heartbeat mechanism to detect the status of edge gateways, isolates faulty edge gateways, and automatically updates the network topology view; uses the updated network topology view to read PLC networking data from PLC devices in real time again; A data transmission module, which transmits the read PLC networking data to the acquisition server through a standardized data access interface.
2. The PLC networking data acquisition system based on an edge gateway according to claim 1, wherein, The method for obtaining virtual IPs includes: Deploy an SDN controller in the edge gateway to centrally manage the virtual switch and virtual router, and configure the connection between the SDN controller and the physical network interface of the edge gateway; define the virtual switch and virtual router in the SDN controller as the boundaries of logically isolated virtual subnets; The SDN controller captures network packets through a mirror port, uses DPI technology to parse the packet payload, and extracts key features; the key features include protocol header fields, function codes, and device identifiers; a preset device fingerprint library is set, and the elements of the device fingerprint library include protocol features, manufacturer identifiers, and device models; different brands and protocol types of PLC devices are identified and classified based on the preset device fingerprint library to obtain a classification result; Define a virtual subnet division strategy according to the classification result, and the virtual subnet division strategy includes isolation by brand, isolation by protocol, and isolation by functional group; the SDN controller automatically creates virtual subnets according to the classification result, binds them to the corresponding virtual switches, and configures the access control list of the virtual router to restrict cross-subnet communication; Deploy a lightweight DHCP server inside the virtual subnet to assign a unique virtual IP to each PLC. For each PLC device, manually bind the virtual IP and the physical network interface through the SDN controller; configure NAT rules in the virtual router to map the physical IP of the PLC to a globally unique virtual IP.
3. The PLC networking data acquisition system based on an edge gateway according to claim 2, characterized in that, The method for isolating PLC devices with the same IP address includes: In the SDN controller, an independent virtual switch and virtual router are assigned to each virtual subnet; each virtual switch serves as the entry or exit of PLC devices within the virtual subnet and controls the traffic forwarding of PLC devices within the virtual subnet; pre-configured flow table rules are set, and the virtual switch controls the traffic through the configured flow table rules, only allowing communication between PLC devices within the same virtual subnet; the pre-configured flow table rules include an ingress traffic matching rule, a default discard rule, a VLAN isolation rule, a NAT conversion rule, an access control list rule, and an AI adaptive flow table rule; for different virtual subnets, the virtual switch isolates the traffic within different subnets based on VLAN tags. Each virtual subnet routes and forwards data packets through a virtual router; the virtual router only allows legal cross-subnet data transmission according to network policies and configurations. For devices with the same IP address but belonging to different virtual subnets, cross-subnet illegal communication is blocked by configuring access control policies.
4. The PLC networking data acquisition system based on an edge gateway according to claim 3, characterized in that, The method for obtaining the network topology view includes: Scanning all connected PLC devices through the SDN controller, manually binding the virtual IP of the PLC device to the corresponding physical network interface to generate a PLC device mapping table; recording the virtual IP, physical IP, MAC address, and connected physical network interface information of each PLC device through the PLC device mapping table; taking the edge gateway as the central node, constructing a network topology view based on the PLC device mapping table, and using the topology drawing tool Graphviz to visually display the network topology view.
5. The PLC networking data acquisition system based on an edge gateway according to claim 4, characterized in that, The method for connecting the edge gateway and PLC devices based on the network topology view includes: The edge gateway reads the virtual IP of each PLC device and its corresponding actual physical network interface information according to the obtained network topology view, and establishes a virtual communication link with the PLC device. Abstract the frame format, field definition, check algorithm, and state machine logic of various PLC communication protocols, encapsulate them into a unified PLC communication protocol library; generate a data request command based on the PLC communication protocol library, and send the data request to the PLC device through the virtual communication link; the PLC device responds to the received data request command and transmits the original data packet to the edge gateway through the virtual communication link; the edge gateway captures the original data packet transmitted through the virtual communication link and performs protocol decoding and data extraction through the FPGA hardware to obtain PLC networking data.
6. The PLC networking data acquisition system based on an edge gateway according to claim 5, characterized in that, The PLC networking data includes device ID, communication protocol, timestamp, device status data, sensor data, and device alarm data.
7. The PLC networking data acquisition system based on an edge gateway according to claim 6, characterized in that, The method for dynamically adjusting the acquisition period includes: Reading the PLC real-time status based on the PLC networking data, performing multi-dimensional analysis on the PLC real-time status using fuzzy logic to obtain device status grading; dynamically allocating the data acquisition period according to the device status grading; adjusting the acquisition period in real-time based on a sliding time window. When the data change rate exceeds the preset data change rate threshold, the acquisition period is automatically shortened to increase the acquisition density.
8. The PLC networking data acquisition system based on an edge gateway according to claim 7, characterized in that, The method for optimizing the acquisition strategy includes: Collect the CPU usage rate of the edge gateway in real time through the API to obtain the CPU load of the edge gateway; when the CPU load of the edge gateway exceeds the preset CPU load threshold of the edge gateway, extend the PLC network data polling interval, reduce the number of concurrently collected PLC devices at the same time, and suspend the PLC network data collection tasks of non-critical PLC devices. Monitor the bandwidth utilization rate of the network interface in real time to obtain the network congestion status, and use a lightweight compression algorithm to compress the collected PLC network data.
9. The PLC networking data acquisition system based on an edge gateway according to claim 8, wherein, The method for synchronizing the optimized acquisition strategy between edge gateways based on the improved Raft consensus algorithm includes: Run the improved Raft consensus algorithm on the edge gateway nodes. The improved Raft consensus algorithm includes a dynamic timeout mechanism. Real-time monitor network quality parameters through the dynamic timeout mechanism, establish an edge gateway cluster and complete the initial Leader election; the network quality parameters include round-trip delay, packet loss rate, and network jitter metrics; calculate the comprehensive network quality index through weighted average of network quality parameters; dynamically adjust the election timeout time and log replication timeout time of the improved Raft algorithm based on the comprehensive network quality index. Synchronize the optimized acquisition strategy to each edge gateway node through the improved Raft consensus algorithm; the optimized acquisition strategy synchronized by the improved Raft consensus algorithm includes maintaining an independent log replication success probability model for each gateway node. Dynamically adjust the retry interval to the optimal value according to the current round-trip delay and packet loss rate; each edge gateway node performs network topology data collection according to the optimized acquisition strategy; synchronize the collected topology data to the Leader node through the improved Raft consensus mechanism; the Leader node merges the topology data of each gateway node; automatically update the network topology view and synchronize the updated network topology view to each edge gateway node.
10. A PLC networking data acquisition method based on an edge gateway, which is used to implement a PLC networking data acquisition system according to any one of claims 1 to 9, characterized in that, Including: S1. Deploy an SDN controller, adopt deep packet inspection technology to identify and classify different PLC devices, and automatically assign them to virtual subnets to obtain virtual IPs; each virtual subnet isolates PLC devices with the same IP address through a virtual switch and a virtual router, enabling PLC devices with the same IP address to operate independently in their respective virtual subnets; record the virtual IPs of PLC devices and the actual physical network interface information through a mapping table to establish a network topology view. S2. Connect the edge gateway and PLC devices based on the network topology view, parse the protocol by integrating the PLC communication protocol library and using FPGA hardware acceleration, and read the PLC network data from the PLC devices in real time. S3. Read the real-time status of the PLC based on the PLC network data, dynamically adjust the collection period, and optimize the acquisition strategy according to the CPU load of the edge gateway and the network congestion status. S4. Based on the improved Raft consensus algorithm, synchronize the optimized acquisition strategy between edge gateways, and use a heartbeat mechanism to detect the status of edge gateways, isolate faulty edge gateways, and automatically update the network topology view; use the updated network topology view to read the PLC network data from the PLC devices in real time again. S5. Transmit the read PLC networking data to the acquisition server through a standardized data access interface.
Citation Information
Patent Citations
Data acquisition system based on edge calculation
CN116055525A
Distributed device IP address allocation management and control method and system
CN110691151A
Security control method and system based on SDN architecture
CN118784311A