Distribution network fault diagnosis method based on harmonic spectrum analysis and related device
Through the distribution network fault diagnosis method based on harmonic spectrum analysis and combined with the SVM classification model, the problem of low classification accuracy in the existing technology is solved, and the accuracy and robustness of multiple fault types are achieved, which is improved.
Patent Information
- Application Number
- CN202510343249.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-06-24
AI Technical Summary
The existing distribution network fault diagnosis method based on harmonic spectrum analysis is difficult to accurately distinguish when facing multiple types of faults, resulting in low classification accuracy and poor diagnostic accuracy.
A distribution network fault diagnosis method based on harmonic spectrum analysis is adopted. By collecting abnormal signals and pre-processing to extract harmonic spectrum, the comprehensive analysis and judgment indicators of distribution network faults are calculated and inputted to the pre-trained SVM classification model to achieve efficient and accurate classification of fault types.
It improves the accuracy of fault diagnosis, avoids misjudgment and blind spot problems caused by single feature extraction in traditional methods, and enhances the robustness and diagnostic accuracy of complex fault situations.
Smart Images

Figure CN120195457A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of distribution network fault diagnosis, and relates to a distribution network fault diagnosis method and related device based on harmonic spectrum analysis. Background Art
[0002] With the continuous growth of the economy, the demand for electricity is increasing, and the reliability and security of the power system become more and more important. As an important part of the power system, the distribution network undertakes the tasks of power distribution and transmission, and its stability directly affects the normal operation of society. However, during the operation of the distribution network, it is often disturbed by various natural and human factors. Fault types such as lightning strikes, bird damage, and vehicle hitting poles often occur. These faults can cause power outages, equipment damage, and even large-scale power outages. Therefore, it is of great significance to diagnose the fault type in a timely and accurate manner and take corresponding measures to improve the safety and stability of the distribution network.
[0003] Currently, the traditional methods for distribution network fault diagnosis mainly rely on measuring the waveforms of current and voltage, and identifying the fault type through the characteristic changes of the waveforms. Common diagnostic methods include the analysis of zero-sequence current, overcurrent protection, and short-circuit current waveforms. These methods can effectively detect faults and conduct preliminary positioning in most cases, but there are still certain limitations for complex fault situations or the influence of multiple interference factors. Especially when facing different types of faults (such as bird damage, vehicle hitting poles, lightning strikes, etc.), it is difficult for conventional methods to accurately distinguish and classify the fault types.
[0004] In recent years, with the rapid development of smart grid and distribution automation technologies, the distribution network fault diagnosis technology has gradually developed towards a more intelligent and accurate direction. Fault diagnosis methods based on new technologies such as spectrum analysis and digital signal processing have received increasing attention. By performing spectrum analysis on the current and voltage waveforms, the harmonic components in the signal can be effectively extracted, and their amplitudes and frequency distributions can be analyzed, thereby deeply analyzing the cause of the fault. Compared with traditional methods, spectrum analysis can reveal more signal characteristics, especially by analyzing the harmonic characteristic differences generated by different types of faults, and has higher diagnostic accuracy and robustness.
[0005] Existing distribution network fault diagnosis methods based on harmonic spectrum analysis often have difficulty in accurately distinguishing when facing multiple types of faults, such as bird damage, vehicle hitting poles, and lightning strikes. Although the harmonic characteristics generated by different types of faults are different, traditional spectrum analysis methods usually have difficulty in extracting the small differences between fault characteristics, resulting in low classification accuracy. Especially when multiple faults occur simultaneously, the diagnostic accuracy is greatly reduced. Summary of the Invention
[0006] The object of the present invention is to provide a distribution network fault diagnosis method and related device based on harmonic spectrum analysis, so as to solve the technical problems of low classification accuracy and poor diagnosis accuracy in the prior art for fault diagnosis.
[0007] To achieve the above object, the present invention adopts the following technical solutions:
[0008] In the first aspect, the present invention provides a distribution network fault diagnosis method based on harmonic spectrum analysis, including the following steps:
[0009] When a distribution network fault occurs, collect abnormal signals and perform preprocessing to obtain a harmonic spectrum;
[0010] Extract features from the harmonic spectrum to obtain a number of feature values;
[0011] Calculate a comprehensive judgment index for the distribution network fault through a number of feature values;
[0012] Input the comprehensive judgment index for the distribution network fault into a pre-trained SVM classification model to obtain the classification result of the fault diagnosis.
[0013] Further, the step of collecting abnormal signals and performing preprocessing to obtain a harmonic spectrum specifically includes:
[0014] When a distribution network fault occurs, use a fault indicator to record the time-domain waveform data of the current and voltage in real time, obtain the abnormal waveform change caused by the fault, and collect the original signal;
[0015] Use the wavelet threshold denoising method to perform multi-resolution decomposition on the original signal, threshold the high-frequency noise and then reconstruct the original signal, perform normalization processing on the signal amplitude, and finally intercept the signal to retain the data of one cycle before and after the fault to obtain the harmonic spectrum.
[0016] Further, the step of extracting features from the harmonic spectrum to obtain a number of feature values specifically includes:
[0017] Extract features from the harmonic spectrum to obtain fundamental wave features, harmonic features, and time features;
[0018] The fundamental wave features include the fundamental wave amplitude and the fundamental wave amplitude distortion rate, and the specific calculation formulas are:
[0019]
[0020] where H0 is the fundamental wave amplitude; ψ0(t) is the fundamental wave wavelet function;
[0021]
[0022] where D is the fundamental wave amplitude distortion rate; and are the amplitudes of the fundamental waves before and after the fault, respectively;
[0023] The harmonic features include harmonic amplitude, high-order harmonic energy, high-order harmonic energy ratio, high-order harmonic energy change, and high-order harmonic instantaneous peak value. The specific calculation formulas are as follows:
[0024]
[0025] where H k is the amplitude of the k-th harmonic;
[0026]
[0027] where E high is the high-order harmonic energy; N1 is the starting order of the high-order harmonics; N2 is the ending order of the high-order harmonics;
[0028]
[0029] where P high is the high-order harmonic energy ratio; is the total energy of the signal; E high is the total energy of the high-order harmonics;
[0030]
[0031] where ΔE high is the change rate of the high-order harmonic energy; is the high-order harmonic energy at the time of fault; is the high-order harmonic energy in the normal state;
[0032]
[0033] where P peak is the instantaneous peak value of the high-order harmonic energy; x k (t) is the instantaneous amplitude of the k-th harmonic component;
[0034] The time features include the peak duration. The specific calculation formula is as follows:
[0035] T spike = t2 - t1, H(t2) ≤ ∈H peak
[0036] where H(t) is the instantaneous amplitude of the signal; H peak is the maximum value of the peak amplitude; t1 is the starting time of the peak; t2 is the ending time of the peak; ∈ is a constant.
[0037] Furthermore, the comprehensive judgment indexes for distribution network faults include: high-low order harmonic weight ratio index, dynamic harmonic energy mutation rate, odd-even harmonic energy deviation index, harmonic time-frequency entropy index, zero-sequence current peak index, and harmonic mutation characteristic index;
[0038] The calculation formula for the high-low order harmonic weight ratio index is:
[0039]
[0040] Wherein, H k is the amplitude of the k-th harmonic; w k is the weight factor of high-order harmonics, set as w k = k 2 ; N is the highest harmonic order; HLWRI is the high-low order harmonic weight ratio index;
[0041] The calculation formula for the dynamic harmonic energy mutation rate is:
[0042]
[0043] Wherein, DHER is the dynamic harmonic energy mutation rate; is the total harmonic energy; Δt is the sampling time interval;
[0044] The calculation formula for the odd-even harmonic energy deviation index is:
[0045]
[0046] Wherein, HOEI is the odd-even harmonic energy deviation index; odd is odd-order harmonics; even is even-order harmonics;
[0047] The calculation formula for the harmonic time-frequency entropy index is:
[0048]
[0049] Wherein, HFEI is the harmonic time-frequency entropy index; is the normalized ratio of the k-th harmonic energy;
[0050] The calculation formula for the zero-sequence current peak index is:
[0051] ZSPI = max t |I0(t)| * T spike
[0052] Wherein, I0(t) is the instantaneous value of the zero-sequence current; T spike is the peak duration; ZSPI is the zero-sequence current peak index;
[0053] The calculation formula for the harmonic mutation characteristic index is:
[0054]
[0055] Among them, E harm (t) is the value of the total harmonic energy varying with time; is the average value of the harmonic energy.
[0056] Furthermore, the training method of the SVM classification model includes the following steps:
[0057] Obtain sample data and perform preprocessing, and divide the sample data into a training set and a test set;
[0058] Select a kernel function to map the input data to a high-dimensional space. The expression of the kernel function is:
[0059]
[0060] Among them, K(x i , x j ) is the kernel function; σ controls the width of the Gaussian distribution;
[0061] Construct an SVM classification model based on the kernel function. The decision function of the SVM classification model is:
[0062]
[0063] Among them, α i is the Lagrange multiplier; b is the bias term; f(x) is the decision value;
[0064] The goal of the SVM classification model is to maximize the classification margin and reduce classification errors at the same time. The specific expression is:
[0065]
[0066] The constraint condition of the SVM classification model is:
[0067]
[0068] Among them, α i is the Lagrange multiplier; C is the penalty parameter;
[0069] Use the training set to train the SVM classification model. For a new sample x new , the classification result of the SVM classification model is:
[0070]
[0071] Among them, b is the bias term;
[0072] Verify the trained model using the test set; evaluate the model using accuracy, precision, recall, and confusion matrix as performance metrics, and further evaluate the model stability through k-fold cross-validation;
[0073] If both the performance metrics and the stability meet the preset conditions, output the trained SVM classification model; if either the performance metrics or the stability fails to meet the standard, perform parameter optimization and retrain the model until the preset conditions are met.
[0074] Further, the steps of obtaining sample data and performing preprocessing, and dividing the sample data into a training set and a test set specifically include:
[0075] Obtain sample data, where the sample data includes fault types, waveform features, and labels; given a sample set X = {x1, x2,..., x n}, where represents the m waveform features of the i-th sample; the corresponding label Y = {y1, y2,..., y n}, y i ∈{-1, +1,..., k} represents the fault category;
[0076] Normalize all waveform features x i so that their values are in the same order of magnitude. The specific calculation formula is:
[0077]
[0078] where is the normalized waveform feature; μ is the mean of the feature; σ is the standard deviation;
[0079] Use the principal component analysis method to perform dimensionality reduction on the normalized waveform features to obtain the preprocessed sample data. The specific calculation formula is:
[0080] X new = X·P
[0081] where X is the original feature matrix, P is the PCA transformation matrix; X new is the feature matrix after dimensionality reduction;
[0082] Divide the sample data into a training set and a test set. 80% of the sample data is the training set, and 20% of the sample data is the test set.
[0083] Further, it also includes:
[0084] Calculate the confidence of the classification result. The specific calculation formula is:
[0085] Confidence = |f(x)|
[0086] Among them, Confidence represents the confidence level; f(x) is the decision value;
[0087] If the confidence level is lower than the preset threshold, trigger the secondary diagnosis process and reclassify by adding features.
[0088] In a second aspect, the present invention provides a distribution network fault diagnosis system based on harmonic spectrum analysis, including:
[0089] A preprocessing module, configured to collect abnormal signals and perform preprocessing when a distribution network fault occurs to obtain a harmonic spectrum;
[0090] A feature extraction module, configured to extract features from the harmonic spectrum to obtain a number of feature values;
[0091] A multi-dimensional analysis module, configured to calculate a comprehensive judgment index for distribution network faults through a number of feature values;
[0092] An SVM classification module, configured to input the comprehensive judgment index for distribution network faults into a pre-trained SVM classification model to obtain a classification result of fault diagnosis.
[0093] In a third aspect, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above method are implemented.
[0094] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0095] Compared with the prior art, the present invention has the following beneficial effects:
[0096] The present invention discloses a distribution network fault diagnosis method and related devices based on harmonic spectrum analysis. When a distribution network fault occurs, abnormal signals are collected to accurately analyze short-time fault signals, which can quickly capture spectral features at the initial stage of the fault and perform diagnosis in a timely manner, solving the lag problem in short-time fault diagnosis of traditional methods; the present invention introduces a multi-dimensional spectrum analysis method, extracts multi-level harmonic features of fault signals, comprehensively considers the mutual influence of various fault factors, and calculates a comprehensive judgment index for distribution network faults. Combining with the SVM classification model can efficiently and accurately classify fault types, avoiding misjudgment and blind spot problems caused by single feature extraction in traditional methods and improving the accuracy of fault diagnosis. Description of the Drawings
[0097] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the embodiments. It should be understood that the following drawings only show certain embodiments of the present invention, and thus should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0098] Figure 1 is the flowchart of the method of the present invention;
[0099] Figure 2 is the schematic diagram of the principle of the system of the present invention;
[0100] Figure 3 is the schematic diagram of the comprehensive judgment index for distribution network faults in the embodiments of the present invention;
[0101] Figure 4 is the flowchart of the distribution network fault diagnosis method in the embodiments of the present invention;
[0102] Figure 5 is the schematic diagram of the structure of the computer device of the present invention. Detailed implementation manners
[0103] The following will refer to the accompanying drawings and combine with embodiments to detail the present invention. It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
[0104] The following detailed descriptions are all exemplary descriptions, aiming to provide further detailed descriptions of the present invention. Unless otherwise specified, all technical terms adopted by the present invention have the same meaning as commonly understood by those of ordinary skill in the art to which the present application belongs. The terms used in the present invention are only for describing specific implementation manners, and are not intended to limit the exemplary embodiments according to the present invention.
[0105] See Figure 1 and Figure 4 , the embodiments of the present invention disclose a distribution network fault diagnosis method based on harmonic spectrum analysis. By adopting advanced signal processing technologies and combining more accurate harmonic feature extraction algorithms, it can efficiently distinguish different types of faults. Through multi-dimensional fault feature extraction and classification algorithm optimization, the diagnostic accuracy and the precision of fault classification are improved. Especially in complex fault situations, the robustness and diagnostic accuracy can be effectively enhanced.
[0106] Specifically, it includes the following steps:
[0107] S1. When a distribution network fault occurs, collect abnormal signals and perform preprocessing to obtain a harmonic spectrum;
[0108] S1.1 Signal collection
[0109] When a fault occurs in the distribution network, the fault indicator will record the time-domain waveform data of current and voltage in real time. At key nodes of distributed transformers, circuit breakers or distribution network lines, it can capture abnormal waveform changes caused by faults such as short circuits, ground faults and line breaks. To ensure that the collected signals can cover sufficient harmonic components, a sampling rate that conforms to the Nyquist sampling law is selected to cover the frequency range up to and including the 20th harmonic.
[0110] S1.2 Data preprocessing
[0111] The collected original signals are affected by noise, environmental interference or equipment self-errors. The wavelet threshold denoising method is used to perform multi-resolution decomposition on the signals. After thresholding the high-frequency noise, the original signals are reconstructed. The signal amplitudes are normalized to ensure that all waveform data are within a unified magnitude range, improving the robustness of subsequent analysis. According to the time window of the fault occurrence, the waveform signals are intercepted, and only the data of one cycle before and after the fault are retained, reducing the calculation amount and highlighting the key features.
[0112] S2. Extract features from the harmonic spectrum to obtain a number of eigenvalues;
[0113] Extract features from the harmonic spectrum to obtain the following features:
[0114] 1. Fundamental wave features
[0115] Fundamental wave amplitude:
[0116]
[0117] where ψ0(t) is the fundamental wavelet function and H0 is the fundamental wave amplitude.
[0118] Fundamental wave amplitude distortion rate:
[0119]
[0120] where and are the amplitudes of the fundamental wave before and after the fault, respectively.
[0121] 2. Harmonic features
[0122] Harmonic amplitude:
[0123]
[0124] where H k is the amplitude of the kth harmonic.
[0125] Higher harmonic energy:
[0126]
[0127] Among them, N1, N2: starting and ending orders of high-order harmonics;
[0128] Proportion of high-order harmonic energy:
[0129]
[0130] Among them, P high : Proportion of high-order harmonic energy; Total energy of the signal; E high : Total energy of high-order harmonics;
[0131] Change in high-order harmonic energy:
[0132]
[0133] Among them, ΔE high : Rate of change of high-order harmonic energy (percentage). High-order harmonic energy during a fault. High-order harmonic energy in the normal state. If ΔE high > 0, it indicates that the high-order harmonic energy increases significantly during a fault.
[0134] Instantaneous peak value of high-order harmonics:
[0135]
[0136] Among them, P peak : Instantaneous peak value of high-order harmonic energy. x k (t): Instantaneous amplitude of the k-th harmonic component. N1, N2: starting and ending orders of high-order harmonics.
[0137] 3. Time characteristics
[0138] Peak duration:
[0139] T spike = t2 - t1, H(t2) ≤ ∈H peak
[0140] Among them, H(t): Instantaneous amplitude of the signal. H peak : Maximum value of the peak amplitude. t1: Starting time of the peak. t2: Ending time of the peak. ∈ is 0.05.
[0141] S3, a comprehensive judgment index for distribution network faults is calculated through several eigenvalues;
[0142] See Figure 3 , the comprehensive judgment index for distribution network faults includes:
[0143] 1. High-Low Weighted Ratio Index (HLWRI)
[0144] Objective: To quickly identify high-frequency impact or oscillation faults caused by lightning strikes or vehicle collisions with poles, etc., through the weight differences of high and low harmonics.
[0145]
[0146] Among them, H k : The amplitude of the k-th harmonic; w k : The weight factor of high-order harmonics, set as w k = k 2 (reflecting the importance of high-frequency characteristics). N: The highest harmonic order.
[0147] Fault characteristics:
[0148] Lightning strike: The proportion of the weight of high-order harmonics increases significantly, and HLWR increases.
[0149] Bird damage / tree-line conflict: Dominated by low-order harmonics, and HLWRI is relatively low.
[0150] Vehicle collision with pole: HLWRI is moderately high, with high-frequency oscillation
[0151] This embodiment introduces the weight factor w k , highlighting the importance of high-order harmonics and enhancing the sensitivity to lightning strike and vehicle collision with pole faults.
[0152] 2. Dynamic Harmonic Energy Rate (DHER)
[0153] Objective: To analyze the time-varying characteristics of harmonic energy and capture the spike and oscillation characteristics during fault occurrence.
[0154]
[0155] Among them, Total harmonic energy. t: Sampling time interval.
[0156] Fault characteristics:
[0157] Lightning strike: DHER increases significantly, reflecting the harmonic energy mutation caused by high-frequency impact.
[0158] Vehicle collision with pole: DHER is relatively high, and oscillation causes large energy fluctuations.
[0159] Bird damage / tree-line conflict: DHER is relatively low, and the energy fluctuation is slow or intermittent.
[0160] This embodiment utilizes the time-varying gradient of harmonic energy to highlight the high-energy mutation characteristics caused by lightning strikes and vehicle collisions with poles.
[0161] 3. Harmonic Odd-Even Index (HOEI)
[0162] Objective: Analyze the asymmetric characteristics of tree-line conflicts and lightning strike faults through the asymmetry of odd and even harmonic energies.
[0163]
[0164] Where H k : Magnitude of the k-th harmonic. Odd harmonics: 3, 5, 7…; Even harmonics: 2, 4, 6…
[0165] Lightning strike / tree-line conflict: Even harmonics are enhanced and HOEI decreases, showing asymmetric current.
[0166] Bird damage: Odd harmonics (especially the 3rd harmonic) are dominant and HOEI is relatively high.
[0167] Vehicle hitting the pole: Odd harmonics are dominant and HOEI is moderately high.
[0168] This embodiment analyzes the asymmetry from the perspective of odd and even harmonic distributions and is suitable for analyzing tree-line conflicts and lightning strike faults.
[0169] 4. Harmonic Frequency Entropy Index (HFEI)
[0170] Objective: Quantify the complexity of harmonic energy distribution, especially harmonic anomalies caused by lightning strikes or high-frequency disturbances.
[0171]
[0172] Where Normalized ratio of the k-th harmonic energy.
[0173] Fault characteristics:
[0174] Lightning strike: HFEI increases significantly, reflecting the complex distribution of high-order harmonics.
[0175] Vehicle hitting the pole: HFEI is relatively high, and the distribution of high-order harmonics is abnormal during the oscillation process.
[0176] Bird damage / tree-line conflict: HFEI is relatively low, and the harmonic distribution is relatively simple.
[0177] This embodiment uses entropy values to describe the complexity of harmonics and is applicable to high-frequency impact or disturbance characteristics.
[0178] 5. Zero-Sequence Peak Index (ZSPI)
[0179] Objective: Detect the zero-sequence current spike phenomenon for diagnosing faults caused by bird damage and asymmetric current.
[0180] ZSPI = max t |I0(t)| * T spike
[0181] Where, I0(t): The instantaneous value of the zero-sequence current. T spike : The spike duration.
[0182] Fault characteristics:
[0183] Bird damage: ZSPI increases significantly, showing intermittent spikes.
[0184] Lightning strike / tree-line conflict / vehicle hitting the pole: ZSPI is low, and the zero-sequence current spike is not significant.
[0185] This embodiment emphasizes the zero-sequence current spike characteristics in bird damage faults to distinguish them from other faults.
[0186] 6. Harmonic Change Burst Index (HCBI)
[0187] Objective: Analyze the mutation characteristics of harmonic energy to capture short-term faults caused by lightning strikes or bird damage.
[0188]
[0189] Where, E harm (t): The value of the total harmonic energy changing with time. The average value of the harmonic energy.
[0190] Fault characteristics:
[0191] Lightning strike: HCBI increases significantly, reflecting a high-energy mutation.
[0192] Bird damage: HCBI is medium, and the intermittent discharge causes energy fluctuations.
[0193] Vehicle hitting the pole / tree-line conflict: HCBI is low, and the energy change is relatively stable.
[0194] This embodiment quantitatively evaluates the mutation characteristics of harmonic energy and is applicable to transient shock diagnosis.
[0195] The DHER and HCBI in this embodiment are mainly used for dynamic change analysis and capture; the HLWRI and HFEI focus on the high-frequency harmonic distribution and are suitable for lightning strike and vehicle hitting the pole faults. Transient spike and oscillation characteristics. The HOEI and ZSPI are used for asymmetry analysis and are especially suitable for tree-line conflict and bird damage diagnosis.
[0196] S4. Input the comprehensive judgment indexes of the distribution network faults into the pre-trained SVM classification model to obtain the classification results of the fault diagnosis.
[0197] In this step, the training of the SVM classification model includes the following steps:
[0198] S4.1. Obtain the sample data and perform preprocessing, and divide the sample data into a training set and a test set;
[0199] 1) Organize the sample data into the input format required by the support vector machine, and at the same time perform data preprocessing to improve the model performance.
[0200] Fault types: such as lightning strike, vehicle hitting the pole, bird damage, tree-line conflict.
[0201] Waveform features: such as DHER, HCBI, HLWRI, HFEI, HOEI, OFI, etc.
[0202] Label: fault category.
[0203] Given sample set: X = {x1, x2,..., x n}, where represents the m waveform features (such as DHER, HCBI, etc.) of the i-th sample, and the corresponding label: Y = {y1, y2,..., y n}, y i ∈{-1, +1,..., k}, representing the category of the fault (such as lightning strike, bird damage, etc.).
[0204] 2) Normalization: Normalize all waveform features x i to make their values in the same magnitude.
[0205]
[0206] where μ is the mean of the features and σ is the standard deviation.
[0207] 3) Feature selection and dimensionality reduction: Reduce the dimension of the feature space, remove redundant features, and improve the training efficiency of the model.
[0208] Use principal component analysis (PCA) to perform dimensionality reduction on the features:
[0209] X new = X·P
[0210] where X is the original feature matrix, P is the PCA transformation matrix, and X new is the feature matrix after dimensionality reduction.
[0211] 4) Data division: Divide the samples into a training set and a test set for training and validating the model. Randomly divide X and Y into a training set and a test set in a certain proportion, with 80% for training and 20% for testing.
[0212] S4.2, Training of the support vector machine (SVM) classification model
[0213] 1) Select a kernel function to map the input data into a high-dimensional space to better find the classification hyperplane.
[0214] The decision function of SVM:
[0215]
[0216] where: K(x i , x) is the kernel function; α i is the Lagrange multiplier; b is the bias term.
[0217] Here, select the RBF kernel (Gaussian kernel) as the kernel function, and σ controls the width of the Gaussian distribution:
[0218]
[0219] 2) Construct the optimal classifier
[0220] The goal of SVM is to maximize the classification margin and minimize the classification error as much as possible:
[0221]
[0222] where the constraint conditions are:
[0223]
[0224] where, α i : Lagrange multiplier, solved by the gradient descent method using the Lagrange duality theory. C is the penalty parameter, used to balance the classification accuracy and the tolerance for outliers.
[0225] 3) Classification decision
[0226] Function: Use the trained model to classify new data.
[0227] For a new sample x new , the classification result is:
[0228]
[0229] S4.3, Use the test set to validate the trained model;
[0230] 1) Performance metrics
[0231] (1) Accuracy: Accuracy measures the overall classification correctness of the model.
[0232]
[0233] TP (True Positive): The positive class is correctly classified.
[0234] TN (True Negative): The negative class is correctly classified.
[0235] FP (False Positive): The negative class is misclassified as the positive class.
[0236] FN (False Negative): The positive class is misclassified as the negative class.
[0237] (2) Precision: Precision measures the reliability of the model's prediction for the positive class.
[0238]
[0239] A high precision indicates few false positives in the model's positive class predictions.
[0240] (3) Recall: Recall reflects the model's coverage ability for positive class samples.
[0241]
[0242] A high recall indicates a high proportion of positive class samples being recognized.
[0243] (4) Confusion Matrix: The confusion matrix shows the distribution of the classification results.
[0244]
[0245] Analyze the misclassification situation (e.g., the frequency of a certain type of fault being misjudged as another type of fault).
[0246] 2) Cross-validation: Further evaluate the model stability through k-fold cross-validation. The specific steps include:
[0247] 1. Divide the dataset into k subsets.
[0248] 2. Each time, take k - 1 subsets as the training set and the remaining 1 subset as the validation set.
[0249] 3. Repeat k times and take the average of the performance metrics.
[0250] 2) Parameter optimization
[0251] (1) Grid search
[0252] C ∈ {0.1, 1, 10, 100}, σ ∈ {0.1, 0.5, 1, 2}
[0253] Set the candidate value ranges of the hyperparameters C (regularization parameter) and σ (RBF kernel parameter), perform cross-validation for each parameter combination, and select the parameter with the best performance.
[0254] (2) Verify the generalization performance of the model
[0255] Calculate the final performance metrics using the test set to ensure that the performance of the model on new samples is close to the cross-validation results.
[0256] In this step, apply the trained and verified model to new samples for fault diagnosis, and finally obtain the classification results of fault diagnosis:
[0257] For a new sample x new , its classification result is:
[0258]
[0259] According to y new Output the fault category (such as external force faults like lightning strikes and vehicle hitting poles).
[0260] S5, Model confidence analysis and secondary diagnosis;
[0261] For each sample, calculate the confidence of the classification (the absolute value of the decision value f(x) output by the model):
[0262] Confidence = |f(x)|
[0263] The higher the confidence, the more reliable the classification result.
[0264] For samples with low confidence, trigger the secondary diagnosis process, add features, and reclassify.
[0265] See Figure 2 , this embodiment of the present invention discloses a distribution network fault diagnosis system based on harmonic spectrum analysis, including a preprocessing module, a feature extraction module, a multi-dimensional analysis module, and an SVM classification module;
[0266] Among them, the preprocessing module is used to collect abnormal signals and perform preprocessing when a distribution network fault occurs to obtain a harmonic spectrum; the feature extraction module is used to extract features from the harmonic spectrum to obtain several feature values; the multi-dimensional analysis module is used to calculate a comprehensive judgment index for distribution network faults through several feature values; the SVM classification module is used to input the comprehensive judgment index for distribution network faults into a pre-trained SVM classification model to obtain the classification results of fault diagnosis.
[0267] In one embodiment of the present invention, a computer device is provided. Refer to Figure 5 , the computer device includes a processor and a memory. The memory is used to store a computer program, and the computer program includes program instructions. The processor is used to execute the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, and is suitable for implementing one or more instructions. Specifically, it is suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function. The processor described in the embodiments of the present invention can be used for the operation of a distribution network fault diagnosis method based on harmonic spectrum analysis.
[0268] The present invention also provides a storage medium, specifically a computer-readable storage medium (Memory). The computer-readable storage medium is a memory device in the computer device and is used to store programs and data. It can be understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and, of course, the extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space, and the operating system of the terminal is stored in this storage space. And, one or more instructions suitable for being loaded and executed by the processor are also stored in this storage space. These instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. One or more instructions stored in the computer-readable storage medium can be loaded and executed by the processor to implement the corresponding steps of a distribution network fault diagnosis method based on harmonic spectrum analysis in the above embodiments.
[0269] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) that contain computer-usable program code.
[0270] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices produce a means for implementing the functions specified in Figure 1 one or more of the processes Figure 1 or blocks or a combination of blocks.
[0271] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing devices to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction means that implements the functions specified in Figure 1 one or more of the processes Figure 1 or blocks or a combination of blocks.
[0272] These computer program instructions can also be loaded onto a computer or other programmable data processing devices, such that a series of operation steps are executed on the computer or other programmable devices to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable devices provide steps for implementing the functions specified in Figure 1 one or more of the processes Figure 1 or blocks or a combination of blocks.
[0273] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: the specific implementation manners of the present invention can still be modified or equivalently replaced, and any modification or equivalent replacement that does not depart from the spirit and scope of the present invention shall be covered by the protection scope of the claims of the present invention.
Claims
1. A distribution network fault diagnosis method based on harmonic spectrum analysis, characterized in that: The following steps are involved: When a distribution network fault occurs, the abnormal signal is collected and preprocessed to obtain the harmonic spectrum; Extract features from the harmonic spectrum to obtain several eigenvalues; The comprehensive analysis index of distribution network faults is obtained by calculating several characteristic values; The comprehensive analysis index of distribution network faults is input into the pre-trained SVM classification model to obtain the classification results of fault diagnosis.
2. A distribution network fault diagnosis method based on harmonic spectrum analysis according to claim 1, characterized in that: The step of collecting abnormal signals and preprocessing them to obtain harmonic spectrum specifically includes: When a distribution network fault occurs, the time domain waveform data of current and voltage is recorded in real time through the fault indicator, the abnormal waveform changes caused by the fault are obtained, and the original signal is collected; The wavelet threshold denoising method is used to perform multi-resolution decomposition on the original signal, and the high-frequency noise is thresholded to reconstruct the original signal. The signal amplitude is normalized, and finally the signal is intercepted to retain the data of one cycle before and after the fault to obtain the harmonic spectrum.
3. A distribution network fault diagnosis method based on harmonic spectrum analysis according to claim 1, characterized in that: The step of extracting features from the harmonic spectrum to obtain a number of eigenvalues specifically includes: Extract the features of the harmonic spectrum to obtain fundamental wave features, harmonic features and time features; The fundamental wave characteristics include the fundamental wave amplitude and the fundamental wave amplitude distortion rate, and the specific calculation formula is: Where H0 is the fundamental amplitude; ψ0(t) is the fundamental wavelet function; Where D is the fundamental amplitude distortion rate; and are the amplitudes of the fundamental wave before and after the fault respectively; The harmonic characteristics include harmonic amplitude, high-order harmonic energy, high-order harmonic energy ratio, high-order harmonic energy change and high-order harmonic instantaneous peak value. The specific calculation formula is: Among them, H k is the amplitude of the kth harmonic; Among them, E high is the high-order harmonic energy; N1 is the starting order of the high-order harmonic; N2 is the ending order of the high-order harmonic; Among them, P high is the proportion of high-order harmonic energy; is the total energy of the signal; E high is the total energy of higher harmonics; Where, ΔE high is the rate of change of higher harmonic energy; It is the high-order harmonic energy during fault; It is the high-order harmonic energy under normal conditions; Among them, P peak is the instantaneous peak value of high-order harmonic energy; x k (t) is the instantaneous amplitude of the kth harmonic component; The time feature includes the peak duration, and the specific calculation formula is: T spike =t2-t1,H(t2)≤∈H peak Where H(t) is the instantaneous amplitude of the signal; H peak is the maximum value of the peak amplitude; t1 is the start time of the peak; t2 is the end time of the peak; ∈ is a constant.
4. A distribution network fault diagnosis method based on harmonic spectrum analysis according to claim 1, characterized in that: The comprehensive analysis and judgment indicators of distribution network faults include: high-order and low-order harmonic weight ratio index, dynamic harmonic energy mutation rate, odd-even harmonic energy deviation index, harmonic time-frequency entropy index, zero-sequence current peak index and harmonic mutation characteristic index; The calculation formula of the high and low harmonic weight ratio index is: Among them, H k is the amplitude of the kth harmonic; w k is the weight factor of higher harmonics, set to w k =k 2 ; N is the highest harmonic number; HLWRI is the high and low harmonic weight ratio index; The calculation formula of the dynamic harmonic energy mutation rate is: Where DHER is the dynamic harmonic energy mutation rate; is the total harmonic energy; Δt is the sampling time interval; The calculation formula of the odd and even harmonic energy deviation index is: Among them, HOEI is the odd-even harmonic energy deviation index; odd is the odd harmonic; even is the even harmonic; The calculation formula of the harmonic time-frequency entropy index is: Among them, HFEI is the harmonic time-frequency entropy index; is the normalized ratio of the kth harmonic energy; The calculation formula of the zero-sequence current peak index is: ZSPI=max t |I0(t)|*T spike Where, I0(t) is the instantaneous value of zero-sequence current; T spike is the peak duration; ZSPI is the zero-sequence current spike index; The calculation formula of the harmonic mutation characteristic index is: Among them, E harm (t) is the variation of total harmonic energy over time; is the average value of the harmonic energy.
5. A distribution network fault diagnosis method based on harmonic spectrum analysis according to claim 1, characterized in that: The training method of the SVM classification model comprises the following steps: Obtain sample data and perform preprocessing, dividing the sample data into training set and test set; A kernel function is selected to map the input data to a high-dimensional space. The expression of the kernel function is: Among them, K(x i ,x j ) is the kernel function; σ controls the width of the Gaussian distribution; The SVM classification model is constructed based on the kernel function. The decision function of the SVM classification model is: Among them, α i is the Lagrange multiplier; b is the bias term; f(x) is the decision value; The goal of the SVM classification model is to maximize the classification interval while reducing the classification error. The specific expression is: The constraints of the SVM classification model are: Among them, α i is the Lagrange multiplier; C is the penalty parameter; Use the training set to train the SVM classification model. For the new sample x new , the classification result of the SVM classification model is: Where b is the bias term; Use the test set to verify the trained model; use accuracy, precision, recall and confusion matrix as performance indicators to evaluate the model, and use k-fold cross validation to further evaluate the model stability; If both the performance index and stability meet the preset conditions, the trained SVM classification model is output; if any of the performance index and stability does not meet the standard, parameter optimization is performed and the model is retrained until the preset conditions are met.
6. A distribution network fault diagnosis method based on harmonic spectrum analysis according to claim 5, characterized in that: The step of obtaining sample data and performing preprocessing to divide the sample data into a training set and a test set specifically includes: Obtain sample data, which includes fault type, waveform characteristics and labels; given a sample set X = {x1, x2, ..., x n },in represents the m waveform features of the ith sample; the corresponding label Y = {y1, y2, ..., y n },y i ∈{-1,+1,...,k} represents the fault category; For all waveform features x i Normalize them so that their values are at the same level. The specific calculation formula is: in, is the normalized waveform feature; μ is the mean of the feature; σ is the standard deviation; The principal component analysis method is used to reduce the dimension of the normalized waveform features to obtain the preprocessed sample data. The specific calculation formula is: X new =X·P Among them, X is the original feature matrix, P is the PCA transformation matrix; X new is the feature matrix after dimensionality reduction; The sample data is divided into a training set and a test set, 80% of the sample data is the training set and 20% of the sample data is the test set.
7. A distribution network fault diagnosis method based on harmonic spectrum analysis according to claim 1, characterized in that: Also includes: Calculate the confidence of the classification result. The specific calculation formula is: Confidence=|f(x)| Among them, Confidence represents confidence; f(x) is the decision value; If the confidence level is lower than the preset threshold, the secondary diagnosis process is triggered and features are added for reclassification.
8. A distribution network fault diagnosis system based on harmonic spectrum analysis, characterized in that: include: A preprocessing module is used to collect abnormal signals and preprocess them to obtain harmonic spectrum when a distribution network fault occurs; A feature extraction module is used to extract features from the harmonic spectrum to obtain a number of feature values; Multi-dimensional analysis module, used to obtain comprehensive analysis indicators of distribution network faults through calculation of several characteristic values; The SVM classification module is used to input the comprehensive analysis and judgment indicators of distribution network faults into the pre-trained SVM classification model to obtain the classification results of fault diagnosis.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Fault monitoring method and early warning system for loading and unloading crane pipe at bottom
CN121027832A
Primary and secondary fusion complete ring main unit fault diagnosis method and system
CN121389910A