PLC simulation device, method, electronic device and storage medium in industrial control system
By designing a PLC simulation device that can parse and process PLC programs in the industrial control system, the problem that the existing system cannot simulate real PLC operations is solved, the ability to capture PLC threatening behaviors is improved, and the security and simulation of the system are enhanced. .
Patent Information
- Application Number
- CN201911099943.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-12
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2039-11-12
AI Technical Summary
Existing industrial control systems lack active defense capabilities in terms of information security. The PLC simulation device in the honeypot cannot execute real industry PLC programs, making the simulation unrealistic and easily identifiable by attackers.
A PLC simulation device in an industrial control system is designed, including a dispatch center module, a program analysis module, a configuration module, a network service module, an input and output module and a logging module. It can parse and process PLC programs, simulate real PLC operations, and record Related information to enhance emulation and security.
By simulating real PLC operations and recording threat behaviors, it improves the ability to capture PLC threat behaviors, provides higher simulation and security, and enhances the protection capabilities of industrial control systems.
Smart Images

Figure CN111025933B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of industrial control safety technology, and in particular to a PLC simulation device, method, electronic equipment and storage medium in an industrial control system. Background Art
[0002] At the beginning of the construction of existing industrial control systems, information security issues were rarely considered. The protection schemes mainly involved physically isolating the network or deploying protective equipment such as firewalls, but the above schemes cannot actively defend against targeted threats. The PLC simulation in the existing honeypot cannot execute real industry PLC programs (ladder diagrams, functional module diagrams), cannot simulate the generation of real enterprise actual data, and cannot process external access requests to upload PLC programs, firmware and other files, resulting in low simulation of the honeypot system, which is easily identified as a honeypot system by attackers. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a PLC simulation device, method, electronic device and storage medium in an industrial control system, which can use a real PLC program to process requests and feed back relevant data to the requesting end, thereby better capturing threat behaviors against the PLC and recording relevant information.
[0004] An embodiment of the present invention provides a PLC simulation device in an industrial control system, comprising:
[0005] The dispatch center module is used to dispatch the operations of each module in the PLC simulation device and ensure the communication between the modules;
[0006] The program analysis module is used to analyze the PLC program, feed back the analysis status to the dispatch center module, and transmit the PLC program processing results to the input and output module;
[0007] A configuration module is used to configure the PLC simulation device as needed and feed back the configuration information to the dispatch center module; wherein the configuration information includes: PLC model, port, IP, usage protocol, log record or file storage path;
[0008] The network service module is used to obtain and analyze data traffic from the Internet, extract relevant instruction data and perform relevant operations;
[0009] The input and output module is used to receive the relevant instruction data from the network service module, and after being processed by the PLC program, the network service module is called to add it into the transmission protocol and return to the request end;
[0010] The log recording module is used to record and save all relevant information of the PLC simulation device, including but not limited to: operation records, data records or access records.
[0011] Furthermore, the parsing operation of the PLC program and feeding back the parsing status to the dispatch center module specifically includes: parsing the PLC program, if the parsing is successful, feeding back a parsing success instruction to the dispatch center module; if the parsing fails, feeding back a parsing failure instruction to the dispatch center module, and prompting the module to re-introduce a valid PLC program.
[0012] Furthermore, when a PLC program is re-introduced through the dispatch center module, the program parsing module is called to re-parse the newly-introduced PLC program.
[0013] Furthermore, after obtaining and parsing the data traffic from the Internet, the method further includes:
[0014] Start basic services according to the model configured by the PLC simulation device, including but not limited to: Http, Https or Telnet;
[0015] Start the protocol service according to the model and port number configured by the PLC simulation device, including but not limited to: HTTP, TCP, OPC, Ethernet, CIP, Modbus or S7;
[0016] Parse the data traffic according to the protocol format.
[0017] Furthermore, the extracting of relevant instruction data and performing relevant operations specifically includes:
[0018] If the relevant instruction data is a read-write request, the relevant data is sent to the input-output module. The input-output module sends the processed data to the network service module according to the actual processing result of the program analysis module, and adds it to the protocol output;
[0019] If the relevant instruction data is to write into the PLC program, the PLC program is saved to the preset file storage path, and the PLC program is re-run;
[0020] If the relevant instruction data is to download a PLC program, the preset PLC program is transmitted to the external requesting end;
[0021] If the relevant instruction data is firmware or other files, the relevant files are saved to a preset file storage path.
[0022] Furthermore, if the read / write request is specifically to read the device information of the PLC simulation device, the configuration information of the current PLC simulation device is fed back to the external request end.
[0023] The above-mentioned PLC simulation device also includes: an exception handling module, which is used to handle the abnormalities in each module in a timely manner according to different abnormal types to ensure the normal operation of the PLC simulation device.
[0024] In a second aspect, an embodiment of the present invention provides a PLC simulation method in an industrial control system, comprising:
[0025] Analyze the preset PLC program;
[0026] If the analysis is successful, the PLC simulation device is configured; wherein the configuration information involved in the configuration operation includes: PLC model, port, IP, usage protocol, log record or file storage path;
[0027] If the configuration is successful, the data traffic from the Internet is obtained and parsed, the relevant instruction data is extracted and the relevant operations are performed;
[0028] Call the PLC program to process the relevant instruction data, add it into the transmission protocol and return it to the requesting end;
[0029] Record and save all relevant information of the PLC simulation device, including but not limited to: operation records, data records or access records.
[0030] Further, the parsing operation on the preset PLC program specifically includes: parsing the PLC program, if the parsing is successful, performing a configuration operation; if the parsing fails, prompting to re-introduce a valid PLC program.
[0031] Furthermore, the method further includes: when the PLC program is re-input, the newly-input PLC program is parsed again.
[0032] Furthermore, after obtaining and parsing the data traffic from the Internet, the method further includes:
[0033] Start basic services according to the model configured by the PLC simulation device, including but not limited to: Http, Https or Telnet;
[0034] Start the protocol service according to the model and port number configured by the PLC simulation device, including but not limited to: HTTP, TCP, OPC, Ethernet, CIP, Modbus or S7;
[0035] Parse the data traffic according to the protocol format.
[0036] Furthermore, the extracting of relevant instruction data and performing relevant operations specifically includes:
[0037] If the relevant instruction data is a read or write request, the PLC program is used to perform processing operations and the processed data is added to the protocol for output;
[0038] If the relevant instruction data is to write into the PLC program, the PLC program is saved to the preset file storage path, and the PLC program is re-run;
[0039] If the relevant instruction data is to download a PLC program, the preset PLC program is transmitted to the external requesting end;
[0040] If the relevant instruction data is firmware or other files, the relevant files are saved to a preset file storage path.
[0041] Furthermore, if the read / write request is specifically to read the device information of the PLC simulation device, the configuration information of the current PLC simulation device is fed back to the external request end.
[0042] The above method embodiment also includes: when an abnormality occurs in the PLC simulation process, timely processing is performed according to different abnormality types to ensure the normal operation of the PLC simulation device.
[0043] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a housing, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside a space enclosed by the housing, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute any of the above-mentioned PLC simulation methods.
[0044] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the PLC simulation method described in any of the aforementioned implementation methods.
[0045] The embodiments of the present invention provide a PLC simulation device, method, electronic device and storage medium in an industrial control system. The PLC simulation device parses a real PLC program and configures the PLC simulation device as needed. If data traffic is received from the network, relevant instruction data is extracted and corresponding related operations are performed to simulate real PLC operations and feed back relevant data results to the requesting end. At the same time, a log recording module is built into the PLC simulation device to record and save operation records, data records or access records.
[0046] The PLC simulation device described in the embodiment of the present invention can be deployed separately or in a honeypot, can run real PLC programs, construct real industry data, disguise real industrial control systems, and better capture threat behaviors, operating methods, attack methods, etc. against PLCs; and record related behaviors and files to provide relevant information for subsequent active defense against targeted threats. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 It is a schematic structural diagram of an embodiment of a PLC simulation device in an industrial control system of the present invention;
[0049] Figure 2 It is a structural schematic diagram of another embodiment of a PLC simulation device in an industrial control system of the present invention;
[0050] Figure 3 A method flow chart of an embodiment of a PLC simulation method in an industrial control system of the present invention;
[0051] Figure 4 A method flow chart of another embodiment of a PLC simulation method in an industrial control system of the present invention;
[0052] Figure 5 The figure is a schematic structural diagram of an embodiment of an electronic device of the present invention. DETAILED DESCRIPTION
[0053] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0054] It should be clear that the described embodiments are only some embodiments of the present invention, not all 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.
[0055] In order to more clearly illustrate the embodiments of the present invention, the technical terms involved are explained and described:
[0056] PLC: Programmable Logic Controller;
[0057] Ladder diagram (LD): Ladder diagram language is the most commonly used programming language in PLC programming. It is a programming language similar to relay circuit.
[0058] Function Block Diagram (FBD): Function Block Diagram language is a PLC programming language similar to digital logic circuits.
[0059] In a first aspect, an embodiment of the present invention provides a PLC simulation device in an industrial control system, which can capture threat behaviors against the PLC and obtain relevant records.
[0060] Figure 1 The present invention is a schematic structural diagram of an embodiment of a PLC simulation device in an industrial control system, comprising:
[0061] The dispatch center module 101 is used to dispatch the modules in the PLC simulation device to perform operations and ensure the communication between the modules.
[0062] The program analysis module 102 is used to analyze the PLC program, feed back the analysis status to the dispatch center module 101 , and transmit the PLC program processing result to the input and output module 105 .
[0063] Among them, the parsing operation of the PLC program and feeding back the parsing status to the dispatch center module 101 specifically includes: parsing the PLC program, if the parsing is successful, feeding back the parsing success instruction to the dispatch center module 101; if the parsing fails, feeding back the parsing failure instruction to the dispatch center module 101, and prompting to re-introduce a valid PLC program.
[0064] The configuration module 103 is used to configure the PLC simulation device as needed and feed back the configuration information to the dispatch center module 101; wherein the configuration information includes: PLC model, port, IP, usage protocol, log record or file storage path; further, the configuration information also includes: device ID, manufacturer information, version information, order number or serial number and other information.
[0065] The network service module 104 is used to obtain and analyze data traffic from the Internet, extract relevant instruction data and perform relevant operations.
[0066] After obtaining and parsing the data traffic from the Internet, the method further includes:
[0067] Start basic services according to the model configured by the PLC simulation device, including but not limited to: Http, Https or Telnet;
[0068] Start the protocol service according to the model and port number configured by the PLC simulation device, including but not limited to: HTTP, TCP, OPC, Ethernet, CIP, Modbus or S7;
[0069] Parse the data traffic according to the protocol format.
[0070] The extracting of relevant instruction data and performing relevant operations specifically include:
[0071] If the relevant instruction data is a read-write request, the relevant data is sent to the input-output module. The input-output module sends the processed data to the network service module according to the actual processing result of the program analysis module, and adds it to the protocol output;
[0072] If the relevant instruction data is to write into the PLC program, the PLC program is saved to the preset file storage path, and the PLC program is re-run;
[0073] If the relevant instruction data is to download a PLC program, the preset PLC program is transmitted to the external requesting end;
[0074] If the relevant instruction data is firmware or other files, the relevant files are saved to a preset file storage path.
[0075] More specifically, if the read / write request is to read the device information of the PLC simulation device, the configuration information of the current PLC simulation device is fed back to the external request end.
[0076] The input / output module 105 is used to receive relevant instruction data from the network service module 104, and after being processed by the PLC program, the network service module 104 is called to be added into the transmission protocol and returned to the requesting end.
[0077] The log recording module 106 is used to record and save all relevant information of the PLC simulation device, including but not limited to: operation records, data records or access records.
[0078] More preferably, when a PLC program is re-introduced through the dispatch center module, the newly-introduced PLC program is parsed again.
[0079] The PLC simulation device described in this embodiment can be deployed separately or in a honeypot. It can run real PLC programs, build real industry data, disguise real industrial control systems, and better capture threat behaviors, operating methods, attack methods, etc. against PLCs; and record related behaviors and files to provide relevant information for subsequent active defense against targeted threats.
[0080] Figure 2 This is a schematic structural diagram of another embodiment of a PLC simulation device in an industrial control system of the present invention, comprising:
[0081] The dispatch center module 101 is used to dispatch the modules in the PLC simulation device to perform operations and ensure the communication between the modules.
[0082] The program analysis module 102 is used to analyze the PLC program, feed back the analysis status to the dispatch center module, and transmit the PLC program processing result to the input and output module.
[0083] Among them, the parsing operation of the PLC program and feeding back the parsing status to the dispatch center module 101 specifically includes: parsing the PLC program, if the parsing is successful, feeding back the parsing success instruction to the dispatch center module 101; if the parsing fails, feeding back the parsing failure instruction to the dispatch center module 101, and prompting to re-introduce a valid PLC program.
[0084] The configuration module 103 is used to configure the PLC simulation device as needed and feed back the configuration information to the dispatch center module; wherein the configuration information includes: PLC model, port, IP, usage protocol, log record or file storage path.
[0085] The network service module 104 is used to obtain and analyze data traffic from the Internet, extract relevant instruction data and perform relevant operations.
[0086] After obtaining and parsing the data traffic from the Internet, the method further includes:
[0087] Start basic services according to the model configured by the PLC simulation device, including but not limited to: Http, Https or Telnet;
[0088] Start the protocol service according to the model and port number configured by the PLC simulation device, including but not limited to: HTTP, TCP, OPC, Ethernet, CIP, Modbus or S7;
[0089] Parse the data traffic according to the protocol format.
[0090] The extracting of relevant instruction data and performing relevant operations specifically include:
[0091] If the relevant instruction data is a read / write request, the relevant data is sent to the input / output module 105. The input / output module 105 sends the processed data to the network service module 104 according to the actual processing result of the program analysis module 102, and adds it into the protocol for output;
[0092] If the relevant instruction data is to write into the PLC program, the PLC program is saved to the preset file storage path, and the PLC program is re-run;
[0093] If the relevant instruction data is to download a PLC program, the preset PLC program is transmitted to the external requesting end;
[0094] If the relevant instruction data is firmware or other files, the relevant files are saved to a preset file storage path.
[0095] More specifically, if the read / write request is to read the device information of the PLC simulation device, the configuration information of the current PLC simulation device is fed back to the external request end.
[0096] The input / output module 105 is used to receive relevant instruction data from the network service module 104, and after being processed by the PLC program, the network service module 104 is called to be added into the transmission protocol and returned to the requesting end.
[0097] The log recording module 106 is used to record and save all relevant information of the PLC simulation device, including but not limited to: operation records, data records or access records.
[0098] The exception handling module 107 is used to handle the abnormalities in each module in a timely manner according to different abnormality types to ensure the normal operation of the PLC simulation device. The abnormality types are not specifically limited, including but not limited to: external request abnormality or internal program processing abnormality;
[0099] 1. External request exception: When the external device is connected to the PLC simulation device and operates the PLC through the protocol, such as read / write request, file upload request, file download request, mode switch request, etc., if the program cannot parse due to an external protocol input error or the external protocol does not match the model and version of the PLC being simulated by the PLC simulation device, different exception types will be returned according to different types of requests. (For example, this simulation device simulates the Siemens S7 protocol, and the external request is a Modbus protocol request. At this time, an exception will be returned according to the exception handling in the S7 protocol. If this simulation device runs the Schneider Modbus protocol, requests using the Ethernet protocol will be processed according to the exception mechanism of the Ethernet protocol.)
[0100] 2. Internal program handling exceptions: When there are exceptions in the calls between modules or in the module program itself, the exceptions need to be handled. For example, when there are type conversion exceptions, null pointer exceptions, array out-of-bounds exceptions, file not found exceptions, etc., different exceptions are handled differently. When the exception affects the normal operation of the program, restart the program.
[0101] The present invention mainly uses software to simulate PLC equipment, which can be deployed separately or together with the existing industrial control system honeypot. The real PLC program (ladder diagram, function module diagram) of the industrial enterprise can be deployed in the software, and the PLC program, firmware and other files uploaded by external access can be restored. It highly simulates the industrial control system and has the characteristics of low cost and difficult to identify. It enhances the existing industrial control system protection system; at the same time, it can repair itself for internal abnormal conditions to ensure the normal operation of the PLC simulation device.
[0102] In a second aspect, an embodiment of the present invention provides a PLC simulation method in an industrial control system, which can capture threat behaviors against PLC and obtain relevant records.
[0103] Figure 3 The present invention is a method flow chart of an embodiment of a PLC simulation method in an industrial control system, comprising:
[0104] S11: Analyze the preset PLC program;
[0105] S12: If the analysis is successful, the PLC simulation device is configured; wherein the configuration information involved in the configuration operation includes: PLC model, port, IP, usage protocol, log record or file storage path;
[0106] S13: If the configuration is successful, the data traffic from the Internet is obtained and parsed, relevant instruction data is extracted and relevant operations are performed;
[0107] S14: calling the PLC program to process the relevant instruction data, adding it into the transmission protocol and returning it to the requesting end;
[0108] S15: Record and save all relevant information of the PLC simulation device, including but not limited to: operation records, data records or access records.
[0109] Preferably, the parsing operation on the preset PLC program specifically includes: parsing the PLC program, and if the parsing is successful, performing a configuration operation; if the parsing fails, prompting to re-introduce a valid PLC program.
[0110] More preferably, the method further comprises: when the PLC program is re-input, re-parsing the newly-input PLC program.
[0111] Preferably, after acquiring and parsing the data traffic from the Internet, the method further includes:
[0112] Start basic services according to the model configured by the PLC simulation device, including but not limited to: Http, Https or Telnet;
[0113] Start the protocol service according to the model and port number configured by the PLC simulation device, including but not limited to: HTTP, TCP, OPC, Ethernet, CIP, Modbus or S7;
[0114] Parse the data traffic according to the protocol format.
[0115] Preferably, the extracting relevant instruction data and performing relevant operations specifically include:
[0116] If the relevant instruction data is a read or write request, the PLC program is used to perform processing operations and the processed data is added to the protocol for output;
[0117] If the relevant instruction data is to write into the PLC program, the PLC program is saved to the preset file storage path, and the PLC program is re-run;
[0118] If the relevant instruction data is to download a PLC program, the preset PLC program is transmitted to the external requesting end;
[0119] If the relevant instruction data is firmware or other files, the relevant files are saved to a preset file storage path.
[0120] More preferably, if the read / write request is specifically to read device information of a PLC simulation device, the configuration information of the current PLC simulation device is fed back to the external requesting end.
[0121] The above method embodiment also includes: when an abnormality occurs in the PLC simulation process, timely processing is performed according to different abnormality types to ensure the normal operation of the PLC simulation device.
[0122] Figure 4 This is another embodiment of a method flow chart of a PLC simulation method in an industrial control system of the present invention. The PLC simulation device can be deployed in an industrial control honeypot or deployed separately. The instruction data includes multiple forms. This embodiment only takes writing a PLC program as an example, including:
[0123] S21: performing analysis operation on the preset PLC program;
[0124] S22: If the analysis is successful, the PLC simulation device is configured;
[0125] S23: If the configuration is successful, the required services are started;
[0126] S24: Acquire data traffic from the Internet, parse the data traffic to obtain relevant instruction data for writing into the PLC program;
[0127] S25: storing the PLC program in a preset file storage path and performing a restart operation;
[0128] S26: Reparse the written PLC program.
[0129] In a third aspect, an embodiment of the present invention further provides an electronic device capable of capturing threat behaviors against a PLC and obtaining relevant records.
[0130] Figure 5This is a schematic diagram of the structure of an embodiment of an electronic device of the present invention. The electronic device may include: a housing 51, a processor 52, a memory 53, a circuit board 54 and a power supply circuit 55, wherein the circuit board 54 is arranged inside the space enclosed by the housing 51, and the processor 52 and the memory 53 are arranged on the circuit board 54; the power supply circuit 55 is used to supply power to various circuits or devices of the electronic device; the memory 53 is used to store executable program codes; the processor 52 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 53, so as to execute the PLC simulation method described in any of the aforementioned embodiments.
[0131] For details on the specific execution process of the above steps by the processor 52 and the steps further executed by the processor 52 by running the executable program code, please refer to the present invention. Figure 3 , 4 The description of the illustrated embodiment will not be repeated here.
[0132] This electronic device exists in many forms, including but not limited to:
[0133] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
[0134] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, such as iPad.
[0135] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, smart toys, and portable car navigation devices.
[0136] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0137] (5) Other electronic devices with data interaction functions.
[0138] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the PLC simulation method described in any of the aforementioned implementation methods.
[0139] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0140] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0141] In particular, for the method embodiment, since it is basically similar to the device embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the device embodiment.
[0142] For the convenience of description, the above device is described by dividing the functions into various units / modules. Of course, when implementing the present invention, the functions of each unit / module can be implemented in the same or multiple software and / or hardware.
[0143] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0144] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A PLC simulation device in an industrial control system, It is characterized in that Use the real PLC program to process the request and feed back relevant data to the requester, capture the threat behavior against the PLC and record relevant information; including: The dispatch center module is used to dispatch the operations of each module in the PLC simulation device and ensure the communication between the modules; The program analysis module is used to analyze the PLC program, feed back the analysis status to the dispatch center module, and transmit the PLC program processing results to the input and output module; A configuration module is used to configure the PLC simulation device as needed and feed back the configuration information to the dispatch center module; wherein the configuration information includes: PLC model, port, IP, usage protocol, log record or file storage path; The network service module is used to obtain and analyze data traffic from the Internet, extract relevant instruction data and perform relevant operations; The input and output module is used to receive the relevant instruction data from the network service module, and after being processed by the PLC program, the network service module is called to add it into the transmission protocol and return to the request end; The log recording module is used to record and save all relevant information of the PLC simulation device, including but not limited to: operation records, data records or access records; The parsing operation of the PLC program and feeding back the parsing status to the dispatch center module specifically includes: parsing the PLC program, if the parsing is successful, feeding back a parsing success instruction to the dispatch center module; if the parsing fails, feeding back a parsing failure instruction to the dispatch center module, and prompting to re-introduce a valid PLC program.
2. The PLC simulation device according to claim 1, It is characterized in that When a PLC program is re-input through the dispatch center module, the program parsing module is called to re-parse the newly-input PLC program.
3. The PLC simulation device according to claim 1, It is characterized in that After obtaining and parsing the data traffic from the Internet, the method further includes: Start basic services according to the model configured by the PLC simulation device, including but not limited to: Http, Https or Telnet; Start the protocol service according to the model and port number configured by the PLC simulation device, including but not limited to: HTTP, TCP, OPC, Ethernet, CIP, Modbus or S7; Parse the data traffic according to the protocol format.
4. The PLC simulation device according to claim 1, It is characterized in that The extracting of relevant instruction data and performing relevant operations specifically include: If the relevant instruction data is a read-write request, the relevant data is sent to the input-output module. The input-output module sends the processed data to the network service module according to the actual processing result of the program analysis module, and adds it to the protocol output; If the relevant instruction data is to write into the PLC program, the PLC program is saved to the preset file storage path, and the PLC program is re-run; If the relevant instruction data is to download a PLC program, the preset PLC program is transmitted to the external requesting end; If the relevant instruction data is firmware or other files, the relevant files are saved to a preset file storage path.
5. The PLC simulation device according to claim 4, It is characterized in that If the read / write request is specifically to read the device information of the PLC simulation device, the configuration information of the current PLC simulation device is fed back to the external request end.
6. The PLC simulation device according to any one of claims 1 to 5, It is characterized in that Also includes: The exception handling module is used to handle the exceptions in a timely manner according to the different exception types when the exceptions occur in each module, so as to ensure the normal operation of the PLC simulation device.
7. A PLC simulation method in an industrial control system, It is characterized in that Use the real PLC program to process the request and feed back relevant data to the requester, capture the threat behavior against the PLC and record relevant information; including: Analyze the preset PLC program; If the analysis is successful, the PLC simulation device is configured; wherein the configuration information involved in the configuration operation includes: PLC model, port, IP, usage protocol, log record or file storage path; If the configuration is successful, the data traffic from the Internet is obtained and parsed, the relevant instruction data is extracted and the relevant operations are performed; Call the PLC program to process the relevant instruction data, add it into the transmission protocol and return it to the requesting end; Record and save all relevant information of the PLC simulation device, including but not limited to: operation records, data records or access records; The parsing operation on the preset PLC program specifically includes: parsing the PLC program, if the parsing is successful, performing a configuration operation; if the parsing fails, prompting to re-introduce a valid PLC program.
8. The PLC simulation method according to claim 7, It is characterized in that Also includes: When the PLC program is re-input, the newly-input PLC program is parsed again.
9. The PLC simulation method according to claim 7, It is characterized in that After obtaining and parsing the data traffic from the Internet, the method further includes: Start basic services according to the model configured by the PLC simulation device, including but not limited to: Http, Https or Telnet; Start the protocol service according to the model and port number configured by the PLC simulation device, including but not limited to: HTTP, TCP, OPC, Ethernet, CIP, Modbus or S7; Parse the data traffic according to the protocol format.
10. The PLC simulation method according to claim 7, It is characterized in that The extracting of relevant instruction data and performing relevant operations specifically include: If the relevant instruction data is a read or write request, the PLC program is used to perform processing operations and the processed data is added to the protocol for output; If the relevant instruction data is to write into the PLC program, the PLC program is saved to the preset file storage path, and the PLC program is re-run; If the relevant instruction data is to download a PLC program, the preset PLC program is transmitted to the external requesting end; If the relevant instruction data is firmware or other files, the relevant files are saved to a preset file storage path.
11. The PLC simulation method according to claim 10, It is characterized in that If the read / write request is specifically to read the device information of the PLC simulation device, the configuration information of the current PLC simulation device is fed back to the external request end.
12. The PLC simulation method according to any one of claims 7 to 11, It is characterized in that Also includes: In the event of an abnormality during the PLC simulation process, timely processing is performed according to different abnormality types to ensure the normal operation of the PLC simulation device.
13. An electronic device, It is characterized in that The electronic device comprises: a housing, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute any method described in claims 7-12.
14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method described in any one of claims 7-12.
