Complex metrological sensor anomaly feature analysis method based on long-term cumulative data
By combining multi-dimensional feature extraction and a two-layer LSTM network with an attention mechanism, the problem of insensitivity to slow degradation in existing technologies is solved, enabling accurate detection and reliable early warning of sensor anomalies.
Patent Information
- Application Number
- CN202511332009.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2045-09-18
AI Technical Summary
Existing technologies are insensitive to slow degradation and lack interpretability when processing long-term accumulated data, making it impossible to build accurate sensor anomaly early warning systems.
By extracting multi-dimensional features from long-term accumulated sensor data in the time domain, frequency domain, and time-frequency domain, a model combining a two-layer long short-term memory network and an attention mechanism is constructed. This model learns the short-term temporal dependencies within data segments and the long-term evolution trends between segments. Combined with single-class support vector machine and SHAP value analysis, accurate detection of sensor anomalies is achieved.
It achieves accurate detection of sensor anomalies, effectively distinguishes between normal fluctuations and real anomalies, provides reliable protection for stable system operation, and generates structured anomaly diagnosis reports.
Smart Images

Figure CN120832626B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of state monitoring and fault prediction, in particular to a complex metering sensor abnormal feature analysis method based on long-term cumulative data. BACKGROUND
[0002] The complex metering sensor is a core sensing element in industrial automation, Internet of Things and intelligent manufacturing system, and its long-term operation reliability and data accuracy are directly related to the success or failure of production safety, energy efficiency management and equipment predictive maintenance. With the deepening of digital transformation, various key equipment is usually equipped with a large number of sensors and continuous data collection, forming a large amount of long-term cumulative time series data. These data not only contain the normal operation mode of the system, but also record the performance degradation of the sensor itself over time and the signs of various abnormal events. Therefore, how to mine value from these long-term cumulative historical data to achieve accurate insight into the health status of the sensor and early warning has become a research direction in the field of industrial intelligence.
[0003] At present, the detection technology for sensor abnormalities is still limited to traditional methods: first, the widely used criterion based on fixed or dynamic threshold is simple and easy to implement, but it is difficult to effectively distinguish between normal changes caused by reasonable fluctuations in working conditions and real abnormal precursors. It has insufficient sensitivity to slowly occurring drift faults, and the threshold setting is highly dependent on historical experience. Second, the isolated forest or autoencoder trained using short-term data often focuses on the detection of instantaneous sudden abnormalities. Its model has a limited field of view and cannot model the slowly developing degradation trend in months or years, lacking the ability to understand long-term evolution patterns. This makes it difficult for maintenance personnel to develop accurate maintenance strategies based on this, and the technical achievements are difficult to translate into actual productivity.
[0004] In summary, the existing technology has problems of being insensitive to slow degradation and lacking interpretability when dealing with long-term cumulative data, which leads to the inability to build an intelligent diagnostic system that can accurately alert and clearly trace the source. Therefore, it is of great significance to develop an analysis method that can deeply integrate long-term and short-term context information, automatically focus on key abnormal features, and provide clear diagnostic evidence. SUMMARY
[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and provide a method for analyzing the abnormal features of complex metrological sensors based on long-term accumulated data. This method can comprehensively capture the static statistical characteristics, dynamic frequency characteristics, and transient changes in non-stationary signals by extracting multi-dimensional features from long-term accumulated sensor data in the time domain, frequency domain, and time-frequency domain. Simultaneously, it constructs a model combining a two-layer long short-term memory network (LSTM) with an attention mechanism. The first layer LSTM learns the short-term temporal dependencies within data segments, while the second layer LSTM learns the long-term evolutionary trends between segments. The attention mechanism focuses on key time periods. This deep integration from feature extraction to model construction enables the model to accurately identify the differences between normal and abnormal data, thereby achieving precise detection of sensor anomalies. In practical applications, it can effectively distinguish between normal sensor fluctuations and true anomalies, providing a reliable guarantee for the stable operation of the system.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a method for analyzing the abnormal characteristics of complex metering sensors based on long-term cumulative data, wherein the specific steps of the method are as follows:
[0007] S100. Preprocess the long-term accumulated time-series data stream from the accessed sensors, dividing the continuous data stream into multiple data segments;
[0008] S200. For each obtained data segment, perform multi-dimensional feature extraction in parallel, including time-domain feature extraction, frequency-domain feature extraction, and time-frequency-domain feature extraction. Combine all features to form a high-dimensional feature vector. , among which, element Representing the The fused feature vectors of each data segment are used as input to a two-layer long short-term memory network to comprehensively characterize the operational state of the data segment, while simultaneously recording the timestamp information corresponding to each data segment. ;
[0009] S300 constructs a two-layer long short-term memory network model to learn short-term dependencies within segments and long-term evolutionary trends between segments, respectively. An attention mechanism is introduced for weighted fusion to focus on key anomalous periods, outputting a deep state feature vector. ;
[0010] S400. Calculate the anomaly score of the deep state feature vector based on a single-class support vector machine, determine anomalies by combining an adaptive threshold, and use SHAP value backtracking analysis to analyze the anomaly contribution of the original features and attention weights.
[0011] S500: The data segments and their feature vectors identified as normal in S400 are added to the training sample set of the single-class support vector machine for online incremental learning.
[0012] Further, in the S100, the long-term cumulative data includes multiple groups of measurement data collected by the sensor during operation, and time stamps and operating condition parameters corresponding to each group of measurement data;
[0013] The operating condition parameters include external environmental factors such as temperature, humidity, and pressure of the environment affecting the measurement results of the sensor, and internal working state parameters such as working voltage and current of the sensor itself;
[0014] The collected long-term cumulative data is preprocessed, the missing measurement data is filled and corrected, and the operating condition parameters are normalized;
[0015] Based on the preprocessed long-term cumulative data, the continuous flow is divided into multiple equal-length data segments, a time stamp and a segment sequence number are added to each segmented data segment, and the segmented data segments are organized into an ordered queue for output, for feature extraction in S200.
[0016] Further, in the S200, multi-dimensional feature extraction includes:
[0017] Time domain feature extraction: calculating the mean and variance, skewness and kurtosis of the segment, the mean and variance are used to represent the average level and fluctuation range of the signal, and the skewness and kurtosis are used to describe the shape and sharpness of the signal distribution;
[0018] Frequency domain feature extraction: performing fast Fourier transform on the segment data to extract dominant frequency, spectral entropy, and specific frequency band energy proportion features;
[0019] Time-frequency domain feature extraction: calculating the wavelet coefficient energy under each scale to form a wavelet energy spectrum, and extracting the maximum value, mean value, and entropy features in the wavelet energy spectrum to capture transient abnormal features in the signal;
[0020] The time domain features, frequency domain features, and time-frequency domain features extracted for the same data segment are spliced and normalized to form a high-dimensional feature vector representing the running state of the data segment .
[0021] Further, in the S300, the first layer LSTM of the double-layer long short-term memory network model is used to learn the short-term time sequence dependence of the high-dimensional feature vector in each data segment, and the high-dimensional feature vector is input into the first layer LSTM network in time steps, and the number of hidden layer neurons of the first layer LSTM network is set to For each time step , the hidden state vector and the cell state vector are calculated by , wherein This represents the neural network function of the first layer LSTM, and the hidden state vector. Containing short-term contextual information within the data segment up to the current time step, this layer encodes the fine-grained short-term dynamic characteristics and dependencies within each data segment by learning the feature change patterns within the data segment.
[0022] Furthermore, in S300, the second layer of the two-layer long short-term memory network model, LSTM, is used to learn the long-term evolution trend between different data segments by using the hidden state sequence output by the first layer LSTM. As input, the number of hidden layer neurons in the second LSTM is set to... For each time step ,pass Calculate the hidden state vector and cell state vector The second LSTM layer at each time step Output It is a high-level abstract representation of the long-term operating state of a system, used to learn the long-term evolution patterns between different data fragments.
[0023] Furthermore, in S300, the weighted fusion process of the attention mechanism is as follows:
[0024] The hidden state sequence output by the second-layer LSTM at all time steps The input is fed into an attention layer, which uses a learnable scoring function. Dynamically calculate each time step Attention weights The ,in, For query vector, , , This is the weight matrix. It is the bias vector;
[0025] right Normalize all hidden states According to its corresponding attention weight By performing weighted summation, we obtain a deep state feature vector that integrates long-term and short-term contextual information and focuses on key time periods. ,Right now .
[0026] Furthermore, in S400, the depth state feature vector output by S300 is... The input is fed into a single-class support vector machine model, which is then processed by a kernel function. Mapping the feature vector to a high-dimensional feature space, where the kernel function adopts a radial basis function , is the kernel function parameter, is the deep state feature vector to be judged , is the normal sample feature vector learned by the one-class support vector machine, and the feature vector distance from the normal state core hypersphere obtained by model training as the anomaly score , that is , wherein, is the number of support vectors, is the Lagrange multiplier of the support vector, is the support vector, is the number of normal sample feature vectors, is the hypersphere center offset;
[0027] Based on the anomaly score distribution of historical normal data, an adaptive threshold is calculated , wherein is the mean of the anomaly score of the historical normal data, is the standard deviation of the anomaly score of the historical normal data, and the anomaly score of the current feature vector , it is determined that the time period is abnormal, and the SHAP value is used to backtrack the abnormal contribution degree of the original feature and the attention weight.
[0028] Further, for the state judged to be abnormal, the factors causing the abnormal judgment are analyzed, and the attention weight output by the attention mechanism in the S300 stage is calculated In the distribution of each time step, the key time segment with the largest contribution is identified;
[0029] Using the SHAP value, the contribution degree of each type of time domain, frequency domain, and time-frequency domain feature extracted by S200 for the current anomaly score is calculated, that is , wherein, is a single original feature extracted by S200, including time domain features, frequency domain features, and time-frequency domain features, is a set of all original features used for anomaly judgment, is a set of all features, from which the target feature is removed , and the set composed of all remaining features, is a feature subset, is the factorial of the number of features in the subset S, is the factorial of the total number of features, is the one-class support vector machine output function, indicates that the feature Feature subset The output after being input into a single-class support vector machine model For features not included Feature subset The output after inputting the model;
[0030] Based on the contribution ranking, identify the main feature dimensions that cause the anomalies and their specific manifestations;
[0031] Generate a structured anomaly diagnostic report, which includes anomaly timestamps, anomaly scores, judgment results, and information on the main anomaly features and their contributions.
[0032] Compared with existing technologies, this method for analyzing the anomaly characteristics of complex metering sensors based on long-term cumulative data has the following advantages:
[0033] This invention extracts multi-dimensional features from long-term accumulated sensor data in the time, frequency, and time-frequency domains. This allows for the comprehensive capture of the static statistical characteristics, dynamic frequency characteristics, and transient changes in non-stationary signals. Simultaneously, it constructs a model combining a two-layer long short-term memory network (LSTM) with an attention mechanism. The first LSTM learns short-term temporal dependencies within data segments, while the second LSTM learns long-term evolutionary trends between segments. The attention mechanism focuses on key time periods. This deep integration from feature extraction to model construction enables the model to accurately identify the differences between normal and abnormal data, thereby achieving precise detection of sensor anomalies. In practical applications, it can effectively distinguish between normal sensor fluctuations and genuine anomalies, providing a reliable guarantee for stable system operation.
[0034] Other advantages, objectives and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination or study, or may be learned from the practice of the invention. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0036] Figure 1 This is a flowchart illustrating the operation of an anomaly feature analysis method for complex metering sensors based on long-term cumulative data.
[0037] Figure 2A step block diagram of a complex metering sensor abnormal feature analysis method based on long-term accumulated data;
[0038] Figure 3 A logic block diagram of the S300 multi-dimensional rule matching stage in Example Two. DETAILED DESCRIPTION
[0039] In order to further illustrate the technical means and effects adopted by the present application to achieve the predetermined object of the present application, the specific embodiments, structures, features and effects according to the present application are described in detail below in combination with the drawings and preferred embodiments.
[0040] Example One
[0041] This embodiment is based on a complex metering sensor abnormal feature analysis method based on long-term accumulated data, and takes complex metering sensors such as pressure and temperature commonly used in industrial scenarios as application objects, such as Figure 2 As shown, through the complete process of data preprocessing, multi-dimensional feature extraction, double-layer LSTM and attention mechanism modeling, abnormality determination and contribution analysis, online incremental learning, accurate detection of sensor abnormalities, positioning of key abnormal periods and tracing of abnormal causes are realized, and long-term applicability is improved through continuous optimization of the model, thereby providing a reliable technical solution for sensor state monitoring and fault warning of industrial systems.
[0042] Firstly, enter the data preprocessing stage S100, a large amount of accumulated data will be generated during the long-term operation of the sensor, which is the basis for anomaly analysis, but the original state cannot be directly used, and the data quality needs to be improved through preprocessing. Long-term accumulated data includes raw measurement data collected by sensors (such as real-time pressure values of pressure sensors and real-time temperature values of temperature sensors), time stamps corresponding to measurement data (used to mark the data collection time and provide a basis for subsequent time dimension analysis), and operating condition parameters (external environment parameters: environmental temperature, humidity, and external pressure affecting sensor measurement accuracy; internal state parameters: working voltage and current reflecting the working state of the sensor itself). For missing values in the original data (due to sensor hardware failure or data transmission interruption), the mean filling method is used to complete the missing data to avoid affecting the accuracy of subsequent analysis. For the problem of large dimension difference of operating condition parameters, the minimum-maximum normalization method is used to convert them to a unified numerical interval to eliminate dimension interference and ensure balanced weights of each parameter in subsequent analysis. The preprocessed data is sorted in ascending order according to the time stamp to ensure the time sequence continuity of the data, and the continuous data stream is divided into equal-length data segments to ensure that each segment contains consistent time information, making it easier to extract features uniformly and compare them. A timestamp label (recording the start and end time of the segment) and a segment sequence number (distinguishing different segments for subsequent data calling and anomaly positioning) are added to each data segment, and all segments are organized into an ordered queue as input data for the multi-dimensional feature extraction stage.
[0043] Then, enter the multi-dimensional feature extraction stage S200, different abnormal states of the sensor (such as instantaneous impact, periodic failure, and slow degradation) will show characteristics in different dimensions of the data. Therefore, features need to be extracted from time domain, frequency domain, and time-frequency domain to build a comprehensive state representation. Specifically:
[0044] Time domain feature extraction: Time domain features directly reflect the statistical characteristics of data in the time dimension. For each data segment, four core features are extracted: mean, variance, skewness, and kurtosis. The mean represents the average running level of the sensor in that period, the variance reflects the data fluctuation range, the skewness describes the symmetry of data distribution (normal operation data distribution is symmetric, and skewness anomaly indicates sensor collection deviation), and the kurtosis represents the sharpness of data distribution (high kurtosis indicates that there are many extreme values in the data, which can correspond to instantaneous anomalies);
[0045] Frequency domain feature extraction: Periodic anomalies (such as periodic data fluctuations caused by sensor component wear) are difficult to detect in the time domain and need to be mined through frequency domain analysis. Fast Fourier transform is performed on the data segment to convert the time domain signal into the frequency domain signal, convert the data from the time-amplitude dimension to the frequency-amplitude dimension, extract the dominant frequency (the frequency with the largest amplitude in the frequency domain, which is stable during normal operation, and which deviates or appears a new dominant frequency during an anomaly), the spectral entropy (describes the uniformity of frequency component distribution, and the increase in entropy value indicates a more complex frequency distribution corresponding to a fault), and the specific frequency band energy ratio (preset according to the sensor type and the frequency band related to the fault, calculate the proportion of the energy of the frequency band to the total energy, and the abnormal change of the proportion prompts the corresponding fault).
[0046] Time-frequency domain feature extraction: Transient anomalies of sensors (such as sudden impact, transient circuit failure) are non-stationary signals, which are captured through time-frequency domain analysis. Wavelet transform is used to process the data segment, which decomposes the signal into wavelet coefficients of different scales (corresponding to different frequency ranges). The wavelet coefficient energy at each scale is calculated, and the wavelet energy spectrum (which directly displays the energy distribution of the signal in the time-frequency two-dimensional plane) is constructed. Three types of features are extracted from the energy spectrum: maximum value (reflecting the time-frequency region with the most concentrated energy, corresponding to transient anomalies), mean value (reflecting the overall energy level, and an abnormal mean value indicates a change in the overall state of the sensor), and entropy (describing the uniformity of energy distribution, and an abnormal entropy value indicates a non-stationary anomaly).
[0047] High-dimensional feature vector construction: The time domain, frequency domain, and time-frequency domain features of the same data segment are concatenated in a predetermined order (time domain, frequency domain, and time-frequency domain) to form an initial feature set. The initial feature set is normalized to eliminate the numerical range difference between different features, and finally fused to form a high-dimensional feature vector representing the running state of the data segment (t is the data segment number), and the feature vectors of all segments are arranged in chronological order to form a sequence (T is the total number of segments), and the timestamp information of each segment is recorded as input to the double-layer LSTM network.
[0048] Next, enter the double-layer LSTM and attention mechanism modeling stage S300. The high-dimensional feature vector sequence contains complex time sequence dependencies (short-term correlation of features within a segment, long-term evolution of features between segments). A double-layer LSTM network is constructed, and an attention mechanism is introduced to focus on key time periods. The first layer LSTM learns the short-term dependence within a segment: The first layer LSTM is used to capture the short-term time sequence correlation of features within a single data segment (such as the correlation between time domain variance and frequency domain specific frequency band energy ratio within the same segment). The number of hidden layer neurons is set to The feature vector sequence The data is sequentially input into the first LSTM layer at each time step, with each time step corresponding to a feature vector of a data segment. By using the gating mechanism of LSTM (input gate, forget gate, output gate), combined with Calculate the hidden state vector and cell state vector (in For the network function of the first layer LSTM, , These represent the hidden state and cell state of the previous time step, respectively. It integrates short-term contextual information within the segment up to the current time step, fully encoding the fine dynamic characteristics within the segment; the second-layer LSTM learns the long-term evolution trend between segments: the second-layer LSTM focuses on the long-term evolution relationship of features between different data segments (such as the slow upward trend of time-frequency domain entropy in multiple consecutive segments, corresponding to sensor performance degradation), and uses the hidden state sequence output by the first-layer LSTM. As input, set the number of neurons in the hidden layer. Similarly, through a gating mechanism, based on Calculate the hidden state vector and cell state vector ( For the network function of the second layer LSTM, , (This refers to the hidden state and cell state of the previous time step.) It is a high-level abstraction of the long-term operating state of sensors, effectively capturing slow evolution patterns on a daily or monthly basis, and solving the problem of insensitivity to long-term trends; Attention mechanism, focusing on key anomaly periods: To highlight the periods that play a key role in anomaly detection, an attention mechanism is introduced to weight and fuse the output of the second-layer LSTM, combining the hidden state sequences of all time steps of the second layer. Input to the attention layer via a learnable scoring function. Calculate the original weights for each time step (where q is the query vector used to capture features related to anomalies); , , This is a weight matrix that can be optimized through training; (As the bias vector), the original weights are normalized using the softmax function to obtain the attention weights. (To ensure the sum of all weights is 1, facilitating the quantification of the importance of each time period), the hidden states are weighted and summed to obtain the deep state feature vector. This vector integrates both long-term and short-term contextual information and highlights key time-period features, providing accurate input for subsequent anomaly detection.
[0049] Secondly, enter the anomaly determination and contribution analysis stage S400, based on the deep state feature vector, use single classification support vector machine to realize anomaly determination, and trace the abnormal reason through SHAP value, specifically:
[0050] Abnormal score calculation: input the deep state feature vector C into the pre-trained single classification support vector machine model (model training stage uses a large number of sensor normal operation data feature vectors as samples to learn the feature distribution of normal state), select radial basis function as the kernel function (this function can effectively process high-dimensional data, and the model complexity is adjusted by the γ parameter), map the feature vector to a high-dimensional feature space, construct the core hypersphere of the normal state, and calculate the abnormal score (where is the number of support vectors, is the Lagrange multiplier of the support vector, is the support vector, is the hypersphere center offset), the abnormal score is the distance between the feature vector and the normal state hypersphere, The larger the value is, the farther the sensor state deviates from the normal level in this period;
[0051] Adaptive threshold setting and anomaly determination: to avoid misjudgment caused by fixed threshold (different sensors, different working conditions, different normal state fluctuation range), set adaptive threshold based on the abnormal score distribution of historical normal data , calculate the mean and standard deviation of the abnormal score of historical normal data, determine the threshold according to , compare the abnormal score of the current feature vector with the threshold , if , determine that the sensor state is abnormal in this period; if , determine that it is normal;
[0052] Abnormal contribution analysis and diagnosis report generation: for the period determined to be abnormal, trace the abnormal reason in two steps, first step: analyze the distribution of attention weights The time step corresponding to the fragment with the largest weight value is the key abnormal fragment (this fragment has the largest contribution to abnormal determination); second step, use SHAP value to quantify the abnormal contribution degree of each original feature in the key fragment, that is , where is a single original feature, is the full feature set, The absolute value of the SHAP value is larger for the output function of the single classification support vector machine, which indicates that the feature has a more significant impact on the abnormal score, i.e., the feature is the main cause of the abnormality. A structured abnormality diagnosis report is generated, including information such as abnormal timestamp (based on determination), abnormal score , determination result (abnormal / normal), key abnormal segment, main abnormal feature and contribution, etc., to provide clear fault positioning basis for operation and maintenance personnel.
[0053] Finally, enter the online incremental learning stage S500. During long-term operation of the sensor, the performance will slowly degrade, and the initial training samples cannot cover the normal state in the later period, resulting in a decrease in the determination accuracy of the model. Therefore, the model is continuously optimized through online incremental learning. The data segments determined as normal in S400 and their corresponding high-dimensional feature vectors are selected as new normal samples, and the new samples are supplemented to the training sample set of the single classification support vector machine, enriching the time coverage range and state diversity of the samples. The model is updated so that the model can learn new normal state patterns. Through continuous sample supplementation and model updating, it is ensured that the model can accurately distinguish between normal and abnormal states at all times and adapt to the long-term operation changes of the sensor.
[0054] In summary, the embodiment constructs a comprehensive and adaptive sensor anomaly detection and diagnosis method through multi-dimensional feature extraction, double-layer LSTM and attention mechanism modeling, abnormal scoring and SHAP explainable analysis, and online incremental learning, which is suitable for long-term health state monitoring and early warning of complex measurement sensors in industrial environments.
[0055] Embodiment Two
[0056] Based on embodiment one, this embodiment details the operation process of the complex measurement sensor abnormal feature analysis method based on long-term cumulative data for performing sensor abnormal feature analysis, as shown in Figure 1 , and the specific process is as follows:
[0057] (1) Data preprocessing and segmentation
[0058] S100.1: Obtain the long-term cumulative time series data stream of the sensor (including measurement values, timestamps, and working condition parameters);
[0059] S100.2: Fill in and correct missing data, and normalize environmental parameters (temperature, humidity, and pressure) and sensor state parameters (voltage and current);
[0060] S100.3: Sort the data stream by timestamp and segment it into equal-length segments;
[0061] S100.4: Label each segment with a timestamp and a sequence number, and generate an ordered queue;
[0062] (2) Multi-dimensional feature extraction
[0063] S200.1: Time-domain feature extraction, calculate segment mean, variance (characterize data fluctuation), calculate skewness, kurtosis (describe distribution shape);
[0064] S200.2: Frequency-domain feature extraction, extract dominant frequency through Fourier transform, calculate spectral entropy and specific frequency band energy proportion;
[0065] S200.3: Time-frequency domain feature extraction, generate wavelet energy spectrum, extract wavelet energy maximum, mean and entropy value (capture transient anomalies);
[0066] S200.4: Concatenate three types of features and normalize to generate high-dimensional feature vector;
[0067] (3) Long and short-term dependence modeling (as shown in Figure 3
[0068] S300.1: First layer LSTM, input high-dimensional feature vector sequence, learn short-term time series dependence within the segment;
[0069] S300.2: Second layer LSTM, input hidden state sequence output by the first layer, learn long-term evolution trend between segments;
[0070] S300.3: Attention mechanism, dynamically weight the hidden state output by the second layer LSTM, focus on key abnormal time periods, generate deep state feature vector;
[0071] (4) Anomaly detection and attribution
[0072] S400.1: Input deep feature vector into single classification support vector machine;
[0073] S400.2: Calculate the distance from the feature vector to the normal state hypersphere as the anomaly score;
[0074] S400.3: Dynamically set threshold: set adaptive threshold according to the anomaly score distribution of historical normal data;
[0075] S400.4: If the anomaly score exceeds the threshold, it is determined to be abnormal, and the attention weight is backtracked to locate the key abnormal time period, and the SHAP value is used to analyze the contribution of the original feature (identify the main abnormal dimension), generate a diagnostic report (including abnormal timestamp, score, key features);
[0076] (5) Model incremental update
[0077] S500.1: Select data segments and their corresponding feature vectors that are determined to be normal;
[0078] S500.2: The normal data segments and feature vectors screened out are supplemented to the training sample set of the single classification support vector machine;
[0079] S500.3: The single classification support vector machine model is subjected to online incremental learning using the supplemented training sample set to update the model parameters and improve the model's adaptability to new normal data patterns;
[0080] S500.4: The new data segments are processed in a loop to continuously optimize.
[0081] The above is only a preferred embodiment of the present application, and does not limit the present application in any form. Although the present application has been disclosed as above with a preferred embodiment, it is not intended to limit the present application. Any person skilled in the art can make some changes or modifications to the above disclosed technical content to obtain equivalent embodiments with equivalent changes, without departing from the technical solution of the present application. Any modification, change, and modification of the above embodiments, which do not depart from the technical solution of the present application, are still within the scope of the present application.
Claims
1. A method for analyzing the abnormal characteristics of complex metering sensors based on long-term cumulative data, characterized in that, The specific steps of this method are as follows: S100. Preprocess the long-term accumulated time-series data stream from the accessed sensors, dividing the continuous data stream into multiple data segments; S200. For each obtained data segment, perform multi-dimensional feature extraction in parallel, including time-domain feature extraction, frequency-domain feature extraction, and time-frequency-domain feature extraction. Combine all features to form a high-dimensional feature vector [V1, V2, ..., V]. T ], where element V t This represents the fused feature vector of the t-th data segment, and also records the timestamp information T corresponding to each data segment. stamp =[t s1 , t s2 , ..., t sT ]; S300: Construct a two-layer long short-term memory network model to learn short-term dependencies within segments and long-term evolution trends between segments respectively, and introduce an attention mechanism for weighted fusion to focus on key abnormal periods, and output a deep state feature vector C; S400. Calculate the anomaly score of the deep state feature vector based on a single-class support vector machine, determine anomalies by combining an adaptive threshold, and use SHAP value backtracking analysis to analyze the anomaly contribution of the original features and attention weights. S500: The data segments and their feature vectors identified as normal in S400 are added to the training sample set of the single-class support vector machine for online incremental learning. In S300, the first layer LSTM of the two-layer long short-term memory network model is used to learn the short-term temporal dependencies of high-dimensional feature vectors within each data segment, and to store the high-dimensional feature vector V t The data is sequentially input into the first LSTM network at time steps. The number of hidden neurons in the first LSTM network is set to h1. For each time step t, the data is processed by... Calculate the hidden state vector and cell state vector Where LSTM1 represents the neural network function of the first LSTM layer, and the hidden state vector In step S300, the second layer of the two-layer Long Short-Term Memory (LSTM) network model, containing short-term context information within the data segment up to the current time step, is used to learn the long-term evolution trend between different data segments by using the hidden state sequence output by the first layer LSTM. As input, the number of hidden layer neurons in the second LSTM layer is set to h2. For each time step t, through... Calculate the hidden state vector and cell state vector The second LSTM layer outputs at each time step t. It is a high-level abstract representation of the long-term operating state of a system, used to learn the long-term evolution patterns between different data fragments.
2. The method for analyzing the abnormal characteristics of complex metering sensors based on long-term cumulative data according to claim 1, characterized in that, In S100, the long-term cumulative data includes multiple sets of measurement data collected by the sensor during operation, as well as the timestamp and operating condition parameters corresponding to each set of measurement data; The operating condition parameters include external environmental factors such as ambient temperature, humidity and pressure that affect the sensor measurement results, as well as internal operating state parameters such as the sensor's own operating voltage and current. The collected long-term cumulative data is preprocessed, missing measurement data is filled and corrected, and the operating condition parameters are normalized. Based on the preprocessed long-term cumulative data sorted by timestamp, the continuous stream is divided into multiple data segments of equal length, and a timestamp and segment sequence number are added to each segment.
3. The method for analyzing the abnormal characteristics of complex metering sensors based on long-term cumulative data according to claim 1, characterized in that, In step S200, multi-dimensional feature extraction includes: Temporal feature extraction: Calculate the mean and variance, skewness and kurtosis of the segment. The mean and variance are used to characterize the average level and fluctuation range of the signal, and the skewness and kurtosis are used to describe the shape and sharpness of the signal distribution. Frequency domain feature extraction: Perform fast Fourier transform on the segment data to extract dominant frequency, spectral entropy, and energy proportion of specific frequency bands; Time-frequency domain feature extraction: Calculate the wavelet coefficient energy at each scale to form a wavelet energy spectrum, and extract the maximum value, mean value and entropy features in the wavelet energy spectrum to capture transient anomalies in the signal; The time-domain features, frequency-domain features, and time-frequency-domain features extracted from the same data segment are concatenated and normalized to form a high-dimensional feature vector V representing the operating state of the data segment. t .
4. The method for analyzing the abnormal characteristics of complex metering sensors based on long-term cumulative data according to claim 1, characterized in that, In S300, the weighted fusion process of the attention mechanism is as follows: The hidden state sequence output by the second-layer LSTM at all time steps The input is fed into an attention layer, which uses a learnable scoring function. Dynamically calculate the attention weight α at each time step t t The Where q is the query vector, W a W1 and W2 are weight matrices, and b1 is the bias vector; right Normalize all hidden states According to its corresponding attention weight α t By performing weighted summation, we obtain a deep state feature vector C that integrates long-term and short-term contextual information and focuses on key time periods.
5. The method for analyzing the abnormal characteristics of complex metering sensors based on long-term cumulative data according to claim 1, characterized in that, In step S400, the deep state feature vector C output from S300 is input to a single-class support vector machine model. The single-class support vector machine model maps the feature vector to a high-dimensional feature space using a kernel function K(x, y), where the kernel function is a radial basis function K(x, y) = exp(-γ||xy||). 2 ), where γ is the kernel function parameter, x is the depth state feature vector C to be determined, and y is the normal sample feature vector learned by the single-class support vector machine. The distance between the feature vector C and the normal state core hypersphere obtained from model training is calculated as the anomaly score S, i.e. Where n is the number of support vectors, α i C is the Lagrange multiplier for support vectors. i For support vectors, n is the number of normal sample feature vectors, and ρ is the offset of the hypersphere center. Based on the distribution of outlier scores in historical normal data, calculate the adaptive threshold θ = μ s +3σ s , where μ s σ is the mean of the outlier scores in historical normal data. s The standard deviation of the abnormal scores in historical normal data is used. When the abnormal score s of the current feature vector is greater than θ, the time period is determined to be abnormal. The SHAP value is used to backtrack and analyze the abnormal contribution of the original features and attention weights.
6. The method for analyzing the abnormal characteristics of complex metering sensors based on long-term cumulative data according to claim 5, characterized in that, For states deemed abnormal, analyze the factors leading to this abnormality determination and calculate the attention weight α output by the attention mechanism in stage S300. t Based on the distribution across time steps, the key time segments that contribute the most are identified; Using the SHAP value, the contribution of various time-domain, frequency-domain, and time-frequency-domain features extracted for the key time segment S200 to the current anomaly score s is calculated, i.e. Among them, f j S200 is a single raw feature extracted, including time-domain features, frequency-domain features, and time-frequency-domain features. F is the set of all raw features used for anomaly detection. j } is to remove the target feature f from the full feature set F. j Afterwards, the set consisting of all remaining features, S is a feature subset, |S|! is the factorial of the number of features in subset S, |F|! is the factorial of the total number of features, φ(·) is the output function of the single-class support vector machine model, φ(S∪{f j }) indicates that it contains feature f j Feature subsets s∪{f j The output φ(S) after inputting into a single-class support vector machine model is the output excluding feature f. j The output of the model is a feature subset s input to it. Based on the contribution ranking, identify the main feature dimensions that cause the anomalies and their specific manifestations; Generate a structured anomaly diagnostic report, which includes anomaly timestamps, anomaly scores, judgment results, and information on the main anomaly features and their contributions.
Citation Information
Patent Citations
Spinning machine fault detection method and system based on deep learning
CN120234685A
Agricultural equipment fault diagnosis method and system based on deep learning
CN120316579A