PLC program monitoring method and device and electronic equipment
By building a PLC program monitoring system, real-time collection, backup and comparison of PLC program data, the problem of PLC program monitoring in the existing technology relying on manpower and low disaster recovery efficiency is solved, and efficient remote management and rapid recovery of PLC programs are achieved.
Patent Information
- Application Number
- CN202311433661.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2025-05-02
AI Technical Summary
The existing PLC program monitoring method relies on managers to check the PLC program version and operation logs from time to time on site, which consumes a lot of manpower and the PLC program is not backed up according to the version, resulting in the inability to recover in time during disaster recovery.
A PLC program monitoring method is designed. By building a PLC program monitoring system, PLC program data of different PLC control systems is collected and stored in the database, and PLC program versions are backed up and compared in real time, error alerts are issued in a timely manner and program recovery is carried out.
Remote real-time monitoring and management of PLC programs is realized, which reduces on-site manpower work, improves the efficiency and reliability of disaster recovery and reduces recovery costs and misoperation risks.
Smart Images

Figure CN119916772A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of PLC program monitoring, and in particular relates to a PLC program monitoring method, device and electronic equipment. Background Art
[0002] Currently, PLC control systems are widely used in various industries. In order to prevent possible safety hazards in PLC control systems, it is necessary to monitor the PLC programs in the PLC control systems.
[0003] The traditional PLC program monitoring method mainly relies on managers to check the PLC program version and operation log on site from time to time. This consumes a lot of manpower, and the PLC program is not backed up or updated according to the version, so disaster recovery cannot be restored in time.
[0004] With the development of technology, the monitoring requirements of PLC programs in various industries have gradually increased, gradually changing from on-site manual recording of PLC programs to remote monitoring and management of PLC programs, and at the same time, there are certain requirements for the reliability of PLC in the face of disaster recovery. In view of this, the present invention provides a PLC program monitoring method. Summary of the invention
[0005] In order to solve the above problems in the prior art, that is, to solve the problem that the existing PLC program monitoring method is managed by the management personnel taking irregular inspections on site, which will consume a lot of manpower, and the PLC program is not backed up or updated according to the version situation, and the disaster recovery situation cannot be restored in time, the present invention proposes a PLC program monitoring method, which includes:
[0006] Step S100, constructing a PLC program monitoring system;
[0007] Step S200, collecting PLC program data in different PLC control systems through the PLC program monitoring system and storing them in a database; the PLC program includes a configuration program, a standard operating procedure and a program version number;
[0008] Step S300, obtaining an operation instruction, communicating with the PLC control system to be monitored in real time by setting a communication protocol, reading the latest program version of the PLC program in the PLC control system to be monitored, and backing it up to the database;
[0009] Step S400, comparing the latest program version of the PLC program with the standard operating procedure pre-stored in the database to obtain a comparison result;
[0010] Step S500, determining whether the comparison result is correct, if so, jumping to step S300, otherwise, issuing an error alarm message to remind the staff to verify the latest program version of the PLC program.
[0011] In some preferred embodiments, the PLC program monitoring system is a software system with a B / S architecture;
[0012] The PLC program monitoring system includes a data acquisition unit, a program comparison unit and a program recovery unit;
[0013] The data acquisition unit is used to collect PLC program data in different PLC control systems and store them in a database;
[0014] The program comparison unit is used to communicate with the PLC control system to be monitored in real time by setting a communication protocol according to the operation instruction, read the latest program version of the PLC program in the PLC control system to be monitored, and back it up to the database;
[0015] Compare the latest program version of the PLC program with the standard operating procedure pre-stored in the database to obtain a comparison result;
[0016] Determine whether the comparison result is correct. If so, re-communicate with the PLC control system to be monitored and continue monitoring. Otherwise, issue an error alarm message to remind the staff to verify the latest program version.
[0017] The program recovery unit is used to transmit the latest program version with the correct comparison result of the backup in the database to the corresponding PLC control system for PLC program recovery when a disaster recovery situation is detected.
[0018] In some preferred embodiments, the set communication protocol includes Modbus TCP protocol.
[0019] In some preferred embodiments, the communication method with the PLC control system to be monitored includes wired transmission and wireless transmission; the wireless transmission includes 5G, 4G, bridge, WIFI, NB-lot, ZigBee, Lora, Thread, and Z-wave.
[0020] In some preferred implementations, the configuration program includes a ladder diagram, a function block diagram, a statement list, a sequential function chart, and a continuous function chart.
[0021] In some preferred embodiments, the database includes SQL Server, mySQL, Sybase, Oracle, DB2, Oracle, informix, FoxPro database, Access database and PostgreSQL database.
[0022] In some preferred embodiments, the error alarm information is issued by a combination of sound and light.
[0023] A second aspect of the present invention provides a PLC program monitoring device, the device comprising:
[0024] A PLC control system, configured to run a PLC program; and also configured to communicate with the host computer;
[0025] The host computer is configured to construct a PLC program monitoring system, collect PLC program data in different PLC control systems and store them in a database; the PLC program includes a configuration program, a standard operating procedure and a program version number;
[0026] It is also configured to obtain operation instructions, communicate with the PLC control system to be monitored in real time by setting a communication protocol, read the latest program version of the PLC program in the PLC control system to be monitored, and back it up to the database; compare the latest program version of the PLC program with the standard operation procedure pre-stored in the database to obtain the comparison result;
[0027] Determine whether the comparison result is correct. If so, re-communicate with the PLC program to be tested. Otherwise, issue an error alarm message to remind the staff to verify the latest program version of the PLC program.
[0028] In a third aspect of the present invention, an electronic device is proposed, comprising: at least one processor; and a memory communicatively connected to at least one of the processors; wherein the memory stores instructions executable by the processor, and the instructions are used to be executed by the processor to implement the above-mentioned PLC program monitoring method.
[0029] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to be executed by the computer to implement the above-mentioned PLC program monitoring method.
[0030] Beneficial effects of the present invention:
[0031] The present invention can realize the remote management of on-site PLC programs in the center, improve the immediacy of program management, and reduce a large amount of statistical workload on site. At the same time, it can be used to restore the system when a disaster occurs in the on-site PLC system, reduce the on-site PLC program recovery cost, and reduce the risk of misoperation. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings.
[0033] Figure 1 It is a flow chart of a PLC program monitoring method according to an embodiment of the present invention;
[0034] Figure 2 A schematic diagram of a flow chart of performing PLC program monitoring in combination with a version number according to an embodiment of the present invention;
[0035] Figure 3 It is a structural diagram of a computer system of an embodiment of the present invention that is suitable for implementing an electronic device of an embodiment of the present application. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0037] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
[0038] A PLC program monitoring method according to a first embodiment of the present invention is as follows: Figure 1 As shown, the method includes:
[0039] Step S100, constructing a PLC program monitoring system;
[0040] Step S200, collecting PLC program data in different PLC control systems through the PLC program monitoring system and storing them in a database; the PLC program includes a configuration program, a standard operating procedure and a program version number;
[0041] Step S300, obtaining an operation instruction, communicating with the PLC control system to be monitored in real time by setting a communication protocol, reading the latest program version of the PLC program in the PLC control system to be monitored, and backing it up to the database;
[0042] Step S400, comparing the latest program version of the PLC program with the standard operating procedure pre-stored in the database to obtain a comparison result;
[0043] Step S500, determining whether the comparison result is correct, if so, jumping to step S300, otherwise, issuing an error alarm message to remind the staff to verify the latest program version of the PLC program.
[0044] In order to more clearly illustrate a PLC program monitoring method of the present invention, each step in an embodiment of the method of the present invention is described in detail below with reference to the accompanying drawings.
[0045] Step S100, constructing a PLC program monitoring system;
[0046] In this embodiment, a PLC program monitoring system is first constructed. The PLC program monitoring system is a software system with a B / S architecture and can monitor multiple PLC programs at the same time;
[0047] The PLC program monitoring system includes a data acquisition unit, a program comparison unit and a program recovery unit; the PLC program monitoring system has operation logs, record reading and auditing functions;
[0048] A data acquisition unit, used to collect PLC program data in different PLC control systems and store them in a database;
[0049] A program comparison unit, used to communicate with the PLC control system to be monitored in real time by setting a communication protocol according to an operation instruction, read the latest program version of the PLC program in the PLC control system to be monitored, and back it up to the database;
[0050] Compare the latest program version of the PLC program with the standard operating procedure pre-stored in the database to obtain a comparison result;
[0051] Determine whether the comparison result is correct. If so, re-communicate with the PLC control system to be monitored and continue monitoring. Otherwise, issue an error alarm message to remind the staff to verify the latest program version.
[0052] The program recovery unit is used to transmit the latest program version with the correct comparison result of the backup in the database to the corresponding PLC control system for PLC program recovery when a disaster recovery situation is detected.
[0053] Step S200, collecting PLC program data in different PLC control systems through the PLC program monitoring system and storing them in a database; the PLC program includes a configuration program, a standard operating procedure and a program version number;
[0054] In this embodiment, the configuration program includes ladder diagram (LAD), function block diagram (FBD), statement list (STL), sequential function chart (SFC), and continuous function chart (CFC);
[0055] The databases include SQL Server, mySQL, Sybase, Oracle, DB2, Oracle, informix, FoxPro database, Access database and PostgreSQL database; the database's system throughput, response time, parallel processing capability, speed of server response to requests and other capabilities must meet the program management requirements of different PLC devices (i.e. PLC control systems).
[0056] Step S300, obtaining an operation instruction, communicating with the PLC control system to be monitored in real time by setting a communication protocol, reading the latest program version of the PLC program in the PLC control system to be monitored, and backing it up to the database;
[0057] In this embodiment, the communication protocol is preferably Modbus TCP protocol.
[0058] The communication methods with the PLC control system to be monitored include wired transmission and wireless transmission; wireless transmission includes 5G, 4G, bridge, WIFI, NB-lot, ZigBee, Lora, Thread, Z-wave. Wired transmission includes optical cable transmission.
[0059] When backing up, the version number of the on-site PLC program can be recorded first, and then the version number of the new program version can be compared with the recorded version number to see if they are consistent. If they are inconsistent, back them up, send a program version change prompt alarm to the human-computer interaction interface, and then jump to step S400 to compare the program. Otherwise, monitor and read. Figure 2 shown.
[0060] Step S400, comparing the latest program version of the PLC program with the standard operating procedure pre-stored in the database to obtain a comparison result;
[0061] Step S500, determining whether the comparison result is correct, if so, jumping to step S300, otherwise, issuing an error alarm message to remind the staff to verify the latest program version of the PLC program.
[0062] In this embodiment, it is preferred to check whether the name, function, expression and statement of the new program are consistent with those of the standard operation program. If so, jump to step S300, otherwise, issue an error alarm message to remind the staff to verify the latest program version of the PLC program. In addition, while comparing, the program operation log is recorded.
[0063] A PLC program monitoring device according to a second embodiment of the present invention comprises:
[0064] A PLC control system, configured to run a PLC program; and also configured to communicate with the host computer;
[0065] The host computer includes a computer configured to construct a PLC program monitoring system, and collect PLC program data in different PLC control systems and store them in a database; the PLC program includes a configuration program, a standard operating procedure, and a program version number;
[0066] It is also configured to obtain operation instructions, communicate with the PLC control system to be monitored in real time by setting a communication protocol, read the latest program version of the PLC program in the PLC control system to be monitored, and back it up to the database; compare the latest program version of the PLC program with the standard operation procedure pre-stored in the database to obtain the comparison result;
[0067] Determine whether the comparison result is correct. If so, re-communicate with the PLC program to be tested. Otherwise, issue an error alarm message to remind the staff to verify the latest program version of the PLC program.
[0068] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process and related instructions of the system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0069] It should be noted that the second embodiment of a PLC program monitoring device provided in the above embodiment is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the modules or steps in the embodiments of the present invention can be decomposed or combined. For example, the modules in the above embodiment can be combined into one module, or further divided into multiple sub-modules to complete all or part of the functions described above. The names of the modules and steps involved in the embodiments of the present invention are only for distinguishing the modules or steps, and are not regarded as improper limitations of the present invention.
[0070] An electronic device according to the third embodiment of the present invention comprises at least one processor; and a memory communicatively connected to at least one of the processors; wherein the memory stores instructions executable by the processor, and the instructions are used to be executed by the processor to implement the above-mentioned PLC program monitoring method.
[0071] A fourth embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to be executed by the computer to implement the above-mentioned PLC program monitoring method.
[0072] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process and related instructions of the electronic device and computer-readable storage medium described above can refer to the corresponding process in the aforementioned method example and will not be repeated here.
[0073] Reference below Figure 3 , which shows a structural diagram of a computer system of a server suitable for implementing the method, device, electronic device and computer-readable storage medium embodiments of the present application. Figure 3 The server shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0074] like Figure 3 As shown, the computer system includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303. In RAM 303, various programs and data required for system operation are also stored. CPU 301, ROM 302 and RAM 303 are connected to each other through a bus 304. Input / output (I / O) interface 305 is also connected to bus 304.
[0075] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed so that a computer program read therefrom is installed into the storage section 308 as needed.
[0076] It should be noted that the computer-readable medium (i.e., the removable medium 311) mentioned above in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0077] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0078] The block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the system or computer program product according to various embodiments of the present application. It should also be noted that in some alternative implementations, the functions marked in the boxes may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram, and the combination of boxes in the block diagram, can be implemented with a dedicated hardware-based system that performs the specified functions or operations, or can be implemented with a combination of dedicated hardware and computer instructions.
[0079] The terms "first", "second", etc. are used to distinguish similar objects rather than to describe or indicate a particular order or sequence.
[0080] The term "comprise" or any other similar term is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus / device that includes a list of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, article, or apparatus / device.
[0081] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
Claims
1. A PLC program monitoring method, characterized in that: The method includes: Step S100, constructing a PLC program monitoring system; Step S200, collecting PLC program data in different PLC control systems through the PLC program monitoring system and storing them in a database; the PLC program includes a configuration program, a standard operating procedure and a program version number; Step S300, obtaining an operation instruction, communicating with the PLC control system to be monitored in real time by setting a communication protocol, reading the latest program version of the PLC program in the PLC control system to be monitored, and backing it up to the database; Step S400, comparing the latest program version of the PLC program with the standard operating procedure pre-stored in the database to obtain a comparison result; Step S500, determining whether the comparison result is correct, if so, jumping to step S300, otherwise, issuing an error alarm message to remind the staff to verify the latest program version of the PLC program.
2. A PLC program monitoring method according to claim 1, characterized in that: The PLC program monitoring system is a software system with B / S architecture; The PLC program monitoring system includes a data acquisition unit, a program comparison unit and a program recovery unit; The data acquisition unit is used to collect PLC program data in different PLC control systems and store them in a database; The program comparison unit is used to communicate with the PLC control system to be monitored in real time by setting a communication protocol according to the operation instruction, read the latest program version of the PLC program in the PLC control system to be monitored, and back it up to the database; Compare the latest program version of the PLC program with the standard operating procedure pre-stored in the database to obtain a comparison result; Determine whether the comparison result is correct. If so, re-communicate with the PLC control system to be monitored and continue monitoring. Otherwise, issue an error alarm message to remind the staff to verify the latest program version. The program recovery unit is used to transmit the latest program version with a correct comparison result of the backup in the database to the corresponding PLC control system for PLC program recovery when a disaster recovery situation is detected.
3. A PLC program monitoring method according to claim 1, characterized in that: The set communication protocol includes Modbus TCP protocol.
4. A PLC program monitoring method according to claim 1, characterized in that: The communication methods with the PLC control system to be monitored include wired transmission and wireless transmission; the wireless transmission includes 5G, 4G, bridge, WIFI, NB-lot, ZigBee, Lora, Thread, and Z-wave.
5. A PLC program monitoring method according to claim 1, characterized in that: The configuration program includes ladder diagram, function block diagram, statement list, sequential function chart and continuous function chart.
6. A PLC program monitoring method according to claim 4, characterized in that: The databases include SQLServer, mySQL, Sybase, Oracle, DB2, Oracle, informix, FoxPro database, Access database and PostgreSQL database.
7. A PLC program monitoring method according to claim 1, characterized in that: The error alarm information is sent out in a sound and light combination manner.
8. A PLC program monitoring device, characterized in that: The device includes: A PLC control system, configured to run a PLC program; and also configured to communicate with the host computer; The host computer is configured to construct a PLC program monitoring system, collect PLC program data in different PLC control systems and store them in a database; the PLC program includes a configuration program, a standard operating procedure and a program version number; It is also configured to obtain operation instructions, communicate with the PLC control system to be monitored in real time by setting a communication protocol, read the latest program version of the PLC program in the PLC control system to be monitored, and back it up to the database; compare the latest program version of the PLC program with the standard operation procedure pre-stored in the database to obtain the comparison result; Determine whether the comparison result is correct. If so, re-communicate with the PLC program to be tested. Otherwise, issue an error alarm message to remind the staff to verify the latest program version of the PLC program.
9. An electronic device, characterized in that: include: at least one processor; and a memory communicatively coupled to at least one of the processors; The memory stores instructions executable by the processor, and the instructions are used to be executed by the processor to implement a PLC program monitoring method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to be executed by the computer to implement a PLC program monitoring method according to any one of claims 1 to 7.