Random forest model-based power distribution network traveling wave adaptive filtering method and device
By using an adaptive filtering method based on a random forest model, and leveraging multidimensional feature extraction and optimal wavelet threshold function selection, the problem of poor filtering effect of a single threshold function is solved, achieving efficient noise reduction of traveling wave signals in distribution networks and accurate fault location.
Patent Information
- Application Number
- CN202511404944.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2045-09-29
AI Technical Summary
In existing technologies, the traveling wave signal filtering method based on a single threshold function has limited noise reduction effect in distribution network fault location, making it difficult to accurately locate the fault point, especially in complex noise backgrounds.
An adaptive filtering method based on a random forest model is adopted. Multi-scale decomposition is performed through discrete wavelet transform to extract multi-dimensional features. The optimal wavelet threshold function and threshold are selected using the random forest model to reconstruct the signal, thereby suppressing noise and preserving key features.
It significantly improves noise reduction performance and fault identification accuracy, especially under conditions of low signal-to-noise ratio or abrupt and complex signals, and has good generalization ability and engineering adaptability.
Smart Images

Figure CN121327673A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traveling wave detection technology, and in particular to an adaptive filtering method and apparatus for traveling waves in distribution networks based on a random forest model. Background Technology
[0002] When a short circuit or ground fault occurs in a power distribution network, a sudden and dramatic change in voltage and current occurs at the fault point, which in turn excites an electromagnetic traveling wave (TWW) signal propagating along the distribution line. TWWW signals are characterized by high propagation speed and strong abrupt changes, and can be used to locate fault points in the power distribution network. However, background noise such as electromagnetic interference, white noise, and switching noise exists in the power distribution system, making TWWW signals highly susceptible to contamination during transmission, thus affecting the accuracy of fault location. Current technologies typically use a single threshold function with adaptive modulation optimization to filter the TWWW signal. However, this noise reduction effect is limited and makes it difficult to accurately locate the fault point. Summary of the Invention
[0003] The adaptive filtering method and apparatus for traveling wave signals in distribution networks based on random forest models provided in this invention at least solves the problem that the noise reduction effect of filtering traveling wave signals with a single threshold function is limited and it is difficult to accurately locate fault points. The method achieves filtering by adaptively selecting a suitable threshold function based on signal characteristics, which effectively suppresses noise and improves the accuracy of fault point location.
[0004] In a first aspect, the present invention provides an adaptive filtering method for traveling waves in a distribution network based on a random forest model, comprising the steps of: performing multi-scale decomposition on a first traveling wave signal according to discrete wavelet transform to obtain first detail coefficients and first approximation coefficients; performing multi-dimensional feature extraction on the first traveling wave signal and the first detail coefficients to obtain a first feature vector of the first traveling wave signal; inputting the first feature vector into a trained random forest model, and outputting the optimal wavelet threshold function type and optimal threshold of the first traveling wave signal through the random forest model; performing thresholding on the first detail coefficients according to the optimal wavelet threshold function type and the optimal threshold to obtain denoised second detail coefficients; and reconstructing the first traveling wave signal according to the second detail coefficients and the first approximation coefficients to obtain a second traveling wave signal.
[0005] In one embodiment of the present invention, multi-dimensional feature extraction is performed based on the first traveling wave signal and the first detail coefficients to obtain a first feature vector of the first traveling wave signal, including the following steps: frequency domain feature extraction is performed based on the first detail coefficients to obtain a first feature; wherein the first feature includes the wavelet energy distribution, energy concentration, and wavelet entropy corresponding to the first detail coefficients; time domain feature extraction is performed based on the first traveling wave signal to obtain a first second feature; wherein the first second feature includes the root mean square value, maximum amplitude, and duration corresponding to the first traveling wave signal; statistical distribution feature extraction is performed based on the first traveling wave signal to obtain a first third feature; wherein the first third feature includes the skewness, kurtosis, number of local extrema, and noise estimate corresponding to the first traveling wave signal; and feature vector is constructed based on the first first feature, the first second feature, and the first third feature to obtain the first feature vector.
[0006] In one embodiment of the present invention, the first feature vector is input into a trained random forest model, and the random forest model outputs the optimal wavelet threshold function type and the optimal threshold of the first traveling wave signal. The steps include: inputting the first feature vector into the random forest model, determining a preliminary classification result of the first traveling wave signal through the classification trees of the random forest model; wherein the random forest model includes multiple classification trees; inputting the preliminary classification result into the statistical analyzer of the random forest model, and using the statistical analyzer to count the number of each preliminary classification result, determining the preliminary classification result with the most occurrences as the optimal wavelet threshold function type; inputting the optimal wavelet threshold function type into the particle swarm optimizer of the random forest model, and using the particle swarm optimizer to optimize the threshold size of the optimal wavelet threshold function type to obtain the optimal threshold.
[0007] In one embodiment of the present invention, before inputting the first feature vector into the trained random forest model, the method further includes the following steps: training the pre-constructed random forest model to be trained according to preset particles and a training set to obtain a first random forest model corresponding to the preset particles; wherein, the preset particles include the number of classification trees, the minimum number of leaf nodes, and the number of random features for node splitting; performing cross-validation on the first random forest model based on the out-of-bag data of the first random forest model to obtain the macro-average F1 score of the first random forest model; performing particle swarm optimization iterative optimization on the first random forest model according to preset particle swarm optimization parameters and the macro-average F1 score to obtain the optimal hyperparameters; and retraining the first random forest model according to the optimal hyperparameters to obtain the trained random forest model.
[0008] In one embodiment of the present invention, a first traveling wave signal is decomposed into first detail coefficients and first approximation coefficients according to discrete wavelet transform, comprising the steps of: calculating the inner product of the first traveling wave signal and the target sub-wavelet to obtain wavelet transform coefficients; wherein the target sub-wavelet is obtained by scaling and time-shifting the Dobessi wavelet basis function; and recursively decomposing the wavelet transform coefficients through a filter bank to obtain the first detail coefficients of multiple layers and the first approximation coefficients of the target layer.
[0009] In one embodiment of the present invention, the wavelet transform coefficients are obtained by performing an inner product calculation on the first traveling wave signal and the target sub-wavelet, as follows: , In the formula, The wavelet transform coefficients are... As a scale, For time shift, The first traveling wave signal, For time, For the target sub-wavelet, Let be the Dobessi wavelet basis function.
[0010] In one embodiment of the present invention, the optimal wavelet threshold function type includes a soft threshold function, a hard threshold function, and a compromise threshold function; thresholding is performed on the first detail coefficients according to the soft threshold function and the optimal threshold corresponding to the soft threshold function to obtain denoised second detail coefficients, including the steps of: setting the first detail coefficient to zero when the absolute value of the first detail coefficient is not greater than the optimal threshold; adjusting the first detail coefficient to the product of the difference between the absolute value of the first detail coefficient and the optimal threshold and the sign of the first detail coefficient when the optimal threshold is less than the absolute value of the first detail coefficient; thresholding is performed on the first detail coefficients according to the hard threshold function and the optimal threshold corresponding to the hard threshold function to obtain denoised second detail coefficients, including the step of: thresholding the first detail coefficients according to the soft threshold function and the optimal threshold corresponding to the hard threshold function to obtain denoised second detail coefficients, including the step of: thresholding the first detail coefficients according to the soft threshold function and the optimal threshold corresponding to the soft threshold function to obtain denoised second detail coefficients. If the absolute value of the first detail coefficient is not greater than the optimal threshold, the first detail coefficient is set to zero; if the optimal threshold is less than the absolute value of the first detail coefficient, the first detail coefficient is retained; according to the compromise threshold function and the optimal threshold corresponding to the compromise threshold function, the first detail coefficient is thresholded to obtain the noise-reduced second detail coefficient, including the steps of: if the absolute value of the first detail coefficient is less than the lower limit of the optimal threshold, the first detail coefficient is set to zero; if the absolute value of the first detail coefficient is within the range of the optimal threshold, the first detail coefficient is adjusted to be the product of the difference between the absolute value of the first detail coefficient and the optimal threshold and the sign of the first detail coefficient; if the upper limit of the optimal threshold is less than the absolute value of the first detail coefficient, the first detail coefficient is retained.
[0011] In one embodiment of the present invention, before performing multi-scale decomposition on the first traveling wave signal according to discrete wavelet transform to obtain the first detail coefficients and the first approximation coefficients, the method further includes the steps of: acquiring the original traveling wave signal of the target distribution network; and standardizing the original traveling wave signal to obtain the first traveling wave signal; wherein the standardization process includes amplitude normalization and sampling alignment.
[0012] Secondly, the present invention also provides a distribution network traveling wave adaptive filtering device based on a random forest model, applied to the distribution network traveling wave adaptive filtering method based on a random forest model as described in any one of the above claims, comprising a wavelet transform module for performing multi-scale decomposition on a first traveling wave signal according to discrete wavelet transform to obtain first detail coefficients and first approximation coefficients; a feature extraction module for performing multi-dimensional feature extraction on the first traveling wave signal and the first detail coefficients to obtain a first feature vector of the first traveling wave signal; an optimal determination module for inputting the first feature vector into a trained random forest model and outputting the optimal wavelet threshold function type and optimal threshold of the first traveling wave signal through the random forest model; a filtering processing module for performing threshold processing on the first detail coefficients according to the optimal wavelet threshold function type and the optimal threshold to obtain denoised second detail coefficients; and a signal reconstruction module for reconstructing the first traveling wave signal according to the second detail coefficients and the first approximation coefficients to obtain a second traveling wave signal.
[0013] Thirdly, the present invention also provides an electronic device including a processor and a memory storing a program, the program including instructions that, when executed by the processor, cause the processor to perform the adaptive filtering method for traveling waves in a distribution network based on a random forest model as described in any of the preceding claims.
[0014] Compared with the prior art, the above-described technical solution of the present invention has the following advantages:
[0015] The adaptive wave filtering method for distribution networks based on a random forest model described in this invention extracts multidimensional features of the signal in the time, frequency, and statistical domains. It then uses the random forest model to discriminate the signal's structural characteristics, enabling dynamic intelligent selection of three threshold functions: soft, hard, and compromise. This allows each signal type to be matched with the most suitable denoising strategy, significantly improving denoising performance, especially under conditions of low signal-to-noise ratio or abrupt, complex signals. This avoids the contradiction between denoising and fidelity found in existing threshold methods, effectively suppressing noise while retaining key feature components needed for fault location, thus improving the accuracy of fault identification and ranging. Furthermore, it possesses strong generalization ability and engineering adaptability, making it well-suited for adaptive signal denoising in distribution network fault detection scenarios. Attached Figure Description
[0016] 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 embodiments can be obtained based on these drawings without creative effort. In the drawings:
[0017] Figure 1 This is one of the flowcharts of the adaptive filtering method for traveling waves in distribution networks based on a random forest model in a preferred embodiment of the present invention.
[0018] Figure 2 This is the second flowchart of the adaptive filtering method for traveling waves in distribution networks based on a random forest model in a preferred embodiment of the present invention.
[0019] Figure 3 This is a schematic diagram of the energy hierarchy of the first traveling wave signal in a preferred embodiment of the present invention.
[0020] Figure 4 This is a schematic diagram of multidimensional feature extraction in a preferred embodiment of the present invention.
[0021] Figure 5 This is a waveform diagram of a preferred embodiment of the present invention.
[0022] Figure 6 This is a schematic diagram of the structure of a distribution network traveling wave adaptive filtering device based on a random forest model in a preferred embodiment of the present invention.
[0023] Figure 7 This is a schematic diagram of the structure of an electronic device in a preferred embodiment of the present invention.
[0024] The above figures include the following reference numerals: 11, wavelet transform module; 12, feature extraction module; 13, optimal determination module; 14, filtering module; 15, signal reconstruction module; 201, calculation unit; 202, ROM; 203, RAM; 204, bus; 205, I / O interface; 206, input unit; 207, output unit; 208, storage unit; 209, communication unit. Detailed Implementation
[0025] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the invention. It should be understood that the accompanying drawings and embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the invention.
[0026] It should be noted that, when faced with noise in traveling wave signals of power distribution networks, wavelet transform has become a commonly used signal denoising tool due to its excellent time-frequency localization characteristics.
[0027] In existing technologies, wavelet thresholding denoising methods mainly use fixed-form soft thresholding, hard thresholding, or compromise thresholding functions to process different traveling wave signals. This approach suffers from insufficient adaptability.
[0028] In recent years, scholars both domestically and internationally have conducted extensive research on wavelet thresholding denoising methods. However, the research direction remains focused on improving wavelet threshold functions or proposing new threshold functions. This approach, however, is still limited to single fixed threshold denoising, improving the processing effect only under specific characteristics of traveling wave signals. In complex noise backgrounds and with increasingly diverse signals, it is difficult to balance signal fidelity and noise suppression, thus limiting its engineering application effectiveness.
[0029] In existing technologies, machine learning has been incorporated into signal processing, but most of these studies focus on the adaptive tuning and optimization of a single threshold function. When faced with traveling wave signals with significantly different characteristics, even after adjusting the threshold function parameters and optimizing the function, the threshold function may still not be suitable, and the noise reduction effect will still not achieve satisfactory results.
[0030] Furthermore, Chinese invention patent CN117763288A discloses a wavelet threshold denoising parameter optimization method based on an improved particle swarm optimization algorithm. This method improves wavelet basis optimization efficiency by optimizing the threshold and wavelet basis in wavelet denoising and employing an ant colony algorithm suitable for discrete parameter optimization. However, it remains limited to using particle swarm optimization to optimize the threshold parameters of a specific threshold function. For traveling wave signals with certain characteristics, the optimization may still yield unsatisfactory results.
[0031] Chinese invention patent CN107886078A discloses a wavelet thresholding denoising method based on a hierarchical adaptive threshold function. It constructs a threshold function that is continuous at the threshold, differentiable in the wavelet domain, and possesses a trend parameter. The trend parameter for each wavelet decomposition layer is obtained by calculating the entropy values of the noise signal energy and the total signal energy at each decomposition layer, allowing the wavelet threshold function to adaptively select the trend parameter at each decomposition layer. However, this method is still limited to improving and optimizing a single threshold function. While it possesses a certain degree of adaptability, it cannot achieve targeted dynamic adjustment for traveling wave signals with different characteristics.
[0032] Chinese invention patent CN117332219A discloses an electrical signal denoising method based on wavelet packet frequency division adaptive denoising. The method involves wavelet packet decomposition of the electrical signal to obtain a wavelet packet tree, adjusting the frequency division threshold of the node coefficients in the last layer using the energy ratio coefficients corresponding to each node, and then applying the frequency division threshold function for denoising to obtain the denoised node coefficients of each frequency band in the last layer, ultimately reconstructing the denoised electrical signal. However, its adaptive strategy is singular, relying solely on frequency energy and failing to fully utilize the time-frequency characteristics of the signal. It also lacks a mechanism for judging and selecting the merits of different types of threshold functions, making it unable to adapt to variations in different signal types or complex operating conditions.
[0033] To solve the above problems, refer to Figure 1 As shown, this embodiment of the invention provides an adaptive filtering method for traveling waves in distribution networks based on a random forest model. The adaptive filtering method for traveling waves in distribution networks based on a random forest model includes the following steps:
[0034] First, the first traveling wave signal is decomposed into first detail coefficients and first approximation coefficients according to the discrete wavelet transform.
[0035] Secondly, multi-dimensional feature extraction is performed based on the first traveling wave signal and the first detail coefficient to obtain the first feature vector of the first traveling wave signal.
[0036] Next, the first feature vector is input into the trained random forest model, and the random forest model outputs the optimal wavelet threshold function type and the optimal threshold of the first traveling wave signal.
[0037] Subsequently, based on the optimal wavelet threshold function type and the optimal threshold, the first detail coefficients are thresholded to obtain the denoised second detail coefficients.
[0038] Finally, the first traveling wave signal is reconstructed based on the second detail coefficient and the first approximation coefficient to obtain the second traveling wave signal.
[0039] In this embodiment of the invention, the first traveling wave signal, i.e., the traveling wave signal of the target distribution network, can be voltage-type or current-type, and can be obtained through different sampling conditions. Multi-scale decomposition of the first traveling wave signal using discrete wavelet transform can accurately locate the low-frequency and high-frequency components in the signal, ensuring the accuracy of feature extraction.
[0040] Among them, the approximation coefficients, also known as the low-frequency component coefficients, are used to represent the overall trend and smoothing components of the signal. The detail coefficients, also known as the high-frequency component coefficients, are used to represent the detailed components of the signal, such as abrupt changes and rapid fluctuations. Taking a voltage-type traveling wave signal as an example, the low-frequency approximation coefficients can represent the power frequency component and overall trend of the voltage signal, while the high-frequency detail coefficients can represent the transient traveling waves caused by faults, switching operations, etc. in the voltage signal.
[0041] Those skilled in the art can set the specific number of decomposition layers according to actual needs. Preferably, 3 to 5 layers of decomposition are performed. For example, taking a 3-layer decomposition as an example, the first approximation coefficients A1, A2, and A3 of the first to third layers, and the first detail coefficients D1, D2, and D3 of the first to third layers can be obtained. In this case, A3, D1, D2, and D3 are selected. Among them, the detail coefficients are the main objects of thresholding, while the approximation coefficients are usually directly retained for the final signal reconstruction.
[0042] Those skilled in the art can select appropriate wavelet basis functions as the mother wavelet according to actual needs. For example, Daubechies 4 (db4), Symlet wavelet basis functions, and Coiflet wavelet basis functions can be selected. In distribution network traveling wave analysis, db4 is preferred, while other scenarios can be determined through cross-validation.
[0043] After completing the multi-scale decomposition and obtaining the corresponding coefficients, feature extraction can be performed. During feature extraction, one or more of time-domain features, frequency-domain features, and statistical distribution features can be selected, as long as the statistical features characterize the signal's time-frequency properties and noise structure are applicable. This also facilitates integration with existing traveling wave analysis systems, requiring no complex hardware support and exhibiting good integration and maintainability.
[0044] Subsequently, the first feature vector is used as the input to the random forest model. The random forest model identifies the matching relationship between the first feature vector and the wavelet threshold function, and the optimal wavelet threshold function type is determined based on the signal structure characteristics.
[0045] Random forests, as an ensemble learning algorithm, possess powerful nonlinear modeling capabilities and resistance to overfitting. They maintain high classification accuracy even when dealing with problems involving high feature dimensionality and complex inter-sample correlations.
[0046] Random Forest (RF) models are trained based on the signal characteristics of traveling wave signals and the corresponding optimal wavelet threshold functions. Through continuous iterative training, their adaptability is improved. This establishes a stable mapping relationship between signal characteristics and the optimal wavelet threshold function, enabling intelligent selection of the threshold function and exhibiting good adaptability and generalization. It is particularly suitable for noise reduction of traveling wave signals in distribution networks under various complex backgrounds, overcoming the limitations of traditional threshold strategies that rely solely on frequency domain features, avoiding overfitting to a single scenario, and improving robustness.
[0047] In addition, at the software implementation level, the random forest model is lightweight, has fast classification and inference speed, and can be deployed on embedded devices, edge computing terminals, or back-end servers.
[0048] For example, optimal wavelet thresholding function types include soft thresholding, hard thresholding, and compromise thresholding. By selecting the optimal wavelet thresholding function type to perform thresholding on the first detail coefficients, unimportant noise features can be effectively filtered out, while important traveling wave features are preserved and fine-tuned. This improves noise reduction performance, signal fidelity, and fault identification accuracy. Besides determining the optimal wavelet threshold function type, it's also necessary to identify the corresponding optimal threshold. This optimal threshold is used to distinguish which features are important and which are not. For example, noise estimation can be achieved using methods such as Median Absolute Deviation (MAD) to obtain the corresponding threshold.
[0049] After determining the optimal wavelet threshold function type and the corresponding optimal threshold, thresholding can be performed on the first detail coefficients to obtain the denoised second detail coefficients, thus suppressing noise while preserving the main signal components. Finally, the first traveling wave signal is reconstructed using the second detail coefficients and the first approximation coefficients to obtain the denoised second traveling wave signal.
[0050] This adaptive filtering approach, which uses feature-driven and model-based decision-making, is scalable and can be combined with deep learning and graph neural networks to achieve iterative optimization, possessing potential for long-term engineering applications and technological upgrades.
[0051] The adaptive wave filtering method for distribution networks based on a random forest model described in this invention extracts multidimensional features of the signal in the time, frequency, and statistical domains. It then uses the random forest model to discriminate the signal's structural characteristics, enabling dynamic intelligent selection of three threshold functions: soft, hard, and compromise. This allows each signal type to be matched with the most suitable denoising strategy, significantly improving denoising performance, especially under conditions of low signal-to-noise ratio or abrupt, complex signals. This avoids the contradiction between denoising and fidelity found in existing threshold methods, effectively suppressing noise while retaining key feature components needed for fault location, thus improving the accuracy of fault identification and ranging. Furthermore, it possesses strong generalization ability and engineering adaptability, making it well-suited for adaptive signal denoising in distribution network fault detection scenarios.
[0052] Reference Figure 2 As shown, in some embodiments of the adaptive filtering method for traveling waves in distribution networks based on the random forest model of the present invention, before performing multi-scale decomposition on the first traveling wave signal according to the discrete wavelet transform to obtain the first detail coefficients and the first approximation coefficients, the method further includes the step of first obtaining the original traveling wave signal of the target distribution network.
[0053] Among them, the original traveling wave signal is a voltage-type traveling wave signal or a current-type traveling wave signal collected by the monitoring device of the target distribution network, which has the characteristics of non-stationarity and abrupt change.
[0054] To ensure the effectiveness of subsequent multi-scale decomposition, the original traveling wave signal was then standardized to obtain the first traveling wave signal. The standardization process included amplitude normalization and sample alignment, and an appropriate signal length was selected for analysis based on the sampling frequency.
[0055] Reference Figure 2 As shown, the adaptive filtering method for traveling waves in distribution networks based on a random forest model, as described in this invention, in some embodiments, involves multi-scale decomposition of the first traveling wave signal according to discrete wavelet transform to obtain first detail coefficients and first approximation coefficients, including the following steps:
[0056] First, the Dobessi wavelet basis functions are scaled and time-shifted to obtain the target sub-wavelet. This is represented as:
[0057] .
[0058] In the formula, These are the Dobercy wavelet basis functions, also known as mother wavelets, used to detect specific shape templates for signal abrupt changes. The scale is an integer used to control... The scaling factor represents the frequency resolution of the analysis. A larger value indicates a lower frequency, and vice versa. It is a time shift, also an integer, used to control... The translation position along the time axis represents the time resolution of the analysis. The target sub-wavelet, also known as the mother wavelet, is defined by a specific scale and location. Sub-wavelets after scaling and translation. It is the normalization factor, also known as the amplitude scaling factor, used to ensure that regardless of how much the wavelet is stretched or compressed, The energy is equal for all wavelet transform coefficients at different scales to ensure comparability.
[0059] Next, the inner product of the first traveling wave signal and the target sub-wavelet is calculated to obtain the wavelet transform coefficients. The target sub-wavelet is obtained as follows:
[0060] .
[0061] In the formula, This is the first traveling wave signal. For time. These are the wavelet transform coefficients, representing the first traveling wave signal. The inner product of the target subwavelet and the wavelet, and integration is one way to calculate the inner product, representing the signal in time. and scale The similarity between the wavelet transform and the wavelet transform coefficients measures the similarity at a given time point. Nearby, the first traveling wave signal and its scale are The similarity of the target subwavelets.
[0062] If at a certain point in time If a sudden change occurs that resembles the shape of a high-frequency db4 wavelet, the absolute values of the corresponding wavelet transform coefficients will be large. If the signal is smooth in this region, its orthogonality to the high-frequency wavelet will be strong, and the absolute values of the corresponding wavelet transform coefficients will be small.
[0063] The wavelet transform coefficients are recursively decomposed using a filter bank to obtain the first detail coefficients of the multilayer layer and the first approximation coefficients of the target layer.
[0064] For example, the traveling wave signal is decomposed into three levels using discrete wavelet transform. First, the traveling wave signal is decomposed into three levels. The first approximation coefficient A1 and the first detail coefficient D1 of the first layer are obtained by decomposing the first approximation coefficient A1 of the first layer. Then, the first approximation coefficient A1 of the first layer is decomposed to obtain the first approximation coefficient A2 and the first detail coefficient D2 of the second layer. Finally, the first approximation coefficient A2 of the second layer is decomposed to obtain the first approximation coefficient A3 and the first detail coefficient D3 of the third layer.
[0065] Thus, each coefficient can reflect the characteristic information of the traveling wave signal in different frequency bands. Among them, the high-level detail coefficients (such as D1) contain high-frequency abrupt changes and noise information, the intermediate-level detail coefficients (such as D2) may contain some abrupt change features, and the low-level approximation coefficients (such as A3) usually represent the signal trend components.
[0066] Reference Figure 3 As shown, this illustrates the distribution of energy at different levels, providing a basis for subsequent feature extraction and facilitating classification by the random forest model to determine the optimal wavelet threshold function type. Furthermore, the wavelet decomposition structure can be preserved to ensure the complete reconstruction of the denoised traveling wave signal components.
[0067] Reference Figure 2 and Figure 4 As shown, the adaptive filtering method for traveling waves in distribution networks based on a random forest model, as described in this invention, in some embodiments, performs multi-dimensional feature extraction based on a first traveling wave signal and a first detail coefficient to obtain a first feature vector of the first traveling wave signal, including the following steps:
[0068] In the first aspect, frequency domain features are extracted based on the first detail coefficients to obtain the first feature. The first feature includes the wavelet energy distribution, energy concentration, and wavelet entropy corresponding to the first detail coefficients.
[0069] In the second aspect, time-domain features are extracted based on the first traveling wave signal to obtain first and second features. The first and second features include the root mean square value, maximum amplitude, and duration corresponding to the first traveling wave signal.
[0070] Thirdly, statistical distribution features are extracted based on the first traveling wave signal to obtain the first and third features. These first and third features include the skewness, kurtosis, number of local extrema, and noise estimate corresponding to the first traveling wave signal.
[0071] Finally, feature vectors are constructed based on the first feature, the first second feature, and the first third feature to obtain the first feature vector.
[0072] Specifically, to enable the subsequent random forest model to classify better, a multi-dimensional feature vector, namely the first feature vector, needs to be constructed. The first feature vector can comprehensively and accurately describe the time-domain morphology, frequency-domain structure, statistical distribution, and noise level of the first traveling wave signal, thus providing sufficient discrimination criteria for the random forest model to select the optimal wavelet threshold function type for noise reduction.
[0073] In terms of frequency-domain features via wavelet, the multi-resolution characteristics of wavelet decomposition are utilized to reveal the energy distribution and structural complexity of the first traveling wave signal from the frequency / scale dimension.
[0074] When determining the wavelet energy distribution, the energy Ej of each layer can be obtained by calculating the sum of squares of all coefficients based on the first detail coefficients of each layer. All energies are then combined into an energy distribution vector [E1, E2, ..., Ej]. For ease of comparison, normalization is typically performed, and the percentage of energy in each layer relative to the total energy is calculated.
[0075] The energy of high-frequency spike-shaped signals, such as ideal traveling wavefronts, is mainly concentrated in the high-frequency layer, e.g., E1, E2. This energy concentration in the high-frequency layer indicates that the key information is abrupt, making hard thresholding suitable for preserving spikes. Conversely, the energy of low-frequency smooth signals, such as power frequency interference or slowly changing signals, is mainly concentrated in the low-frequency layer and approximation components, e.g., Ej. A more uniform energy distribution or concentration in the low frequencies indicates a smoother signal, making soft thresholding suitable for comprehensive noise reduction.
[0076] When determining the Energy Concentration Ratio, a single numerical value can be used to measure the degree of concentration of energy distribution. Based on the energy distribution vector [E1, E2, ..., Ej], find the largest energy value max(Ej) and calculate the total detailed energy Etotal. Then divide the maximum energy by the total detailed energy.
[0077] A result close to 1 indicates that the signal energy is highly concentrated in a specific frequency band, and the signal structure is relatively simple. High concentration may correspond to a clear, single feature, allowing for more targeted strategies. Conversely, a smaller result indicates that the energy is dispersed across multiple frequency bands, resulting in a complex signal structure or the presence of broadband noise. Low concentration implies that the signal and noise may be mixed more evenly, requiring more generalized denoising methods.
[0078] When determining wavelet entropy, the uncertainty or complexity of the signal energy distribution can be measured from an information theory perspective. First, the energy proportion p of each layer is calculated. j For each energy percentage p j Calculate p j *log2p j Sum all terms and take the negative sign.
[0079] Low entropy: Energy is highly concentrated in a few layers, p j The vector contains only a few large values, with the rest being very small. This indicates that the signal structure is ordered and simple, and hard thresholding can be considered. High entropy values: energy is distributed very evenly across layers, p j All values in the vector are roughly the same size. This indicates that the signal components are complex and disordered, or contain white noise (the energy of white noise is uniformly distributed across all frequency bands). High entropy means that the signal and noise are difficult to distinguish in the frequency domain; in this case, soft thresholding or compromise thresholding is suitable.
[0080] In terms of time-domain features extraction, the corresponding features can be determined directly through calculation, and these features directly reflect the macroscopic shape and energy of the signal.
[0081] Determining the root mean square (RMS) value quantifies the average power or overall energy intensity of a signal. First, take all sampling points of the first traveling wave signal, calculate the square of each sampling point, sum all the squared values, then divide the sum by the signal length to obtain the RMS value. Finally, take the square root to obtain the root mean square value.
[0082] A higher root mean square (RMS) value indicates a stronger total signal energy and potentially a higher signal-to-noise ratio (SNR). In high-energy signals, the effective signal component dominates, while noise is relatively minor. In this case, using a soft threshold for smooth contraction can better protect the continuity and shape of the main signal and avoid the ringing effect that may be caused by a hard threshold. Conversely, a hard threshold is suitable for low-energy signals.
[0083] Determining the maximum absolute amplitude captures the peak intensity of a signal and quantifies the most dramatic abrupt changes. Take all sample points of the first traveling wave signal, calculate the absolute value of each sample point, and then find the maximum value among all absolute values to obtain the maximum amplitude.
[0084] The wavefront of a traveling wave signal is typically the point of maximum amplitude in the signal; therefore, the maximum amplitude directly reflects the severity of the fault or the salience of its characteristics. A high maximum amplitude implies a very strong abrupt change, resulting in one or more very large coefficient values in the wavelet coefficients, far exceeding the noise level. Hard thresholding can preserve these coefficients intact, thus retaining the sharpness of the fault characteristics without loss. Soft thresholding, on the other hand, shrinks these large coefficients, potentially weakening the peaks of the characteristics.
[0085] Duration measures the span of time during which the main energy of a signal is concentrated, and is typically calculated based on an energy threshold. For example, the instantaneous energy envelope of the first traveling wave signal can be calculated using a short-time Fourier transform or a Hilbert transform. Alternatively, the duration can be determined by calculating the square of the signal, setting an energy threshold, such as 10% of the maximum energy, and finding the first and last times when the energy exceeds the threshold.
[0086] Fault traveling waves are typically short-duration pulse signals. Interference signals, such as those from switching operations, may have longer durations or more complex shapes. Short-duration signals exhibit more transient characteristics, while long-duration signals may contain more stationary components. This, combined with other characteristics, can determine the denoising strategy.
[0087] Statistical distribution features describe the shape of a signal from the perspective of probability distribution, quantifying the signal's symmetry, sharpness, and oscillation.
[0088] Skewness measures the asymmetry in the amplitude distribution of a signal. It is calculated by taking the mean and standard deviation of the first traveling wave signal, then calculating the cube of the difference between each sampling point and the mean, averaging all the cubed values, and dividing the result by the cube of the standard deviation.
[0089] When the skewness is approximately zero, the distribution is essentially symmetrical, such as Gaussian noise. When the skewness is greater than zero and positively skewed, the distribution's "tail" extends to the right, exhibiting some large positive abrupt changes. When the skewness is less than zero and negatively skewed, the distribution's "tail" extends to the left, exhibiting some large negative abrupt changes. High skewness implies the presence of outliers far from the mean, which are likely fault characteristics. Hard thresholding can better preserve these extreme values.
[0090] Kurtosis measures the sharpness or tail thickness of a signal amplitude distribution. Its calculation is similar to that of skewness, but it calculates the fourth power.
[0091] When the kurtosis is approximately 3 or the extreme kurtosis is approximately 0, the distribution resembles a normal distribution. When the kurtosis is greater than 3 (i.e., a sharp peak), the distribution is sharper and has a thicker tail than a normal distribution, indicating the presence of many extreme values (pulses). When the kurtosis is less than 3 (i.e., a flat top), the distribution is flatter and has fewer extreme values than a normal distribution. High kurtosis directly indicates the presence of sharp pulses in the signal and is suitable for hard thresholding.
[0092] The number of local extrema quantifies the oscillation frequency or roughness of a signal. During calculation, the signal is traversed, and each sampling point is checked to determine if it is a local extrema. If the current sampling point's value is greater than the values of its two adjacent sampling points, it is determined to be a local maximum. Conversely, it is determined to be a local minimum. The total number of all local maximums and minimums is counted, and this total is divided by the signal duration to obtain the extrema density per unit time.
[0093] Pure, smooth signals have few extrema. Signals with high-frequency oscillations or high noise levels have many extrema, which usually indicate severe high-frequency noise contamination. Soft thresholding, by shrinking the overall coefficient, can more effectively suppress this prevalent noise, while hard thresholding may retain too many noise spikes.
[0094] A noise estimator directly quantifies the noise level in a signal and forms the theoretical basis for threshold calculation. The noise estimator can be calculated using the median absolute deviation (MAD). Compared to calculations using standard deviation, the MAD is less sensitive to abrupt changes in the signal itself and can more accurately estimate the true level of background noise.
[0095] Finally, the above feature values are combined into a multi-dimensional feature vector, which is used as the input to the random forest model so that the random forest model can dissect the signal from different angles and dimensions to achieve accurate decision-making.
[0096] Reference Figure 2As shown, the adaptive filtering method for traveling waves in distribution networks based on a random forest model, as described in this invention, in some embodiments, inputs a first feature vector into a trained random forest model, and outputs the optimal wavelet threshold function type and optimal threshold of the first traveling wave signal through the random forest model, including the following steps:
[0097] First, the first feature vector is input into a random forest model, and the preliminary classification result of the first traveling wave signal is determined by the classification trees of the random forest model. The random forest model consists of multiple classification trees.
[0098] Secondly, the preliminary classification results are input into the statistical analyzer of the random forest model. The statistical analyzer counts the number of each preliminary classification result and determines the preliminary classification result with the most occurrences as the optimal wavelet threshold function type.
[0099] Finally, the optimal wavelet threshold function type is input into the particle swarm optimizer of the random forest model. The particle swarm optimizer optimizes the threshold size of the optimal wavelet threshold function type to obtain the optimal threshold.
[0100] In the process of signal denoising, the selection of the threshold function has a crucial impact on the final denoising effect. Existing methods often cannot dynamically select hard threshold, soft threshold, or compromise threshold functions based on signal characteristics, making it difficult to balance the broadening characteristics and noise distribution characteristics of different types of signals.
[0101] In this embodiment of the invention, in order to achieve a more refined and personalized optimal wavelet threshold function type, random forest (RF) and particle swarm optimization (PSO) are combined to achieve macro-classification selection and micro-threshold optimization.
[0102] Regarding the optimal wavelet threshold function type, the random forest model constructs a mapping relationship between the feature vectors of the traveling wave signal and the optimal wavelet threshold function type during the training phase by analyzing the feature vectors of the sample traveling wave signal and the denoising effects after processing with different threshold functions. After training, the model can automatically compare the feature vectors of newly input traveling wave signals to determine the optimal wavelet threshold function type.
[0103] Regarding the optimal threshold, the threshold size corresponding to the optimal wavelet threshold function type is fine-tuned using a particle swarm optimizer. Specifically, this includes:
[0104] 1) Fitness Function: Defines the optimization objective of PSO, aiming to maximize the signal-to-noise ratio (SNR) of the denoised signal or minimize its root mean square error (RMSE). For example, the fitness function can be... Set to: .
[0105] in, It is the signal obtained after noise reduction using the threshold represented by the corresponding particle.
[0106] 2) Particles and search space: Each particle represents a candidate threshold. The search space is set within a reasonable range, such as the upper and lower fluctuation range of the value calculated based on the general threshold formula, to ensure the efficiency and stability of optimization.
[0107] 3) Iterative optimization: By simulating the foraging behavior of bird flocks, the velocity and position of particles are continuously updated during the iteration process, guiding the particle swarm to fly towards the global optimal solution, and finally finding a threshold that makes the fitness function optimal.
[0108] This approach overcomes the limitations of traditional threshold function denoising methods, which often employ a "one-size-fits-all" approach. Furthermore, by introducing a particle swarm optimizer, it overcomes the drawback of threshold values depending on a fixed formula, making the wavelet denoising process more targeted and adaptable. Especially when dealing with traveling wave signals in complex fault types or high-noise environments, this adaptive selection mechanism can significantly improve denoising performance, providing a more stable and reliable signal foundation for distribution network fault feature extraction.
[0109] The training and test sets are constructed to include traveling wave signals with various fault types and different noise intensity levels.
[0110] Specifically, firstly, the raw signals are generated: a three-phase power transmission system for the distribution network is constructed, and fault points are set up to simulate various fault traveling wave signals, including single-phase grounding faults, two-phase short-circuit faults, and three-phase short-circuit faults, as well as different fault traveling wave waveforms at different fault distances. These raw and pure traveling wave signals are the third traveling wave signals.
[0111] Secondly, different levels of noise are superimposed: In order to simulate noise interference in a real environment, Gaussian white noise and electromagnetic interference of different signal-to-noise ratios (SNR) are added to the pure traveling wave signal to generate a series of noisy signal samples. These traveling wave signals are the fourth traveling wave signals.
[0112] Next, feature extraction: multi-scale decomposition and multi-dimensional feature extraction are performed on each fourth traveling wave signal to obtain the corresponding second feature vector.
[0113] Finally, the second feature vector of each fourth traveling wave signal is processed using three threshold functions: hard thresholding, soft thresholding, and compromise thresholding, and then reconstructed to obtain the fifth traveling wave signal. By comparing the signal-to-noise ratio and root mean square error of the fifth traveling wave signal with those of the third traveling wave signal, the optimal wavelet thresholding function type is determined, and each signal is labeled. For example, 0, 1, and 2 represent the soft thresholding function, hard thresholding function, and compromise thresholding function, respectively. This yields the dataset, of which 80% is used as the training set and 20% as the test set.
[0114] Considering that the performance of the random forest model largely depends on the selection of its hyperparameters, in order to determine the optimal hyperparameters, the adaptive filtering method for traveling waves in distribution networks based on the random forest model described in this invention further includes, in some embodiments, the following steps before inputting the first feature vector into the trained random forest model:
[0115] First, the pre-built random forest model to be trained is trained according to the preset particles and training set to obtain the first random forest model corresponding to the preset particles.
[0116] Preferably, the number of classification trees in the pre-built random forest model to be trained is set to 200, the minimum number of leaf nodes is set to 1, and the number of random features for node splitting is set to the square root of the total number of features.
[0117] Considering that the number of samples with the best labels in each class may be unbalanced in the dataset, a cost matrix is introduced to prevent the model from biased towards the majority class. By setting the misclassification cost inversely proportional to the number of samples in each class, the model is forced to give equal importance to all classes, thereby improving the model's generalization ability.
[0118] Specifically, the preset particles include the number of classification trees, the minimum number of leaf nodes, and the number of random features for node splitting. Each preset particle is a set of hyperparameter combinations. Based on the hyperparameter sets corresponding to the preset examples and the training set, the random forest model to be trained is trained to obtain the first random forest model after initial training.
[0119] Secondly, cross-validation is performed on the first random forest model using out-of-bag (OBB) data to avoid wasting samples due to additional validation set splits. This yields the macro-average F1 score of the first random forest model, which is the arithmetic mean of the F1 scores for all classes. The macro-average F1 score fairly measures the overall performance of the model on imbalanced datasets.
[0120] Finally, based on the preset particle swarm optimization (PSO) parameters and the macro-average F1 score, the first random forest model is iteratively optimized using PSO to obtain the optimal hyperparameters. The preset PSO parameters include particle population size, maximum number of iterations, and other parameters. Through iterative optimization and convergence, the hyperparameter data that optimizes model performance is obtained, improving the model's classification accuracy and generalization ability.
[0121] Experimental results show that the optimized model significantly improves classification performance, with a 1.1% increase in the macro-average F1 score. In application examples, this method can intelligently match the optimal threshold function based on signal characteristics, and the signal-to-noise ratio of the denoised signal is improved by 5.6 dB compared to the best traditional fixed method, effectively preserving the key features of the fault wavefront.
[0122] In some embodiments of the distribution network traveling wave adaptive filtering method based on the random forest model described in this invention, the optimal wavelet threshold function types include soft threshold function, hard threshold function, and compromise threshold function.
[0123] Based on the soft thresholding function and its corresponding optimal threshold, the first detail coefficients are thresholded to obtain the denoised second detail coefficients, including the following steps:
[0124] If the absolute value of the first detail coefficient is not greater than the optimal threshold, the first detail coefficient is set to zero.
[0125] If the optimal threshold is less than the absolute value of the first detail coefficient, the first detail coefficient is adjusted to be the product of the difference between the absolute value of the first detail coefficient and the optimal threshold and the sign of the first detail coefficient.
[0126] Based on the hard thresholding function and its corresponding optimal threshold, the first detail coefficients are thresholded to obtain the denoised second detail coefficients, including the following steps:
[0127] If the absolute value of the first detail coefficient is not greater than the optimal threshold, the first detail coefficient is set to zero.
[0128] If the optimal threshold is less than the absolute value of the first detail coefficient, the first detail coefficient is retained.
[0129] Based on the compromise threshold function and the optimal threshold corresponding to the compromise threshold function, the first detail coefficients are thresholded to obtain the denoised second detail coefficients, including the following steps:
[0130] If the absolute value of the first detail coefficient is less than the lower limit of the optimal threshold, the first detail coefficient is set to zero.
[0131] If the absolute value of the first detail coefficient is within the range of the optimal threshold, the first detail coefficient is adjusted to be the product of the difference between the absolute value of the first detail coefficient and the optimal threshold and the sign of the first detail coefficient.
[0132] If the upper limit of the optimal threshold is less than the absolute value of the first detail coefficient, the first detail coefficient is retained.
[0133] In some embodiments of the adaptive filtering method for traveling waves in distribution networks based on a random forest model described in this invention, the first traveling wave signal is reconstructed according to the second detail coefficients and the first approximation coefficients to obtain the second traveling wave signal, which is expressed as follows:
[0134] .
[0135] In the formula, That is, the second traveling wave signal obtained by reconstruction. The function is a reconstruction function. By performing an inverse transformation on the corresponding coefficients through the reconstruction function, the second traveling wave signal can be obtained, thus achieving noise reduction. It is the first approximation coefficient. It is the second detail coefficient.
[0136] To ultimately verify the effectiveness of the adaptive wave filtering method for distribution networks based on the random forest model described in this invention in practical applications, refer to Figure 5 As shown, Figure 5 A set of waveform comparison diagrams are shown. The noisy signal is obtained by superimposing noise on the original clean signal; it has obvious wavefront characteristics but complex background noise.
[0137] After performing multi-scale decomposition and feature extraction on the noisy signal, the features are input into the random forest model for processing, which can determine that the optimal wavelet threshold function type is a compromise threshold function.
[0138] Compared to reconstructed signals obtained through other threshold functions, this method not only effectively filters out noise but also accurately preserves the wavefront amplitude and rising edge steepness of the original pure signal, resulting in a waveform that closely matches the pure signal. In contrast, reconstructed signals obtained through traditional fixed threshold methods lead to significant signal distortion.
[0139] On the other hand, refer to Figure 6 As shown, this embodiment of the invention also provides a distribution network traveling wave adaptive filtering device based on a random forest model, applicable to the distribution network traveling wave adaptive filtering method based on a random forest model described in any of the above embodiments. The distribution network traveling wave adaptive filtering device based on a random forest model includes a wavelet transform module 11, a feature extraction module 12, an optimal determination module 13, a filtering processing module 14, and a signal reconstruction module 15.
[0140] Wavelet transform module 11 is used to perform multi-scale decomposition on the first traveling wave signal according to discrete wavelet transform, so as to obtain the first detail coefficients and the first approximation coefficients.
[0141] The feature extraction module 12 is used to perform multi-dimensional feature extraction based on the first traveling wave signal and the first detail coefficient to obtain the first feature vector of the first traveling wave signal.
[0142] The optimal determination module 13 is used to input the first feature vector into the trained random forest model, and output the optimal wavelet threshold function type and optimal threshold of the first traveling wave signal through the random forest model.
[0143] The filtering module 14 is used to perform thresholding on the first detail coefficients according to the optimal wavelet threshold function type and the optimal threshold to obtain the noise-reduced second detail coefficients.
[0144] The signal reconstruction module 15 is used to reconstruct the first traveling wave signal based on the second detail coefficient and the first approximation coefficient to obtain the second traveling wave signal.
[0145] This invention also provides a non-transitory machine-readable medium storing a computer program. When executed by a computer's processor, the computer program causes the computer to perform the adaptive wave filtering method for distribution networks based on a random forest model as described in any of the above embodiments.
[0146] This invention also provides a computer program product, including a computer program. When executed by a computer's processor, the computer program causes the computer to perform the adaptive wave filtering method for distribution networks based on a random forest model as described in any of the above embodiments.
[0147] This invention also provides an electronic device, including at least one processor and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, which, when executed by the at least one processor, causes the electronic device to perform the adaptive wave filtering method for distribution networks based on a random forest model as described in any of the above embodiments.
[0148] refer to Figure 7The diagram illustrates a structural block diagram of an electronic device that can serve as an embodiment of the present invention, representing an example of a hardware device applicable to various aspects of the invention. The term "electronic device" is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0149] Reference Figure 7 As shown, the electronic device includes a computing unit 201, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 202 or a computer program loaded from a storage unit 208 into a random access memory (RAM) 203. The RAM 203 may also store various programs and data required for the operation of the electronic device. The computing unit 201, ROM 202, and RAM 203 are interconnected via a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.
[0150] Multiple components in the electronic device are connected to I / O interface 205, including: input unit 206, output unit 207, storage unit 208, and communication unit 209. Input unit 206 can be any type of device capable of inputting information into the electronic device. Input unit 206 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of the electronic device. Output unit 207 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 208 may include, but is not limited to, disks and optical discs. Communication unit 209 allows the electronic device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, and / or wireless communication transceivers, such as Bluetooth devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0151] The computing unit 201 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 201 include, but are not limited to, CPUs, graphics processing units (GPUs), various special-purpose artificial intelligence (AI) computing units, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. The computing unit 201 performs the various methods and processes described above. For example, in some embodiments, the method embodiments of the present invention can be implemented as a computer program tangibly contained in a machine-readable medium, such as storage unit 208. In some embodiments, part or all of the computer program can be loaded and / or installed on an electronic device via ROM 202 and / or communication unit 209. In some embodiments, the computing unit 201 can be configured to perform the methods described above by any other suitable means (e.g., by means of firmware).
[0152] Computer programs for implementing the methods of embodiments of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0153] In the context of embodiments of the present invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable signal medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, or infrared systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0154] It should be noted that the term "comprising" and its variations used in the embodiments of the present invention are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The modifications of "one" and "a plurality" mentioned in the embodiments of the present invention are illustrative and not restrictive, and those skilled in the art should understand that unless explicitly indicated otherwise in the context, they should be understood as "one or more".
[0155] The steps described in the method embodiments provided by the present invention can be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of protection of the present invention is not limited in this respect.
[0156] The term "embodiment" in this specification refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of the invention. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply independence or alternativeity from other embodiments. The various embodiments in this specification are described in a related manner, with reference to each other for similar or identical parts. In particular, for apparatus, device, and system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, and relevant details are referred to in the description of the method embodiments.
[0157] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.
Claims
1. An adaptive filtering method for traveling waves in a distribution network based on a random forest model, characterized in that, Including the following steps: Based on the discrete wavelet transform, the first traveling wave signal is decomposed into multi-scale decomposition to obtain the first detail coefficients and the first approximation coefficients. Multidimensional feature extraction is performed based on the first traveling wave signal and the first detail coefficient to obtain the first feature vector of the first traveling wave signal; The first feature vector is input into the trained random forest model, and the random forest model outputs the optimal wavelet threshold function type and the optimal threshold of the first traveling wave signal. Based on the optimal wavelet threshold function type and the optimal threshold, the first detail coefficients are thresholded to obtain the denoised second detail coefficients. The first traveling wave signal is reconstructed based on the second detail coefficient and the first approximation coefficient to obtain the second traveling wave signal.
2. The adaptive filtering method for traveling waves in distribution networks based on a random forest model according to claim 1, characterized in that, Multidimensional feature extraction is performed based on the first traveling wave signal and the first detail coefficients to obtain the first feature vector of the first traveling wave signal, including the following steps: Frequency domain features are extracted based on the first detail coefficients to obtain the first feature; wherein, the first feature includes the wavelet energy distribution, energy concentration and wavelet entropy corresponding to the first detail coefficients; Time-domain features are extracted based on the first traveling wave signal to obtain first and second features; wherein, the first and second features include the root mean square value, maximum amplitude and duration corresponding to the first traveling wave signal; Based on the first traveling wave signal, statistical distribution features are extracted to obtain the first and third features; wherein, the first and third features include the skewness, kurtosis, number of local extrema and noise estimate corresponding to the first traveling wave signal; The first feature vector is obtained by constructing a feature vector based on the first feature, the first second feature, and the first third feature.
3. The adaptive filtering method for traveling waves in distribution networks based on a random forest model according to claim 1, characterized in that, The first feature vector is input into a trained random forest model, and the random forest model outputs the optimal wavelet threshold function type and optimal threshold for the first traveling wave signal, including the following steps: The first feature vector is input into the random forest model, and the preliminary classification result of the first traveling wave signal is determined by the classification tree of the random forest model; wherein, the random forest model includes multiple classification trees; The preliminary classification results are input into the statistical analyzer of the random forest model. The statistical analyzer counts the number of each preliminary classification result and determines the preliminary classification result with the most occurrences as the optimal wavelet threshold function type. The optimal wavelet threshold function type is input into the particle swarm optimizer of the random forest model. The particle swarm optimizer optimizes the threshold size of the optimal wavelet threshold function type to obtain the optimal threshold.
4. The adaptive filtering method for traveling waves in distribution networks based on a random forest model according to claim 1 or 3, characterized in that, Before inputting the first feature vector into the trained random forest model, the following steps are also included: The pre-constructed random forest model to be trained is trained according to the preset particles and the training set to obtain the first random forest model corresponding to the preset particles; wherein, the preset particles include the number of classification trees, the minimum number of leaf nodes, and the number of random features of node splitting; Cross-validation of the first random forest model is performed based on the out-of-bag data of the first random forest model to obtain the macro-average F1 score of the first random forest model. Based on the preset particle swarm optimization operating parameters and the macro-average F1 score, the first random forest model is subjected to particle swarm optimization iterative optimization to obtain the optimal hyperparameters. The first random forest model is retrained based on the optimal hyperparameters to obtain the trained random forest model.
5. The adaptive filtering method for traveling waves in distribution networks based on a random forest model according to claim 1, characterized in that, Based on the discrete wavelet transform, the first traveling wave signal is decomposed into multi-scale coefficients to obtain the first detail coefficients and the first approximation coefficients, including the following steps: The wavelet transform coefficients are obtained by performing an inner product calculation on the first traveling wave signal and the target sub-wavelet; wherein, the target sub-wavelet is obtained by scaling and time-shifting the Dobes wavelet basis function; The wavelet transform coefficients are recursively decomposed using a filter bank to obtain the first detail coefficients of the multilayer layer and the first approximation coefficients of the target layer.
6. The adaptive filtering method for traveling waves in distribution networks based on a random forest model according to claim 5, characterized in that, The wavelet transform coefficients are obtained by performing an inner product calculation on the first traveling wave signal and the target sub-wavelet, and are expressed as follows: , , In the formula, The wavelet transform coefficients are... As a scale, For time shift, The first traveling wave signal, For time, For the target sub-wavelet, Let be the Dobessi wavelet basis function.
7. The adaptive filtering method for traveling waves in distribution networks based on a random forest model according to claim 1, characterized in that: The optimal wavelet threshold function types include soft threshold function, hard threshold function, and compromise threshold function; Based on the soft thresholding function and the optimal threshold corresponding to the soft thresholding function, the first detail coefficients are thresholded to obtain the denoised second detail coefficients, including the following steps: If the absolute value of the first detail coefficient is not greater than the optimal threshold, the first detail coefficient is set to zero; If the optimal threshold is less than the absolute value of the first detail coefficient, the first detail coefficient is adjusted to be the product of the difference between the absolute value of the first detail coefficient and the optimal threshold and the sign of the first detail coefficient. Based on the hard thresholding function and the optimal threshold corresponding to the hard thresholding function, the first detail coefficients are thresholded to obtain the denoised second detail coefficients, including the following steps: If the absolute value of the first detail coefficient is not greater than the optimal threshold, the first detail coefficient is set to zero; If the optimal threshold is less than the absolute value of the first detail coefficient, the first detail coefficient is retained; Based on the compromise threshold function and the optimal threshold corresponding to the compromise threshold function, thresholding is performed on the first detail coefficients to obtain the denoised second detail coefficients, including the following steps: If the absolute value of the first detail coefficient is less than the lower limit of the optimal threshold, the first detail coefficient is set to zero. If the absolute value of the first detail coefficient is within the range of the optimal threshold, the first detail coefficient is adjusted to be the product of the difference between the absolute value of the first detail coefficient and the optimal threshold and the sign of the first detail coefficient. If the upper limit of the optimal threshold is less than the absolute value of the first detail coefficient, the first detail coefficient is retained.
8. The adaptive filtering method for traveling waves in distribution networks based on a random forest model according to claim 1, characterized in that, Before performing multi-scale decomposition of the first traveling wave signal based on discrete wavelet transform to obtain the first detail coefficients and the first approximation coefficients, the following steps are also included: Acquire the raw traveling wave signal of the target distribution network; The original traveling wave signal is standardized to obtain the first traveling wave signal; wherein, the standardization process includes amplitude normalization and sampling alignment.
9. A traveling wave adaptive filtering device for distribution networks based on a random forest model, applied to the traveling wave adaptive filtering method for distribution networks based on a random forest model as described in any one of claims 1 to 8, characterized in that, include: The wavelet transform module is used to perform multi-scale decomposition on the first traveling wave signal according to the discrete wavelet transform to obtain the first detail coefficients and the first approximation coefficients. The feature extraction module is used to perform multi-dimensional feature extraction based on the first traveling wave signal and the first detail coefficient to obtain the first feature vector of the first traveling wave signal; The optimal determination module is used to input the first feature vector into the trained random forest model, and output the optimal wavelet threshold function type and optimal threshold of the first traveling wave signal through the random forest model; The filtering module is used to perform thresholding on the first detail coefficients according to the optimal wavelet threshold function type and the optimal threshold to obtain the noise-reduced second detail coefficients; The signal reconstruction module is used to reconstruct the first traveling wave signal based on the second detail coefficients and the first approximation coefficients to obtain the second traveling wave signal.
10. An electronic device, comprising: A processor and a memory storing a program, characterized in that the program includes instructions that, when executed by the processor, cause the processor to perform the adaptive filtering method for traveling waves in a distribution network based on a random forest model according to any one of claims 1 to 8.
Citation Information
Patent Citations
Hierarchical adaptive threshold function-based wavelet threshold denoising method
CN107886078A
Electrical signal noise reduction method and system based on wavelet packet frequency division self-adaption
CN117332219A
Wavelet threshold noise reduction parameter optimization method based on improved particle swarm optimization algorithm
CN117763288A
Image denoising method for improving wavelet threshold and threshold function
CN117593210A
Distribution line fault waveform denoising analysis method based on improved wavelet threshold function and computer equipment
CN119199380A