Method and system for centrally and safely collecting PLC data of same network segment of multiple production lines

By configuring multi-port switches and firewalls in multiple production line data acquisition systems, network isolation and address conversion are achieved, and the problems of multiple hardware configurations, multiple data link links and many transit communication software in existing systems are solved, and the system is improved stability and data acquisition efficiency.

CN119483987APending Publication Date: 2025-02-18BAOSTEEL NIPPON STEEL AUTO SHEET CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311002729.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-10
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing multi-production line data acquisition systems have problems such as many hardware configurations, many data link links and many transit communication software, which leads to a decrease in system stability and cannot meet the requirements of high-frequency, stable and accurate data acquisition.

Method used

By configuring the data acquisition network hardware environment of multiple units, network isolation and address conversion are achieved using multi-port switches and firewalls, data link links are reduced, and bidirectional communication is realized through NAT mapping, reducing hardware and software configuration requirements.

Benefits of technology

The isolation between each production line control network and the centralized acquisition network is achieved, the reliability and stability of network communication is improved, the hardware and software configuration costs are reduced, and data acquisition efficiency and stability are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119483987A_ABST
    Figure CN119483987A_ABST
Patent Text Reader

Abstract

The invention discloses a centralized and safe acquisition method for PLC data in the same network segment of multiple production lines. The method comprises the following steps: S1, configuring a data acquisition network hardware environment of multiple units; s2, setting a network environment; s3, configuring bidirectional isolation of different IP network segments and carrying out communication; s4, controlling data acquisition and transmission of the plurality of units; and S5, controlling data receiving and centralized display of the plurality of units. The invention also discloses a centralized safety acquisition system for PLC data in the same network segment of multiple production lines. According to the invention, each production line control network can be isolated from a centralized acquisition network, but a bidirectional communication function can be implemented, and the network communication reliability of the system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to metallurgy and steel rolling technology, and more specifically, to a method and system for centralized and secure collection of PLC data of multiple production lines in the same network segment. The method and system are particularly suitable for centralized data collection in smart factories with the same network segment but independent of each other, and can be applied to production process units such as cold rolling and annealing. Background Art

[0002] Collecting key production data from production lines for data analysis and improving production line efficiency is a common improvement route. For existing production line key upload data collection systems, when the production line systems are the same brand of electrical controllers, the IP address network segments of each production line are often the same. Figure 1 As shown, the corresponding IP address segments of unit A 100 and unit B 200 are 192.168.11.xx and 192.168.11.xx respectively; in order to centrally collect the production data of the two production lines, the unit PLCs 101 and 201 of the two production lines are connected to the multi-port switches 102 and 202 respectively; in order to collect the production line data, the front-end data collection PCs 103 and 203 are respectively set up, and the front-end data collection PCs 103 and 203 are equipped with dual network ports, one network port corresponds to the multi-port switches 102 and 202, and the other network port is set to a different IP network segment, such as 172.10.11.S2 and 172.10.11.S1, and then the multi-port switch 300 is used to connect unit A 100 and unit B 200 to the same network, providing a hardware environment for the unit to collect data from multiple production lines. Finally, the centralized data collection PC 400 can collect data from multiple production lines at the same time, but the system has the following disadvantages:

[0003] 1. More hardware configurations, such as each production line needs to be equipped with a front-end data acquisition PC and dual network cards, resulting in high hardware investment costs;

[0004] 2. There are many links in the data link. When the centralized data acquisition PC 400 collects data from unit A 100, it needs to go through the unit PLC 101, multi-port switch 102 and front-end data acquisition PC 103. With more links, it is easy to have more fault points, resulting in maintenance difficulties and reduced system stability.

[0005] 3. Multiple transfer software is required to transmit unit data to the centralized data acquisition PC 400. Taking unit A 100 as an example, it is necessary to compile a sending program A3 in the unit PLC 101 and a receiving program A2 in the front-end data acquisition PC 103. In order to transfer data to the centralized data acquisition PC 400, it is also necessary to compile a sending program A1 in the front-end data acquisition PC 103 and a total receiving program C in the centralized data acquisition PC 400. It can be summarized as 4 sets of hardware and 4 sets of data communication programs. Multiple data communication programs not only increase the programming workload, but also increase the risk of communication rate reduction and packet loss due to communication between multiple hardware.

[0006] In summary, given that the system has relatively more hardware configurations, more data link links, and more transit communication software, the stability of the data acquisition system will be weakened, and thus it cannot meet the requirements of high frequency, stability, and accuracy of data acquisition. It is necessary to improve the acquisition system to solve the shortcomings of the existing system. Summary of the invention

[0007] In view of the defects existing in the prior art, the purpose of the present invention is to provide a method and system for centralized and secure collection of PLC data from multiple production lines in the same network segment, which can achieve isolation of the control network of each production line from the centralized collection network, while implementing the function of two-way communication, thereby increasing the reliability of system network communication.

[0008] To achieve the above object, the present invention adopts the following technical solution:

[0009] A first aspect of the present invention provides a method for centralized and secure collection of PLC data of multiple production lines in the same network segment, comprising the following steps:

[0010] S1. Configure the data acquisition network hardware environment for multiple units;

[0011] S2. Set up the network environment;

[0012] S3, configure two-way isolation of different IP segments and perform communication;

[0013] S4, controlling the data collection and transmission of the plurality of units;

[0014] S5. Control the data reception and centralized display of the plurality of units.

[0015] Preferably, the step S1 of configuring the data acquisition network hardware environment of multiple units specifically includes:

[0016] A first multi-port switch is configured on the unit PLC of each unit, and the first multi-port switch is configured with a unit firewall;

[0017] The firewalls of the units are all connected to a second multi-port switch, and the second multi-port switch is connected to a centralized collection PC.

[0018] Preferably, the step S2 of setting the network environment specifically includes:

[0019] IP addresses are respectively allocated to the centralized collection PC and the unit firewall configured on each unit, and are set as internal network segment addresses and control network addresses.

[0020] Preferably, the step S3 configures two-way isolation of different IP network segments and performs communication, specifically comprising the following steps:

[0021] S31, the network port and network card of the unit firewall are set to bridge, and an IP address in the same network segment as the unit PLC is allocated;

[0022] S32, assigning an IP address A to the centralized collection PC, assigning an IP address B1 to the unit firewall, and mapping the IP address B1 on the unit firewall to the IP address A on the centralized collection PC;

[0023] S33, assigning an IP address C1 in the same network segment as the centralized data collection PC to each unit. Preferably, the step S4 of controlling the data collection and sending of multiple units specifically includes the following steps:

[0024] S41, initialization, configuring initial communication parameters, setting the communication target end IP address and port, the communication target end IP address is the IP address A on the centralized collection PC, and different ports D1 and D2 are set for each unit;

[0025] S42, establish a communication socket number, input communication parameters such as IP address and port into the socket, TCP communication parameters; if the socket is established normally, proceed to step S43, if the socket is established abnormally, continue to execute step S42;

[0026] S43, establish a target end communication connection, wait for the connection to be established with the centralized collection PC, if the communication connection is established normally, execute step S44, if the communication connection is established abnormally, continue to execute step S43;

[0027] S44, data transmission preparation, setting the transmission data length, reading the memory data of the unit PLC, and combining them into a data packet to be sent;

[0028] S45, sending the packaged data, using a command to send the data to be sent to the network, pointing to the target device.

[0029] Preferably, the step S5 of controlling the data reception and centralized display of the plurality of units specifically comprises the following steps:

[0030] S51, initialization, setting the port number of each unit;

[0031] S52, establish a socket, each unit establishes a socket, sets the IP address to any, the port of the first unit to D1, the port of the second unit to D2, and so on; if the socket is established normally, execute step S53, if the socket is established abnormally, execute step S51;

[0032] S53, start listening, if there is an external connection request, establish a communication connection, wait for receiving data, and execute step S54, if there is no external connection request, continue to execute this step S53 and wait;

[0033] S54, start data reception, read predefined data packets, centrally collect data packets from multiple ports, and save them in a database;

[0034] S55, display the centrally collected data in real time, read the database, and display them one by one on the operation terminal according to the predefined data items.

[0035] A second aspect of the present invention provides a centralized secure collection system for PLC data of multiple production lines in the same network segment, comprising:

[0036] A first multi-port switch is provided with a plurality of switches, each of which is connected to a corresponding unit PLC to obtain data of the unit;

[0037] The unit firewall is provided with a plurality of firewalls, each of which is connected to the corresponding first multi-port switch for network isolation and address translation;

[0038] A second multi-port switch connected to the unit firewall to aggregate different production line networks into an internal network;

[0039] A centralized data collection PC is connected to the second multi-port switch to complete two-way communication and data exchange with the unit;

[0040] The system for centralized and secure collection of PLC data from multiple production lines in the same network segment implements the method for centralized and secure collection of PLC data from multiple production lines in the same network segment provided by the first aspect of the present invention.

[0041] The present invention provides a method and system for centralized and secure collection of PLC data of multiple production lines in the same network segment, which is suitable for isolating the control network from the collection network, and is particularly suitable for centralized collection of production data of multiple production lines, and has the following obvious characteristics and effects:

[0042] 1. It not only solves the problem that traditional centralized collection devices need to be configured with multiple network cards, multiple front-end processors and multiple transfer communication programs, but also reduces costs and collection links;

[0043] 2. It can solve the problem of mixed connection caused by the lack of isolation between the traditional acquisition network and the control network, thereby improving network security;

[0044] 3. End-to-end IP control and port control settings can be performed to keep network communication under control, effectively reducing network load;

[0045] 4. The collection device can also collect data from multiple production lines in a centralized manner, reducing the amount of software development, improving data collection efficiency, data collection stability and collection costs, and providing stable control effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is a structural diagram of the existing multi-unit centralized data acquisition system;

[0047] Figure 2 It is a flow chart of a method for centralized and safe collection of PLC data of multiple production lines in the same network segment of the present invention;

[0048] Figure 3 It is a flow chart of step S5 in the method for centralized and safe collection of PLC data of multiple production lines in the same network segment of the present invention;

[0049] Figure 4 It is a structural schematic diagram of the PLC data centralized safety collection system for multiple production lines in the same network segment of the present invention;

[0050] Figure 5 It is a schematic diagram of the hardware environment of a PLC data security centralized collection device for six production lines in the same network segment in an embodiment of the method for centralized secure collection of PLC data for multiple production lines in the same network segment of the present invention;

[0051] Figure 6 It is a schematic diagram of an application interface for centralized data collection of six production lines in an embodiment of a method for centralized and safe collection of PLC data of multiple production lines in the same network segment of the present invention;

[0052] Figure 7 It is a schematic diagram showing the data collected by the C412 unit in the embodiment of the method for centralized and safe collection of PLC data of multiple production lines in the same network segment of the present invention;

[0053] Figure 8 It is a schematic diagram showing data collected by the C808 unit in an embodiment of the method for centralized and safe collection of PLC data of multiple production lines in the same network segment of the present invention. DETAILED DESCRIPTION

[0054] In order to better understand the above technical solution of the present invention, the technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0055] Combination Figure 2As shown, the present invention provides a method for centralized and secure collection of PLC data of multiple production lines in the same network segment, comprising the following steps:

[0056] S1. Configure the data acquisition network hardware environment for multiple units, as follows:

[0057] A first multi-port switch 3 is configured on the unit PLC 2 of each unit 1, which serves as a window for obtaining data of the unit 1;

[0058] A unit firewall 4 is configured on the first multi-port switch 3 to play the role of network isolation and address translation;

[0059] The unit firewalls 4 are all connected to the second multi-port switch 5, which aggregates the networks of different units 1 into an internal network;

[0060] The second multi-port switch 5 is connected to the centralized collection PC 6 to complete two-way communication and data exchange with the unit 1. Figure 4 shown.

[0061] S2. Set up the network environment as follows:

[0062] For centralized collection PC 6, the unit firewall 4 configured on each unit 1 is assigned an IP address, which is set as the internal network segment address and the control network address to achieve hardware isolation. The PLC network configuration and setting of multiple units with the same network segment is completed to avoid address conflicts of multiple units.

[0063] S3. Configure two-way isolation of different IP segments and perform communication, specifically including the following steps:

[0064] S31, the network port and network card of the unit firewall 4 are set to bridge, and the IP address of the same network segment as the unit PLC2 is assigned;

[0065] S32. Allocate an IP address A to the centralized collection PC 6, and an IP address B1 to the unit firewall 4. Use the NAT function of the unit firewall 4 to map the IP address B1 on the unit firewall 4 to the IP address A on the centralized collection PC 6. In this way, the communication IP address on each unit is mapped to the IP address A of the centralized collection PC 6, such as B1 is mapped to A, B2 is mapped to A, and so on. After NAT is completed, the IP used for communication of each unit is mapped to the same IP address of the centralized collection PC 6, completing the one-way communication of the upload link from unit 1 to the centralized collection PC 6, and achieving the setting of communication between the IP of the same network segment of different production lines and the same host IP;

[0066] S33. According to the actual need for two-way communication, each unit is assigned an IP address C1 in the same network segment as the centralized collection PC 6. For example, if the unit communicates with PLC2, the C1 address is mapped to the unit PLC2 address, that is, the centralized collection PC 6 accessing C1 is the same as accessing the unit PLC2. Although the network segments are different and isolated from each other, the function of a PC sending data to multiple units at the same time is realized.

[0067] S4, control the data collection and transmission of multiple units, each unit sends a program A3, specifically including the following steps:

[0068] S41, initialization, configure the initial communication parameters, set the communication target IP address and port, the communication target IP address is the IP address A on the centralized collection PC, set different ports D1 and D2 for each unit, ports D1 and D2 are used to distinguish each unit, after the setting is completed, execute step S42;

[0069] S42, establish a communication socket number, input communication parameters such as IP address and port into the socket, TCP communication parameters; if the socket is established normally, proceed to step S43, if the socket is established abnormally, continue to execute step S42;

[0070] S43, establish a target end communication connection, wait for the connection to be established with the centralized collection PC, if the communication connection is established normally, execute step S44, if the communication connection is established abnormally, continue to execute step S43;

[0071] S44, data transmission preparation, setting the transmission data length, reading the memory data of the unit PLC, and combining them into a data packet to be sent. After the packaging is completed, execute step S45;

[0072] S45, sending the packaged data, using a command to send the data to be sent to the network, pointing to the target device, that is, the centralized collection PC.

[0073] S5, controlling the data reception and centralized display of multiple units, specifically including the following steps:

[0074] S51, initialization, setting the port number of each unit, such as D1, D2, after the setting is completed, execute step S52;

[0075] S52, establish a socket, each unit establishes a socket, set the IP address to any, the port of the first unit is D1, the port of the second unit is D2, and so on; if the socket is established normally, execute step S53, if the socket is established abnormally, execute step S51;

[0076] S53, start listening, if there is an external connection request, establish a communication connection, wait for receiving data, and execute step S54, if there is no external connection request, continue to execute this step S53 and wait;

[0077] S54, start data reception, read predefined data packets, centrally collect data packets from multiple ports, and save them in a database;

[0078] S55, display the centrally collected data in real time, read the database, and display them one by one on the operation terminal according to the pre-defined data items, so as to facilitate data inspection and use.

[0079] Refer to Figure 4 As shown, the present invention also provides a centralized and secure PLC data collection system for multiple production lines in the same network segment, including:

[0080] The first multi-port switch 3 is provided with a plurality of switches (the number of switches matches the number of the units 1), which are respectively connected to the corresponding unit PLC2 to obtain the data of the unit 1;

[0081] The unit firewall 4 is provided with a plurality of (the number matches the number of the first multi-port switches 3), which are respectively connected to the corresponding first multi-port switches 3 for network isolation and address translation;

[0082] The second multi-port switch 5 is connected to all unit firewalls 4 to aggregate different production line networks into an internal network;

[0083] The centralized data collection PC 6 is connected to the second multi-port switch 5 to complete two-way communication and data exchange with the unit 1;

[0084] The system for centralized secure collection of PLC data for multiple production lines in the same network segment of the present invention realizes the method for centralized secure collection of PLC data for multiple production lines in the same network segment of the present invention.

[0085] Example

[0086] Combination Figure 5 As shown in the figure, the implementation process of PLC data security collection of 6 production lines (units) in the same network segment is as follows:

[0087] S1. Configure the data collection network hardware environment for 6 production lines, as follows:

[0088] Taking the C402 unit as an example, a first multi-port switch connected to 4-1-C402 is configured for the C402 production line, which is connected to the 5-1-C402 unit PLC and serves as a window for obtaining unit data; a 3-1-C402 unit firewall is configured and connected to the 4-1-C402 multi-port switch to play a role in network isolation and address conversion; a second multi-port switch 5 is configured to connect the remaining C412, CA08 and other 5 production line firewalls into an internal network; a centralized collection PC 6 is configured and connected to the second multi-port switch 5 to complete two-way communication and data exchange with the production line.

[0089] S2. Set up the network environment as follows:

[0090] Assign IP addresses to each production line 3-1-C402 firewall and centralized collection PC 6, set them to internal network segment addresses and control network addresses, as shown in the following table, to achieve hardware isolation. Complete the PLC network configuration and settings of the same network segment of multiple production lines to avoid address conflicts of multiple production lines.

[0091] equipment Control network segment 1 Control network segment 2 Internal network segment Centralized collection PC 172.10.11.1 3-1-C402 firewall IP address 192.168.10.204 3-1-C402 collects IP addresses 192.168.10.202 3-1-C412 Firewall IP Address 192.168.11.215 3-1-C412 collects IP addresses 192.168.11.212 3-1-C408 firewall IP address 192.168.11.210 3-1-C408 collects IP addresses 192.168.11.208 3-1-C508 firewall IP address 192.168.10.220 3-1-C508 collects IP addresses 192.168.10.218 3-1-C808 firewall IP address 192.168.11.245 3-1-C808 collects IP addresses 192.168.11.238 3-1-CA08 firewall IP address 192.168.11.250 3-1-CA08 collects IP addresses 192.168.11.248

[0092] S3. Configure two-way isolation of different IP segments and perform communication, specifically including the following steps:

[0093] S31, set the firewall of unit 3-1-C402 and the PLC of unit 5-1-C402 to the same network segment IP address;

[0094] S32. Assign an IP address 172.10.11.1 to the centralized data collection PC 6, which is different from the control network segment to achieve isolation. Assign an IP address 192.168.10.202 to the control network in the 3-1-C402 firewall. Through the firewall NAT function, map the 192.168.10.202 address to the 172.10.11.1 address. In this way, the IP address used for communication on each production line is mapped to the IP address 172.10.11.1 of the centralized data collection PC. After NAT is completed, the IP used for communication on each production line is mapped to the same IP address of the data collection PC, as shown in the following table, completing the one-way communication from the production line to the centralized data PC upload link, and achieving the setting of communication between the IPs of different production lines in the same network segment and the same host IP;

[0095]

[0096] S33. According to the actual need for two-way communication, an IP address 172.10.11.10 in the same network segment as the centralized collection PC 6 is assigned to each production line. For example, if it communicates with the PLC of the 5-1-C402 unit, the address 172.10.11.10 is mapped to the PLC address 192.168.10.101 of the 5-1-C402 unit, that is, the centralized collection PC 6 accessing 172.10.11.10 is the same as accessing the PLC of the 5-1-C402 unit. Although the network segments are different and isolated from each other, the function of a PC sending data to multiple production lines at the same time is realized. The addresses of the 6 production lines after mapping are as follows:

[0097] equipment Address before mapping Mapped address 5-1-C402 unit PLC 192.168.10.101 172.10.11.10 5-1-C412 unit PLC 192.168.11.65 172.10.11.30 5-1-C408 unit PLC 192.168.11.65 172.10.11.50 5-1-C508 unit PLC 192.168.10.64 172.10.11.20 5-1-C808 unit PLC 192.168.11.41 172.10.11.40 5-1-CA08 unit PLC 192.168.11.67 172.10.11.61

[0098] S4, control the data collection and transmission of the six production lines, each unit sends program A3, specifically including the following steps:

[0099] S41, initialization, configure the initial communication parameters, set the communication target IP address and port, the IP address is 172.10.11.1 of the centralized collection PC 6, set different ports D1 and D2 for each production line, ports D1 and D2 are used to distinguish each production line; after the setting is completed, execute step S42;

[0100] The port table is as follows:

[0101] unit Port Number serial number C402 40402 D1 C412 40412 D2 C408 40408 D3 C508 40508 D4 C808 40808 D5 CA08 40908 D6

[0102] S42, establish a communication socket, input communication parameters such as IP address and port into the socket, TCP communication parameters; if the socket is established normally, execute step S43, if the socket is established abnormally, continue to execute step S42;

[0103] S43, establish a target end communication connection, wait for the connection to be established with the centralized collection PC 6, if the communication connection is established normally, execute step S44, if the communication connection is established abnormally, continue to execute step S43;

[0104] S44, data transmission preparation, set the transmission data length, read the 5-1-C402 unit PLC memory data, and combine them into a data packet to be sent. After the packaging is completed, execute step S45;

[0105] S45, sending the packaged data, using a command to send the data to be sent to the network, pointing to the target end device, that is, the centralized collection PC 6;

[0106] S5, controlling the data reception and centralized display of multiple units, specifically including the following steps:

[0107] S51, initialization, setting the port number of each unit, such as D1, D2, after the setting is completed, execute step S52;

[0108] S52, establish a socket, each unit establishes a socket, set the IP address to any, the port of the first unit is D1, the port of the second unit is D2, and so on; if the socket is established normally, execute step S53, if the socket is established abnormally, execute step S51;

[0109] S53, start listening, if there is an external connection request, establish a communication connection, wait for receiving data, and execute step S54, if there is no external connection request, continue to execute this step S53 and wait;

[0110] S54, start data reception, read predefined data packets, centrally collect data packets from multiple ports, and save them in a database;

[0111] S55, display the centrally collected data in real time, read the database, and display them one by one on the operation terminal according to the pre-defined data items, so as to facilitate data inspection and use.

[0112] By setting up the hardware environment for 6 production lines, a network for centralized data collection of the 6 production lines was configured. By using firewall policy configuration, both the end-to-end IP routing and the ports passed can be controlled. After NAT mapping, the address conflict problem of multiple production lines in the same network segment was solved, and the isolation of the control network and the collection network was achieved. The network data security was greatly improved, and the network load was also controlled.

[0113] The actual application interface for centralized data collection of 6 production lines in this embodiment is as follows Figure 6 As shown, the data collected by the C412 unit is displayed in real time as follows Figure 7 As shown, the data collected by the C808 unit is displayed in real time as follows Figure 8 shown.

[0114] Those skilled in the art should recognize that the above embodiments are only used to illustrate the present invention, and are not intended to limit the present invention. As long as they are within the spirit of the present invention, any changes or modifications to the above embodiments will fall within the scope of the claims of the present invention.

Claims

1. A method for centralized and secure collection of PLC data from multiple production lines in the same network segment, characterized in that: The following steps are involved: S1. Configure the data acquisition network hardware environment for multiple units; S2. Set up the network environment; S3, configure two-way isolation of different IP segments and perform communication; S4, controlling the data collection and transmission of the plurality of units; S5. Control the data reception and centralized display of the plurality of units.

2. The method for centralized and secure collection of PLC data of multiple production lines in the same network segment according to claim 1 is characterized in that: The step S1 of configuring the data acquisition network hardware environment of multiple units specifically includes: A first multi-port switch is configured on the unit PLC of each unit, and the first multi-port switch is configured with a unit firewall; The firewalls of the units are all connected to a second multi-port switch, and the second multi-port switch is connected to a centralized collection PC.

3. The method for centralized and secure collection of PLC data of multiple production lines in the same network segment according to claim 2 is characterized in that: The step S2 of setting the network environment specifically includes: IP addresses are respectively allocated to the centralized collection PC and the unit firewall configured on each unit, and are set as internal network segment addresses and control network addresses.

4. The method for centralized and secure collection of PLC data of multiple production lines in the same network segment according to claim 3 is characterized in that: The step S3 configures two-way isolation of different IP network segments and performs communication, and specifically includes the following steps: S31, the network port and network card of the unit firewall are set to bridge, and an IP address in the same network segment as the unit PLC is allocated; S32, assigning an IP address A to the centralized collection PC, assigning an IP address B1 to the unit firewall, and mapping the IP address B1 on the unit firewall to the IP address A on the centralized collection PC; S33, allocating an IP address C1 in the same network segment as the centralized data collection PC to each of the units.

5. The method for centralized and secure collection of PLC data of multiple production lines in the same network segment according to claim 4 is characterized in that: The step S4 controls the data collection and transmission of the plurality of units and specifically comprises the following steps: S41, initialization, configuring initial communication parameters, setting the communication target end IP address and port, the communication target end IP address is the IP address A on the centralized collection PC, and different ports D1 and D2 are set for each unit; S42, establish a communication socket number, input communication parameters such as IP address and port into the socket, TCP communication parameters; if the socket is established normally, proceed to step S43, if the socket is established abnormally, continue to execute step S42; S43, establish a target end communication connection, wait for the connection to be established with the centralized collection PC, if the communication connection is established normally, execute step S44, if the communication connection is established abnormally, continue to execute step S43; S44, data transmission preparation, setting the transmission data length, reading the memory data of the unit PLC, and combining them into a data packet to be sent; S45, sending the packaged data, using a command to send the data to be sent to the network, pointing to the target device.

6. The method for centralized and secure collection of PLC data of multiple production lines in the same network segment according to claim 5 is characterized in that: The step S5 of controlling the data reception and centralized display of the plurality of units specifically comprises the following steps: S51, initialization, setting the port number of each unit; S52, establish a socket, each unit establishes a socket, sets the IP address to any, the port of the first unit to D1, the port of the second unit to D2, and so on; if the socket is established normally, execute step S53, if the socket is established abnormally, execute step S51; S53, start listening, if there is an external connection request, establish a communication connection, wait for receiving data, and execute step S54, if there is no external connection request, continue to execute this step S53 and wait; S54, start data reception, read predefined data packets, centrally collect data packets from multiple ports, and save them in a database; S55, display the centrally collected data in real time, read the database, and display them one by one on the operation terminal according to the predefined data items.

7. A centralized and secure PLC data collection system for multiple production lines in the same network segment, characterized in that: include: A first multi-port switch is provided with a plurality of switches, each of which is connected to a corresponding unit PLC to obtain data of the unit; The unit firewall is provided with a plurality of firewalls, each of which is connected to the corresponding first multi-port switch for network isolation and address translation; A second multi-port switch connected to the unit firewall to aggregate different production line networks into an internal network; A centralized data collection PC is connected to the second multi-port switch to complete two-way communication and data exchange with the unit; The system for centralized and secure collection of PLC data for multiple production lines in the same network segment implements the method for centralized and secure collection of PLC data for multiple production lines in the same network segment as described in any one of claims 1-6.