Pressurized water reactor water loss accident diagnosis method and system based on KNN-TCN
By combining KNN and TCN algorithms, the problem of diagnosing the breaking position and size in pressurized water reactor water loss accidents is solved, and the rapid and accurate diagnosis is achieved, which improves the reliability and accuracy of the system.
Patent Information
- Application Number
- CN202410953175.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-11-12
AI Technical Summary
The prior art is difficult to accurately diagnose the breaking position and breaking size of the pressurized water reactor water loss accident at the same time, resulting in diagnosis difficulties and delays.
Combining the K nearest neighbor classification algorithm (KNN) and the time convolution network (TCN), data is collected through the pressurized water reactor simulation model, data sets are established and model trained to diagnose the breaking position and breaking size.
It realizes a rapid and accurate diagnosis of the breaking position and size of the breaking accident in pressurized water reactor, improves the reliability and accuracy of the diagnosis system, and can timely identify the specific location and size of the accident.
Smart Images

Figure CN118940615A_ABST
Abstract
Description
Background Art
[0002] As a safe, efficient and clean energy, nuclear energy has been used on a large scale in many countries. In recent years, my country's nuclear power industry has also developed rapidly. Reactor safety is the top priority of the nuclear power industry. When safety problems occur, it may eventually lead to serious consequences. The reactor loss of coolant accident (loss of coolant accident) is a typical accident in the safety analysis of nuclear power plants. Different breach locations and breach sizes will directly affect the handling and consequences of the accident, specifically the loss of coolant in the primary circuit. The rupture of the primary circuit pipeline or the auxiliary system pipeline is the main cause of the loss of coolant accident. The consequences of the reactor loss of coolant accident are relatively serious. Even small and medium breaches may cause the core to melt, so it is very important to diagnose the fault in time.
[0003] Usually, the diagnosis of a loss of coolant accident is conducted together with other accidents, but it is seldom conducted alone. It is usually difficult to accurately diagnose the breach location and breach size of a loss of coolant accident at the same time so as to determine the occurrence of the accident in a timely manner. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a pressurized water reactor loss of coolant accident diagnosis method and system based on KNN-TCN in view of the deficiencies in the above-mentioned prior art, which combines the K-Nearest Neighbor classification algorithm (kNN) and the Temporal Convolutional Network (TCN) to solve the technical problem that the existing technology cannot accurately diagnose the rupture location and rupture size of the loss of coolant accident at the same time.
[0005] The present invention adopts the following technical solutions:
[0006] A method for diagnosing a pressurized water reactor loss of coolant accident based on KNN-TCN includes the following steps:
[0007] Collect relevant loss of coolant failure data through the PWR simulation model;
[0008] A data set is established based on the corresponding water loss fault data to build and test the KNN algorithm;
[0009] Based on the corresponding water loss fault data, a data set is established to train and test the TCN neural network;
[0010] Based on the KNN algorithm and TCN neural network, a PWR LOCA diagnosis method based on KNN-TCN was constructed, and the rupture location and rupture size of the LOCA were diagnosed at the same time.
[0011] Preferably, the pressurized water reactor simulation model collects corresponding loss of coolant failure data specifically as follows:
[0012] The GPWR model is used to simulate the loss of coolant in a pressurized water reactor. The ruptures in the hot pipe section, cold pipe section and pressurizer pipe are simulated respectively. Five different rupture size data are obtained and processed.
[0013] Preferably, the breach size data is processed as follows:
[0014] The collected water loss fault data are cleaned, the empty values in the data are adjusted, the erroneous data in the data are eliminated, and the duplicate data are replaced and deleted; then the data are summarized and sorted, classified according to different breach locations and breach sizes, and labels are set for data of different categories to build a complete data set. Then, the complete data set is standardized for each column according to the attribute value through min-max normalization, and the data is normalized to between [0, 1].
[0015] Preferably, cleaning includes sample missing value processing and duplicate value processing.
[0016] Preferably, the KNN algorithm is specifically:
[0017] Calculate the Euclidean distance or cosine similarity between the sample to be classified and the known training samples, and find the K nearest neighbor samples with the shortest distance or the greatest similarity to the sample to be classified; then predict the category of the sample to be predicted based on the category labels of the K nearest neighbor samples.
[0018] Preferably, in the process of predicting the category of the sample to be predicted, for classification problems, the majority voting method is adopted, that is, the category that appears most frequently among the K neighbors is selected as the prediction result; for regression problems, the average method is adopted, that is, the average value of the target attribute values of the K neighbors is calculated as the prediction result.
[0019] Preferably, the labels include label0, label1, label2, and label3, which correspond to no loss of coolant accident, hot pipe section rupture, cold pipe section rupture, and pressurizer rupture, respectively. The data dimension of label0 is [300, 36], and the dimensions of label1, label2, and label3 are [2400, 36], respectively.
[0020] Preferably, a data set is established based on the corresponding dehydration fault data for training and testing the TCN neural network, specifically:
[0021] According to the characteristics of time series data, the length of the sliding window is set to T and the width of the window is set to L;
[0022] On the data set, starting from the initial time, the slider slides forward one time unit each time along the time direction to obtain the data of the next window;
[0023] The data of each sliding window is saved as part of a new dataset, and a dataset is constructed to train and test the TCN neural network.
[0024] Preferably, window lengths of T=3s, 5s, and 7s are selected to construct data sets, and the dimensions of the data sets are [1434, 3, 36], [1428, 5, 36], and [1419, 7, 36], respectively.
[0025] In a second aspect, an embodiment of the present invention provides a pressurized water reactor loss of coolant accident diagnosis system based on KNN-TCN, comprising:
[0026] A collection module collects corresponding loss of coolant failure data through a pressurized water reactor simulation model;
[0027] KNN module, which establishes a data set based on the corresponding water loss fault data to build and test the KNN algorithm;
[0028] TCN module, which establishes a data set based on the corresponding water loss fault data for training and testing the TCN neural network;
[0029] The diagnosis module, based on the KNN algorithm and TCN neural network, constructs a PWR LOCA diagnosis method based on KNN-TCN, and diagnoses the rupture location and rupture size of the LOCA accident at the same time.
[0030] In a third aspect, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned KNN-TCN-based pressurized water reactor loss of coolant accident diagnosis method when executing the computer program.
[0031] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned KNN-TCN-based pressurized water reactor loss of coolant accident diagnosis method.
[0032] Compared with the prior art, the present invention has at least the following beneficial effects:
[0033] A method for diagnosing a pressurized water reactor loss of coolant accident based on KNN-TCN, firstly extracts data through a simulation model, and the data can be used to establish a diagnostic algorithm and test its effect; then, the collected data are used to respectively construct diagnostic methods for the breach position and breach size, and the accuracy of the method can be verified in time through test data to ensure the effectiveness of the subsequent diagnostic system; finally, the above-established KNN algorithm and TCN network are combined to construct a complete diagnostic system, which can completely and effectively realize the diagnosis of a pressurized water reactor loss of coolant accident, and the test data is used for testing to verify the feasibility and accuracy of the entire diagnostic system.
[0034] Furthermore, the accuracy of the GPWR PWR model has been verified in many studies, so the simulated LOCA data generated by the GPWR model has high reliability. By collecting a large amount of LOCA data as the basis for the diagnostic method, the proposed diagnostic algorithm can be established and trained more accurately and the reliability and accuracy of the diagnostic system can be measured more accurately.
[0035] Furthermore, since the data directly generated from the model is relatively complex, it may contain some erroneous data and duplicate data that are difficult to use directly. Therefore, data cleaning can effectively improve the availability of data and reduce the subsequent processing costs. The cleaned data cannot be directly used for algorithm training and testing. It is necessary to divide the data and perform corresponding normalization according to the labels of the fault breach location and breach size. The processed data is used to establish and verify the algorithm.
[0036] Furthermore, the KNN algorithm has the characteristics of simple structure, easy to understand and implement, no need to estimate parameters, and high accuracy in multi-classification problems, and is widely used in the field of fault diagnosis. The KNN algorithm can quickly diagnose faults with a small amount of data, so the use of the KNN algorithm to diagnose the location of the rupture of a loss of coolant accident is accurate and efficient.
[0037] Furthermore, due to the large variety of breach sizes and relatively small amount of data, it is difficult for traditional classification methods to accurately distinguish breach sizes; TCN is a deep learning model for processing time series data. Its advantages lie in its training stability and efficiency, its ability to process data in parallel, and its excellent performance in processing long sequences. Therefore, using the TCN neural network to diagnose the breach size of a loss of coolant accident can effectively mine the differences and connections between time series data, thereby accurately diagnosing the breach size.
[0038] It can be understood that the beneficial effects of the second aspect mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0039] In summary, the present invention combines the advantages of the KNN algorithm and the TCN neural network, and is respectively used for the diagnosis of the breach location and breach size of a loss of coolant accident, effectively improving the speed and accuracy of diagnosis; a large amount of loss of coolant accident data is simulated by the model for training KNN and TCN, so the constructed method has high accuracy; then the two methods are combined to construct a complete diagnostic system, which can quickly and accurately diagnose the specific location and size of the loss of coolant accident through data.
[0040] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1is a flow chart of the diagnostic method of the present invention;
[0042] Figure 2 Schematic diagram of causal expansion convolution;
[0043] Figure 3 Schematic diagram of KNN-TCN fault diagnosis framework;
[0044] Figure 4 A schematic diagram of a computer device provided by an embodiment of the present invention;
[0045] Figure 5 The present invention is a block diagram of an electronic device provided according to an embodiment. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] In the description of the present invention, it should be understood that the terms “include” and “comprises” indicate the presence of described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.
[0048] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0049] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects are in an "or" relationship.
[0050] It should be understood that, although the terms first, second, third, etc. may be used to describe preset ranges, etc. in the embodiments of the present invention, these preset ranges should not be limited to these terms. These terms are only used to distinguish preset ranges from each other. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.
[0051] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0052] Various structural schematic diagrams of the embodiments disclosed in the present invention are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may additionally design regions / layers with different shapes, sizes, and relative positions according to actual needs.
[0053] The present invention provides a method for diagnosing a pressurized water reactor loss of coolant accident based on KNN-TCN, which combines a K-Nearest Neighbor classification algorithm (k-Nearest Neighbor, KNN) and a temporal convolutional network (Temporal Convolutional Network, TCN). The KNN algorithm has the characteristics of simple structure, easy to understand and implement, no need to estimate parameters, and high accuracy in multi-classification problems. Therefore, the algorithm is used to diagnose the occurrence and rupture location of the loss of coolant accident; and combined with the time series data processing capability of the TCN time convolutional network, the TCN is trained using time series data to accurately diagnose the rupture size of the loss of coolant accident. The above-mentioned KNN is combined with TCN to construct a method for diagnosing a pressurized water reactor loss of coolant accident based on KNN-TCN, and the rupture location and rupture size of the accident are accurately diagnosed.
[0054] See also Figure 1 The present invention provides a method for diagnosing a pressurized water reactor loss of coolant accident based on KNN-TCN, comprising the following steps:
[0055] S1. Collect corresponding loss of coolant failure data through a pressurized water reactor simulation model;
[0056] The fault data comes from the GPWR model built on the 3KeyMaster platform. The simulation accuracy of the GPWR model has been verified in many studies. The GPWR model is used to simulate the loss of coolant in a pressurized water reactor, and a total of three locations, namely the hot pipe section, the cold pipe section and the pressurizer pipeline, are simulated.
[0057] The extracted data includes 5 different breach size data simulated at 3 different locations. The specific breach sizes are shown in Table 1:
[0058] Table 1. Rupture dimensions at different rupture locations
[0059]
[0060] The unit of breach size is the percentage of breach area to the cross-sectional area of the pipe.
[0061] 500 data are collected for each breach size. The sample data is time series data with a sampling time of 1 s, of which the first 20 s are normal operation data and the last 480 s are accident data.
[0062] A total of 2,500 samples were collected at each breach location, and the extracted thermal-hydraulic parameters included 36 sensor parameter data such as coolant average temperature, regulator pressure, and water supply flow.
[0063] After the simulation data is collected by the PWR model software, preliminary data processing is required, mainly including:
[0064] S101. Data cleaning
[0065] Clean the collected corresponding dehydration fault data, mainly including sample missing value processing and duplicate value processing; adjust the null values that may appear in the data set, and eliminate the erroneous data in the data;
[0066] Check the data for duplicate data and replace or delete them accordingly;
[0067] Ensure data integrity and compliance.
[0068] S102, Data Arrangement
[0069] The cleaned data are summarized and sorted, classified according to different breach locations and breach sizes, and labels are set for different categories of data to build a complete data set.
[0070] S103. Data Standardization
[0071] The purpose of data standardization is to solve the problem that different evaluation indicators in the data set often have different dimensions, resulting in inaccurate data analysis, so that the preprocessed data is limited to a certain range.
[0072] Use min-max normalization, as shown in formula (1):
[0073]
[0074] Through min-max standardization, each column of the data set is standardized according to the attribute value, and the data is normalized to [0, 1].
[0075] S2. Processing data: establishing a data set based on the loss of coolant failure data obtained in step S1, for constructing and testing the KNN algorithm, so as to diagnose the breach location of the loss of coolant accident;
[0076] The data collected and preliminarily processed in step S1 are divided and used for the diagnosis of the breach fault location of the KNN algorithm.
[0077] The KNN algorithm is a very mature machine learning classification algorithm. It has the characteristics of simple calculation method, fast calculation speed and high efficiency, and is widely used in the field of fault diagnosis.
[0078] The basic principle of KNN algorithm is:
[0079] First, calculate the Euclidean distance or cosine similarity between the sample to be classified and the known training sample, and find the K nearest neighbor samples with the shortest distance or the greatest similarity to the sample to be classified;
[0080] Then, the category of the sample to be classified is determined based on the categories of the K nearest neighbor samples; the specific principle is as follows:
[0081] S201. Distance Metrics
[0082] The key to the KNN algorithm is how to measure the distance or similarity between different samples. Common distance measurement methods include Euclidean distance, Manhattan distance, etc. In the KNN algorithm, the choice of distance measurement method is crucial, which determines the similarity between samples. Taking Euclidean distance as an example, in n-dimensional space, two points a(x 1 ,x 2 ,...,x n ) and b(y 1 ,y 2 ,...,y n ) is calculated as follows:
[0083]
[0084] S202, K value selection
[0085] The K value indicates the number of neighbors considered in the prediction process. The determination of the K value has a great relationship with the final judgment result of the sample; the selection of the K value has a great impact on the performance of the algorithm. If the K value is too large, the algorithm may be too complicated and easily affected by noisy data; if the K value is too small, the algorithm may be too sensitive and too sensitive to small changes in local data. Generally, the K value is selected by cross-validation.
[0086] S203, Classification Decision
[0087] After determining the K nearest neighbors of the sample to be predicted, it is necessary to predict the category of the sample to be predicted based on the category labels of these neighbors. In classification problems, the majority voting method is usually used, that is, the category that appears most frequently among the K neighbors is selected as the prediction result. In regression problems, the average method is usually used, that is, the average value of the target attribute values of the K neighbors is calculated as the prediction result.
[0088] The KNN algorithm is selected to diagnose the rupture location of the PWR LOCA. It is necessary to diagnose whether a LOCA has occurred and the rupture location. Therefore, it is necessary to set data labels for the data in step S1 and re-divide the data set.
[0089] There are 4 types of labels: label0, label1, label2, label3, corresponding to no loss of coolant accident, hot pipe section rupture, cold pipe section rupture, and pressurizer rupture, respectively.
[0090] The first 20 seconds of each group of data in step S1 are extracted as data without a loss of coolant accident, and the data of the hot pipe section rupture, the cold pipe section rupture and the stabilizer rupture use the data from 21s to 500s in the five groups of data under the fault.
[0091] The data set is divided in this way, where the label0 data dimension is [300, 36], and the remaining dimensions are [2400, 36]. The constructed data set is used as a KNN learning sample for diagnosing the breach location.
[0092] S3, processing data: establishing a data set based on the loss of coolant fault data obtained in step S1, for training and testing the TCN neural network, so as to diagnose the breach size of the loss of coolant accident;
[0093] The data collected and preliminarily processed in step S1 are divided for diagnosis of the breach fault size of the TCN neural network.
[0094] TCN is a deep learning model for processing time series data. It is based on the idea of convolutional neural network (CNN). It uses causal convolution and dilated convolution to ensure that only historical data is used in prediction and effectively capture long-term dependencies. The advantages of TCN are its training stability and efficiency, its ability to process data in parallel, and its excellent performance in processing long sequences. The main structure of TCN neural network is as follows: Figure 2 shown.
[0095] Figure 2 The basic structure of TCN mainly includes input layer, hidden layer and output layer. 0 ,x 1 ,...,x T ) is the input data sequence, and d is the expansion factor.
[0096] The basic principles of TCN neural network are as follows:
[0097] 1. Causal convolution is one of the core components of TCN. Its characteristic is that causal convolution ensures that at any time point t, the output depends only on the input at time point t and before, and does not depend on the input after t. This means that causal convolution cannot see future data and is a strict time constraint model. The characteristics of causal convolution ensure that the model only uses historical information when predicting, thereby ensuring the causality of the prediction results.
[0098] 2. Dilated convolution, also known as hole convolution, is used to obtain longer dependencies. Compared with ordinary convolution, dilated convolution introduces a dilation rate parameter to increase the receptive field without increasing the number of parameters, thereby capturing a wider range of contextual information. In dilated convolution, the elements in the convolution kernel are no longer elements in directly adjacent positions. Instead, the receptive field is expanded by gradually adding holes (i.e., sampling intervals) in the linearly stacked convolution layers. This can effectively increase the field of view of the convolution layer, thereby better capturing long-range dependencies in the input data.
[0099] 3. Residual connection is an effective method for training deep networks. It allows the network to transmit information across layers, which is used to solve the problem of performance degradation of convolutional neural networks when the number of layers is very deep. Residual connection is introduced in the output layer of TCN to connect adjacent convolutional layers to alleviate the gradient vanishing problem and accelerate the training process.
[0100] This part needs to determine the specific breach size after a loss of coolant accident occurs. Therefore, it is necessary to set data labels for the data in step S1 and re-divide the data set. From step S1, it can be seen that the data extracted are 5 types of breach size data for each breach location. Therefore, the 5 types of breach size data for each type of breach location are divided into 5 categories from small to large, namely label0, label1, label2, label3, label4. After re-dividing the data set, the dimension of each label data is [1440, 1, 36].
[0101] In order to further improve the diagnostic accuracy of TCN, combined with the time series characteristics of the fault data set, the method of setting a fixed-length sliding window is used to segment, train and test the data set, that is, during diagnosis, the data read each time is changed from the original 1s data to multi-second data. The method of the present invention can effectively enhance the data characteristics of time series data and improve the accuracy of the algorithm. The specific method is as follows:
[0102] S301, according to the characteristics of time series data, set the length of the sliding window to T and the width of the window to L;
[0103] S302, on the data set, starting from the initial time, the slider slides forward one time unit (1s) along the time direction each time to obtain the data of the next window;
[0104] S303: The data in each sliding window will be saved as part of the new data set.
[0105] The data set is constructed by the sliding time window method mentioned above, and the window lengths are selected as T = 3s, 5s, and 7s respectively, and the dimensions of the data set are [1434, 3, 36], [1428, 5, 36], and [1419, 7, 36] respectively. The data is used to train the TCN neural network for the diagnosis of the breach size of the loss of coolant accident.
[0106] S4. Based on the KNN algorithm constructed in step S2 and the TCN neural network constructed in step S3, a PWR LOCA diagnosis method based on KNN-TCN is constructed, and the rupture position and rupture size of the LOCA are diagnosed at the same time.
[0107] Combine the KNN and TCN neural networks established in step S2 and step S3 to build a complete PWR LOCA diagnosis framework. The fault diagnosis structure based on KNN-TCN is as follows: Figure 3 shown.
[0108] Figure 3The raw data in the figure are unprocessed data directly generated during operation, with a sampling time of 1 second. The raw data undergoes data cleaning and normalization, and then the data is divided to generate data sets for KNN algorithm to diagnose breach location and TCN neural network to diagnose breach size.
[0109] The present invention can select different weight parameters for TCN neural network diagnosis according to the provided data dimensions, and realize automatic loading of TCN neural networks with different input dimensions (1, 3, 5, 7); the final fault diagnosis conclusion is obtained through decision-making based on the results of the KNN algorithm and the TCN neural network diagnosis; the above method realizes the diagnosis of pressurized water reactor loss of coolant accidents through the KNN-TCN framework.
[0110] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as systems, methods or program products. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits", "modules" or "platforms".
[0111] In yet another embodiment of the present invention, a pressurized water reactor loss of coolant accident diagnosis system based on KNN-TCN is provided. The system can be used to implement the above-mentioned pressurized water reactor loss of coolant accident diagnosis method based on KNN-TCN. Specifically, the pressurized water reactor loss of coolant accident diagnosis system based on KNN-TCN includes a collection module, a KNN module, a TCN module and a diagnosis module.
[0112] Among them, the collection module collects corresponding loss of coolant failure data through the pressurized water reactor simulation model;
[0113] KNN module, which establishes a data set based on the corresponding water loss fault data to build and test the KNN algorithm;
[0114] TCN module, which establishes a data set based on the corresponding water loss fault data for training and testing the TCN neural network;
[0115] The diagnosis module, based on the KNN algorithm and TCN neural network, constructs a PWR LOCA diagnosis method based on KNN-TCN, and diagnoses the rupture location and rupture size of the LOCA accident at the same time.
[0116] In another embodiment of the present invention, a terminal device is provided, the terminal device includes a processor and a memory, the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., which is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used for the operation of the pressurized water reactor loss of coolant accident diagnosis method based on KNN-TCN, including:
[0117] The corresponding loss of coolant failure data are collected through the pressurized water reactor simulation model; a data set is established based on the corresponding loss of coolant failure data for building and testing the KNN algorithm; a data set is established based on the corresponding loss of coolant failure data for training and testing the TCN neural network; based on the KNN algorithm and the TCN neural network, a pressurized water reactor loss of coolant accident diagnosis method based on KNN-TCN is constructed, and the rupture location and rupture size of the loss of coolant accident are diagnosed at the same time.
[0118] In another embodiment of the present invention, the present invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a terminal device for storing programs and data. It is understandable that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and the extended storage medium supported by the terminal device, and can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that more specific examples (non-exhaustive list) of the computer-readable storage medium here include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0119] Computer readable storage media also include data signals propagated in baseband or as part of a carrier wave, which carry readable program codes. Such propagated data signals can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable storage medium can also be any readable medium other than a readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0120] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0121] The processor may load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the pressurized water reactor loss of coolant accident diagnosis method based on KNN-TCN in the above embodiment; the processor may load and execute the following steps of one or more instructions in the computer-readable storage medium:
[0122] The corresponding loss of coolant failure data are collected through the pressurized water reactor simulation model; a data set is established based on the corresponding loss of coolant failure data for building and testing the KNN algorithm; a data set is established based on the corresponding loss of coolant failure data for training and testing the TCN neural network; based on the KNN algorithm and the TCN neural network, a pressurized water reactor loss of coolant accident diagnosis method based on KNN-TCN is constructed, and the rupture location and rupture size of the loss of coolant accident are diagnosed at the same time.
[0123] See also Figure 4 , the terminal device is a computer device, and the computer device 60 of this embodiment includes: a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When the computer program 63 is executed by the processor 61, the method for calculating the composition of fluid in the reservoir transformation wellbore in the embodiment is realized. To avoid repetition, it is not described one by one here. Alternatively, when the computer program 63 is executed by the processor 61, the functions of each model / unit in the calculation system for the composition of fluid in the reservoir transformation wellbore in the embodiment are realized. To avoid repetition, it is not described one by one here.
[0124] The computer device 60 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 60 may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art will appreciate that Figure 4 This is only an example of the computer device 60 and does not constitute a limitation of the computer device 60. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.
[0125] The processor 61 may be a central processing unit (CPU), or other general-purpose processors, central processing units, graphics processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, data processing logic based on quantum computing, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0126] The memory 62 may be an internal storage unit of the computer device 60, such as a hard disk or memory of the computer device 60. The memory 62 may also be an external storage device of the computer device 60, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the computer device 60.
[0127] Furthermore, the memory 62 may include both an internal storage unit of the computer device 60 and an external storage device. The memory 62 is used to store computer programs and other programs and data required by the computer device. The memory 62 may also be used to temporarily store data that has been output or is to be output.
[0128] Any reference to memory, database or other media used in the embodiments provided in the present application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0129] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0130] See also Figure 5 The terminal device 600 is an electronic device, and the electronic device is in the form of a general computing device. The components of the electronic device may include but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.
[0131] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention described in the above method section of this specification. For example, the processing unit 610 can perform the following steps: Figure 1 Follow the steps shown in .
[0132] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0133] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0134] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0135] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, etc.
[0136] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention described and shown in the drawings here can usually be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0137] The proposed KNN-TCN algorithm is verified using the new water loss fault data generated by the GPWR model built on the 3KeyMaster platform. First, the diagnostic effect of the fault location is verified, and the KNN is tested using the constructed data set. The diagnostic results are shown in Table 2:
[0138] Table 2 LOCA location diagnosis effect
[0139]
[0140] Table 2 shows the comparison of the accuracy of using KNN to diagnose the fault breach location with other methods. From the data in the table, it can be seen that the KNN algorithm has a good diagnostic effect. Therefore, KNN is used to diagnose whether a loss of coolant accident occurs and the location of the breach.
[0141] Then the trained TCN neural network was used to test the diagnostic effect of the breach size. The diagnostic results are shown in Table 3:
[0142] Table 3 Diagnosis results of breach size in LOCA
[0143]
[0144] From the data in the table, we know that the use of TCN neural network to diagnose the fault breach position is more accurate than other methods, and the effect is good. Therefore, the TCN neural network combined with the sliding time window is used to diagnose the breach position of the PWR loss of coolant fault. The above two parts of results verify the effectiveness of the PWR loss of coolant accident diagnosis based on the KNN-TCN algorithm.
[0145] In summary, the present invention provides a pressurized water reactor loss of coolant accident diagnosis method and system based on KNN-TCN. The accuracy of the proposed loss of coolant accident diagnosis method is superior to that of several other common fault diagnosis methods in terms of rupture location and rupture size; and the diagnostic accuracy rate of both the rupture location and the rupture size reaches more than 98%, thereby proving the effectiveness and reliability of the pressurized water reactor loss of coolant accident diagnosis method and system based on KNN-TCN.
[0146] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0147] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0148] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0149] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0150] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0151] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0152] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0153] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0154] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0155] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0156] The above contents are only for explaining the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A method for diagnosing a pressurized water reactor loss of coolant accident based on KNN-TCN, characterized in that: The following steps are involved: Collect relevant loss of coolant failure data through the PWR simulation model; A data set is established based on the corresponding water loss fault data to build and test the KNN algorithm; Based on the corresponding water loss fault data, a data set is established to train and test the TCN neural network; Based on the KNN algorithm and TCN neural network, a PWR LOCA diagnosis method based on KNN-TCN was constructed, and the rupture location and rupture size of the LOCA were diagnosed at the same time.
2. The PWR LOCA diagnosis method based on KNN-TCN according to claim 1, characterized in that: The PWR simulation model collects the following data on the corresponding loss of coolant failure: The GPWR model is used to simulate the loss of coolant in a pressurized water reactor. The ruptures in the hot pipe section, cold pipe section and pressurizer pipe are simulated respectively. Five different rupture size data are obtained and processed.
3. The PWR LOCA diagnosis method based on KNN-TCN according to claim 2, characterized in that: The specific processing of the breach size data is as follows: The collected water loss fault data are cleaned, the empty values in the data are adjusted, the erroneous data in the data are eliminated, and the duplicate data are replaced and deleted; then the data are summarized and sorted, classified according to different breach locations and breach sizes, and labels are set for data of different categories to build a complete data set. Then, the complete data set is standardized for each column according to the attribute value through min-max normalization, and the data is normalized to between [0, 1].
4. The PWR LOCA diagnosis method based on KNN-TCN according to claim 3, characterized in that: Cleaning includes sample missing value processing and duplicate value processing.
5. The PWR LOCA diagnosis method based on KNN-TCN according to claim 1, characterized in that: The KNN algorithm is specifically: Calculate the Euclidean distance or cosine similarity between the sample to be classified and the known training samples, and find the K nearest neighbor samples with the shortest distance or the greatest similarity to the sample to be classified; then predict the category of the sample to be predicted based on the category labels of the K nearest neighbor samples.
6. The PWR LOCA diagnosis method based on KNN-TCN according to claim 5, characterized in that: In the process of predicting the category of the sample to be predicted, for classification problems, the majority voting method is used, that is, the category that appears most frequently among the K neighbors is selected as the prediction result; for regression problems, the average method is used, that is, the average value of the target attribute values of the K neighbors is calculated as the prediction result.
7. The method for diagnosing a pressurized water reactor loss of coolant accident based on KNN-TCN according to claim 5, characterized in that: The labels include label0, label1, label2, and label3, which correspond to no loss of coolant accident, hot pipe section rupture, cold pipe section rupture, and pressurizer rupture, respectively. The data dimension of label0 is [300, 36], and the dimensions of label1, label2, and label3 are [2400, 36], respectively.
8. The method for diagnosing a pressurized water reactor loss of coolant accident based on KNN-TCN according to claim 1, characterized in that: Based on the corresponding water loss fault data, a data set is established for training and testing the TCN neural network: According to the characteristics of time series data, the length of the sliding window is set to T and the width of the window is set to L; On the data set, starting from the initial time, the slider slides forward one time unit each time along the time direction to obtain the data of the next window; The data of each sliding window is saved as part of a new dataset, and a dataset is constructed to train and test the TCN neural network.
9. The method for diagnosing a pressurized water reactor loss of coolant accident based on KNN-TCN according to claim 8, characterized in that: The window lengths T=3s, 5s, and 7s are selected to construct the data sets, and the dimensions of the data sets are [1434, 3, 36], [1428, 5, 36], and [1419, 7, 36], respectively.
10. A PWR loss of coolant accident diagnosis system based on KNN-TCN, characterized in that: include: A collection module collects corresponding loss of coolant failure data through a pressurized water reactor simulation model; KNN module, which establishes a data set based on the corresponding water loss fault data to build and test the KNN algorithm; TCN module, which establishes a data set based on the corresponding water loss fault data for training and testing the TCN neural network; The diagnosis module, based on the KNN algorithm and TCN neural network, constructs a PWR LOCA diagnosis method based on KNN-TCN, and diagnoses the rupture location and rupture size of the LOCA accident at the same time.
