Automatic data synchronization method and system for PLC industrial production

By acquiring PLC cluster information and identifying PLC equipment, locating the faulty equipment and forwarding data in groups, the problem of inability to obtain the faulty PLC equipment data in the prior art is solved, and high-precision, timeliness and stable data synchronization is achieved, avoiding the risk of system shutdown.

CN120065896AInactive Publication Date: 2025-05-30GUANGDONG HANDE ELECTRIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510285237.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-11
Publication Date
2025-05-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art cannot obtain data inside the faulty PLC equipment in a timely manner, resulting in high difficulty in data synchronization, low reliability and poor flexibility in the overall industrial control system.

Method used

By obtaining PLC cluster information, identifying the identification information of each PLC device, positioning and obtaining the status data of the faulty PLC device, grouping and forwarding the service data of the equipment to the transit PLC device, and finally achieving automated data synchronization of the faulty PLC device.

Benefits of technology

Ensure that the upper computer can obtain the data of the faulty PLC device stably and accurately, improve the accuracy, timeliness and stability of data synchronization, avoid the data being unable to be processed for a long time, improve the efficiency of subsequent analysis, and prevent the overall system from being shut down or paralyzed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120065896A_ABST
    Figure CN120065896A_ABST
Patent Text Reader

Abstract

The invention relates to an automatic data synchronization method and system for PLC industrial production, and the method comprises the steps: obtaining PLC cluster information, and determining the recognition information of each PLC device; according to the identification information, positioning and obtaining state data of each PLC device, determining a faulty PLC device in each PLC device, and obtaining device service data in the faulty PLC device; in response to a handle request signal sent out by the faulty PLC device, determining a transfer PLC device, and grouping device service data corresponding to the faulty PLC device to obtain a to-be-forwarded data group; forwarding the service unit data in the to-be-forwarded data group to the corresponding transfer PLC equipment in sequence, and sending the data through the transfer PLC equipment according to a data sending strategy; and after the upper computer receives all the forwarded service unit data, recombining all the service unit data to obtain complete equipment service data in the faulty PLC equipment, thereby realizing automatic data synchronization of the faulty PLC equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of industrial automation, and particularly to an automated data synchronization method and system for PLC industrial production. Background Art

[0002] A PLC (Programmable Logic Controller) is a commonly used computer in an industrial environment for controlling machinery and processes. When they work in a cluster, it means that multiple PLC devices cooperate. They can perform data acquisition and monitoring of each PLC device through a host computer and network connection.

[0003] When a certain PLC device fails, the existing technology can identify the failure of the corresponding PLC device and give an alarm in time. However, the data inside the failed PLC device cannot be obtained in time, and only the output control of the PLC cluster can be maintained. However, for the background monitoring, the detailed data during the data processing or control output of the failed PLC device cannot be obtained in time, resulting in the host computer or background of the PLC device being unable to obtain the corresponding failure data and the detailed control data of a certain control node in the overall system before the failure in detail. The sudden absence of a certain control node easily causes the overall system to malfunction or even crash, and the corresponding cause of the failure cannot be analyzed in time, resulting in greater difficulty in data synchronization, low reliability, and poor flexibility of the overall industrial control system, and unable to synchronize the data information of the corresponding failed PLC device in time to avoid the problem that the overall control system is prone to error due to the failure of a single node. Summary of the Invention

[0004] The present invention provides an automated data synchronization method and system for PLC industrial production to solve the technical problem in the prior art that the data information inside the failed PLC device cannot be obtained in time, resulting in greater difficulty in data synchronization, low reliability, and poor flexibility of the overall industrial control system.

[0005] To solve the above technical problem, an embodiment of the present invention provides an automated data synchronization method for PLC industrial production, including: Obtaining PLC cluster information and determining the identification information of each PLC device according to the PLC cluster information; wherein, the PLC cluster includes several PLC devices and a host computer connected to each PLC; Locating and obtaining the status data of each PLC device according to the identification information, determining the failed PLC device in each PLC device based on the status data, and obtaining the device service data in the failed PLC device; In response to a pull - hand request signal sent by a faulty PLC device, determine a transfer PLC device according to the pull - hand request signal, and group the device service data corresponding to the faulty PLC device to obtain a data group to be forwarded; wherein, the data group to be forwarded includes service unit data corresponding to the number of transfer PLC devices, and each service unit data has a corresponding transfer PLC device; Sequentially forward the service unit data in the data group to be forwarded to the corresponding transfer PLC devices, determine a data sending strategy according to each transfer PLC device, and send data through the transfer PLC devices according to the data sending strategy; wherein, the data sending strategy is a strategy for sending the device service data and service unit data corresponding to each transfer PLC device to the host computer connected to it; After the host computer receives all the forwarded service unit data, reorganize all the service unit data to obtain the complete device service data in the faulty PLC device, thereby realizing the automatic data synchronization of the faulty PLC device.

[0006] As a preferred solution, the obtaining of the PLC cluster information and the determination of the identification information of each PLC device according to the PLC cluster information specifically includes: Identify several PLC devices through network scanning, and determine the host computer connected to by the PLC devices; Perform cluster merging on the PLC devices and the connected host computers to obtain the PLC cluster, and obtain the PLC cluster information; According to the PLC cluster information, determine the attributes of the host computer and the identifiers and functional attributes of each PLC device connected to it stored in the host computer, and compare the identifiers and functional attributes stored in the host computer with the identifiers and functional attributes of each PLC device itself; Obtain the IP addresses, device identifiers, serial numbers, and device names of all the PLC devices that pass the comparison, and use the IP address, device identifier, serial number, and device name of each PLC device as its corresponding identification information; Exclude the PLC devices that do not pass the comparison from the PLC cluster information, and generate an information comparison error alarm for the PLC devices that do not pass the comparison.

[0007] As a preferred solution, the positioning and obtaining of the status data of each PLC device according to the identification information, and the determination of the faulty PLC device in each PLC device based on the status data, and the obtaining of the device service data of the faulty PLC device specifically include: Obtain the identity information of all the PLC devices pre - stored in the host computer; Pull the information corresponding to the IP address, device identifier, serial number, and device name in each PLC device, and match the pulled information with the identity information of each PLC device in the host computer; Extract the status data corresponding to each PLC device in each matched PLC device, and send the corresponding status data to the host computer, so that the PLC device records the first timestamp when sending the status data and the host computer records the second timestamp when receiving the corresponding status data; wherein, each PLC device sends the corresponding status data to the host computer every preset period; Perform abnormal status detection on each PLC device according to the time difference between the first timestamp and the second timestamp; If the time difference is within the preset range, mark the PLC device as a normal device; If the time difference is not within the preset range, mark the PLC device as an abnormal device, and based on the historical status data of the abnormal device obtained by the host computer, perform fault analysis on the current status data of the abnormal device, so as to mark the abnormal device with a fault status as a faulty PLC device, and at the same time obtain the device service data in the faulty PLC device.

[0008] As a preferred solution, the performing fault analysis on the current status data of the abnormal device based on the historical status data of the abnormal device obtained by the host computer, so as to mark the abnormal device with a fault status as a faulty PLC device specifically includes: Construct an initial fault analysis model; Annotate the historical status data of the abnormal device obtained by the host computer, and use the annotated historical status data as training data to train the initial fault analysis model; After the training is completed, obtain a fault analysis model, and use the current status data as the input of the fault analysis model to perform fault analysis on the abnormal device to obtain the fault type of the abnormal device; When the fault type of the abnormal device belongs to a non-communication fault, mark the abnormal device of this type as a faulty PLC device; When the fault type of the abnormal device belongs to a communication fault, issue an audible and visual alarm, and generate a disconnection reminder for the abnormal device through the host computer.

[0009] As a preferred solution, the responding to the external pull request signal of the faulty PLC device, determining the transfer PLC device according to the pull request signal, and grouping the device service data corresponding to the faulty PLC device to obtain a data group to be forwarded specifically includes: In response to the external pull request signal sent by the faulty PLC device, obtain the PLC device that has received the pull request signal of the faulty PLC device as the intermediate PLC device; Based on the topological communication connection structure between the host computer and each PLC device, obtain the communication connection relationship between the faulty PLC device and the intermediate PLC device, and obtain the communication connection relationship between the intermediate PLC device that has a communication connection relationship with the faulty PLC device and the device it communicates with; According to the device service data in the faulty PLC device, determine the target number of intermediate PLC devices required, and screen the intermediate PLC devices according to the target number and the communication connection relationship, so as to obtain the intermediate PLC device with the least number of communication connection relationships between the devices of the intermediate PLC device as the transfer PLC device; Group the device service data corresponding to the faulty PLC device according to the number and attribute information of the transfer PLC devices to obtain the data group to be forwarded.

[0010] As a preferred solution, grouping the device service data corresponding to the faulty PLC device according to the number and attribute information of the transfer PLC devices to obtain the data group to be forwarded specifically includes: Obtain the number of the transfer PLC devices and the attribute information of the transfer PLC devices, and determine the available transfer data margin of each transfer PLC device according to the attribute information of the transfer PLC device and the corresponding device service data; Determine the target transfer data volume of each transfer PLC device according to the number of the transfer PLC devices and the corresponding available transfer data margin; Group the device service data corresponding to the faulty PLC device according to the target transfer data volume of each transfer PLC device, so as to obtain the service unit data corresponding to each transfer PLC device one by one, and form the service unit data into the data group to be forwarded of the faulty PLC device.

[0011] As a preferred solution, sequentially forward the service unit data in the data group to be forwarded to the corresponding transfer PLC device, determine the data sending strategy according to each transfer PLC device, and send the data through the transfer PLC device according to the data sending strategy, specifically including: Determine the forwarding time when sending the service unit data to the corresponding transfer PLC device according to the transfer PLC device corresponding to each service unit data; Send the forwarding time to the host computer so that the host computer sends each forwarding time to the corresponding transfer PLC device for storage as the verification time; Encrypt each business unit data in the faulty PLC device according to the forwarding time and the corresponding attributes to be sent to the relay PLC device, so as to obtain an encrypted data group to be forwarded; Send the business unit data in the encrypted data group to be forwarded sequentially according to the forwarding time, so that each relay PLC device obtains the corresponding business unit data in turn; After each relay PLC device obtains the corresponding business unit data, decrypt the encrypted business unit data according to the verification time, and make a decision on the corresponding business unit data and its own device business data according to the data transmission task list, identification information and status data of each relay PLC device, so as to generate a new data sending strategy, and transmit and send data according to this data sending strategy.

[0012] Correspondingly, the present invention also provides an automated data synchronization system for PLC industrial production, including: an acquisition module, a data identification module, a handshaking request module, a data forwarding module and a synchronization and recombination module; The acquisition module is used to acquire PLC cluster information and determine the identification information of each PLC device according to the PLC cluster information; wherein, the PLC cluster includes several PLC devices and a host computer connected to each PLC; The data identification module is used to locate and acquire the status data of each PLC device according to the identification information, and determine the faulty PLC devices in each PLC device based on the status data, and acquire the device business data in the faulty PLC devices; The handshaking request module is used to respond to the outgoing handshaking request signal of the faulty PLC device, determine the relay PLC device according to the handshaking request signal, and group the device business data corresponding to the faulty PLC device to obtain a data group to be forwarded; wherein, the data group to be forwarded includes business unit data corresponding to the number of relay PLC devices, and each business unit data has a corresponding relay PLC device; The data forwarding module is used to sequentially forward the business unit data in the data group to be forwarded to the corresponding relay PLC device, determine a data sending strategy according to each relay PLC device, and send data through the relay PLC device according to the data sending strategy; wherein, the data sending strategy is a strategy for sending the device business data and business unit data corresponding to each relay PLC device to the host computer connected to it; The synchronization and recombination module is used to recombine all the business unit data after the host computer receives all the forwarded business unit data to obtain the complete device business data in the faulty PLC device, so as to realize the automated data synchronization of the faulty PLC device.

[0013] Accordingly, the present invention further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of an automated data synchronization method for PLC industrial production as described in any one of the above are implemented.

[0014] Accordingly, the present invention further provides a storage medium storing a computer program, wherein when the computer program is executed by a processor, the steps of an automated data synchronization method for PLC industrial production as described in any one of the above are implemented.

[0015] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: The technical solution of the present invention determines the identification information of PLC devices in the PLC cluster by obtaining the PLC cluster information, so as to determine the faulty PLC devices in each PLC device, and groups the corresponding device service data to obtain a data group to be forwarded. Furthermore, the corresponding business unit data is forwarded to the corresponding transfer PLC device for distribution and transmission. Finally, the transfer PLC device sends the corresponding business unit data to achieve the synchronization of the service data in the faulty PLC device, ensuring that the host computer can stably and accurately obtain the data of the corresponding faulty PLC device, improving the accuracy, timeliness and stability of data synchronization, avoiding the data of the corresponding faulty PLC device being in an unprocessed state for a long time, and at the same time being able to improve the subsequent timely analysis of the faulty PLC device and the overall industrial system, thereby avoiding the shutdown or paralysis of the overall industrial system, and also avoiding manual data synchronization of the faulty PLC device, improving the data synchronization efficiency and user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a flowchart of the steps of an automated data synchronization method for PLC industrial production in an embodiment of the present application; Figure 2 is a structural relationship diagram between a PLC device and a host computer in an embodiment of the present application; Figure 3 is a structural diagram of an automated data synchronization system for PLC industrial production in an embodiment of the present application.

[0017] Reference Numerals in the Drawings: Obtaining Module 201, Data Identification Module 202, Handshake Request Module 203, Data Forwarding Module 204, Synchronization and Reorganization Module 205 DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention. Embodiment 1

[0019] Please refer to Figure 1 , an automated data synchronization method for PLC industrial production provided by an embodiment of the present invention, including the following methods S101 - S105: Step S101: Obtain PLC cluster information, and determine the identification information of each PLC device according to the PLC cluster information; wherein, the PLC cluster includes several PLC devices and a host computer connected to each PLC.

[0020] As a preferred solution of this embodiment, the obtaining of PLC cluster information and determining the identification information of each PLC device according to the PLC cluster information specifically includes: Identify several PLC devices through network scanning, and determine the connected host computer through the PLC devices; perform cluster merging on the PLC devices and the connected host computer to obtain the PLC cluster, and obtain the PLC cluster information; according to the PLC cluster information, determine the attributes of the host computer and the identifiers and functional attributes of each PLC device connected thereto stored in the host computer, and compare the identifiers and functional attributes stored in the host computer with the identifiers and functional attributes of each PLC device itself; obtain the IP addresses, device identifiers, serial numbers, and device names in all PLC devices that pass the comparison, and use the IP address, device identifier, serial number, and device name in each PLC device as its corresponding identification information; remove the PLC devices that do not pass the comparison from the PLC cluster information, and generate an information comparison error alarm for the PLC devices that do not pass the comparison.

[0021] In this embodiment, a network scanning device is used to scan and identify several PLC devices. Among them, the network scanning device can be a network scanning device such as the Nmap tool. Through the scanned PLC devices, the connected host computer is determined, and cluster merging is performed to identify the information of the entire PLC cluster.

[0022] In this embodiment, based on the information of the PLC device cluster, the information of each PLC device communicating with the host computer is determined, that is, the attributes of the host computer and the identifiers and functional attributes of the respective PLC devices connected thereto stored in the host computer are determined. Furthermore, by comparing the identifiers and functional attributes stored in the host computer with the identifiers and functional attributes of each PLC device itself, the identity of the PLC devices connected to the host computer is determined, avoiding the access of illegal devices to the communication of the host computer, thereby preventing the occurrence of security risks. That is, when the identifiers and functional attributes stored in the host computer match the identifiers and functional attributes of each PLC device itself one by one, it indicates that the PLC device is a legal device.

[0023] In this embodiment, by obtaining the IP address, device identifier, serial number, and device name in all the PLC devices that have completed the comparison, and using the IP address, device identifier, serial number, and device name in each PLC device as its corresponding identification information, accurate identification can be performed in the subsequent secondary identity verification of the PLC devices, thereby avoiding the situation where the identity data is read multiple times, resulting in the easy leakage of the identity data.

[0024] In this embodiment, the PLC devices that do not pass the comparison are illegal devices in this system, thereby generating an error alarm, and the operator adjusts and corrects the control permissions and protocols related to the PLC devices.

[0025] Step S102: Locate and obtain the status data of each PLC device according to the identification information, and determine the faulty PLC devices in each PLC device based on the status data, and obtain the device service data in the faulty PLC devices.

[0026] As a preferred solution of this embodiment, locating and obtaining the status data of each PLC device according to the identification information, and determining the faulty PLC devices in each PLC device based on the status data, and obtaining the device service data in the faulty PLC devices specifically includes: Obtain the identity information of all PLC devices pre-stored in the host computer; pull the information corresponding to the IP address, device identifier, serial number, and device name in each PLC device, and match the pulled information with the identity information of each PLC device in the host computer; extract the status data corresponding to each PLC device in each PLC device that passes the matching, and send the corresponding status data to the host computer, so that the PLC device records the first timestamp when sending the status data and the host computer records the second timestamp when receiving the corresponding status data; wherein, each PLC device sends the corresponding status data to the host computer every time a preset period elapses; perform abnormal status detection on each PLC device according to the time difference between the first timestamp and the second timestamp; if the time difference is within the preset range, mark the PLC device as a normal device; if the time difference is not within the preset range, mark the PLC device as an abnormal device, and based on the historical status data of the abnormal device obtained by the host computer, perform a fault analysis on the current status data of the abnormal device, so as to mark the abnormal device with a fault status as a faulty PLC device, and at the same time obtain the device service data in the faulty PLC device.

[0027] In this embodiment, by obtaining the identity information of all PLC devices pre-stored in the host computer, the information corresponding to the IP address, device identifier, serial number, and device name in each PLC device can be directly pulled, avoiding repeated readings, and the pulled information is matched with the identity information of each PLC device in the host computer, that is, the information corresponding to the IP address, device identifier, serial number, and device name in each PLC device is matched one by one with the identity information in the host computer to achieve secondary verification of the PLC device.

[0028] In this embodiment, after the PLC devices are matched, the corresponding status data is immediately extracted, and then the fault status of each PLC device is detected and identified based on the status data of the PLC devices. It can be understood that in this embodiment, the abnormal status of the PLC devices is analyzed through the timestamps of the status data, and the timestamps can well reflect whether there are faults in the communication process of the PLC devices and their own communication functions, and can also reflect that there are faults in the relevant modules for processing service data by the devices themselves (the time delay caused by data processing is also reflected in the timestamp of the status data received by the host computer). Therefore, the time difference is verified by using the first timestamp when the PLC device records and sends the status data and the second timestamp when the host computer records and receives the corresponding status data. When the corresponding time difference exceeds the preset range, it indicates that there are abnormalities in the communication stage or the device data processing stage of the PLC device, resulting in its own data being unable to be timely and accurately fed back to the host computer. Then, the current status data of the abnormal device is further analyzed for faults to determine the specific fault conditions, and then the faulty PLC device is marked, and at the same time, the device service data of the corresponding faulty PLC device is obtained.

[0029] In this embodiment, when the time difference is within the preset range, it indicates that there are no corresponding fault problems in the communication stage, data sampling stage, data processing stage, etc. of the PLC device. Then, the PLC device can be marked as a normal device. It can be understood that through the recording of timestamps and the verification of time differences, all the devices in the PLC cluster can be quickly detected, and a large amount of data information processing is also avoided. It can improve the efficiency of anomaly detection while ensuring the detection accuracy, and at the same time reduce the amount of data calculation and improve the processing ability of the code and program.

[0030] As a preferred solution of this embodiment, based on the historical status data of the abnormal device obtained by the host computer, the current status data of the abnormal device is analyzed for faults, and the abnormal device in the fault status is marked as a faulty PLC device, which specifically includes: Construct an initial fault analysis model; label the historical status data of the abnormal device obtained by the host computer, and use the labeled historical status data as training data to train the initial fault analysis model; after the training is completed, obtain the fault analysis model, and use the current status data as the input of the fault analysis model to analyze the faults of the abnormal device to obtain the fault type of the abnormal device; when the fault type of the abnormal device belongs to non-communication faults, the abnormal device of this type is marked as a faulty PLC device; when the fault type of the abnormal device belongs to communication faults, an audible and visual alarm is issued, and a disconnection reminder of the abnormal device is generated through the host computer.

[0031] In this embodiment, after an abnormal device is identified, the historical status data of the abnormal device stored in the host computer can be obtained, and the labeled historical status data can be used as training data to be input into the initial fault analysis model for model training. After the training is completed, a fault analysis model can be obtained to analyze the faults of the abnormal device and obtain the fault types of the abnormal device. Among them, the fault types include non-communication faults and communication faults. Communication faults refer to situations where there are communication delays between the abnormal PLC device and other PLC devices and the host computer, and operators need to further detect and maintain the communication of the abnormal PLC device. For non-communication faults, they include external device faults directly related to the PLC (such as sensors, samplers, controllers, etc.), PLC data processing system faults, PLC electrical faults, and PLC device hardware faults, etc. That is, the PLC device can still communicate with external PLC devices and / or the host computer through communication modules, etc., so the corresponding service data information can be sent out in time to achieve data synchronization of the faulty PLC device.

[0032] In this embodiment, the initially constructed fault analysis model can be a fault tree model, an LSTM model, a self-organizing feature mapping model, and a Bayesian model. An appropriate model can be selected according to specific application scenarios and requirements to analyze and diagnose the faults of PLC industrial automation devices.

[0033] Step S103: In response to the handshaking request signal sent by the faulty PLC device, determine the transfer PLC device according to the handshaking request signal, and group the device service data corresponding to the faulty PLC device to obtain a data group to be forwarded; wherein, the data group to be forwarded includes service unit data corresponding to the number of transfer PLC devices, and each service unit data has a corresponding transfer PLC device.

[0034] As a preferred solution of this embodiment, the step of in response to the handshaking request signal sent by the faulty PLC device, determining the transfer PLC device according to the handshaking request signal, and grouping the device service data corresponding to the faulty PLC device to obtain a data group to be forwarded specifically includes: In response to a pull request signal sent by a faulty PLC device, obtain the PLC device that receives the pull request signal of the faulty PLC device as the intermediate PLC device; based on the topological communication connection structure between the host computer and each PLC device, obtain the communication connection relationship between the faulty PLC device and the intermediate PLC device, and obtain the communication connection relationship between the intermediate PLC device that has a communication connection relationship with the faulty PLC device and the device it communicates with; determine the target number of required intermediate PLC devices according to the device service data in the faulty PLC device, and screen the intermediate PLC devices according to the target number and the communication connection relationship, so as to obtain the intermediate PLC device with the least number of communication connection relationships between the devices of the intermediate PLC device as the transfer PLC device; group the device service data corresponding to the faulty PLC device according to the number and attribute information of the transfer PLC devices to obtain the data group to be forwarded.

[0035] In this embodiment, by responding to the pull request signal sent by the faulty PLC device, that is, the faulty PLC device sends the pull request signal to ensure that the surrounding PLC devices that receive the pull request can communicate with the faulty PLC device. Then, the faulty PLC device can forward its corresponding service data information outward, so that the faulty PLC facility can send the corresponding service data information outward to achieve synchronous reception of the faulty PLC device, and thus determine the PLC device that receives the pull request signal of the faulty PLC device as the intermediate PLC device.

[0036] In this embodiment, through the topological communication connection structure between the host computer and each PLC device, the topological communication structure relationship between the intermediate PLC device and the faulty PLC device can be determined. Furthermore, the communication connection relationship between the intermediate PLC device that has a communication connection relationship with the faulty PLC device and the device it communicates with can be obtained, that is, the communication connection relationship between the communication devices between the intermediate PLC device and other devices. Thus, the intermediate PLC devices are screened to eliminate the intermediate PLC devices with a large number of communication connection relationships with external other devices, so as to avoid the task of data communication transmission of this device being too large, resulting in the device service data of the faulty PLC device being difficult to be fed back to the host computer in time.

[0037] In this embodiment, by determining the device service data in the faulty PLC device, the target number of intermediate PLC devices required can be determined. Preferably, it can be set according to the actual situation. There is a recommended value for the target number of intermediate PLC devices corresponding to the size of its device service data volume. At the same time, there is also a corresponding recommended value table for PLC devices of different processing function types. For example, when the device service data volume of a real-time data acquisition type device is 200MB, the target number of intermediate PLC devices is 5. Furthermore, the intermediate PLC devices are screened through the communication connection relationship, so as to obtain the intermediate PLC devices with the least number of communication connection relationships between the devices corresponding to the target number (preferably, it is best that this intermediate PLC device is only connected to one external device, the upper computer, and the faulty PLC device), as the transfer PLC device. Exemplarily, when the target number is 5, 5 intermediate PLC devices that are only connected to one external device, the upper computer, and the faulty PLC device are screened out. Furthermore, according to the number of transfer PLC devices and their attribute information, the device service data corresponding to the faulty PLC device is grouped to obtain the data group to be forwarded.

[0038] As a preferred solution of this embodiment, according to the number of the transfer PLC devices and their attribute information, the device service data corresponding to the faulty PLC device is grouped to obtain the data group to be forwarded, which specifically includes: Obtain the number of the transfer PLC devices and the attribute information of the transfer PLC devices, and determine the available transfer data margin of each transfer PLC device according to the attribute information of the transfer PLC device and the corresponding device service data; determine the target transfer data volume of each transfer PLC device according to the number of the transfer PLC devices and the corresponding available transfer data margin; group the device service data corresponding to the faulty PLC device according to the target transfer data volume of each transfer PLC device, so as to obtain the service unit data corresponding to the transfer PLC device one by one, and form the service unit data into the data group to be forwarded of the faulty PLC device.

[0039] In this embodiment, through the number of transfer PLC devices and the attribute information of the transfer PLC devices, the available transfer data margin of each transfer PLC device can be determined, and the target transfer data volume of each transfer PLC device can be determined through the number of transfer PLC devices and the corresponding available transfer data margin. Exemplarily, when the attribute information of all transfer PLC devices is the same (that is, they belong to the same type of function and the data volume is roughly the same PLC device), the corresponding available transfer data margin is roughly the same, that is, the data group to be forwarded can be evenly divided according to the number of transfer PLC devices.

[0040] Exemplarily, when the attribute information of the relay PLC devices is different, that is, there are significant differences in the available data transfer margins between each relay PLC device, the relay PLC device with the largest available data transfer margin will be allocated and undertake the forwarding of more business unit data. Conversely, it will be allocated and undertake the forwarding of less business unit data. The specific numerical values can be set according to the actual situation and requirements. The quantity sizes of different industrial systems are different, and the models and functions of the PLC devices are different, which can be additionally set by the operator.

[0041] Step S104: Sequentially forward the business unit data in the data group to be forwarded to the corresponding relay PLC device, determine the data sending strategy according to each relay PLC device, and send the data through the relay PLC device according to the data sending strategy; wherein, the data sending strategy is the strategy for sending the device business data and business unit data corresponding to each relay PLC device to the host computer connected thereto.

[0042] As a preferred solution of this embodiment, the sequentially forwarding the business unit data in the data group to be forwarded to the corresponding relay PLC device, determining the data sending strategy according to each relay PLC device, and sending the data through the relay PLC device according to the data sending strategy specifically includes: Determine the forwarding time when sending the business unit data to the corresponding relay PLC device according to each relay PLC device to which the business unit data corresponds; send the forwarding time to the host computer so that the host computer sends each forwarding time to the corresponding relay PLC device for storage as the verification time; encrypt each business unit data in the faulty PLC device according to the forwarding time and the attributes of the relay PLC device to which it is to be sent, so as to obtain the encrypted data group to be forwarded; sequentially send the business unit data in the encrypted data group to be forwarded according to the forwarding time, so that each relay PLC device sequentially obtains the corresponding business unit data; after each relay PLC device obtains the corresponding business unit data, decrypt the encrypted business unit data according to the verification time, make a decision on the corresponding business unit data and its own device business data according to the data transfer task list, identification information and status data corresponding to each relay PLC device, so as to generate a new data sending strategy, and perform data transmission and sending according to this data sending strategy.

[0043] In this embodiment, the forwarding time for sending service unit data to each corresponding transfer PLC device can be determined, and this forwarding time is sent to the transfer PLC device, which can then be used as the corresponding verification time. At the same time, this forwarding time can be combined with the attributes of the transfer PLC device to encrypt the unit service data, or the transfer PLC device can use the verification time and the attribute information of the transfer PLC it stores to decrypt the encrypted service unit data to ensure the security of data synchronization.

[0044] In this embodiment, the service unit data in the encrypted data group to be forwarded is sequentially sent according to the forwarding time, so that each transfer PLC device sequentially obtains the corresponding encrypted service unit data, decrypts the encrypted service unit data using the verification time, and combines the data transmission task list, identification information, and status data corresponding to each transfer PLC device to make decisions on the corresponding service unit data and its own device service data, thereby generating a new data sending strategy, and enabling the intermediate PLC device to transmit its own device service data and service unit data according to the new data sending strategy.

[0045] Exemplarily, making decisions on the service unit data and its own device service data can be to split the service unit data according to the attributes of the intermediate PLC device and then insert it into the device service data for sending, or to send it in a periodic order. Preferably, the device service data is sent from 0 to 10 ms, and the service unit data is sent from 10 ms to 20 ms. Specifically, it can be set according to the actual situation.

[0046] Step S105: After the host computer receives all the forwarded service unit data, reorganize all the service unit data to obtain the complete device service data in the faulty PLC device, thereby realizing the automatic data synchronization of the faulty PLC device.

[0047] In this embodiment, after the host computer receives all the forwarded service unit data, it reorganizes all the service unit data, that is, reorganizes the data of the service unit data sent by the intermediate PLC device. Since the intermediate PLC device stores the corresponding verification time, that is, the forwarding time in the corresponding service unit data, when the host computer receives the corresponding forwarding time, it can reorganize the service unit data in order to restore the complete device service data in the faulty PLC device to realize the automatic data synchronization of the faulty PLC device.

[0048] It can be understood that the faulty PLC device forwards its own device service data through other PLC devices that have a communication connection with it and meet the data communication conditions, so as to avoid the situation where data cannot be synchronized in time. Further, due to the corresponding time delay between the faulty PLC device and the upper computer, even if the upper computer identifies and confirms the identity of the faulty PLC device, when it suddenly obtains the data of the faulty PLC device, it is likely to be determined as illegal data by the upper computer system. This is because for the upper computer, the faulty PLC device is already in the offline state, and for an intrusion into the industrial system, such as impersonating the identity of the faulty PLC device to send relevant harmful data to the upper computer. At this time, the faulty PLC device is offline and can no longer perform the bilateral identity authentication between the upper computer and the PLC device. If the upper computer continues to receive the data of the faulty PLC device at this time, it may be tampered data, and the illegal data of the corresponding faulty PLC device will be sent to the upper computer, resulting in the paralysis of the entire system. The embodiment of the present invention can well avoid the above situation. By splitting and distributing the device service data of the corresponding faulty PLC device to the forwarding PLC devices, and verifying and transmitting the data through the corresponding verification time, transmission task list, identification information, status data, etc., it can ensure that even if the data is tampered with, it can be limited to the lower-level local PLC devices, ensuring the integrity and overall security of the upper computer and the entire industrial system. At the same time, the upper computer can also perform identity verification on the forwarding PLC devices at all times, further avoiding the security problems caused by identity impersonation.

[0049] Implementing the above embodiments has the following effects: The technical solution of the present invention determines the identification information of the PLC devices in the PLC cluster by obtaining the PLC cluster information, thereby determining the faulty PLC devices in each PLC device, grouping the corresponding device service data to obtain the data group to be forwarded, and then forwarding the corresponding business unit data to the corresponding transfer PLC device for distribution and transmission. Finally, the transfer PLC device sends the corresponding business unit data to achieve the synchronization of the business data in the faulty PLC device, ensuring that the upper computer can stably and accurately obtain the data of the corresponding faulty PLC device, improving the accuracy, timeliness and stability of data synchronization, avoiding the data of the corresponding faulty PLC device being in an unprocessed state for a long time, and at the same time being able to improve the subsequent analysis of the faulty PLC device and the entire industrial system in a timely manner, thereby avoiding the shutdown or paralysis of the entire industrial system, and also avoiding manual data synchronization of the faulty PLC device, improving the data synchronization efficiency and user experience. Embodiment 2

[0050] Please refer to Figure 3, which is an automated data synchronization system for PLC industrial production provided by an embodiment of the present invention, including: an acquisition module 201, a data identification module 202, a handshaking request module 203, a data forwarding module 204, and a synchronization and recombination module 205; The acquisition module 201 is configured to acquire PLC cluster information and determine the identification information of each PLC device according to the PLC cluster information; wherein, the PLC cluster includes a plurality of PLC devices and a host computer connected to each PLC; The data identification module 202 is configured to locate and acquire the status data of each PLC device according to the identification information, and determine the faulty PLC devices in each PLC device based on the status data, and acquire the device service data in the faulty PLC devices; The handshaking request module 203 is configured to respond to the handshaking request signal sent by the faulty PLC device, determine the transfer PLC device according to the handshaking request signal, and group the device service data corresponding to the faulty PLC device to obtain a data group to be forwarded; wherein, the data group to be forwarded includes service unit data corresponding to the number of transfer PLC devices, and each service unit data has a corresponding transfer PLC device; The data forwarding module 204 is configured to sequentially forward the service unit data in the data group to be forwarded to the corresponding transfer PLC device, determine a data sending strategy according to each transfer PLC device, and send data through the transfer PLC device according to the data sending strategy; wherein, the data sending strategy is a strategy for sending the device service data and service unit data corresponding to each transfer PLC device to the host computer connected thereto; The synchronization and recombination module 205 is configured to, after the host computer receives all the forwarded service unit data, recombine all the service unit data to obtain the complete device service data in the faulty PLC device, thereby realizing the automated data synchronization of the faulty PLC device.

[0051] As a preferred solution, the acquiring the PLC cluster information and determining the identification information of each PLC device according to the PLC cluster information specifically includes: Identifying a plurality of PLC devices through network scanning, and determining the host computer connected through the PLC devices; Performing cluster merging on the PLC devices and the connected host computer to obtain the PLC cluster, and acquiring the PLC cluster information; According to the PLC cluster information, determining the attributes of the host computer and the identifiers and functional attributes of the respective PLC devices connected to the host computer stored in the host computer, and comparing the identifiers and functional attributes stored in the host computer with the identifiers and functional attributes of the respective PLC devices themselves; Obtain the IP address, device identifier, serial number, and device name in all PLC devices through comparison, and use the IP address, device identifier, serial number, and device name in each PLC device as its corresponding identification information; Exclude the PLC devices that fail the comparison from the PLC cluster information, and generate an information comparison error alarm for the PLC devices that fail the comparison.

[0052] As a preferred solution, locate and obtain the status data of each PLC device according to the identification information, and determine the faulty PLC devices in each PLC device based on the status data, and obtain the device service data in the faulty PLC devices, specifically including: Obtain the identity information of all PLC devices pre-stored in the host computer; Pull the information corresponding to the IP address, device identifier, serial number, and device name in each PLC device, and match the pulled information with the identity information of each PLC device in the host computer; Extract the status data corresponding to each PLC device in each PLC device that passes the match, and send the corresponding status data to the host computer, so that the PLC device records the first timestamp when sending the status data and the host computer records the second timestamp when receiving the corresponding status data; among them, each PLC device sends the corresponding status data to the host computer every time a preset period elapses; Perform abnormal status detection on each PLC device according to the time difference between the first timestamp and the second timestamp; If the time difference is within the preset range, mark the PLC device as a normal device; If the time difference is not within the preset range, mark the PLC device as an abnormal device, and perform fault analysis on the current status data of the abnormal device based on the historical status data of the abnormal device obtained by the host computer, so as to mark the abnormal device with a faulty status as a faulty PLC device, and at the same time obtain the device service data in the faulty PLC device.

[0053] As a preferred solution, the fault analysis is performed on the current status data of the abnormal device based on the historical status data of the abnormal device obtained by the host computer, so as to mark the abnormal device with a faulty status as a faulty PLC device, specifically including: Construct an initial fault analysis model; Annotate the historical status data of the abnormal device obtained by the host computer, and use the annotated historical status data as training data to train the initial fault analysis model; After the training is completed, a fault analysis model is obtained, and the current state data is used as the input of the fault analysis model to perform fault analysis on the abnormal device to obtain the fault type of the abnormal device; When the fault type of the abnormal device belongs to a non-communication fault, the abnormal device of this type is marked as a faulty PLC device; When the fault type of the abnormal device belongs to a communication fault, an audible and visual alarm is issued, and a disconnection reminder for the abnormal device is generated through the host computer.

[0054] As a preferred solution, in response to a pull request signal sent by the faulty PLC device, the transfer PLC device is determined according to the pull request signal, and the device service data corresponding to the faulty PLC device is grouped to obtain a data group to be forwarded, which specifically includes: In response to a pull request signal sent by the faulty PLC device, the PLC device that receives the pull request signal from the faulty PLC device is obtained as the intermediate PLC device; Based on the topological communication connection structure between the host computer and each PLC device, the communication connection relationship between the faulty PLC device and the intermediate PLC device is obtained, and the communication connection relationship between the intermediate PLC device that has a communication connection relationship with the faulty PLC device and the devices it communicates with is obtained; According to the device service data in the faulty PLC device, the target number of intermediate PLC devices required is determined, and the intermediate PLC devices are screened according to the target number and the communication connection relationship, so as to obtain the intermediate PLC device with the least number of communication connection relationships with other devices as the transfer PLC device; According to the number of transfer PLC devices and their attribute information, the device service data corresponding to the faulty PLC device is grouped to obtain a data group to be forwarded.

[0055] As a preferred solution, according to the number of transfer PLC devices and their attribute information, the device service data corresponding to the faulty PLC device is grouped to obtain a data group to be forwarded, which specifically includes: Obtain the number of transfer PLC devices and the attribute information of the transfer PLC devices, and determine the available transfer data margin of each transfer PLC device according to the attribute information of the transfer PLC device and the corresponding device service data; According to the number of transfer PLC devices and the corresponding available transfer data margin, determine the target transfer data volume of each transfer PLC device; Group the device service data corresponding to the faulty PLC device according to the target transfer data volume of each transfer PLC device, so as to obtain service unit data corresponding one-to-one to the transfer PLC device, and form the service unit data into a data group to be forwarded for the faulty PLC device.

[0056] As a preferred solution, the service unit data in the data group to be forwarded is sequentially forwarded to the corresponding transfer PLC device, and a data sending strategy is determined according to each transfer PLC device, and data is sent through the transfer PLC device according to the data sending strategy. Specifically, it includes: Determine the forwarding time when sending the service unit data to the corresponding transfer PLC device according to each service unit data; Send the forwarding time to the host computer, so that the host computer sends each forwarding time to the corresponding transfer PLC device for storage as the verification time; Encrypt each service unit data in the faulty PLC device according to the forwarding time and the attributes to be sent to the transfer PLC device, so as to obtain an encrypted data group to be forwarded; Send the service unit data in the encrypted data group to be forwarded sequentially according to the forwarding time, so that each transfer PLC device obtains the corresponding service unit data in turn; After each transfer PLC device obtains the corresponding service unit data, decrypt the encrypted service unit data according to the verification time, and make a decision on the corresponding service unit data and its own device service data according to the data transmission task list, identification information and status data corresponding to each transfer PLC device, so as to generate a new data sending strategy, and perform data transmission and sending according to the data sending strategy.

[0057] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the foregoing method embodiment, and will not be elaborated here.

[0058] Implementing the above embodiments has the following effects: The technical solution of the present invention determines the identification information of the PLC devices in the PLC cluster by obtaining the PLC cluster information, so as to determine the faulty PLC devices among the PLC devices, group the corresponding device service data to obtain the data group to be forwarded, and then forward the corresponding business unit data to the corresponding transfer PLC device for distribution and transmission. Finally, the transfer PLC device sends the corresponding business unit data to achieve the synchronization of the service data in the faulty PLC device, ensuring that the host computer can stably and accurately obtain the data of the corresponding faulty PLC device, improving the accuracy, timeliness and stability of data synchronization, avoiding the data of the corresponding faulty PLC device being in an unprocessed state for a long time, and at the same time being able to improve the subsequent timely analysis of the faulty PLC device and the overall industrial system, thereby avoiding the shutdown or paralysis of the overall industrial system, and also avoiding manual data synchronization of the faulty PLC device, improving the data synchronization efficiency and user experience. Embodiment III

[0059] Correspondingly, the present invention further provides a terminal device, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the automated data synchronization method for PLC industrial production described in any one of the above embodiments.

[0060] The terminal device of this embodiment includes: a processor, a memory, and a computer program and computer instructions stored in the memory and executable on the processor. When the processor executes the computer program, it implements each step in Embodiment 1 above, such as Figure 1 the steps S101 to S105 shown. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the above device embodiment, such as the data forwarding module 204.

[0061] Exemplarily, the computer program can be divided into one or more modules / units. The one or more modules / units are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and this instruction segment is used to describe the execution process of the computer program in the terminal device. For example, the data forwarding module 204 is used to sequentially forward the business unit data in the data group to be forwarded to the corresponding transfer PLC device, determine the data sending strategy according to each transfer PLC device, and send the data through the transfer PLC device according to the data sending strategy;

[0062] The terminal device can be a computing device such as a desktop computer, notebook, palmtop computer, and cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that the schematic diagram is only an example of the terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the terminal device may also include input / output devices, network access devices, buses, etc.

[0063] The so-called processor may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor is the control center of the terminal device and connects various parts of the entire terminal device through various interfaces and lines.

[0064] The memory can be used to store the computer programs and / or modules. The processor realizes various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory, and by calling the data stored in the memory. The memory may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system, application programs required for at least one function, etc.; the data storage area may store data created according to the use of the mobile terminal, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one magnetic disk storage device, flash device, or other volatile solid-state storage devices.

[0065] Among them, if the modules / units integrated in the terminal device are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above-described embodiment methods of the present invention, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice within the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals. Embodiment 4

[0066] Correspondingly, the present invention further provides a computer-readable storage medium. The computer-readable storage medium includes a stored computer program, wherein when the computer program runs, it controls the device where the computer-readable storage medium is located to execute the automated data synchronization method for PLC industrial production described in any one of the above embodiments.

[0067] The above-described specific embodiments have further elaborated on the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only the specific embodiments of the present invention and is not used to limit the protection scope of the present invention. It is particularly pointed out that for those skilled in the art, any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. An automated data synchronization method for PLC industrial production, characterized in that: include: Acquire PLC cluster information, and determine identification information of each PLC device according to the PLC cluster information; wherein the PLC cluster includes a plurality of PLC devices and a host computer connected to each PLC; Locating and acquiring status data of each PLC device according to the identification information, determining a faulty PLC device among the PLC devices based on the status data, and acquiring device service data of the faulty PLC device; In response to a pull request signal sent out by a faulty PLC device, a transfer PLC device is determined according to the pull request signal, and the device service data corresponding to the faulty PLC device is grouped to obtain a data group to be forwarded; wherein the data group to be forwarded includes service unit data corresponding to the number of the transfer PLC devices, and each service unit data has a corresponding transfer PLC device; Forward the business unit data in the data group to be forwarded to the corresponding transfer PLC device in sequence, and determine the data sending strategy according to each transfer PLC device, and send the data through the transfer PLC device according to the data sending strategy; wherein the data sending strategy is a strategy for sending the device business data and business unit data corresponding to each transfer PLC device to the upper computer connected to it; After the host computer receives all the forwarded business unit data, it reorganizes all the business unit data to obtain the complete device business data in the faulty PLC device, thereby realizing automatic data synchronization of the faulty PLC device.

2. The method for automatic data synchronization for PLC industrial production according to claim 1, characterized in that: The obtaining of PLC cluster information and determining identification information of each PLC device according to the PLC cluster information specifically includes: Identify several PLC devices through network scanning, and determine the connected host computer through the PLC devices; Cluster merging the PLC device and the connected host computer to obtain the PLC cluster, and acquiring the PLC cluster information; Determine the attributes of the host computer and the identifiers and functional attributes of each PLC device connected to the host computer and stored in the host computer according to the PLC cluster information, and compare the identifiers and functional attributes stored in the host computer with the identifiers and functional attributes of each PLC device itself; Obtaining IP addresses, device identifiers, serial numbers, and device names of all PLC devices that pass the comparison, and using the IP address, device identifier, serial number, and device name of each PLC device as its corresponding identification information; The PLC devices that fail the comparison are removed from the PLC cluster information, and an information comparison error alarm is generated for the PLC devices that fail the comparison.

3. The method for automatic data synchronization for PLC industrial production according to claim 2, characterized in that: Positioning and acquiring status data of each PLC device according to the identification information, determining a faulty PLC device among the PLC devices based on the status data, and acquiring device service data of the faulty PLC device, specifically including: Obtaining identity information of all PLC devices pre-stored in the host computer; Pulling information corresponding to the IP address, device identifier, serial number and device name in each PLC device, and matching the pulled information with the identity information of each PLC device in the host computer; Extracting the status data corresponding to each PLC device from each matched PLC device, and sending the corresponding status data to the host computer, so that the PLC device records a first timestamp when the status data is sent and the host computer records a second timestamp when the corresponding status data is received; wherein each PLC device sends the corresponding status data to the host computer every preset period; Performing abnormal state detection on each PLC device according to the time difference between the first timestamp and the second timestamp; If the time difference is within a preset range, the PLC device is marked as a normal device; If the time difference is not within the preset range, the PLC device is marked as an abnormal device, and based on the historical status data of the abnormal device obtained by the host computer, a fault analysis is performed on the current status data of the abnormal device, thereby marking the abnormal device in a faulty state as a faulty PLC device, and at the same time obtaining the device business data in the faulty PLC device.

4. The method for automatic data synchronization for PLC industrial production according to claim 3, characterized in that: The method of performing fault analysis on the current state data of the abnormal device based on the historical state data of the abnormal device obtained by the host computer, thereby marking the abnormal device in the fault state as a faulty PLC device, specifically includes: Build an initial failure analysis model; Annotating the historical status data of the abnormal device acquired by the host computer, and using the annotated historical status data as training data to perform model training on the initial fault analysis model; After the training is completed, a fault analysis model is obtained, and the current state data is used as an input of the fault analysis model to perform fault analysis on the abnormal device to obtain the fault type of the abnormal device; When the fault type of the abnormal device is a non-communication fault, the abnormal device of this type is marked as a faulty PLC device; When the fault type of the abnormal device belongs to communication fault, an audible and visual alarm is issued, and a disconnection reminder of the abnormal device is generated through the host computer.

5. The method for automatic data synchronization for PLC industrial production according to claim 4, characterized in that: The method responds to the outgoing pull request signal from the faulty PLC device, determines the transfer PLC device according to the pull request signal, and groups the device service data corresponding to the faulty PLC device to obtain the data group to be forwarded, specifically including: In response to a handle request signal sent out by a faulty PLC device, a PLC device corresponding to the handle request signal received by the faulty PLC device is obtained as an intermediate PLC device; Based on the topological communication connection structure between the host computer and each PLC device, the communication connection relationship between the faulty PLC device and the intermediate PLC device is obtained, and the communication connection relationship between the intermediate PLC device that has a communication connection relationship with the faulty PLC device and the device that communicates with it is obtained; Determine the target number of required intermediate PLC devices according to the device service data in the faulty PLC device, and screen the intermediate PLC devices according to the target number and the communication connection relationship, so as to obtain the intermediate PLC device with the least number of communication connection relationships between the devices of the intermediate PLC devices as the transit PLC device; According to the number of the transfer PLC devices and their attribute information, the device service data corresponding to the faulty PLC device is grouped to obtain a data group to be forwarded.

6. An automated data synchronization method for PLC industrial production according to any one of claims 1 to 5, characterized in that: According to the number of the transfer PLC devices and their attribute information, the device service data corresponding to the faulty PLC device is grouped to obtain a data group to be forwarded, which specifically includes: Acquire the number of the transfer PLC devices and attribute information of the transfer PLC devices, and determine the transferable data margin of each transfer PLC device according to the attribute information of the transfer PLC devices and the corresponding device service data; Determine the target transfer data volume of each transfer PLC device according to the number of the transfer PLC devices and the corresponding transferable data margin; According to the target transfer data volume of each transfer PLC device, the device business data corresponding to the faulty PLC device is grouped to obtain business unit data corresponding one to one to the transfer PLC device, and the business unit data is organized into a data group to be forwarded for the faulty PLC device.

7. The method for automatic data synchronization for PLC industrial production according to claim 6, characterized in that: The method of sequentially forwarding the business unit data in the data group to be forwarded to the corresponding transfer PLC device, determining a data transmission strategy according to each transfer PLC device, and transmitting the data through the transfer PLC device according to the data transmission strategy specifically includes: According to the transfer PLC device to which each business unit data is sent, determine the forwarding time when the business unit data is sent to each corresponding transfer PLC device; Sending the forwarding time to the host computer, so that the host computer sends each forwarding time to the corresponding transfer PLC device for storage as verification time; Encrypting each business unit data in the faulty PLC device according to the forwarding time and the corresponding attribute to be sent to the transfer PLC device, thereby obtaining an encrypted data group to be forwarded; The encrypted business unit data in the data group to be forwarded are sent in sequence according to the forwarding time, so that each transfer PLC device obtains the corresponding business unit data in sequence; After obtaining the corresponding business unit data, each transit PLC device decrypts the encrypted business unit data according to the verification time, and makes decisions based on the corresponding business unit data and its own equipment business data according to the data transmission task list, identification information and status data corresponding to each transit PLC device, thereby generating a new data sending strategy, and transmits and sends data according to the data sending strategy.

8. An automated data synchronization system for PLC industrial production, characterized in that: include: Acquisition module, data identification module, pull request module, data forwarding module and synchronization reorganization module; The acquisition module is used to acquire PLC cluster information and determine identification information of each PLC device according to the PLC cluster information; wherein the PLC cluster includes a plurality of PLC devices and a host computer connected to each PLC; The data identification module is used to locate and obtain status data of each PLC device according to the identification information, and determine the faulty PLC device among the PLC devices based on the status data, and obtain device service data in the faulty PLC device; The pull request module is used to respond to the pull request signal sent out by the faulty PLC device, determine the transfer PLC device according to the pull request signal, and group the device business data corresponding to the faulty PLC device to obtain a data group to be forwarded; wherein the data group to be forwarded includes business unit data corresponding to the number of the transfer PLC devices, and each business unit data has a corresponding transfer PLC device; The data forwarding module is used to forward the business unit data in the data group to be forwarded to the corresponding transfer PLC device in sequence, and determine the data sending strategy according to each transfer PLC device, and send the data through the transfer PLC device according to the data sending strategy; wherein the data sending strategy is a strategy for sending the device business data and business unit data corresponding to each transfer PLC device to the host computer connected thereto; The synchronous reorganization module is used to reorganize all the business unit data after the host computer receives all the forwarded business unit data, so as to obtain the complete device business data in the faulty PLC device, thereby realizing automatic data synchronization of the faulty PLC device.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the automatic data synchronization method for PLC industrial production as described in any one of claims 1 to 7 are implemented.

10. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the automatic data synchronization method for PLC industrial production as claimed in any one of claims 1 to 7 are implemented.