Log system and method based on DCS configuration algorithm of nuclear power plant, and medium

By designing a log system based on configuration algorithms in the DCS system of a nuclear power plant and using NOR FLASH storage devices to store fault information, the problem of difficult fault location in the safety-grade DCS system of a nuclear power plant is solved, and convenient fault analysis and system maintainability are realized.

CN121455415APending Publication Date: 2026-02-03NUCLEAR POWER INSTITUTE OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511607295.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-05
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

The on-site environment of safety-grade DCS systems in nuclear power plants is complex, preventing developers and maintenance personnel from arbitrarily testing or debugging them. Therefore, if problems arise in the on-site DCS system, it is difficult for developers and maintenance personnel to locate, analyze, or resolve the issues. Existing logging systems are not suitable for logging in safety-grade DCS systems in nuclear power plants and do not provide adequate convenience for developers and maintenance personnel.

Method used

A logging system based on the DCS configuration algorithm of a nuclear power plant was designed, including board programs, a logging function library and a logging access block. Key fault information is stored through NOR FLASH storage devices, supporting real-time access to log data and providing convenient methods for analysis and problem solving.

Benefits of technology

It enables real-time storage of fault information in the safety-grade DCS system of nuclear power plants, improving the reliability and convenience of fault location and analysis, and enhancing the maintainability and traceability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121455415A_ABST
    Figure CN121455415A_ABST
Patent Text Reader

Abstract

The invention discloses a log system and method based on a nuclear power plant DCS configuration algorithm and a medium, and relates to the technical field of nuclear power plant safety-level DCS systems and log systems. The log system is applied to a nuclear power plant safety level DCS platform main control module. The log system comprises a board card program used for an application program to call log data in a log function library through a log scheduling interface; the log function library is used for realizing initialization of log data, dynamic updating of the log data and exporting of the log data through a designed log main body; and storing the log data in a bottom layer NOR FLASH storage device through a designed log access block, and calling the log data by an application program. A set of log system architecture is designed, key fault information can be stored, power failure is not prone to loss, logs are convenient to obtain, and convenience is provided for development or maintenance personnel to locate, analyze or solve problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of safety-grade DCS systems and log systems for nuclear power plants, specifically to a log system, method, and medium based on nuclear power plant DCS configuration algorithms. Background Technology

[0002] A logging system is a tool used to record events, errors, warnings, and other relevant information generated by an application or service during runtime. These are crucial for troubleshooting, performance optimization, and program status monitoring. The design of a logging system prioritizes the real-time performance, determinism, and reliability of the security-grade DCS system, without compromising its functional safety.

[0003] Currently, the on-site environment of safety-grade DCS systems in nuclear power plants is complex, preventing development or maintenance personnel from arbitrarily testing or debugging them. Therefore, if problems arise in the on-site DCS system, it is difficult for development or maintenance personnel to locate, analyze, or resolve the issues. Furthermore, existing logging systems are not suitable for logging in safety-grade DCS systems in nuclear power plants and cannot effectively facilitate the location, analysis, and resolution of problems by development or maintenance personnel.

[0004] In view of the above, this application is hereby submitted. Summary of the Invention

[0005] The technical problem this invention aims to solve is that the field environment of nuclear power plant safety-grade DCS systems is complex, preventing developers and maintenance personnel from arbitrarily testing or debugging. Therefore, if a problem occurs in the field DCS system, it is difficult for developers and maintenance personnel to locate, analyze, or resolve the issue. Existing log systems are not suitable for logging nuclear power plant safety-grade DCS systems and cannot effectively facilitate the location, analysis, and resolution of problems by developers and maintenance personnel. The purpose of this invention is to provide a log system, method, and medium based on nuclear power plant DCS configuration algorithms. A log system architecture is designed that can store critical fault information, is not easily lost during power outages, and is easily accessible, thus facilitating the location, analysis, and resolution of problems by developers and maintenance personnel.

[0006] This invention is achieved through the following technical solution:

[0007] In a first aspect, the present invention provides a log system based on a nuclear power plant DCS configuration algorithm, which is applied to the main control module of a nuclear power plant safety-grade DCS platform; the log system includes:

[0008] The board program is used by applications to retrieve log data from the log function library through the log scheduling interface;

[0009] The log function library is used for initializing, dynamically updating and exporting log data through a designed log subject, and storing the log data in the underlying NOR FLASH storage device through a designed log access block, and calling the log data by an application program.

[0010] Further, the log function library comprises:

[0011] a log function interface, which is used for providing a log function related interface to an upper layer application program;

[0012] a log subject, which is used for implementing a log data format, and initializing, dynamically updating and exporting log data;

[0013] a log access block, which is used for interacting with the underlying NOR FLASH storage device, and storing log data in the underlying NOR FLASH storage device or calling log data stored in the underlying NOR FLASH storage device based on a log data storage mechanism.

[0014] Further, the log data format comprises a directory header and log records.

[0015] The directory header is used for saving information such as a NOR FLASH storage device existing log system version number, log record total number, first log record storage address, last log record storage address, module board card this time power-on recorded log record number and CRC check code, and serving for updating log data records.

[0016] The log record is used for saving specific error information generated before a configuration algorithm runs and log address management information, the specific error information comprises input data exception, CPU self-diagnosis exception, RAM diagnosis exception, register state information, power supply diagnosis exception information, and the log address management information comprises error type identification bit, length, time stamp, power-on serial number, log record total number, first log record storage address and CRC check code.

[0017] Further, a specific process of the log data initialization is as follows:

[0018] entering the directory header initialization of the log data;

[0019] obtaining directory header data from the directory header address 1 and the directory header address 2 of the NOR FLASH storage device respectively, and selecting newer directory header data;

[0020] Judge whether the directory header is acquired successfully, if yes, read the record according to the last log record address in the directory header, find the last record in the NOR FLASH storage device according to the power-on serial number information of the read record and update the directory header, if no, enter the new directory header process;

[0021] Erase the memory block of the directory header address 1 or address 2 of the NOR FLASH storage device in a turn and store the directory header data into the corresponding address;

[0022] Up to now, the directory header initialization of the log data is finished.

[0023] Further, the specific process of the dynamic update of the log data is as follows:

[0024] Detect whether the buffer area has fault information, if yes, detect whether the fault information is repeatedly recorded, if no, update the directory header and the log record information, if yes, return to re-detect whether the fault information is repeatedly recorded;

[0025] Judge whether the permission of writing into the NOR FLASH storage device is obtained, if yes, determine the FLASH log of the record according to the storage mechanism and write it, if no, write the record into another buffer area, and when the FLASH writing permission is obtained, write it into the corresponding address preferentially;

[0026] The fault information is the fault information collected by the DCS platform master module in the periodic operation of the configuration algorithm and saved into the buffer area.

[0027] Further, the specific process of the export of the log data is as follows:

[0028] When the log data import command is received, the log scheduling interface is called, the log directory header and the log record are read from the specified address of the NOR FLASH storage device;

[0029] And the formatted log data information of the log directory header and the log record is exported to the computer end through the serial port.

[0030] Further, the log data storage mechanism includes a redundancy mechanism or a cyclic storage mechanism.

[0031] In the second aspect, the application further provides a method of the log system based on the DCS configuration algorithm of the nuclear power plant, which comprises:

[0032] The log function library realizes the initialization of the log data, the dynamic update of the log data and the export of the log data through the designed log main body, and stores the log data in the underlying NOR FLASH storage device through the designed log access block;

[0033] The application retrieves log data from the log function library through the log scheduling interface.

[0034] Furthermore, the format of the log data includes a directory header and log records;

[0035] The directory header is used to store information such as the existing log system version number, total number of log records, storage address of the first log record, storage address of the last log record, number of log records recorded by the module board during this power-on, and CRC checksum, in order to provide services for updating log data records.

[0036] The log records are used to store specific error information generated before the configuration algorithm runs, as well as log address management information. The specific error information includes input data anomalies, CPU self-diagnosis anomalies, RAM diagnosis anomalies, register status information, power supply diagnosis anomalies, etc. The log address management information includes error type identification bits, length, timestamp, power-on sequence number, total number of log records, storage address of the first log record, and CRC checksum, etc.

[0037] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method.

[0038] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the above-described method.

[0039] Fifthly, the present invention also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the method described above.

[0040] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0041] This invention relates to a logging system, method, and medium based on the DCS configuration algorithm of a nuclear power plant. This invention can save fault information that may occur during the operation of the DCS configuration algorithm to a NOR FLASH memory in real time. It can be applied to the main control module of the safety-grade DCS platform of a nuclear power plant, and can also be ported to all modules that require a logging system. Attached Figure Description

[0042] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, do not constitute a limitation thereof. In the drawings:

[0043] Figure 1 This is a general framework diagram of the log system of the present invention;

[0044] Figure 2 This is a diagram showing the NOR FLASH storage area partitioning of the log system of this invention;

[0045] Figure 3 This is a diagram of the log recording and storage mechanism of the present invention;

[0046] Figure 4 This is a flowchart of the directory header initialization process for the log system of this invention;

[0047] Figure 5 This is a flowchart of the update log recording process of this invention;

[0048] Figure 6 This invention provides a flowchart for exporting log recording processes.

[0049] Figure 7 This is a flowchart of the main control execution task in an embodiment of the present invention. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of this invention are only for explaining this invention and are not intended to limit this invention.

[0051] This invention employs a log system based on a configuration algorithm to implement a security-grade DCS platform master control. By performing error diagnosis before running the configuration algorithm and promptly saving error logs to a non-volatile NOR FLASH storage device, it provides key data information for post-event analysis, thereby improving the traceability and maintainability of configuration algorithm execution errors.

[0052] Specifically: (1) An asynchronous FLASH writing mechanism was used, and log storage was performed by writing commands to the control register, thus avoiding the program from idling and waiting;

[0053] (2) A redundant storage mechanism was adopted for the log record directory header to ensure the integrity of the log record directory header data;

[0054] (3) A circular storage mechanism is adopted for log data to achieve wear leveling of FLASH and improve the storage life of FLASH;

[0055] (4) A log compression storage mechanism is adopted. During the log recording and packet assembly process, corresponding error identification bits are added according to the error type, and specific error information is closely arranged to achieve more efficient log transmission and storage.

[0056] (5) Using buffer storage technology, resource conflicts may occur during the process of writing log records to FLASH storage device. Therefore, we set up a log buffer to temporarily store all log information to be stored. After the resources are released, the log information in the buffer is stored first.

[0057] (6) Formatted text export technology: When exporting log data, the serial port can be used to directly export the formatted and laid-out log record text information by calling the export interface, without the need to use additional programs or applications to parse the log data.

[0058] In addition, NOR FLASH offers the following advantages for storing log data: high write endurance and a low bad block rate, making it ideal for storing critical log information. It supports byte-level random reads, allowing for very rapid retrieval of log records from any location. This feature is crucial for real-time analysis and immediate response, especially in embedded systems where specific log entries need to be retrieved immediately. It also boasts low power consumption (1uA standby current) and long data retention time after power failure (20 years).

[0059] Example 1

[0060] like Figure 1 As shown, Figure 1 This is a general framework diagram of the logging system of the present invention. The present invention is a logging system based on a nuclear power plant DCS configuration algorithm, which is applied to the main control module of a nuclear power plant safety-grade DCS platform; the logging system includes:

[0061] The board program is used by applications to retrieve log data from the log function library through the log scheduling interface;

[0062] The logging function library is used to initialize log data, dynamically update log data, and export log data through the designed log body; and to store log data in the underlying NOR FLASH storage device through the designed log access block, and make it available for application calls.

[0063] In this embodiment, the log function library includes:

[0064] The logging functionality interface is responsible for providing logging-related interfaces to upper-layer applications.

[0065] The log body is used to implement the various functions of the log, namely, to implement the log data format, and to perform log data initialization, dynamic updating of log data, and export of log data.

[0066] The log access block is used to interact with the underlying NOR FLASH storage device. Based on the log data storage mechanism, it stores log data in the underlying NOR FLASH storage device or retrieves log data stored in the underlying NOR FLASH storage device.

[0067] Specifically, the format of the log data includes a directory header and log records;

[0068] The directory header is used to store information such as the existing log system version number, total number of log records, storage address of the first log record, storage address of the last log record, number of log records recorded by the module board during this power-on, and CRC checksum, in order to provide services for updating log data records.

[0069] The log records are used to store specific error information generated before the configuration algorithm runs, as well as log address management information. The specific error information includes input data anomalies, CPU self-diagnosis anomalies, RAM diagnosis anomalies, register status information, power supply diagnosis anomalies, etc. The log address management information includes error type identification bits, length, timestamp, power-on sequence number, total number of log records, storage address of the first log record, and CRC checksum, etc.

[0070] In this embodiment, log data storage specifically includes:

[0071] The storage device used in this invention is a 4MB NOR FLASH memory, internally divided into 64 blocks, each 64KB in size. It employs an erase-then-write storage mechanism, with each erase operation performed on a block-by-block basis. The total storage area is divided as follows: Figure 2 As shown.

[0072] Log data storage mechanisms mainly include two categories: redundancy mechanisms and circular storage mechanisms.

[0073] (1) Redundancy mechanism

[0074] The directory header employs a redundancy mechanism. When updating the directory header, erase and write operations are performed alternately in two block areas to ensure data integrity. If an abnormal situation occurs during a directory update operation, such as a system power outage, the original data may be corrupted. The redundancy mechanism allows for the recovery of the original data, improving the fault tolerance of the log system.

[0075] (2) Circular storage mechanism

[0076] The log records use a circular storage mechanism. For example... Figure 3As shown, log records are stored starting from the address of the first block (block2). When the last block (block63) is reached, the storage address is set back to the address of the first block (block2), and this process is repeated. If a system power failure occurs during the writing of log records to the FLASH, due to the characteristic that NOR FLASH cannot be rewritten, the storage area of ​​the previous log record is skipped during the next write operation, and the process continues from there.

[0077] In this embodiment, the log system initialization is primarily responsible for updating the directory header. First, it reads the directory header data from the two addresses stored in the NOR FLASH, selecting the newer one. Based on this directory header, it locates the last stored log record in the NOR FLASH and updates the directory header accordingly. Meanwhile, the directory header stored in the NOR FLASH is only updated once during the initialization phase.

[0078] like Figure 4 As shown, the specific process for initializing log data is as follows:

[0079] Enter the directory header of the log data for initialization;

[0080] Retrieve directory header data from directory header address 1 and address 2 of the NOR FLASH storage device respectively, and select the newer directory header data;

[0081] Determine whether the directory header was successfully obtained. If so, read the record based on the address of the last log record in the directory header, and find the last record from the NOR FLASH storage device based on the power-on sequence number information of the read record and update the directory header. If not, proceed to the new directory header creation process.

[0082] The memory block containing the directory header address 1 or address 2 of the NOR FLASH storage device is erased in turn, and the directory header data is stored in the corresponding address.

[0083] At this point, the initialization of the log data directory header is complete.

[0084] In this embodiment, the main control module collects various fault information in real time and stores it in the buffer when running the configuration algorithm periodically. During the space task, it performs log recording and writes it into the NOR FLASH. The packet is assembled using a mechanism of flag bits plus error information. Each flag bit represents a type of fault, and all error information is arranged closely together.

[0085] like Figure 5 As shown, the specific process for dynamically updating log data is as follows:

[0086] Check if there is any fault information in the buffer. If so, check if the fault information is recorded repeatedly. If there is no repeated record, update the directory header and log information. If there is a repeated record, return to check for fault information again.

[0087] Determine whether permission to write to the NOR FLASH storage device has been obtained. If permission has been obtained, determine the FLASH log to which this record should be stored according to the storage mechanism and write it. If permission has not been obtained, write the record to another buffer. When write permission to FLASH is obtained, write to the corresponding address first.

[0088] The fault information is collected in real time by the DCS platform main control module during the periodic operation of the configuration algorithm and saved to the buffer.

[0089] In this embodiment, log data export means that the log data stored in NOR FLASH can be formatted and exported to a PC via a command. The command can specify to start from any number of log records and read any number of log records.

[0090] like Figure 6 As shown, the specific process for exporting log data is as follows:

[0091] When a log data import command is received, the log scheduling interface is invoked to read the log directory header and log records from the specified address of the NOR FLASH storage device.

[0092] The log directory header and formatted log data are then exported to the computer via serial port.

[0093] The specific implementation is as follows:

[0094] 1. Program Download

[0095] Download the main controller bootloader code using a downloader, and then download the normal code to the NORFLASH storage device by running the bootloader.

[0096] 2. Reset Operation

[0097] After rebooting, the bootloader loads the normal code into DDR memory. Then the code jumps to the normal code segment to run.

[0098] 3. Fault injection test

[0099] During operation, the main controller will periodically execute various tasks, such as Figure 7As shown, exception information generated during each task is saved to a temporary buffer, and during idle tasks, this exception information is formatted and written to a NOR FLASH storage device. Fault injection testing can verify the effectiveness of the logging system.

[0100] In practice, the main control's normal code is modified to change the value in the data input area during the fifth cycle, followed by recompiling, downloading, and running. During the fifth cycle, an input data validation failure exception is generated. Exporting the log records reveals that the exception information has been recorded, indicating that the logging system is functioning normally.

[0101] This invention can instantly save fault information that may occur during algorithm operation to a NOR FLASH storage device. It can be applied to the main control module of a safety-grade DCS platform in nuclear power plants, and can also be ported to all modules that require a log system.

[0102] Example 2

[0103] The difference between this embodiment and Embodiment 1 is that this embodiment provides a method for a log system based on a nuclear power plant DCS configuration algorithm, the method including:

[0104] The log function library implements log data initialization, dynamic updating, and export through the designed log body; and stores log data in the underlying NOR FLASH storage device through the designed log access block;

[0105] The application retrieves log data from the log function library through the log scheduling interface.

[0106] As a further implementation, the format of the log data includes a directory header and log records;

[0107] The directory header is used to store information such as the existing log system version number, total number of log records, storage address of the first log record, storage address of the last log record, number of log records recorded by the module board during this power-on, and CRC checksum, in order to provide services for updating log data records.

[0108] The log records are used to store specific error information generated before the configuration algorithm runs, as well as log address management information. The specific error information includes input data anomalies, CPU self-diagnosis anomalies, RAM diagnosis anomalies, register status information, power supply diagnosis anomalies, etc. The log address management information includes error type identification bits, length, timestamp, power-on sequence number, total number of log records, storage address of the first log record, and CRC checksum, etc.

[0109] As a further implementation, log data storage specifically includes:

[0110] The storage device used in this invention is a 4MB NOR FLASH memory, internally divided into 64 blocks, each 64KB in size. It employs an erase-then-write storage mechanism, with each erase operation performed on a block-by-block basis. The total storage area is divided as follows: Figure 2 As shown.

[0111] Log data storage mechanisms mainly include two categories: redundancy mechanisms and circular storage mechanisms.

[0112] (1) Redundancy mechanism

[0113] The directory header employs a redundancy mechanism. When updating the directory header, erase and write operations are performed alternately in two block areas to ensure data integrity. If an abnormal situation occurs during a directory update operation, such as a system power outage, the original data may be corrupted. The redundancy mechanism allows for the recovery of the original data, improving the fault tolerance of the log system.

[0114] (2) Circular storage mechanism

[0115] The log records use a circular storage mechanism. For example... Figure 3 As shown, log records are stored starting from the address of the first block (block2). When the last block (block63) is reached, the storage address is set back to the address of the first block (block2), and this process is repeated. If a system power failure occurs during the writing of log records to the FLASH, due to the characteristic that NOR FLASH cannot be rewritten, the storage area of ​​the previous log record is skipped during the next write operation, and the process continues from there.

[0116] As a further implementation, the specific process for initializing log data is as follows:

[0117] Enter the directory header of the log data for initialization;

[0118] Retrieve directory header data from directory header address 1 and address 2 of the NOR FLASH storage device respectively, and select the newer directory header data;

[0119] Determine whether the directory header was successfully obtained. If so, read the record based on the address of the last log record in the directory header, and find the last record from the NOR FLASH storage device based on the power-on sequence number information of the read record and update the directory header. If not, proceed to the new directory header creation process.

[0120] The memory block containing the directory header address 1 or address 2 of the NOR FLASH storage device is erased in turn, and the directory header data is stored in the corresponding address.

[0121] At this point, the initialization of the log data directory header is complete.

[0122] As a further implementation, the specific process for dynamically updating log data is as follows:

[0123] Check if there is any fault information in the buffer. If so, check if the fault information is recorded repeatedly. If there is no repeated record, update the directory header and log information. If there is a repeated record, return to check for fault information again.

[0124] Determine whether permission to write to the NOR FLASH storage device has been obtained. If permission has been obtained, determine the FLASH log to which this record should be stored according to the storage mechanism and write it. If permission has not been obtained, write the record to another buffer. When write permission to FLASH is obtained, write to the corresponding address first.

[0125] The fault information is collected in real time by the DCS platform main control module during the periodic operation of the configuration algorithm and saved to the buffer.

[0126] As a further implementation, the specific process for exporting log data is as follows:

[0127] When a log data import command is received, the log scheduling interface is invoked to read the log directory header and log records from the specified address of the NOR FLASH storage device.

[0128] The log directory header and formatted log data are then exported to the computer via serial port.

[0129] Meanwhile, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method.

[0130] Meanwhile, the present invention also provides a computer-readable storage medium storing a computer program, characterized in that the computer program implements the above-described method when executed by a processor.

[0131] Meanwhile, the present invention also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the method described above.

[0132] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0133] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0134] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0135] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0136] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A log system based on a nuclear power plant DCS configuration algorithm, characterized in that, This log system is applied to the main control module of the safety-grade DCS platform in nuclear power plants. The log system includes: The board program is used by applications to retrieve log data from the log function library through the log scheduling interface; The logging function library is used to initialize log data, dynamically update log data, and export log data through the designed log body; and to store log data in the underlying NOR FLASH storage device through the designed log access block, and make it available for application calls.

2. The log system based on the nuclear power plant DCS configuration algorithm according to claim 1, characterized in that, The log function library includes: The logging functionality interface is responsible for providing logging-related interfaces to upper-layer applications. The log body is used to implement the log data format, and to perform log data initialization, dynamic updating of log data, and export of log data; The log access block is used to interact with the underlying NOR FLASH storage device. Based on the log data storage mechanism, it stores log data in the underlying NOR FLASH storage device or retrieves log data stored in the underlying NOR FLASH storage device.

3. The log system based on the nuclear power plant DCS configuration algorithm according to claim 2, characterized in that, The format of the log data includes a directory header and log records; The directory header is used to store the existing log system version number, total number of log records, storage address of the first log record, storage address of the last log record, number of log records recorded by the module board during this power-on, and CRC check code information in the NOR FLASH storage device, so as to provide services for updating log data records; The log records are used to store specific error information generated before the configuration algorithm runs, as well as log address management information. The specific error information includes input data anomalies, CPU self-diagnosis anomalies, RAM diagnosis anomalies, register status information, and power supply diagnosis anomalies. The log address management information includes error type identification bits, length, timestamp, power-on sequence number, total number of log records, storage address of the first log record, and CRC checksum.

4. The log system based on the nuclear power plant DCS configuration algorithm according to claim 2, characterized in that, The specific process for initializing log data is as follows: Enter the directory header initialization of the log data; Retrieve directory header data from directory header address 1 and address 2 of the NOR FLASH storage device respectively, and select the newer directory header data; Determine whether the directory header was successfully obtained. If so, read the record based on the address of the last log record in the directory header, and find the last record from the NOR FLASH storage device based on the power-on sequence number information of the read record and update the directory header. If not, proceed to the new directory header creation process. The memory block containing the directory header address 1 or address 2 of the NOR FLASH storage device is erased in turn, and the directory header data is stored in the corresponding address. At this point, the initialization of the log data directory header is complete.

5. The log system based on the nuclear power plant DCS configuration algorithm according to claim 2, characterized in that, The specific process of dynamically updating log data is as follows: Check if there is any fault information in the buffer. If so, check if the fault information is recorded repeatedly. If there is no repeated record, update the directory header and log information. If there are duplicate records, return to check for fault information again; Determine whether permission to write to the NOR FLASH storage device has been obtained. If permission has been obtained, determine the FLASH log to which this record should be stored according to the storage mechanism and write it. If permission is not granted, the record will be written to another buffer. When write permission to FLASH is granted, the record will be written to the corresponding address first. The fault information is collected in real time by the DCS platform main control module during the periodic operation of the configuration algorithm and saved to the buffer.

6. The log system based on the nuclear power plant DCS configuration algorithm according to claim 2, characterized in that, The specific process for exporting log data is as follows: When a log data import command is received, the log scheduling interface is invoked to read the log directory header and log records from the specified address of the NOR FLASH storage device. The log directory header and formatted log data are then exported to the computer via serial port.

7. The log system based on the nuclear power plant DCS configuration algorithm according to claim 1, characterized in that, The log data storage mechanism includes a redundancy mechanism or a circular storage mechanism.

8. The method for a log system based on a nuclear power plant DCS configuration algorithm as described in any one of claims 1 to 7, characterized in that, The method includes: The log function library implements log data initialization, dynamic updating, and export through the designed log body; and stores log data in the underlying NOR FLASH storage device through the designed log access block; The application retrieves log data from the log function library through the log scheduling interface.

9. The method according to claim 8, characterized in that, The format of the log data includes a directory header and log records; The directory header is used to store the existing log system version number, total number of log records, storage address of the first log record, storage address of the last log record, number of log records recorded by the module board during this power-on, and CRC check code information in the NOR FLASH storage device, so as to provide services for updating log data records; The log records are used to store specific error information generated before the configuration algorithm runs, as well as log address management information. The specific error information includes input data anomalies, CPU self-diagnosis anomalies, RAM diagnosis anomalies, register status information, and power supply diagnosis anomalies. The log address management information includes error type identification bits, length, timestamp, power-on sequence number, total number of log records, storage address of the first log record, and CRC checksum.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 8 to 9.

11. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 8 to 9.

12. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 8 to 9.