Open event record storage and transmission method and system
By configuring communication and data mapping software, it supports open event record storage and transmission of multiple protocols, solving the limitations of data exchange between PLC and SCADA systems, achieving efficient data transmission and storage, and reducing implementation cycle and risks.
Patent Information
- Application Number
- CN202510635851.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-09-26
AI Technical Summary
In existing technologies, data exchange between PLC devices and SCADA systems has limitations, resulting in data failures, long implementation cycles and high risks, and bandwidth loss due to the ModBus communication method.
By configuring the communication and data mapping software, selecting the communication protocol, reconstructing the event record area format, and configuring the mapping relationship, the host computer software can read the PLC event record, support multiple protocols such as ModbusTCP, IEC104, and DNP3, and realize open event record storage and transmission.
It reduces the need for secondary development of host computer software, shortens implementation cycle and risks, improves data transmission efficiency, and avoids bandwidth loss.
Smart Images

Figure CN120708306A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of open event recording, and in particular to an open event recording storage and transmission method and system. Background Art
[0002] In the industrial field, event recording is a process of monitoring on-site signals and recording events. The recorded information contains key information such as event content and event time. It is used to analyze various events occurring on-site, especially the sequence of accidents, to trace the process of the event and identify the source of equipment failure.
[0003] Currently, there are two common ways to read and parse event records in the industrial field. One is for the equipment manufacturer to provide relevant software for parsing, and the other is to open it as ModBus data to a third-party SCADA system for analysis and display.
[0004] Both methods have certain limitations. The former is not open enough. The SCADA systems in industries such as hydropower are often not manufactured by the same manufacturer as the PLC manufacturers, and the data cannot be connected. The latter is limited to the ModBus protocol, and often requires SCADA manufacturers to adapt to the PLC manufacturer's protocol and format, which brings certain difficulties to project implementation.
[0005] With the first solution, since the PLC device and event recording software are from the same manufacturer, the communication protocol is typically proprietary, and the software display content is fixed. This prevents users from performing deeper data storage, analysis, and application based on event records. Meeting these requirements often requires custom development, which is time-consuming and high-risk. With the second solution, third parties can access event records from PLC devices through the ModBus protocol. However, since the PLC manufacturer has fixed the communication protocol and data format, while this lowers the barrier to in-depth user application, it still involves custom development of the communication protocol and event content. Furthermore, ModBus communication uses a polling method, requiring periodic queries from the host computer software, which also results in a certain amount of bandwidth loss. Summary of the Invention
[0006] The purpose of the present invention is to overcome the above-mentioned shortcomings and provide an open event record storage and transmission method and system to solve the problems raised in the background technology.
[0007] To solve the above technical problems, the technical solution adopted by the present invention is: an open event record storage and transmission method, comprising the following steps: S1: Communication and data mapping configuration: The communication and data mapping configuration software is deployed on the computer. The communication interface module and the event record storage module are configured through the configuration software. S11: In the communication and data mapping configuration software deployed on the computer, select a communication protocol; S12: Configure communication parameters; S13: Reconstruct the formats of the event record original area and the event record transmission area. In the configuration software, first define the data format of a single event, and then define the event record transmission area that conforms to the event record original area. Each event corresponds to a record. S14: configuring a mapping relationship between the communication protocol and the event record transmission area so that the host computer software can read the current pointer of the event record and the relative address of the corresponding event record according to the mapping relationship; S15: Download the above configuration to PLC; S2: Communication interface module transmission: transmits event records to the host computer software for analysis through the communication protocol; S3: Event record storage and reconstruction: Collect PLC event records into the original record area, and reconstruct them into the record transmission area according to the data format requirements of the third-party software.
[0008] Preferably, the communication protocols include but are not limited to ModbusTCP, IEC104, and DNP3, and multiple protocols can be configured.
[0009] Preferably, when the communication protocol is ModbusTCP or IEC104 or DNP3, select PLC as the server, the default listening port is 502, and the listening port can be modified according to the PLC network application situation, and the corresponding client IP address is configured. Filling 0 means receiving all client requests.
[0010] Preferably, the specific steps of S2 are as follows: S21: The communication interface module acts as a server and calls the corresponding network service according to the downloaded communication protocol if the configuration is valid, otherwise the communication interface module does not work; S22: Open the configured listening port according to the downloaded communication parameters. If the opening is successful, the listening port will be used to listen for client requests. Otherwise, the communication interface module will not work. S23: After the communication interface module works normally, it monitors requests from the client in real time.
[0011] Preferably, the specific steps of S23 are as follows: Establish connection: When receiving a connection request from a client, check whether the client connection matches the client address in the communication parameters. If so, establish a connection with the client. If the client address is configured as 0, do not check the client address and always establish a connection. Processing request commands: After establishing a connection, when receiving a client data request command, check whether the address in the request command conforms to the configured mapping relationship. If so, copy the corresponding data from the event record transmission area to the communication sending interface according to the address and length requirements of the command, and respond to the data to the host computer.
[0012] Preferably, in S31, the original event record information includes: Event type: divided into hard points (events from switch input modules) and soft points (events from PLC custom bits); Event location: When the event source is a hard point, the event location is composed of the rack address, slot address, and channel number; when the event source is a soft point, the event location is the data area type and bit number address; Event current value: The bit value after the event occurs. This value can be used to identify the type of event. That is, if the current value is ON, the event is OFF->ON; if the current value is OFF, the event is ON->OFF. Event time: records the absolute time when an event occurs, which is defined as year-month-day-hour-minute-second-microsecond; Event current pointer: unsigned 32 bits, can be counted up to 4294967295, and will naturally cross the boundary if overflow occurs.
[0013] Preferably, the step S3 specifically includes the following steps: S31: Collect PLC event records to the original record area, S32: The event record original area is a ring-shaped record area, with a maximum number of record entries of N. The value of N is defined according to the available hardware storage resources of the PLC. When a record exceeds the limit, the earliest event record is rolled over. S33: When the event source is a hard point, the hard point module collects external inputs. When an event occurs, the input module caches the event information and actively uploads it to the PLC. The input module can cache multiple events and upload them simultaneously. When the event source is a soft point, the PLC monitors the soft point value and detects whether the soft point value has changed at the end of each program execution cycle. If so, the event is cached. The soft point can cache multiple events. S34: When the PLC event recording module receives an event, it first uses the current pointer + 1 as the current pointer to search for the actual pointer of the target event recording area. If the current pointer is greater than or equal to N, it subtracts N from the actual pointer until the actual pointer is less than N. Then, it inserts the event into the recording area corresponding to the actual pointer of the event recording area. S35: The PLC event recording module reconstructs the event record and records it into the transmission area of the same pointer according to the conversion relationship between the original recording area and the transmission area configured by the software and according to the actual pointer; S36: Repeat S34 and S35 until all events are recorded.
[0014] Preferably, in said S3, the third-party software first reads the current pointer of the event record on the PLC. If it is inconsistent with the local pointer recorded by the application software, the pointer to be read is calculated by the algorithm of step S34. If the local pointer is greater than or equal to N, N is subtracted until the pointer to be read is less than N, which is the first pointer of the unread event. The end pointer of the event record is calculated using the same algorithm, and then the information of each event record is read in sequence.
[0015] In addition, the present invention also discloses a system for implementing the above-mentioned open event record storage and transmission method, comprising the following parts: Communication and data configuration software: deployed on a computer, used to configure the communication interface module and event record storage module, including selecting the communication protocol, configuring communication parameters, reconstructing the event record area format, configuring mapping relationships, and downloading the configuration to the PLC; Communication interface module: As a server, it works according to the downloaded communication protocol and parameters, listens to client requests, establishes connections and processes data request commands, and transmits event records to the host computer software; Event record storage module: used to collect PLC event records into the original record area, and reconstruct them into the record transmission area according to the data format requirements of third-party software, including storing the original information of event records, storing them in a ring record area, processing hard point and soft point event sources, and inserting and reconstructing event records.
[0016] Beneficial effects of the present invention: The present invention can configure event records through the programming software provided by the PLC. The configurable content includes communication protocols, event information, such as the bit name of the event, module address, channel information, event content, event time and other key information, so as to comply with the original communication protocol and data format requirements of the third-party software, avoid the requirements of secondary development of the host computer software, and reduce the implementation cycle and risk. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A schematic diagram of the system structure corresponding to an open event record storage and transmission method; Figure 2 Configure process diagrams for communication and data mapping; Figure 3 This is a schematic diagram of the communication interface module processing flow; Figure 4 Defines a schematic for event logging information. DETAILED DESCRIPTION
[0018] The present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.
[0019] Example 1: An open event record storage and transmission method, comprising the following steps: S1: If Figure 2 As shown, communication and data mapping configuration: the communication and data mapping configuration software is deployed on a computer, and the communication interface module and the event record storage module are configured through the configuration software; S11: In the communication and data mapping configuration software deployed on the computer, select a communication protocol; S12: Configure communication parameters; S13: Reconstruct the formats of the event record original area and the event record transmission area. In the configuration software, first define the data format of a single event, and then define the event record transmission area that conforms to the event record original area. Each event corresponds to a record. S14: configuring a mapping relationship between the communication protocol and the event record transmission area so that the host computer software can read the current pointer of the event record and the relative address of the corresponding event record according to the mapping relationship; S15: Download the above configuration to PLC; S2: Communication interface module transmission: transmits event records to the host computer software for analysis through the communication protocol; S3: Event record storage and reconstruction: Collect PLC event records into the original record area, and reconstruct them into the record transmission area according to the data format requirements of the third-party software.
[0020] Preferably, the communication protocols include but are not limited to ModbusTCP, IEC104, and DNP3, and multiple protocols can be configured.
[0021] Preferably, when the communication protocol is ModbusTCP or IEC104 or DNP3, select PLC as the server, the default listening port is 502, and the listening port can be modified according to the PLC network application situation, and the corresponding client IP address is configured. Filling 0 means receiving all client requests.
[0022] Preferably, if Figure 3 As shown, the specific steps of S2 are as follows: S21: The communication interface module acts as a server and calls the corresponding network service according to the downloaded communication protocol if the configuration is valid, otherwise the communication interface module does not work; S22: Open the configured listening port according to the downloaded communication parameters. If the opening is successful, the listening port will be used to listen for client requests. Otherwise, the communication interface module will not work. S23: After the communication interface module works normally, it monitors requests from the client in real time.
[0023] Preferably, the specific steps of S23 are as follows: Establish connection: When receiving a connection request from a client, check whether the client connection matches the client address in the communication parameters. If so, establish a connection with the client. If the client address is configured as 0, do not check the client address and always establish a connection. Processing request commands: After establishing a connection, when receiving a client data request command, check whether the address in the request command conforms to the configured mapping relationship. If so, copy the corresponding data from the event record transmission area to the communication sending interface according to the address and length requirements of the command, and respond to the data to the host computer.
[0024] Preferably, if Figure 4 As shown, in S31, the original event record information includes: Event type: divided into hard points (events from switch input modules) and soft points (events from PLC custom bits); Event location: When the event source is a hard point, the event location is composed of the rack address, slot address, and channel number; when the event source is a soft point, the event location is the data area type and bit number address; Event current value: The bit value after the event occurs. This value can be used to identify the type of event. That is, if the current value is ON, the event is OFF->ON; if the current value is OFF, the event is ON->OFF. Event time: records the absolute time when an event occurs, which is defined as year-month-day-hour-minute-second-microsecond; Event current pointer: unsigned 32 bits, can be counted up to 4294967295, and will naturally cross the boundary if overflow occurs.
[0025] Preferably, the step S3 specifically includes the following steps: S31: Collect PLC event records to the original record area, S32: The event record original area is a ring-shaped record area, with a maximum number of record entries of N. The value of N is defined according to the available hardware storage resources of the PLC. When a record exceeds the limit, the earliest event record is rolled over. S33: When the event source is a hard point, the hard point module collects external inputs. When an event occurs, the input module caches the event information and actively uploads it to the PLC. The input module can cache multiple events and upload them simultaneously. When the event source is a soft point, the PLC monitors the soft point value and detects whether the soft point value has changed at the end of each program execution cycle. If so, the event is cached. The soft point can cache multiple events. S34: When the PLC event recording module receives an event, it first uses the current pointer + 1 as the current pointer to search for the actual pointer of the target event recording area. If the current pointer is greater than or equal to N, it subtracts N from the actual pointer until the actual pointer is less than N. Then, it inserts the event into the recording area corresponding to the actual pointer of the event recording area. S35: The PLC event recording module reconstructs the event record and records it into the transmission area of the same pointer according to the conversion relationship between the original recording area and the transmission area configured by the software and according to the actual pointer; S36: Repeat S34 and S35 until all events are recorded.
[0026] Preferably, in said S3, the third-party software first reads the current pointer of the event record on the PLC. If it is inconsistent with the local pointer recorded by the application software, the pointer to be read is calculated by the algorithm of step S34. If the local pointer is greater than or equal to N, N is subtracted until the pointer to be read is less than N, which is the first pointer of the unread event. The end pointer of the event record is calculated using the same algorithm, and then the information of each event record is read in sequence.
[0027] Example 2: Figure 1 As shown, a system for implementing the above-mentioned open event record storage and transmission method includes the following parts: Communication and data configuration software: deployed on a computer, used to configure the communication interface module and event record storage module, including selecting the communication protocol, configuring communication parameters, reconstructing the event record area format, configuring mapping relationships, and downloading the configuration to the PLC; Communication interface module: As a server, it works according to the downloaded communication protocol and parameters, listens to client requests, establishes connections and processes data request commands, and transmits event records to the host computer software; Event record storage module: used to collect PLC event records into the original record area, and reconstruct them into the record transmission area according to the data format requirements of third-party software, including storing the original information of event records, storing them in a ring record area, processing hard point and soft point event sources, and inserting and reconstructing event records.
[0028] The above embodiments are merely preferred technical solutions of the present invention and should not be construed as limiting the present invention. The scope of protection of the present invention shall be the technical solutions set forth in the claims, including equivalent alternatives to the technical features of the technical solutions set forth in the claims. In other words, equivalent alternatives and improvements within this scope are also within the scope of protection of the present invention.
Claims
1. An open event record storage and transmission method, characterized in that: The steps include: S1: Communication and data mapping configuration: The communication and data mapping configuration software is deployed on the computer. The communication interface module and the event record storage module are configured through the configuration software. S11: In the communication and data mapping configuration software deployed on the computer, select a communication protocol; S12: Configure communication parameters; S13: Reconstruct the formats of the event record original area and the event record transmission area. In the configuration software, first define the data format of a single event, and then define the event record transmission area that conforms to the event record original area. Each event corresponds to a record. S14: configuring a mapping relationship between the communication protocol and the event record transmission area so that the host computer software can read the current pointer of the event record and the relative address of the corresponding event record according to the mapping relationship; S15: Download the above configuration to PLC; S2: Communication interface module transmission: transmits event records to the host computer software for analysis through the communication protocol; S3: Event record storage and reconstruction: Collect PLC event records into the original record area, and reconstruct them into the record transmission area according to the data format requirements of the third-party software.
2. The method for storing and transmitting open event records according to claim 1, wherein: The communication protocols include but are not limited to ModbusTCP, IEC104, and DNP3, and multiple protocols can be configured.
3. The open event record storage and transmission method according to claim 1, characterized in that: When the communication protocol is ModbusTCP, IEC104 or DNP3, select PLC as the server. The default listening port is 502. The listening port can be modified according to the PLC network application. Configure the corresponding client IP address. Filling 0 means receiving all client requests.
4. The method for storing and transmitting open event records according to claim 1, wherein: The specific steps of S2 are as follows: S21: The communication interface module acts as a server and calls the corresponding network service according to the downloaded communication protocol if the configuration is valid, otherwise the communication interface module does not work; S22: Open the configured listening port according to the downloaded communication parameters. If the opening is successful, the listening port will be used to listen for client requests. Otherwise, the communication interface module will not work. S23: After the communication interface module works normally, it monitors requests from the client in real time.
5. The method for storing and transmitting open event records according to claim 1, wherein: The specific steps of S23 are as follows: Establish connection: When receiving a connection request from a client, check whether the client connection matches the client address in the communication parameters. If so, establish a connection with the client. If the client address is configured as 0, do not check the client address and always establish a connection. Processing request commands: After establishing a connection, when receiving a client data request command, check whether the address in the request command conforms to the configured mapping relationship. If so, copy the corresponding data from the event record transmission area to the communication sending interface according to the address and length requirements of the command, and respond to the data to the host computer.
6. The method for storing and transmitting open event records according to claim 1, characterized in that: In S31, the original event record information includes: Event type: divided into hard points (events from switch input modules) and soft points (events from PLC custom bits); Event location: When the event source is a hard point, the event location is composed of the rack address, slot address, and channel number; when the event source is a soft point, the event location is the data area type and bit number address; Event current value: The bit value after the event occurs. This value can be used to identify the type of event. That is, if the current value is ON, the event is OFF->ON; if the current value is OFF, the event is ON->OFF. Event time: records the absolute time when an event occurs, which is defined as year-month-day-hour-minute-second-microsecond; Event current pointer: unsigned 32 bits, can be counted up to 4294967295, and will naturally cross the boundary if overflow occurs.
7. The open event record storage and transmission method according to claim 1, characterized in that: The S3 specifically includes the following steps: S31: Collect PLC event records to the original record area, S32: The event record original area is a ring-shaped record area, with a maximum number of record entries of N. The value of N is defined according to the available hardware storage resources of the PLC. When a record exceeds the limit, the earliest event record is rolled over. S33: When the event source is a hard point, the hard point module collects external inputs. When an event occurs, the input module caches the event information and actively sends it to the PLC. The input module can cache multiple events and send them simultaneously. When the event source is a soft point, the PLC monitors the soft point value. At the end of each program execution cycle, it detects whether the soft point value has changed. If so, the event is cached. The soft point can cache multiple events. S34: When the PLC event recording module receives an event, it first uses the current pointer + 1 as the current pointer to search for the actual pointer of the target event recording area. If the current pointer is greater than or equal to N, it subtracts N from the actual pointer until the actual pointer is less than N. Then, it inserts the event into the recording area corresponding to the actual pointer of the event recording area. S35: The PLC event recording module reconstructs the event record and records it into the transmission area of the same pointer according to the conversion relationship between the original recording area and the transmission area configured by the software and according to the actual pointer; S36: Repeat S34 and S35 until all events are recorded.
8. The open event record storage and transmission method according to claim 7, characterized in that: In step S3, the third-party software first reads the current pointer of the event record on the PLC. If it is inconsistent with the local pointer recorded by the application software, the to-be-read pointer is calculated using the algorithm of step S34. If the local pointer is greater than or equal to N, N is subtracted until the to-be-read pointer is less than N, which is the first pointer of the unread event. The same algorithm is used to calculate the end pointer of the event record, and then the information of each event record is read in sequence.
9. A system for implementing the open event record storage and transmission method according to any one of claims 1 to 8, characterized in that: Includes the following sections: Communication and data configuration software: deployed on a computer, used to configure the communication interface module and event record storage module, including selecting the communication protocol, configuring communication parameters, reconstructing the event record area format, configuring mapping relationships, and downloading the configuration to the PLC; Communication interface module: As a server, it works according to the downloaded communication protocol and parameters, listens to client requests, establishes connections and processes data request commands, and transmits event records to the host computer software; Event record storage module: used to collect PLC event records into the original record area, and reconstruct them into the record transmission area according to the data format requirements of third-party software, including storing the original information of event records, storing them in a ring record area, processing hard point and soft point event sources, and inserting and reconstructing event records.