A random forest-based public variable load type decomposition method
Patent Information
- Application Number
- CN202211527698.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-01
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2042-12-01
AI Technical Summary
但是隐马尔科夫模型运算量大、推理困难、图信号处理算法仍不完善、深度学习模型参数多、可解释性差
[0033]本发明将高频数据降频为低频数据,计算功率变化量判断事件是否发生。对事件所对应的高频电流电压数据分析,提取高频特征,并利用基于改进PSO的随机森林算法对特征进行分类,从而实现对公变负荷的分类。本发明将改进PSO的随机森林算法应用到高频非侵入式负荷分解领域,利用有功功率的功率变化量进行事件检测。通过高频电流电压数据,提取出各种高频特征,并根据数据特点提取一种新的特征。利用改进PSO的随机森林算法分类,获得了更好的公变负荷的分解结果,实现更高精度的公变负荷类型分解。
Smart Images

Figure CN115878979B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of non-intrusive load monitoring and relates to a method for decomposing public variable load types based on random forest. Background Technology
[0002] Transformers are core and crucial equipment in power grids, used to connect transmission systems of different voltage levels. Operating under diverse climatic conditions and varying electrical and mechanical conditions, transformers constantly face significant risks during operation, leading to failures in components such as windings and cores, and causing substantial impacts on the power grid. Therefore, monitoring the health status of transformers and accurately identifying faults helps minimize equipment damage, economic losses, and the impact on power system reliability.
[0003] Currently, there are two main methods of load balancing: intrusive load balancing and non-intrusive load balancing. Both require the acquisition of load power consumption data. The difference lies in their methods: Intrusive load balancing (ILM) uses independent instruments to measure the power consumption of each load; while non-intrusive load balancing (NILM), proposed by George W. Hart in 1984, obtains relevant information about each load within a specific area by sampling and analyzing the total meter data. Compared to traditional intrusive load balancing, non-intrusive load balancing not only saves on the number of sensors but also eliminates the need for individual modifications and maintenance of existing circuits, making it a convenient, low-cost, and highly versatile method.
[0004] The electrical parameters measured by electricity meters mainly include voltage, current, apparent power, and frequency. Simple calculations can then be used to obtain electrical equipment parameters such as active power, power factor, reactive power, and energy consumption. Data acquisition can be divided into two main categories based on the sampling frequency: high-frequency sampling (>1Hz) and low-frequency sampling (<1Hz). Low-frequency sampling primarily collects parameters such as power and quantity. Low-frequency sampling reduces data transmission and storage requirements but results in the loss of high-frequency information from the equipment. High-frequency sampling mainly collects parameters such as current, harmonics, and electromagnetic interference from the equipment, enabling a more comprehensive capture of the equipment's characteristics.
[0005] Among numerous public transformer load decomposition models and methods, Hidden Markov Models (HMMs) possess the ability to model time-series data and characterize unobservable states, and have been extensively studied. Deep learning-based methods can automatically extract features and have strong generalization capabilities. Graph signal processing-based methods are computationally simple and have short training cycles. However, HMMs suffer from high computational complexity and inference difficulties, graph signal processing algorithms are still imperfect, and deep learning models have many parameters and poor interpretability. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method for decomposing public variable load types based on random forest.
[0007] The technical problem solved by this invention is achieved through the following technical solution:
[0008] A method for decomposing common variable load types based on random forest, characterized by the following steps:
[0009] Step 1: Collect high-frequency voltage and current data of the total load of electrical equipment using deployed electricity meters;
[0010] Step 2: Calculate the active power and power variation of each cycle using the acquired high-frequency voltage and current data of the total load. Perform event detection based on the power variation to obtain the event dataset.
[0011] Step 3: Extract features from the obtained event dataset;
[0012] Step 4: Initialize the particle swarm;
[0013] Step 5: Train the system using the Random Forest algorithm and adjust the parameters of the Random Forest using the Particle Swarm Optimization algorithm.
[0014] Moreover, in step 2, the data is high-frequency current and voltage data at 3.2 kHz.
[0015] Furthermore, the formula for calculating the active power of each cycle using the acquired total load high-frequency voltage and current data is as follows:
[0016]
[0017] Where, p m Let m be the power of the m-th cycle. For the m-th current cycle, Let m be the m-th voltage cycle, where m is a positive integer and N represents the number of sampling points per cycle. In equation (1), m is an integer from 1 to M-1.
[0018] Furthermore, the formula for calculating the power change per cycle using the acquired total load high-frequency voltage and current data is as follows:
[0019] Δp m =|p m -p m-1 | (2)
[0020] In equation (2), Δp m Let T1 represent the power difference between two adjacent waves, and let Δp represent a positive real number. mIf Δp > T1, then Δp m Store it in the event dataset ε.
[0021] Furthermore, the method for feature extraction from the obtained event dataset is as follows: for events in the time dataset set ε, four features are extracted from the corresponding current: root mean square value of current, peak current, current harmonic factor, and power difference between adjacent two waves; and four features are extracted from the corresponding VI trajectory: slope of the VI trajectory midline, peak value of the midline, number of intersection points, and area on the left and right sides of the trajectory, thereby obtaining the feature set.
[0022] Root mean square value of current I RMS The calculation method is as follows:
[0023]
[0024] Among them, the peak current I peak It means The maximum value of the current harmonic factor I CF Defined as:
[0025]
[0026] From the corresponding VI trajectory, four features are extracted: VI midline slope, midline peak value, number of intersection points, and area on both sides of the trajectory. The eight features corresponding to the m-th event are defined as vector f. m , will f m The set formed is called the characteristic set.
[0027] Furthermore, the method for initializing the particle swarm is as follows:
[0028] Suppose a population X = {X1, X2, ..., Xn} contains m particles. m}, the position X of each particle i Represented by points in n-dimensional space as {x i1 x i2 , ..., x in The update velocity V of each particle in n directions i Represented as {v i1 v i2 , ..., v in}, Individual extreme value p id p represents the best extremum found by the current particle, the global extremum. gd This represents the optimal extreme value found by all particles. The particle update formula is as follows:
[0029]
[0030]
[0031] In the formula: and Let represent the position and velocity of the i-th particle at latitude d in the t-th iteration, respectively. and Let c1 and c2 represent the global extremum and the individual extremum of the i-th particle at the t-th iteration, respectively, where c1 and c2 are acceleration factors, and r2 is a random number between 0 and 1; typically, an upper boundary v is set for the velocity. max and lower boundary v min , to prevent particles from moving away from the search space; ζ t ζ t-1 ∈R + This is called the current effective factor, ζ. t This is called the extended memory effective factor, ζ. t-1 This is called the extended memory effective factor.
[0032] The advantages and beneficial effects of this invention are as follows:
[0033] This invention downconverts high-frequency data to low-frequency data and calculates power changes to determine whether an event has occurred. It analyzes the high-frequency current and voltage data corresponding to the event, extracts high-frequency features, and classifies these features using a random forest algorithm based on an improved PSO (Power Scaling Optimization) model, thereby achieving the classification of transformer loads. This invention applies the improved PSO random forest algorithm to the field of high-frequency non-intrusive load decomposition, using power changes in active power for event detection. Various high-frequency features are extracted from high-frequency current and voltage data, and a new feature is extracted based on the data characteristics. Classification using the improved PSO random forest algorithm yields better transformer load decomposition results, achieving higher accuracy in transformer load type decomposition. Attached Figure Description
[0034] Figure 1 This is a flowchart of the prediction method of the present invention;
[0035] Figure 2 This is a schematic diagram of the four features extracted from the VI trajectory in this invention;
[0036] Figure 3 This is a flowchart of the random forest algorithm based on the improved PSO of this invention. Detailed Implementation
[0037] The present invention will be further described in detail below through specific embodiments. The following embodiments are merely descriptive and not limiting, and should not be used to limit the scope of protection of the present invention.
[0038] This embodiment provides a method for decomposing common variable load types based on random forest, such as Figure 1As shown. This method generally consists of five steps: collecting high-frequency voltage and current data, calculating power changes and performing event detection, constructing a feature set based on high-frequency current and VI trajectories, initializing the particle swarm, and performing classification based on a random forest algorithm with improved PSO.
[0039] First, high-frequency current data is downsampled into low-frequency active power data, and event detection is performed using power changes. Then, features are extracted from the current and voltage data corresponding to the detected events. Finally, the features of each event are used to classify the transformer load using a random forest algorithm based on an improved PSO (Power Sorting Optimization) algorithm, thereby achieving load decomposition.
[0040] Applying the random forest algorithm based on the improved PSO to decompose the load type of the public transformer is to treat the decomposition of the load type as a classification problem, that is, for the change of the total current at a certain moment, to determine which known device caused it, thereby determining the operating status of the device.
[0041] This embodiment uses a private dataset, which contains data on the overall current and voltage data and the active power of each device in a region.
[0042] A method for decomposing common variable load types based on random forest includes the following steps:
[0043] Step 1: Collect high-frequency voltage and current data of the total load of electrical equipment using deployed electricity meters;
[0044] Step 2: Calculate the active power and power change of each cycle using the acquired data, and perform event detection based on the power change to obtain the event dataset;
[0045] Step 3: Extract features from the obtained event dataset;
[0046] Step 4: Initialize the particle swarm;
[0047] Step 5: Train the random forest algorithm using the improved PSO algorithm, and adjust the parameters in the random forest using the particle swarm optimization algorithm.
[0048] The above method and process are as follows Figure 3 As shown.
[0049] This embodiment specifically includes the following steps:
[0050] Step 1: Obtain the total load current and voltage data of the user equipment within a set range as detection data; the m-th current cycle voltage cycle Where m is a positive integer, and N represents the number of sampling points per cycle. Therefore, the power of the m-th cycle is defined as:
[0051]
[0052] In equation (1), m is an integer from 1 to M-1.
[0053] Step 2: Define Δp m for:
[0054] Δp m =|p m -p m-1 | (2)
[0055] In equation (2), Δp m Let T1 represent the power difference between two adjacent two waves. If Δp m If Δp > T1, then Δp m Store it in the event set ε.
[0056] Step 3: For events in set ε, extract four features from the corresponding current: root mean square current value, peak current value, current harmonic factor, and power difference between adjacent two waves. Extract four features from the corresponding VI trajectory: slope of the VI trajectory midline, peak midline value, number of intersection points, and area under the curve of the trajectory. This yields the feature set.
[0057] Root mean square value of current I RMS The calculation method is as follows:
[0058]
[0059] Peak current I peak It means The maximum value of the current harmonic factor I. CF Defined as:
[0060]
[0061] From the corresponding VI trajectory, four features are extracted: VI midline slope, midline peak value, number of intersection points, and area on both sides of the trajectory. Figure 2 As shown. Among them, Figure 2 (a) The angle θ formed by the neutral line and the normalized voltage axis is called the slope of the neutral line. Figure 2 In (b), the maximum vertical distance from the centerline to the VI trajectory is called the centerline peak. Figure 2 In (c), in the middle section, the number of times the VI trajectory is worse becomes the number of intersections. Figure 2 In (d), the area enclosed by the black dashed line is called the left and right areas of the VI trajectory.
[0062] The eight features corresponding to the m-th event are defined as vector f. m , will f m The set formed is called the characteristic set.
[0063] Step 4: Let the population containing m particles be X = {X1, X2, ..., X...} m}, the position X of each particle i Represented by points in n-dimensional space as {x i1 x i2 , ..., x in The update velocity V of each particle in n directions i Represented as {v i1 v i2 , ..., v in Individual extreme value p id p represents the best extremum found by the current particle, the global extremum. gd This represents the optimal extreme value found by all particles. The particle update formula is as follows:
[0064]
[0065]
[0066] In the formula: and Let represent the position and velocity of the i-th particle at latitude d in the t-th iteration, respectively. and Let c1 and c2 represent the global extremum and the individual extremum of the i-th particle at the t-th iteration, respectively, where c1 and c2 are acceleration factors, and r2 is a random number between 0 and 1; typically, an upper boundary v is set for the velocity. max and lower boundary v min , to prevent particles from moving away from the search space; ζ t ζ t-1 ∈R + ζ is called the current effective factor. t This is called the extended memory effective factor, ζ. t-1 This is called the extended memory effective factor.
[0067] Step 5: Combine equal numbers of majority and minority class samples to form a new balanced training set, and use a random forest model to classify and predict the test set. For the model parameters in the random forest, the optimal parameters are iteratively selected using a particle swarm optimization algorithm, and the final classification result of the model is output.
[0068] Performance Evaluation
[0069] Commonly used performance evaluation metrics include recall (Re), precision (Pr), and F1-score. Their definitions are as follows: Pr = TP / (TP + FP), Re = TP / (TP + FN), F1-score = 2Pr·Re / (Pr + Re). A true positive (TP) indicates that the device was detected as powered on and correctly identified. A false positive (FP) represents an appliance that was not powered on but was mistakenly identified as another appliance. A false negative (FN) represents an appliance that was not powered on but was mistakenly identified as powered on. The magnitude of recall (Re) indicates the level of FN, while precision (Pr) represents the accuracy of identification. Therefore, the F1-score can balance recall and precision.
[0070] This invention, along with two other existing methods—Support Vector Machine and XGBoost—has its performance verified through experiments on a private dataset. Table 1 shows the performance comparison. As can be seen from the two tables, the variable load type decomposition technique of this invention is superior.
[0071] Table 1. Comparison of F1-score results of public load type decomposition results for private datasets
[0072] This invention 0.98 0.90 0.93 0.94 0.82 0.94 SVM 0.82 0.70 0.77 0.77 0.64 0.73 XGBoost 0.87 0.75 0.82 0.83 0.67 0.79
[0073] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0074] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0075] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0076] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for decomposing variable load types based on random forest, characterized in that: Includes the following steps: Step 1: Collect high-frequency voltage and current data of the total load of electrical equipment using deployed electricity meters; Step 2: Calculate the active power and power variation of each cycle using the acquired total load high-frequency voltage and current data. Detect events based on the power variation to obtain an event dataset. Step 3: Extract features from the obtained event dataset; Step 4: Initialize the particle swarm; Step 5: Train the system using the Random Forest algorithm and adjust the parameters in the Random Forest using the Particle Swarm Optimization algorithm; The method for initializing the particle swarm is as follows: Suppose it contains A population of particles The position of each particle Depend on A point in 3D space is represented as Each particle in Update speed in each direction Represented as Individual extreme values This represents the best extremum found by the current particle, the global extremum. This represents the optimal extreme value found by all particles. The particle update formula is as follows: In the formula: and They represent the first During the nth iteration The particle in the first Latitude and speed and They represent the first The global extremum and the th iteration at the th iteration The individual extreme value of each particle. and For acceleration factors, and A random number between 0 and 1; typically set as the upper limit of the speed. and lower boundary To prevent particles from drifting away from the search space; This is called the current effective factor. This is called the extended memory effective factor. This is called the extended memory effective factor; In step 2, the data is high-frequency current and voltage data at 3.2 kHz. The formula for calculating the active power per cycle using the acquired high-frequency voltage and current data of the total load is as follows: in, For the first The power of one cycle, For the first One current cycle, For the first One voltage cycle, of which positive integer, In equation (1), the number of sampling points per cycle is represented. 1~ Integers; The formula for calculating the power change per cycle using the acquired total load high-frequency voltage and current data is as follows: In equation (2), Let represent the power difference between two adjacent two waves. Represent a positive real number, if Then Store in event dataset ; The method for feature extraction from the obtained event dataset is as follows: for the set in the time dataset For the event, four features are extracted from the corresponding current: root mean square current value, peak current value, current harmonic factor, and power difference between adjacent two waves. Four features are extracted from the corresponding VI trajectory: VI trajectory midline slope, midline peak value, number of intersection points, and area under the left and right sides of the trajectory. This yields a feature set. ; root mean square value of current The calculation method is as follows: Among them, peak current It means The maximum value of the current harmonic factor Defined as: Extract four features from the corresponding VI trajectory: VI midline slope, midline peak value, number of intersections, and area on both sides of the trajectory. The eight features corresponding to each event are defined as a vector. ,Will The set formed is called the characteristic set. .
Citation Information
Patent Citations
Hot spot fault detection method for photovoltaic cell panel
CN106230377A
Power system short-term load probability forecasting method, device and system
CN109214605A
Non-intrusive load identification method fusing transient and steady state characteristics
CN114709926A