Fault Detection and Handling Methods in Hydrogen Production Systems Based on Safety PLC
By using high-frequency sampling and three-dimensional tensor matrix analysis based on a safety PLC, micro-mutation anomalies in the hydrogen production system are identified. Combined with a self-verification model and dynamic response strategy, the problems of low identification rate and response delay of traditional PLC under complex faults are solved, and efficient fault handling and safety control of the hydrogen production system are realized.
Patent Information
- Application Number
- CN202511697625.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-19
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2045-11-19
AI Technical Summary
Traditional PLC control systems suffer from low recognition rates and response delays when faced with multiple concurrent faults, logic anomaly coupling faults, or intermittent sensor false alarms in hydrogen production systems. This makes it difficult to achieve fast and accurate fault handling, leading to accidental shutdowns or safety incidents in the hydrogen production system.
A fault detection method based on a safety PLC is adopted. A three-dimensional tensor matrix is constructed through high-frequency sampling to identify micro-mutation anomaly intervals, construct an anomaly distribution map, extract anomaly edge feature sequences, and perform fault judgment using a self-verification model built into the safety PLC. Dynamic response strategies are implemented, such as channel redundancy replacement and dynamic load cut-off.
It enables accurate perception and fault handling of short-term, multi-parameter, and weakly coupled anomalies in hydrogen production systems, improves the sensitivity of anomaly detection and the system's adaptive response capability, and ensures the fault tolerance and recovery capability of hydrogen production systems under complex operating conditions.
Smart Images

Figure CN121142947B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of safety control technology for hydrogen production systems, specifically to fault detection and handling methods in hydrogen production systems based on safety PLCs. Background Technology
[0002] Hydrogen production systems are widely used in various industrial sectors such as new energy, chemical industry, and metallurgy, and are a core component in realizing the utilization of hydrogen energy. Their operation involves high temperatures, high pressures, and flammable and explosive gases, requiring extremely high safety standards. In recent years, with the continuous growth in demand for green energy, hydrogen production systems have developed towards larger scale, automation, and intelligence, with PLCs (Programmable Logic Controllers) serving as the system control center and being widely deployed at key control points.
[0003] Traditional PLC control systems mostly use ordinary industrial-grade PLCs. Although they have certain logic judgment and control capabilities, they suffer from problems such as low recognition rate, response delay, and inconsistent processing strategies when faced with complex situations such as multi-point concurrent faults, logic abnormal coupling faults, or intermittent sensor false alarms. This can easily lead to accidental shutdown of the hydrogen production system, process disturbances, or even safety accidents.
[0004] Especially in the electrolysis unit module of hydrogen production, the core sensors include electrolysis voltage, electrolysis current, temperature, gas purity, flow rate, etc. Once there is a sudden change in data or it is inconsistent with the logical operation trend, it may be caused by temporary sensor failure, control logic deviation, actuator lag or other complex system failures. If it cannot be judged and dealt with in time, it will cause the entire hydrogen production system to enter an emergency shutdown state, resulting in huge economic losses.
[0005] In addition, the data coupling between different modules of the hydrogen production system is high. For example, a sudden change in the outlet pressure of the gas-liquid separator may simultaneously affect the feed control of the electrolyzer and the cooling water regulation. Traditional PLCs are unable to complete the multi-signal correlation judgment within milliseconds, resulting in misjudgment or missed judgment. Summary of the Invention
[0006] The purpose of this invention is to provide a fault detection and handling method for a hydrogen production system based on a safety PLC, so as to overcome the shortcomings in the prior art.
[0007] To achieve the above objectives, the present invention provides the following technical solution: a fault detection and handling method for a hydrogen production system based on a safety PLC, comprising:
[0008] S100: Collect a set of multiple key parameter signals P during the operation of the hydrogen production system, and form an original signal sequence P(t) with a time resolution of Δt through instantaneous high-frequency sampling;
[0009] S200. Perform continuous sliding window feature extraction on P(t), construct a three-dimensional tensor matrix F, and identify the micro-mutation anomaly interval Z from F;
[0010] S300. Map Z to the parameter-time state space, construct an anomaly distribution map, and reconstruct its boundary layer to extract the anomaly edge feature sequence B(t), including the number of local phase transition points, mean shift magnitude, and cooperative fluctuation index.
[0011] S400: In the self-verification model built into the safety PLC, based on the matching degree R between the current B(t) and the pre-trained normal behavior feature library, determine whether an atypical micro-mutation abnormal state has been triggered; if the matching degree R is lower than the safety threshold λ, proceed to S500.
[0012] S500: Construct the operation link L in the safety PLC logic processing unit, analyze the trigger-response path between parameters, and calculate the correlation with the ideal control link. The offset ΔL; if ΔL exceeds the set coupling threshold, it is determined to be a coupling failure; otherwise, it is determined to be an abnormal parameter isolation offset.
[0013] S600 invokes the graded response strategy library according to the fault type, including performing signal filtering and channel redundancy replacement for isolated parameter offset anomalies; and implementing at least two combined actions such as dynamic load cut-off, backup hydrogen supply switching, emergency cooling of the cooling system, or data rollback for coupled faults.
[0014] S700: Feedback data processed by S600 back to matrix F. If the abnormal interval Z disappears and ΔL tends to stabilize, maintain the current strategy; if the abnormality reappears, record the event and perform secondary intervention.
[0015] Preferably, the set of multiple key parameter signals P includes the electrolysis voltage, electrolysis current, and cell temperature in the electrolysis cell module; the outlet pressure, gas-liquid ratio, and purity factor in the hydrogen separation module; and the water flow rate and temperature difference in the cooling module.
[0016] Preferably, the three-dimensional tensor matrix F has a dimension of n×m×Δt, where n is the number of signal channels and m is the number of statistical features within each channel window;
[0017] The micro-mutation anomaly interval Z satisfies the condition that the local mutation amount Δpi is a time segment above the preset mutation rate threshold η, and its continuous time length is less than the control period Tc.
[0018] Preferably, the step of mapping Z to the parameter-time state space and constructing an anomaly distribution map includes: based on the mutation amount corresponding to each channel in Z. and its time index Generate parameter-time coordinate point set The Q value is normalized, and a weighted Gaussian kernel density estimation method is used to fit the probability distribution of outliers to obtain a continuous anomaly density function. x represents the magnitude of change, and t represents time; based on The peak interval of anomaly intensity is identified by the rate of change of the first derivative along the time axis, and the boundary contour of the anomaly distribution is extracted to form a two-dimensional anomaly distribution map. .
[0019] Preferably, the abnormal edge feature sequence B(t) is extracted, including the number of local phase transition points, the mean shift magnitude, and the co-oscillation index, including:
[0020] The Sobel operator is applied to E(x,t) to extract the boundary gradient, and the nonmaximum suppression algorithm is combined to extract the boundary curve Γ(t);
[0021] The number of local phase transition points Np is calculated based on the rate of change of curvature on Γ(t), and is defined as the count of continuous positive and negative curvature reversal regions.
[0022] Select regions of equal width both inside and outside the boundary of Γ(t), and calculate their mean values respectively. , and define the mean offset magnitude. ;
[0023] Extract the variation trend of multi-channel signals adjacent to Γ(t), construct the cooperative fluctuation space based on principal component analysis, and calculate the cooperative fluctuation index Ds.
[0024] Preferably, the matching degree R between the current B(t) and the pre-trained normal behavior feature library includes:
[0025] A sample library Tn of abnormal edge features under normal operating conditions is pre-constructed, with the sample dimension consistent with B(t);
[0026] Based on the Euclidean distance algorithm, the similarity between the current feature sequence B(t) and each sample in Tn is calculated, and the matching degree R corresponding to the minimum distance is taken.
[0027] R is compared with the set safety threshold λ. If R is greater than λ, it is determined to be an atypical micromutation anomaly.
[0028] Preferably, the step of constructing the operation link L in the safety PLC logic processing unit, analyzing the trigger-response path between parameters, and calculating the offset ΔL from the ideal control link L0 includes:
[0029] Based on the order of responses and triggering dependencies of each parameter Pi in the current cycle, construct the running link L, which is represented as a directed graph structure G;
[0030] Pre-configure the ideal control link in the configuration file This indicates the standard trigger path between parameters under normal operating conditions;
[0031] The topology matching algorithm is used to calculate L and The structural difference ΔL between them includes node order offset and edge connection variation rate.
[0032] Preferably, the step of feeding back the processed feedback data to matrix F includes:
[0033] Collect the real-time values of each key parameter after executing S600 and construct a new time series P′(t), and update the tensor matrix F′ based on the same sliding window extraction method;
[0034] Re-identify the abnormal interval Z′ in F′. If Z′ is empty, it means that the abnormal behavior has been eliminated.
[0035] Calculate the current running link L′ and compare it with the ideal link. The comparison yields a new structural offset ΔL′;
[0036] If Z′ is empty and ΔL′ is below the stability threshold, then maintain the current response strategy.
[0037] The technical effects and advantages provided by the present invention in the above technical solution are as follows:
[0038] 1. This invention provides a fault detection and processing method for hydrogen production systems based on a safety PLC. By constructing a multi-dimensional feature tensor, identifying micro-mutation anomaly intervals, modeling anomaly distribution maps, reconstructing boundary layers, and extracting features, it achieves accurate perception of short-term, multi-parameter, and weakly coupled anomalies that are difficult to identify using traditional methods. Compared to existing solutions that rely solely on threshold judgment or single-point monitoring, this invention significantly improves the sensitivity of anomaly detection, the expressive power of system modeling, and the structural integrity of diagnostic logic. It is particularly suitable for the early identification and classification management of latent faults in high-safety-level hydrogen production systems.
[0039] 2. This invention achieves closed-loop control and adaptive response for fault handling by integrating a self-verification model, operational link structure offset analysis, and hierarchical response strategy library within a safety PLC. This method not only dynamically adjusts the response path based on the fault type (such as channel redundancy replacement or linked disconnection), but also supports continuous judgment and feedback correction of abnormal states, ensuring that the control system possesses fault tolerance, recovery, and manual takeover mechanisms when facing complex operating conditions. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0041] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0043] For examples, please refer to Figure 1 As shown in this embodiment, the fault detection and handling method in the hydrogen production system based on a safety PLC includes:
[0044] S100: Collect a set of multiple key parameter signals P during the operation of the hydrogen production system, and form an original signal sequence P(t) with a time resolution of Δt through instantaneous high-frequency sampling;
[0045] S200. Perform continuous sliding window feature extraction on P(t), construct a three-dimensional tensor matrix F, and identify the micro-mutation anomaly interval Z from F;
[0046] S300. Map Z to the parameter-time state space, construct an anomaly distribution map, and reconstruct its boundary layer to extract the anomaly edge feature sequence B(t), including the number of local phase transition points, mean shift magnitude, and cooperative fluctuation index.
[0047] S400: In the self-verification model built into the safety PLC, based on the matching degree R between the current B(t) and the pre-trained normal behavior feature library, determine whether an atypical micro-mutation abnormal state has been triggered; if the matching degree R is lower than the safety threshold λ, proceed to S500.
[0048] S500: Construct the running link L in the safety PLC logic processing unit, analyze the trigger-response path between parameters, and calculate the offset ΔL from the ideal control link L0; if ΔL exceeds the set coupling threshold, it is determined to be a coupling fault, otherwise it is determined to be an abnormal parameter isolation offset.
[0049] S600 invokes the graded response strategy library according to the fault type, including performing signal filtering and channel redundancy replacement for isolated parameter offset anomalies; and implementing at least two combined actions such as dynamic load cut-off, backup hydrogen supply switching, emergency cooling of the cooling system, or data rollback for coupled faults.
[0050] S700: Feedback data processed by S600 back to matrix F. If the abnormal interval Z disappears and ΔL tends to stabilize, maintain the current strategy; if the abnormality reappears, record the event and perform secondary intervention.
[0051] In this invention, step S100 is used to collect a set of multiple key parameter signals P during the operation of the hydrogen production system, and to form an original signal sequence P(t) with a time resolution of Δt through instantaneous high-frequency sampling. In this embodiment, the hydrogen production system typically includes, but is not limited to, the following functional modules: an electrolyzer module, a hydrogen separation module, and a cooling module.
[0052] In this embodiment, the following core operating parameters are collected from the above modules to form a parameter signal set P:
[0053] Electrolytic cell module: Collects electrolysis voltage, electrolysis current and cell temperature. These parameters can directly reflect the energy input and thermodynamic state of the electrolysis reaction.
[0054] Hydrogen separation module: Collects outlet pressure, gas-liquid ratio and purity factor of produced gas to monitor hydrogen production efficiency, gas-liquid separation status and downstream hydrogen supply safety;
[0055] Cooling module: Collects cooling water flow rate and inlet / outlet temperature difference to reflect heat exchange efficiency and potential cooling capacity degradation issues.
[0056] To identify subtle, abnormal changes that are difficult to detect under normal control cycles, this invention further employs a sampling frequency significantly higher than the normal control cycle to instantaneously sample each signal channel in the parameter set P. Specifically, the sampling frequency is set to be more than three times the main cycle of the control system, thereby achieving high temporal resolution capture of the system's operating state.
[0057] The signals from each channel are sampled synchronously according to a unified time base to generate an original signal sequence P(t) with a time resolution of Δt, where Δt is much smaller than the minimum control response time Tc of the hydrogen production system.
[0058] The final P(t) is a multidimensional time series data structure with time as the horizontal axis and signal channel as the vertical axis.
[0059] In this invention, step S200 is used to perform continuous sliding window feature extraction on P(t), construct a three-dimensional tensor matrix F, and identify the micro-mutation anomaly interval Z from F, specifically including:
[0060] Let P(t) be a multidimensional time series data containing n channels. Each channel signal This corresponds to a key parameter in a hydrogen production system, such as voltage, current, and temperature. For each signal channel... A fixed-length sliding window W slides along the time axis, and multiple statistical features are extracted within each window, including but not limited to: window mean. Window variance First derivative mean Higher-order features such as kurtosis, skewness, and energy spectral density can be selected.
[0061] Through the above process, a statistical feature vector for each channel at each time slice is constructed. The sliding window feature results of n channels, m features, and Δt time points are organized into a three-dimensional tensor matrix F, defined as: Where: n represents the number of signal channels, m represents the number of statistical features per channel, and t represents the sliding window step size, i.e., the total number of frames sampled by the window in the time dimension. This tensor F reflects the joint evolution behavior of the system among multiple parameters at a fine-grained time scale, and can be used for high-dimensional feature identification of anomalous behavior.
[0062] After the tensor F is constructed, this invention further proposes a method for identifying micro-mutation anomaly regions based on local mutation amount detection, the core of which is:
[0063] For each feature dimension in F, calculate the difference between consecutive frames in the time dimension. And compare it with the corresponding feature dimension's variation rate threshold η, if it satisfies If so, then that time frame is marked as a suspicious mutation point.
[0064] This invention further introduces a definition standard for the micromutation anomalous interval Z, including:
[0065] The number of consecutive mutation points is no less than r (e.g., 3 frames); the total duration does not exceed the control cycle Tc of the main control system. Therefore, the micro-mutation anomaly interval Z is defined as a set of time segments that satisfy the above conditions. .
[0066] In this invention, step S300 is used to map Z to the parameter-time state space, construct an anomaly distribution map, reconstruct its boundary layer, and extract the anomaly edge feature sequence B(t), including the number of local phase transition points, mean shift magnitude, and cooperative fluctuation index.
[0067] The construction of anomaly distribution maps involves spatial mapping and density analysis of the anomalous points contained in the micromutation anomalous interval Z to reveal the local clustering, evolution direction, and scope of influence of the anomalous points.
[0068] First, from the micro-mutation anomaly intervals Z identified in the aforementioned three-dimensional tensor matrix F, the mutation amount Δpᵢ corresponding to each channel and its time index at the i-th anomaly point in the time series are extracted. Mutation amount This refers to the magnitude of parameter change within a continuous time window, defined as the absolute value of the difference between the current window's feature value and the previous window's. For example, for channel i, at time point t, its abrupt change is calculated as follows: ; group all outliers into pairs Organized in the form of parameter-time coordinate point set Q, we obtain the following form: Where k is the total number of outliers in Z, and t k Index the position of each mutation on the timeline.
[0069] To eliminate numerical scale differences between different parameter channels and improve the consistency and stability of modeling, all parameters in Q are... The values are normalized. The normalization method used is min-max normalization, i.e.: In the formula, Indicates the minimum mutation amount. The maximum mutation amount is represented; the treated Q is converted to Q′, where the Δp value is limited to [0,1] to maintain comparability between parameters.
[0070] Next, density modeling is performed on the outliers in Q′. The weighted Gaussian kernel density estimation (KDE) method is used to fit the probability distribution of the outliers in the parameter-time plane. The kernel density function ρ(x,t) is defined as: ;in, This represents a two-dimensional Gaussian kernel function with bandwidth h. These are the weighting coefficients for the corresponding outliers. In this embodiment, The default value can be set to 1, or by... Weighted allocation; This represents the time index of the i-th anomaly. Using this density function ρ(x,t), a continuous two-dimensional anomaly density map can be obtained, with the horizontal axis representing the parameter variation magnitude x and the vertical axis representing time t. The function value indicates the density or clustering intensity of anomalies within the region.
[0071] Calculate the first derivative of ρ(x,t) in the time dimension, i.e. By analyzing the rate of change of ρ(x,t) over different time periods, regions of abnormal intensity growth can be identified. If the derivative value continues to rise and exceeds a set threshold θ, it indicates that the region is the peak interval of abnormal intensity.
[0072] In the density function plot, using ρ(x,t) as the grayscale image, a contour extraction algorithm is employed to obtain its boundary contour. The contour lines represent the iso-boundaries of the anomaly density function, indicating the trend of anomalous behavior evolving from the background region to the core region. The extracted contour lines are defined as follows: Where c is the density threshold constant, representing the judgment boundary of the high-risk area. Its value can be dynamically determined based on historical training data or set empirically, for example, taking the 90th percentile of ρ. The final E(x,t) is the anomaly distribution map, whose geometric boundary structure can reflect the expansion range, changing trend and focusing direction of the current anomaly state.
[0073] After obtaining the anomaly distribution map E(x,t), in order to achieve in-depth analysis of the anomaly structure, representative feature values are extracted from its boundary layer to form an anomaly edge feature sequence B(t), which includes the following three key indicators: number of local phase transition points, mean shift amplitude, and cooperative fluctuation index.
[0074] First, E(x,t) is treated as a two-dimensional grayscale image, and its boundaries are extracted. The Sobel operator is used to perform gradient detection on the image, obtaining the direction and intensity information of edge pixels. Then, a non-maximum suppression algorithm is used to filter the gradient response, retaining the most salient local edges, forming the boundary curve Γ(t). This curve describes the edge change trajectory of the anomaly density over time.
[0075] Curvature analysis is performed along the trajectory of Γ(t). Curvature changes are used to characterize the "inflection point" structure of the boundary line, i.e., sudden jumps in anomalous behavior. A phase transition point is defined as the location where the curvature sign reverses. By analyzing the curvature K(t) of Γ(t) at each point, if the signs of K(t) differ between two consecutive time points (from positive to negative or from negative to positive), it is recorded as a phase transition. A local sliding window is defined, and the number of phase transitions occurring within it is counted, denoted as the number of local phase transition points Np.
[0076] On both sides of the Γ(t) boundary line, take the inner and outer regions with equal-width time windows (e.g., extend the boundary line 10 time units to the left and 10 time units to the right respectively), and calculate the average value of the anomaly density function within each region. and The mean offset Δμ is defined as the absolute value of the difference between the means of two regions, i.e. The larger the value of Δμ, the greater the difference in abnormal states on both sides of the boundary, and the clearer the abnormal boundary.
[0077] Finally, to analyze the linkage between abnormal states across multiple parameter channels, feature vector sequences of all channels in the original tensor F are extracted within the time segment corresponding to the Γ(t) boundary.
[0078] Based on the principal component analysis (PCA) method, the dimensionality of these channel feature vectors is reduced, and the contribution rate of the first principal component is extracted as the co-variability index Ds, which is used to measure the consistency of the changing trends of multiple channels during abnormal periods.
[0079] Specifically, the co-variance index Ds is calculated as follows: ;in The eigenvalues of the first principal component are... It is the sum of the eigenvalues of all principal components. The closer Ds is to 1, the more synchronized the fluctuations between channels are, and the higher the degree of abnormal coupling.
[0080] In this invention, step S400 is used to determine whether an atypical micro-mutation abnormal state is triggered based on the matching degree R between the current B(t) and the pre-trained normal behavior feature library in the self-verification model built into the safety PLC; if the matching degree R is lower than the safety threshold λ, proceed to S500.
[0081] First, during the initial deployment phase or the stable operation phase of the system, operational data under multiple operating conditions is collected over a long period, and the corresponding abnormal edge feature sequences B(t) are extracted to form a set of historical samples representing the normal operating state, defined as the normal feature sample library Tn. Each sample Tnⱼ in the sample library contains values in the following three dimensions: the number of local phase transition points Np; the mean offset magnitude Δμ; and the cooperative fluctuation index Ds. Each sample can be represented as a three-dimensional vector: Where N is the total number of samples in the sample library. To improve coverage, Tn should cover as many parameter combinations and control response scenarios as possible under normal operation, which can be obtained through experimental data collection or simulation model generation.
[0082] After identifying the abnormal distribution map E(x,t) and completing the boundary layer reconstruction, the abnormal edge feature sequence B(t) at the current time is extracted. Its dimension is exactly the same as that of the samples in Tn, and it is also represented as a three-dimensional vector: ;in: This represents the number of phase transition points on the current abnormal boundary curve Γ(t); The magnitude of the mean shift inside and outside the boundary; This is a multi-channel coordinated fluctuation index. This vector serves as an anomalous structural representation of the current system state and is used for matching analysis with a normal feature library.
[0083] To measure the similarity between current features and normal behavior, this invention uses the Euclidean distance algorithm as the feature matching degree calculation model. The Euclidean distance is defined as the geometric distance between two sample points in the feature space, and the specific formula is as follows: The above distance calculation is performed on each sample in the sample database Tn. The above process yielded a total of N matching degree values. The minimum value Rmin is taken and defined as the optimal matching degree between the current feature sequence B(t) and the normal sample library Tn, that is: The matching degree R can be understood as the distance between the current abnormal state and the historical normal state. The smaller the value, the more similar the two states are, and the larger the value, the further the two states deviate from the normal state.
[0084] This invention introduces a safety threshold λ as a criterion for distinguishing between normal fluctuations and atypical abnormal states. The threshold λ can be determined in one of two ways:
[0085] Empirical threshold setting: The distribution of matching degree R is statistically analyzed by manually observing historical data, and the upper limit of the 95% confidence interval is taken as λ;
[0086] Adaptive threshold learning: The discrimination boundary is trained from normal and abnormal labeled samples through a machine learning model, and the λ value is dynamically generated.
[0087] Once the current matching degree R is detected to be greater than the safety threshold λ, it is determined that: if R > λ, it is an atypical micro-mutation abnormal state; that is, the abnormal edge characteristics of the current system have obviously deviated from the normal operation state. Although it does not show a high amplitude mutation, it has an abnormal evolution trend and needs to enter the next stage of S500 response strategy matching and handling process.
[0088] In this invention, step S500 is used to construct the running link L in the safety PLC logic processing unit, analyze the trigger-response path between parameters, and calculate the offset ΔL from the ideal control link L0; if ΔL exceeds the set coupling threshold, it is determined to be a coupling fault, otherwise it is determined to be an abnormal parameter isolation offset.
[0089] During each control cycle, key parameters are collected. The change response timestamps and trigger event sources are used to extract the trigger-response relationships between parameters. Based on the temporal sequence and causal relationship of parameter changes, the operational chain L within the current cycle is constructed, formalized as a directed graph structure G=(V,E), where: the node set V represents the parameter set Pi; the edge set E represents the control path where the preceding parameter triggers the subsequent parameter (i.e., Pi→Pj means that the change of Pi causes the response of Pj). The edge is generated according to the following rule: if parameter Pi undergoes a sudden change at time t1, and Pj responds after a short time window Δt; and there is a configuration logic or physical control path between them; then a directed edge (Pi→Pj) is added to graph G. This graph G is the real-time operational chain L for this cycle, used to describe the actual trigger-response logic chain occurring in the hydrogen production system.
[0090] During the deployment or commissioning phase, a set of ideal control links is preset using the logical sequence in the process logic diagram or PLC control program. This represents the standard trigger-response path that should be followed between parameters Pi under normal operating conditions, also expressed in the form of a directed graph. Among them: node set The set of theoretical parameters, consistent with V; edge set This represents the triggering sequence in a normal logical chain (e.g., changes in electrolysis current should precede increases in hydrogen production flow rate, and adjustments to cooling water flow rate should lag behind increases in electrolyzer temperature, etc.). This is the chain diagram. Stored in the PLC configuration file or safety policy module, it serves as a benchmark model for judging differences in the current operating link.
[0091] To measure the difference between the current running link L and the ideal link To address the structural differences between the two graphs, this invention introduces a topology matching algorithm to calculate the structural offset ΔL between them, comprehensively reflecting the following two types of offset factors:
[0092] Using topological sorting algorithms (such as Kahn's algorithm), sort L and L respectively. Performing topological sorting yields two sets of parameter response order sequences: ; The Spearman rank correlation coefficient or the longest common subsequence algorithm is used to calculate SL and The degree of offset between them yields the node sequence offset index. .
[0093] Edge connection variation rate, used to compare graph L with graph L. Middle edge set E and The degree of difference is defined as follows: if an edge exists in L, but... If an edge does not exist in the given information, it is considered a newly added edge; if an edge is in the given information... An edge exists in L but is missing in L; this is denoted as a lost edge. The edge connection mutation rate... Defined as: =(Number of newly added edges + Number of lost edges) / Total number of standard edges;
[0094] Ultimately, the structural offset ΔL is determined by... and The weighted combination calculation yields the following expression: ; where α and β are empirical coefficients, which can be set according to the system’s sensitivity to sequence offset and connection offset. Generally, α=0.6 and β=0.4 can be taken.
[0095] This invention sets a coupling threshold δ as the upper limit tolerance of ΔL to determine whether a link-level anomaly exists. The threshold δ can be set in the following ways: based on the maximum value of ΔL during historical normal operation, or by inversely deriving the acceptable range of ΔL through the system security level and response requirements.
[0096] When the calculated ΔL satisfies the following conditions: ΔL≥δ: it is determined to be a coupling fault, that is, a structural anomaly occurs in the trigger-response link between parameters; ΔL<δ: it is determined to be an isolated parameter offset anomaly, that is, a local offset but the overall link has not been disturbed.
[0097] In this invention, step S600 is used to call the graded response strategy library according to the fault type, including performing signal filtering and channel redundancy replacement for isolated parameter offset anomalies; and implementing at least two combined actions such as dynamic load cut-off, backup hydrogen supply switching, emergency cooling of the cooling system, or data rollback for coupled faults.
[0098] The response strategy library is organized in a modular structure, with each strategy type stored as a response unit. The library structure is as follows: Each strategy unit Si contains the following fields: triggering conditions (such as exception type label, ΔL size, fault channel ID); response level (Level 1~3); and execution action set Ai= n represents the total number of actions to be executed; priority weight (used for conflict strategy filtering); action execution verification flag (used for closed-loop confirmation); the library file is pre-deployed in the safety PLC and supports online updates and manual reconfiguration to adapt to different working conditions or business rule adjustments.
[0099] After executing step S500, the current anomaly is determined to be a parameter isolated offset anomaly (i.e., ΔL is lower than the set coupling threshold δ), indicating that the anomaly source may be limited to a certain channel or submodule, and the overall system control link has not been disrupted. At this time, the present invention adopts a lightweight fault-tolerant strategy, which mainly includes the following two types of response actions:
[0100] Signal filtering: For sudden offset signals with a high false alarm probability or caused by noise interference, a sliding median filter or Kalman filter is used to filter out the current abnormal channel signal. The filter parameters can be dynamically adjusted according to the signal change rate. For example, for the parameter pi(t), a 5-point sliding median filter is used: the output value is the median of the past 5 sampling points pi'(t); if the offset amplitude Δpi is less than the set perturbation threshold ε, the abnormal label of the channel is suppressed.
[0101] Channel redundancy replacement: When a sensor channel is confirmed to be persistently abnormal while other channels are normal, the system will automatically activate the corresponding redundant channel or backup sensor. The execution method is as follows: Check if there is a backup channel pi′ bound to the abnormal channel pi; if the pi′ data is stable, satisfying the stability criterion S (e.g., standard deviation)... If the drift rate is <τ), then replace the input pi with pi′; and recalculate the tensors F and B(t) to complete the local feature self-repair.
[0102] When the current ΔL is determined to be greater than or equal to the coupling threshold δ, and a coupling fault is identified, it indicates that the anomaly has affected multiple control paths or triggered logical link disorder. A coordinated strategy combination must be implemented to prevent the fault from propagating. This invention designs the following multi-strategy combination action set, and the response process executes at least two of the following strategies:
[0103] Dynamic load disconnection: Immediately disconnects downstream load modules that are coupled with the current abnormal channel; the disconnection signal controls the high-voltage power-off equipment through the relay output port or DO module; the load status is buffered or switched to a buffer power supply before disconnection.
[0104] Switching to the backup hydrogen supply channel: Check if a backup hydrogen supply system is configured (such as high-pressure cylinder group, external hydrogen supply pipeline); if so, close the main hydrogen production path valve and switch to the backup channel; start the backup hydrogen supply pump / pressure regulating device to maintain a stable downstream hydrogen supply and prevent system shutdown.
[0105] Emergency cooling of the cooling system: If the abnormality is related to the temperature of the electrolytic cell or the cooling efficiency decreases, the emergency cooling mode is triggered; the emergency cooling valve group is opened to increase the cooling water flow and lower the set temperature; if the main cooling system is saturated, the emergency cooling device (such as the air-cooled module) is activated.
[0106] Data status rollback and locking: Automatically rollback the current PLC program status and key parameter snapshots to restore the stable configuration before the anomaly; simultaneously lock the control permissions of the affected modules, retaining only the manual confirmation channel; and generate a fault snapshot log for post-event analysis and tracing. The above strategies can be triggered in combinations according to levels. Response levels can be defined as follows: Level 1 (Minor Anomaly): Only enable redundancy replacement or short-term filtering; Level 2 (Moderate Coupling): Enable load shedding + cooling strategy; Level 3 (Severe Coupling): Enable backup system + data rollback + manual intervention.
[0107] In this invention, step S700 is used to feed back the feedback data processed in S600 to matrix F. If the abnormal interval Z disappears and ΔL tends to stabilize, the current strategy is maintained; if the abnormality reappears, the event is recorded and secondary intervention is performed.
[0108] Immediately after the S600 strategy is executed, a feedback evaluation mechanism is activated to collect real-time values of various key parameters affected by the execution actions (such as electrolysis current, tank temperature, flow rate, cooling water pressure, etc.). The set of parameters collected during this stage is denoted as: ;in: This represents the parameter value of channel i at time t after the response strategy is executed; t represents the time series from the start time of feedback evaluation to the current time.
[0109] To ensure consistency with the aforementioned processing, the sampling frequency, channel dimensions, and sliding window structure remain consistent with the initial modeling stage. That is, in the same manner as the original tensor matrix F, a fixed-length sliding window W′ is used to continuously extract features from P′(t). The statistical features extracted within each window include the mean, variance, and the mean of the first derivative. Finally, the updated tensor matrix F′ is constructed, with the following dimensions: Where: n is the number of signal channels; m is the number of statistical features extracted in each channel; ts is the number of window steps in the current feedback cycle.
[0110] Anomaly interval identification is performed on F′, using the same mutation amount judgment logic as in the initial stage: for any channel Calculate the feature changes between its continuous windows. ;like If the variance rate is greater than the preset threshold η and the continuous time length is less than the control period Tc, it is marked as an anomaly; all anomalies constitute a new set of anomaly intervals Z′. The judgment criteria are as follows:
[0111] If Z′ is an empty set, it means that the abnormal behavior has been eliminated by the policy, and the current system can be considered to have returned to a stable state. Whether Z′ is empty is the first criterion for maintaining or upgrading the policy.
[0112] Furthermore, to ensure that anomalies are suppressed not only at the signal level but also that the overall system control logic structure remains unchanged, this invention remodels the trigger-response relationship within the latest feedback data cycle, constructing the operational link L′. The steps are as follows:
[0113] Based on the relationship between parameter response order and time delay, from Constructing a directed graph This indicates the currently running link. ;node Indicates parameter channels, edges Indicates the trigger response path; and the preset ideal link. Perform a structural comparison, calculate the link offset ΔL′, and use the same combined offset metric: ;in: Indicates the offset in the node topological sorting; This represents the offset of the edge connection structure; α and β are weighting coefficients, defined in the same way as described above, typically α=0.6 and β=0.4. This ΔL′ reflects whether the current control link has been restored to the standard path.
[0114] Based on the two core indicators Z′ and ΔL′ mentioned above, a judgment is made on whether the response strategy should be maintained: If empty and Below the stability threshold ε (usually set by engineering experience, such as...) If the value is less than 0.1, it indicates that the current anomaly has been eliminated, the structure has stabilized, the S600 strategy remains unchanged, and normal operation has resumed. Non-empty or Δ If the abnormal behavior recurs or the structural deviation has not yet converged, the following actions will be taken: record the current state snapshot and abnormal feature value into the system log; mark the abnormality as a recurring abnormal event; and automatically invoke the predefined secondary intervention mechanism, which may include manual review, enabling the upper-level redundant system to take over control, or switching to the extreme protection mode (Level 3).
[0115] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for fault detection and its handling in a hydrogen production system based on a safety PLC, characterized in that: The method comprises the following steps: S100, collecting a plurality of key parameter signal sets P in the running process of a hydrogen production system, and forming an original signal sequence P(t) with a time resolution of Δt through instantaneous high-frequency sampling; S200, performing continuous sliding window feature extraction on P(t) to construct a three-dimensional tensor matrix F, and identifying a micro-mutation abnormal interval Z from F; S300, mapping Z to a parameter-time state space to construct an abnormal distribution atlas, and performing boundary layer reconstruction on the abnormal distribution atlas to extract an abnormal edge feature sequence B(t), including a local phase change point number, an average offset amplitude, and a cooperative fluctuation index, wherein the step of extracting the abnormal edge feature sequence B(t) comprises: applying a Sobel operator to a two-dimensional abnormal distribution atlas E(x, t) to extract a boundary gradient, and combining a non-maximum suppression algorithm to extract a boundary curve Γ(t); calculating the local phase change point number Np based on the curvature change rate on Γ(t), which is defined as the count of continuous positive and negative curvature inversion regions; Selecting equal-width regions inside and outside the Γ(t) boundary, respectively calculating their mean values , , and defining the mean value offset amplitude ; extracting a multi-channel signal change trend adjacent to Γ(t), constructing a cooperative fluctuation space based on principal component analysis, and calculating a cooperative fluctuation index Ds; S400, in a self-checking model built in a safety PLC, judging whether an atypical micro-mutation abnormal state is triggered based on a matching degree R between the current B(t) and a pre-trained normal behavior feature library; if the matching degree R is greater than a safety threshold λ, proceeding to S500; S500, constructing a running link L in the safety PLC logic processing unit, analyzing the trigger-response path between parameters, and calculating the offset AL of the ideal control link ; if the AL exceeds the set coupling threshold, it is determined as a coupling fault, otherwise it is determined as a parameter isolated offset anomaly; S600, calling a hierarchical response strategy library according to a fault type, including performing signal filtering and channel redundancy replacement for a parameter isolated offset abnormality, and implementing at least two combined actions of dynamic load cutting, standby hydrogen supply switching, emergency cooling of a cooling system, and data rollback for a coupling fault; S700, feeding back the feedback data processed in S600 to the matrix F again, and if the abnormal interval Z disappears and ΔL tends to be stable, maintaining the current strategy; if the abnormality reappears, recording the event and performing secondary intervention, wherein the feedback data processed in S600 is fed back to the matrix F again to judge the effectiveness of the current response strategy in a closed loop, which comprises the following steps: collecting real-time values of each key parameter after S600 is performed and constructing a new time sequence P'(t), and updating the tensor matrix F' based on the same sliding window extraction method; re-identifying an abnormal interval Z' in F', and if Z' is empty, it indicates that the abnormal behavior has been eliminated; The current running link L' is calculated and compared with the ideal link The new structure offset ΔL' is obtained by comparison; if Z' is empty and ΔL' is lower than a stable threshold, the current response strategy is maintained.
2. The method of fault detection in a safety PLC based hydrogen generation system and its handling as claimed in claim 1 wherein: The plurality of key parameter signal sets P include an electrolysis voltage, an electrolysis current, and an in-tank temperature in an electrolytic cell module, an outlet pressure, a gas-liquid ratio, and a purity factor in a hydrogen separation module, and a water flow rate and a temperature difference in a cooling module.
3. The method of fault detection in a safety PLC based hydrogen generation system and its handling as claimed in claim 1 wherein: The three-dimensional tensor matrix F has a dimension of n×m×Δt, wherein n is the number of signal channels, and m is the number of statistical features in each channel window; The micro-mutation abnormal interval Z satisfies a time sequence segment in which a local mutation amount Δpi is above a preset variation rate threshold η, and a continuous time length of which is less than a control period Tc.
4. The method for fault detection in a safety PLC based hydrogen generation system and its handling as claimed in claim 1 wherein: The mapping of Z to a parameter-time state space, construction of an anomaly distribution atlas, comprises: according to the mutation variables corresponding to each channel in Z and the time index thereof , a parameter-time coordinate point set is generated ; Q is normalized and a weighted Gaussian kernel density estimation method is used to fit the probability distribution of the abnormal points to obtain a continuous anomaly density function , x is the amplitude of change, and t is the time; based on the first derivative change rate in the time axis direction, an abnormal intensity peak interval is identified, and an anomaly distribution boundary contour line is extracted to form a two-dimensional anomaly distribution atlas .
5. The method for fault detection in a safety PLC based hydrogen generation system and its handling as claimed in claim 1 wherein: The matching degree R between the current B(t) and the pre-trained normal behavior feature library comprises: A sample library Tn of abnormal edge features in normal operation state is constructed in advance, and the sample dimension is consistent with B(t); Based on the Euclidean distance algorithm, the similarity between the current feature sequence B(t) and each sample in Tn is calculated, and the matching degree R corresponding to the minimum distance is taken; Compare R with the set safety threshold λ, if R is greater than λ, it is determined as atypical micro-mutation abnormal state.
6. The method of fault detection in a safety PLC based hydrogen generation system and its handling as claimed in claim 5 wherein: The running link L is constructed in the safety PLC logic processing unit, the trigger-response path between parameters is analyzed, and the offset ΔL from the ideal control link L0 is calculated, including: According to the response order and trigger dependence relationship of each parameter Pi in the current period, the running link L is constructed, which is represented as a directed graph structure G; Pre-set ideal control link in configuration file Standard trigger path between parameters under normal working condition The topology matching algorithm is used to calculate L and The structural difference ΔL between them includes node order offset and edge connection variation rate.
Citation Information
Patent Citations
Coordination control method of photovoltaic off-grid hydrogen production system
CN120519916A