Line loss prediction method and system based on physical-data double-driven capsule network
By constructing a physical-data dual-driven capsule network model, and combining the equivalent circuit model of power equipment with the data-driven model, the problem of insufficient line loss prediction accuracy in existing technologies is solved, achieving high-precision and adaptive line loss prediction, and improving the power grid operation efficiency and equipment condition assessment capabilities.
Patent Information
- Application Number
- CN202511347278.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2045-09-19
AI Technical Summary
Existing physical model-driven line loss prediction methods struggle to accurately cover nonlinear loss factors in complex power systems, resulting in insufficient prediction accuracy. There is an urgent need to improve the accuracy and interpretability of line loss prediction.
A physical-data dual-driven capsule network model is constructed, which combines the equivalent circuit model of power equipment and the data-driven model. Through multi-scale feature fusion of the physical capsule network layer and the data capsule network layer, and using historical line loss data for training and optimization, high-precision line loss prediction is achieved.
It achieves high-precision, adaptive prediction of power system line losses, provides accurate reference for power grid dispatch, improves power grid operation efficiency, and promptly detects equipment problems and reduces energy consumption.
Smart Images

Figure CN120850810B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power system automation, in particular to a line loss prediction method and system based on a physical-data dual-driven capsule network. BACKGROUND
[0002] In the process of power system operation, line loss is an important indicator to measure the efficiency of the power grid. Currently, a line loss prediction method is physically model driven.
[0003] The core of the physically model driven method is to rely on accurate device parameters and circuit models for line loss prediction. For example, when calculating line resistance loss, the original resistance, temperature coefficient and other parameters of the line need to be accurately known, and then the corresponding physical formula is used for calculation. However, in the complex power system operation environment, this method has obvious limitations. For example, in the actual power grid, there are a large number of nonlinear loss factors, such as harmonic loss, contact resistance change, etc. These nonlinear factors are difficult to accurately cover with traditional physical models, resulting in a significant reduction in the prediction accuracy of the physical model under complex conditions.
[0004] With the continuous development and complication of the power system, it becomes more and more important to improve the accuracy and interpretability of line loss prediction. Therefore, there is an urgent need for a new line loss prediction method that can improve the prediction accuracy and interpretability. SUMMARY
[0005] Therefore, it is necessary to provide a line loss prediction method and system based on a physical-data dual-driven capsule network in view of the problems in the related art.
[0006] In order to achieve the above-mentioned purpose, in a first aspect, the present application provides a line loss prediction method based on a physical-data dual-driven capsule network, which comprises:
[0007] constructing a physical-data dual-driven capsule network model, including: constructing a physical capsule network layer based on an equivalent circuit model of a power device, the physical capsule network layer comprising a line loss capsule and a transformer loss capsule; constructing a data capsule network layer; verifying the output results of the physical capsule network layer and the output results of the data capsule network layer, and correcting the physical capsule network layer and the data capsule network layer when an anomaly is verified; performing multi-scale feature fusion on the physical capsule network layer and the data capsule network layer based on a gated feature aggregation mechanism to obtain the physical-data dual-driven capsule network model;
[0008] training and optimizing the physical-data dual-driven capsule network model using historical line loss data;
[0009] Based on the trained and optimized physical-data dual driving capsule network model, line loss prediction is performed.
[0010] In some embodiments, the line loss capsule calculates line loss based on the following formula:
[0011] ;
[0012]
[0013] wherein, R is the conductor resistance reference value at 20℃, is the resistance temperature coefficient, T is the conductor temperature, and I is the real-time current;
[0014] The transformer loss capsule calculates transformer loss based on the following formula:
[0015] ;
[0016]
[0017] wherein, is the load rate, is the oil temperature, is the temperature-dependent no-load loss, is the short-circuit loss under rated load, and a, b, and c are coefficients fitted through factory test data.
[0018] In some embodiments, a data capsule network layer is constructed, including:
[0019] A feature extraction capsule group is constructed;
[0020] The data capsule network layer is constructed based on an attention mechanism.
[0021] In some embodiments, the output results of the physical capsule network layer and the output results of the data capsule network layer are verified, and when the verification is abnormal, the physical capsule network layer and the data capsule network layer are corrected, including:
[0022] Based on the following formula, a consistency index of the output results of the physical capsule network layer and the output results of the data capsule network layer is obtained :
[0023]
[0024] wherein, is the output result of the physical capsule network layer, is the output result of the data capsule network layer; an absolute difference between an output result of the physical capsule network layer and an output result of the data capsule network layer;
[0025] when a consistency index is greater than a preset threshold, correcting the physical capsule network layer and the data capsule network layer as follows:
[0026] performing back propagation sensitivity analysis on the physical capsule network layer to obtain parameters of the physical capsule network layer performing gradient analysis on a consistency index ;
[0027] correcting the parameters of the physical capsule network layer based on the following formula:
[0028]
[0029] wherein, is the corrected parameter, is the parameter before correction, is a correction coefficient, is an output result of the physical capsule network layer, is an output result of the data capsule network layer;
[0030] resetting the coupling coefficient of the abnormal data capsule to an initial value.
[0031] In some embodiments, the physical capsule network layer and the data capsule network layer are subjected to multi-scale feature fusion based on a gating feature aggregation mechanism to obtain the physical-data dual-driven capsule network model, including:
[0032] obtaining a gating output value based on the following formula:
[0033]
[0034] wherein, is the gating output value, is an activation function, is a weight matrix of the gating mechanism, is a concatenation operation of the output result of the physical capsule network layer to the output result of the data capsule network layer, is a bias vector;
[0035] subjecting the physical capsule network layer and the data capsule network layer to multi-scale feature fusion based on the gating output value:
[0036]
[0037] wherein, To obtain the prediction value of the physical-data dual-driven capsule network model, is an element-wise multiplication.
[0038] In some embodiments, the physical-data dual-driven capsule network model is trained and optimized using historical line loss data, including:
[0039] A composite loss function is constructed, and the formula of the composite loss function is as follows:
[0040]
[0041] wherein, is a prediction error loss, is a physical consistency loss, is a dynamic routing stability loss, , , is a weight of the prediction error loss, a weight of the physical consistency loss, and a weight of the dynamic routing stability loss, respectively;
[0042] The parameters of the data capsule network layer are fixed, and only the physical parameters of the physical capsule network layer are optimized;
[0043] An adaptive learning strategy is used to jointly fine-tune the physical-data dual-driven capsule network model;
[0044] A sliding window is used to perform incremental learning on the physical-data dual-driven capsule network model.
[0045] In some embodiments, before obtaining the physical-data dual-driven capsule network model based on the multi-scale feature fusion of the physical capsule network layer and the data capsule network layer based on the gating feature aggregation mechanism, the method further comprises dynamically adjusting the fusion weights of the physical capsule network layer and the data capsule network layer using an evidence weight fusion algorithm, including:
[0046] The confidence of the output result of the physical capsule network layer and the membership degree of the output result of the data capsule network layer are obtained based on the following formula, respectively:
[0047] ;
[0048]
[0049] wherein, is the membership degree of the output result of the physical capsule network layer belonging to the kth cluster, is the membership degree of the output result of the data capsule network layer belonging to the kth cluster, is the output result of the physical capsule network layer, is the output result of the data capsule network layer, is the center vector of the kth cluster, is the variance of the kth cluster, K is the total number of clusters, is the center vector of the lth cluster, is the variance of the lth cluster, l≤k≤K;
[0050] The Jousselme distance between the membership distribution of the physical capsule network layer output result and the membership distribution of the data capsule network layer output result is obtained based on the following formula :
[0051]
[0052] wherein, is the membership vector of the physical capsule network layer output result, is the transposed vector of the membership vector of the physical capsule network layer output result, is the membership vector of the data capsule network layer output result, is the transposed vector of the membership vector of the data capsule network layer output result, and D is a positive definite weight matrix.
[0053] The fusion weight of the physical capsule network layer and the data capsule network layer is dynamically adjusted by using a sliding window mechanism. The formula of the fusion weight of the physical capsule network layer is as follows:
[0054]
[0055] wherein, is the fusion weight of the physical capsule network layer; t is the time step; [N-n, N] is the time range of the sliding window, and the sliding window contains n+1 samples from N-n to N; n+1 represents the total number of samples in the sliding window. is the Jousselme distance between the membership distribution of the physical capsule network layer output result at the tth moment and the membership distribution of the data capsule network layer output result; is an indicator function; is a conflict judgment threshold;
[0056] The fusion weight of the data capsule network layer is obtained based on the following formula:
[0057]
[0058] wherein, is the fusion weight of the data capsule network layer, is the fusion weight of the physical capsule network layer.
[0059] In some embodiments, the fusion weight of the data capsule network layer is adjusted based on the following formula:
[0060] ;
[0061]
[0062] wherein, is the adjusted fusion weight of the data capsule network layer, is the fusion weight of the data capsule network layer before adjustment, is the initial attenuation weight of the data capsule network layer, and t is the number of times the physical-data dual-driven capsule network model has been trained so far.
[0063] In a second aspect, the present application also provides a line loss prediction system based on a physical-data dual-driven capsule network; the line loss prediction system based on the physical-data dual-driven capsule network comprises:
[0064] a physical-data dual-driven capsule network model construction module, configured to construct a physical capsule network layer based on an equivalent circuit model of a power equipment, the physical capsule network layer comprising a line loss capsule and a transformer loss capsule; construct a data capsule network layer; check an output result of the physical capsule network layer and an output result of the data capsule network layer, and correct the physical capsule network layer and the data capsule network layer when an exception is found in the checking; perform multi-scale feature fusion on the physical capsule network layer and the data capsule network layer based on a gating feature aggregation mechanism to obtain the physical-data dual-driven capsule network model;
[0065] a training optimization module, configured to train and optimize the physical-data dual-driven capsule network model using historical line loss data; and the trained and optimized physical-data dual-driven capsule network model is used for line loss prediction.
[0066] In some embodiments, the physical-data dual-driven capsule network model construction module comprises:
[0067] a physical capsule network layer construction unit, configured to construct a physical capsule network layer based on an equivalent circuit model of a power equipment, the physical capsule network layer comprising a line loss capsule and a transformer loss capsule;
[0068] a data capsule network layer construction unit, configured to construct a data capsule network layer;
[0069] a checking and correcting unit, configured to check an output result of the physical capsule network layer and an output result of the data capsule network layer, and correct the physical capsule network layer and the data capsule network layer when an exception is found in the checking;
[0070] a fusion unit configured to perform multi-scale feature fusion on the physical capsule network layer and the data capsule network layer based on a gated feature aggregation mechanism to obtain the physical-data dual-driving capsule network model.
[0071] In the line loss prediction method and system based on the physical-data dual-driving capsule network, the physical-data dual-driving capsule network model including the physical capsule network layer and the data capsule network layer is constructed, the explainability of the physical driving model and the learning ability of the data driven model can be combined, and high-precision and self-adaptive prediction of the line loss of the power system can be realized; more accurate reference can be provided for power grid dispatching, power transmission can be reasonably arranged, and power grid operation efficiency can be improved. BRIEF DESCRIPTION OF DRAWINGS
[0072] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0073] Figure 1 a flowchart of the line loss prediction method based on the physical-data dual-driving capsule network provided in an embodiment of the present application;
[0074] Figure 2 a structural block diagram of the line loss prediction system based on the physical-data dual-driving capsule network provided in another embodiment of the present application;
[0075] Figure 3 a structural block diagram of the physical-data dual-driving capsule network model construction module in the line loss prediction system based on the physical-data dual-driving capsule network provided in another embodiment of the present application.
[0076] Explanation of reference numerals: 10, physical-data dual-driving capsule network model construction module; 101, physical capsule network layer construction unit; 102, data capsule network layer construction unit; 103, verification and correction unit; 104, fusion unit; 20, training and optimization module. DETAILED DESCRIPTION
[0077] In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.
[0078] In one embodiment, please refer to Figure 1The application provides a line loss prediction method based on a physical-data dual driving capsule network, which comprises the following steps: S10-S30.
[0079] S10: constructing a physical-data dual driving capsule network model, comprising: constructing a physical capsule network layer based on an equivalent circuit model of a power equipment, wherein the physical capsule network layer comprises a line loss capsule and a transformer loss capsule; constructing a data capsule network layer; checking an output result of the physical capsule network layer and an output result of the data capsule network layer, and correcting the physical capsule network layer and the data capsule network layer when an exception is found in the checking; and performing multi-scale feature fusion on the physical capsule network layer and the data capsule network layer based on a gated feature aggregation mechanism to obtain the physical-data dual driving capsule network model.
[0080] S20: training and optimizing the physical-data dual driving capsule network model using historical line loss data.
[0081] Performing line loss prediction based on the trained and optimized physical-data dual driving capsule network model.
[0082] In the line loss prediction method based on the physical-data dual driving capsule network, the physical-data dual driving capsule network model comprising a physical capsule network layer and a data capsule network layer is constructed, the interpretability of the physical driving model and the learning ability of the data driven model can be combined, and high-precision and self-adaptive prediction of the line loss of the power system can be realized; more accurate references can be provided for power grid dispatching, power transmission can be reasonably arranged, and power grid operation efficiency can be improved; in the aspect of equipment state evaluation, the operation of the equipment can be more accurately judged, and potential problems can be found in time; in the aspect of energy saving optimization, the link with larger line loss can be found, and targeted measures can be taken to reduce energy consumption.
[0083] In step S10, refer to the S10 step in Figure 1 , constructing a physical-data dual driving capsule network model, comprising: constructing a physical capsule network layer based on an equivalent circuit model of a power equipment, wherein the physical capsule network layer comprises a line loss capsule and a transformer loss capsule; constructing a data capsule network layer; checking an output result of the physical capsule network layer and an output result of the data capsule network layer, and correcting the physical capsule network layer and the data capsule network layer when an exception is found in the checking; and performing multi-scale feature fusion on the physical capsule network layer and the data capsule network layer based on a gated feature aggregation mechanism to obtain the physical-data dual driving capsule network model.
[0084] As an example, the line loss capsule and the transformer loss capsule in the constructed physical capsule network layer can calculate line loss through physical formula and T-type equivalent circuit, etc.
[0085] As an example, the physical capsule network layer can adopt a modular design and can include two core processing units, i.e., a line loss capsule and a transformer loss capsule. Each capsule can encapsulate the physical characteristic equation and the equivalent circuit model of a specific power device, and the parameterized calculation can achieve an interpretable expression of the physical law.
[0086] As an example, the implementation details of the line loss capsule are as follows:
[0087] Input parameters: real-time current I (unit: A), conductor temperature T (unit: ℃).
[0088] As an example, the line loss capsule can calculate line loss based on the following formula:
[0089] ;
[0090]
[0091] wherein, R0 is the conductor resistance reference value at 20℃, R is the resistance temperature coefficient, T is the conductor temperature, and I is the real-time current.
[0092] As can be seen from the above, the line loss capsule first calculates the current resistance value R according to the temperature sensor data , and then calculates the line loss P according to the current transformer measurement value .
[0093] As an example, the implementation details of the transformer loss capsule are as follows:
[0094] Input parameters: load rate (unit: per unit), oil temperature (unit: ℃).
[0095] As an example, the transformer loss capsule calculates transformer loss based on the following formula:
[0096] ;
[0097]
[0098] wherein, is the load rate, is the oil temperature, is the temperature-dependent no-load loss, For short-circuit loss under rated load, a, b, c are coefficients obtained by fitting factory test data.
[0099] As can be seen from the above, the transformer loss capsule first calculates the current iron loss according to the oil temperature , then calculates the variable copper loss in combination with the load rate , and finally obtains the transformer loss .
[0100] As an example, the data capsule network layer can adopt a dynamic routing capsule network to learn nonlinear loss features (such as harmonic features, contact resistance features, and environmental features, etc.) that are not covered by the physical capsule network layer. Specifically, the harmonic features can be additional losses caused by current harmonic distortion (such as 3rd harmonic, 5th harmonic); the contact resistance features can be loss fluctuations caused by changes in wire joint contact resistance; and the environmental features can be the influence of temperature and humidity on wire resistance (such as increased resistance caused by high temperature).
[0101] As an example, constructing the data capsule network layer can include the following contents: constructing a feature extraction capsule group; and constructing the data capsule network layer based on an attention mechanism.
[0102] As an example, the core of the feature extraction capsule group can be to convert the input high-dimensional feature vector into a capsule output with explicit physical meaning through 3 groups of parallel convolution capsule layers.
[0103] Specifically, the input feature vector is processed by 3 groups of parallel convolution capsule layers as follows:
[0104]
[0105] wherein, is the i-th component (or sub-feature) in the input feature vector , the input feature vector is a high-dimensional feature representation obtained after preprocessing the original input data, and the dimension is n, and is a specific feature element in the high-dimensional vector; is the output vector of the j-th capsule in the l-th subspace (harmonic feature, contact resistance feature, or environmental feature); k is the number of components in the input feature vector ; and is a trainable convolution kernel, is a bias term.
[0106] As an example, the related formulas of the bidirectional routing protocol based on the attention mechanism are as follows:
[0107]
[0108] where, is the core output, representing the attention weight of node i on candidate object j; is the feature vector of node i; is the feature vector of candidate object j relative to node i; is the inner product of vectors and, used to quantify the similarity between the two; is the feature vector of candidate object k relative to node i; is the temperature coefficient, used to adjust the concentration of weights; The larger it is, the more concentrated the weights are on a small number of high-similarity candidate objects (differences are amplified); The smaller it is, the more evenly distributed the weights are (differences are weakened);
[0109]
[0110] where, is the original feature vector of node i itself; is a learnable weight matrix or parameter matrix used to map the feature vector of node i into a feature space related to candidate object j.
[0111] As an example, the aggregated feature vector of candidate object j can be obtained based on the following formula :
[0112]
[0113] The output result of the data capsule network layer is obtained based on the following formula (i.e. ):
[0114]
[0115] where, is the unitization of , resulting in a vector with the same direction and a modulus of 1; is a scaling factor with a value range of [0, 1), which tends to 1 when .
[0116] As an example, the output result of the physical capsule network layer and the output result of the data capsule network layer are checked, and when the check is abnormal, the physical capsule network layer and the data capsule network layer are corrected, which can include the following contents:
[0117] The consistency index of the output result of the physical capsule network layer and the output result of the data capsule network layer is obtained based on the following formula :
[0118]
[0119] wherein, is the output result of the physical capsule network layer; is the output result of the data capsule network layer; the output result of the physical capsule network layer and the output result of the data capsule network layer can both be vectors; is the norm of a vector, usually L2 norm, i.e. Euclidean distance, used to quantify the size or intensity of a vector; is the absolute difference between the output result of the physical capsule network layer and the output result of the data capsule network layer, measuring their distance in the feature space; is the maximum of the length of the output result of the physical capsule network layer and the length of the output result of the data capsule network layer, used to normalize the absolute difference, avoiding the distortion of the difference measure caused by the excessive intensity of the vector itself;
[0120] When the consistency index is greater than a preset threshold (for example, the preset threshold can be 0.3), the physical capsule network layer and the data capsule network layer are corrected as follows:
[0121] The physical capsule network layer is subjected to backpropagation sensitivity analysis to obtain the parameters of the physical capsule network layer; The gradient of the consistency index ; specifically, it can be decomposed into the derivative of the physical feature and the derivative of the physical property with respect to the parameter ; it can be efficiently realized by using automatic differentiation tools (such as PyTorch's backward);
[0122] The parameters of the physical capsule network layer are corrected based on the following formula:
[0123]
[0124] wherein, is the corrected parameter, is the parameter before correction, is the correction coefficient, is the output result of the physical capsule network layer, is the output result of the data capsule network layer;
[0125] The coupling coefficient of the abnormal data capsule is reset to the initial value.
[0126] As an example, the parameters of the physical capsule network layer can include the transformation matrix and the coupling coefficient of the physical capsule network layer, and other parameters used to calculate the output result of the physical capsule network layer.
[0127] As an example, the physical capsule network layer and the data capsule network layer are fused based on a gating feature aggregation mechanism to obtain the physical-data dual-driven capsule network model, including:
[0128] The gating output value is obtained based on the following formula:
[0129]
[0130] wherein, is the gating output value, is an activation function, is a weight matrix of the gating mechanism, is a splicing operation of the output result of the physical capsule network layer to the output result of the data capsule network layer, is a bias vector;
[0131] The physical capsule network layer and the data capsule network layer are fused based on the gating output value:
[0132]
[0133] wherein, is a prediction value of the obtained physical-data dual-driven capsule network model, and is an element-wise multiplication.
[0134] It should be noted that the gating output value g can be the fusion weight of the physical capsule network layer at this time, and 1-g can be the fusion weight of the data capsule network layer at this time.
[0135] It should be further noted that the physical capsule network layer and the data capsule network layer can be fused based on the gating feature aggregation mechanism after the output results of the physical capsule network layer and the data capsule network layer are verified to be normal. If the output results of the physical capsule network layer and the data capsule network layer are verified to be abnormal, the physical capsule network layer and the data capsule network layer need to be corrected by using the above method until the output results of the physical capsule network layer and the data capsule network layer are verified to be normal, and then the physical capsule network layer and the data capsule network layer are fused based on the gating feature aggregation mechanism.
[0136] As an example, before obtaining the physical-data dual-driven capsule network model after multi-scale feature fusion of the physical capsule network layer and the data capsule network layer based on the gated feature aggregation mechanism, the method may further include: dynamically adjusting the fusion weights of the physical capsule network layer and the data capsule network layer using an evidence weight fusion algorithm. This dynamic adjustment of the fusion weights may include the following:
[0137] The confidence level of the physical capsule network layer output and the membership level of the data capsule network layer output are obtained based on the following formulas:
[0138] ;
[0139]
[0140] in, The membership degree of the physical capsule network layer output to the k-th cluster is given. The membership degree of the data capsule network layer output to the k-th cluster. This is the output of the physical capsule network layer. The output of the data capsule network layer. Let be the center vector of the k-th cluster. Let be the variance of the k-th cluster, and K be the total number of clusters. Let l be the center vector of the l-th cluster. Let K be the variance of the l-th cluster, where l ≤ k ≤ K; The squared Euclidean distance between the output of the physical capsule network layer and the center vector of the kth cluster; The squared Euclidean distance between the output of the physical capsule network layer and the center vector of the l-th cluster; The squared Euclidean distance between the output of the data capsule network layer and the center vector of the kth cluster; The squared Euclidean distance between the output of the data capsule network layer and the center vector of the l-th cluster;
[0141] The Jousselme distance between the membership distribution of the physical capsule network layer output and the membership distribution of the data capsule network layer output is obtained based on the following formula. :
[0142]
[0143] in, This represents the membership vector output by the physical capsule network layer. This is the transpose of the membership vector of the output of the physical capsule network layer. a membership vector output by the data capsule network layer, a transpose vector of the membership vector output by the data capsule network layer, D is a positive definite weight matrix;
[0144] The fusion weight of the physical capsule network layer is dynamically adjusted by using a sliding window mechanism. The formula of the fusion weight of the physical capsule network layer is as follows:
[0145]
[0146] wherein, is the fusion weight of the physical capsule network layer; t is a time step; [N-n, N] is the time range of the sliding window, and the sliding window contains n+1 samples from N-n to N; n+1 represents the total number of samples in the sliding window; is the Jousselme distance between the membership distribution of the output result of the physical capsule network layer at the t time and the membership distribution of the output result of the data capsule network layer; is an indicator function; is a conflict judgment threshold;
[0147] The fusion weight of the data capsule network layer is obtained based on the following formula:
[0148]
[0149] wherein, is the fusion weight of the data capsule network layer, is the fusion weight of the physical capsule network layer.
[0150] As an example, the fusion weight of the data capsule network layer can also be adjusted based on the following formula:
[0151] ;
[0152]
[0153] wherein, is the adjusted fusion weight of the data capsule network layer, is the fusion weight of the data capsule network layer before adjustment, is the initial decay weight of the data capsule network layer, and t is the number of times that the physical-data dual-driven capsule network model has been trained.
[0154] It should be noted that the fusion weight of the data capsule network layer is adjusted, and the fusion weight of the physical capsule network layer is updated as follows: .
[0155] In step S20, please refer to Figure 1In step S20, the physical-data dual-driven capsule network model is trained and optimized using historical line loss data.
[0156] As an example, in step S20, training and optimizing the physical-data dual-driven capsule network model using historical line loss data can include the following steps: S201-S204.
[0157] S201: Construct a composite loss function, and the formula of the composite loss function is as follows:
[0158]
[0159] wherein, is a prediction error loss, is a physical consistency loss, is a dynamic routing stability loss, , , The prediction error loss, the physical consistency loss, and the dynamic routing stability loss are respectively weighted by a weight, a weight, and a weight.
[0160] S202: Fix the parameters of the data capsule network layer, and only optimize the physical parameters of the physical capsule network layer.
[0161] S203: Adopt an adaptive learning strategy to jointly fine-tune the physical-data dual-driven capsule network model.
[0162] S204: Adopt a sliding window to perform incremental learning on the physical-data dual-driven capsule network model.
[0163] As an example, in step S20, the physical-data dual-driven capsule network model is trained and optimized using historical line loss data through an optimization algorithm such as gradient descent, and the parameters of the physical-data driven capsule network model are adjusted to minimize the prediction error and improve the line loss prediction accuracy. Specifically, a hierarchical adaptive training strategy can be adopted to realize parameter optimization through a physical constraint guided data driven framework.
[0164] As an example, in step S201, The prediction error loss can adopt an improved Huber loss function:
[0165]
[0166] wherein y is a true value, is a predicted value, and is 1.5 times the standard deviation of historical data.
[0167] As an example, in step S201, the physical consistency loss The mean square error of the output result of the physical network capsule layer and the theoretical value is calculated:
[0168]
[0169] wherein N is the number of physical capsules, is the theoretical value of the i-th physical capsule, is the output result of the i-th physical capsule.
[0170] As an example, in step S201, the dynamic routing stability loss The inter-capsule coupling coefficient entropy value can be measured, and the corresponding formula is as follows:
[0171]
[0172] wherein is the inter-capsule coupling coefficient entropy value, and k is the number of capsules.
[0173] As an example, in step S203, an adaptive learning strategy can be adopted based on the following formula to jointly fine-tune the physical-data dual-driven capsule network model by cosine annealing:
[0174]
[0175] wherein is the initial learning rate, = 0.001; is the minimum learning rate; is the learning rate after joint fine-tuning; T is the annealing temperature; and t is the current temperature.
[0176] As an example, before training and optimizing the physical-data dual-driven capsule network model using historical line loss data, a step of preprocessing the historical line loss data can also be included. Specifically, the preprocessing can include steps of outlier detection and correction, multi-source data alignment, adaptive normalization, and feature enhancement.
[0177] As an example, an improved isolation forest algorithm can be used for outlier detection, and the specific formula can be as follows:
[0178]
[0179] wherein is the sample is the path length in the isolation tree, is the standardization factor.
[0180] As an example, the following optimization can be performed in view of the characteristics of power data:
[0181] a) Introduce a sliding window mechanism (window size can be 24 hours) to build the component isolation tree within the sliding window;
[0182] b) For continuous variables (e.g. current), replace the default Euclidean distance with piecewise linear kernel function;
[0183] c) Set a dynamic anomaly threshold.
[0184] As an example, the multi-source data alignment can include constructing a timestamp alignment matrix, and the specific formula is as follows:
[0185]
[0186] wherein, is the output of the timestamp alignment matrix, and is a binary value (0 or 1) indicating whether the i th time feature of the physical capsule network layer matches the j th time feature of the data capsule network layer; is the i th time feature of the physical capsule network layer; is the j th time feature of the data capsule network layer; is the absolute difference between the two time features; is the time matching threshold.
[0187] As an example, the optimal matching can be solved by the Hungarian algorithm, and the corresponding formula is as follows:
[0188]
[0189] wherein, the constraint condition is and .
[0190] As an example, the adaptive normalization can include: adopting a hybrid normalization strategy for different physical quantities; specifically: for current and voltage, adopting an improved Tanh normalization; for temperature, adopting a constrained Min-Max normalization; and for discrete states, performing One-Hot encoding.
[0191] As an example, the feature enhancement can include generating derivative features, specifically including current harmonic distortion rate and load unbalance degree. The formula of the load unbalance degree may be as follows:
[0192]
[0193] wherein, I a , I b and I c are three-phase currents.
[0194] In step S30, please refer to Figure 1The line loss prediction is performed based on the trained and optimized physical-data dual driving capsule network model in the step S30.
[0195] As an example, real-time power data can be collected and preprocessed, and then input into the trained and optimized physical-data dual driving capsule network model for line loss prediction. The preprocessing method of real-time power data can refer to the preprocessing method of historical line loss data, which will not be described here.
[0196] In another embodiment, please refer to Figure 1 Figure 2 The application also provides a line loss prediction system based on a physical-data dual driving capsule network, which can include a physical-data dual driving capsule network model construction module 10 and a training optimization module 20. The physical-data dual driving capsule network model construction module 10 is used to construct a physical capsule network layer based on an equivalent circuit model of power equipment, the physical capsule network layer including line loss capsules and transformer loss capsules; construct a data capsule network layer; check the output results of the physical capsule network layer and the data capsule network layer, and correct the physical capsule network layer and the data capsule network layer when there is an abnormality; perform multi-scale feature fusion on the physical capsule network layer and the data capsule network layer based on a gating feature aggregation mechanism to obtain the physical-data dual driving capsule network model. The training optimization module 20 is used to train and optimize the physical-data dual driving capsule network model using historical line loss data. The trained and optimized physical-data dual driving capsule network model 10 is used for line loss prediction.
[0197] As an example, please refer to Figure 1 Figure 2 Figure 3 The physical-data dual driving capsule network model construction module 10 can include a physical capsule network layer construction unit 101, a data capsule network layer construction unit 102, a checking and correcting unit 103, and a fusion unit 104. The physical capsule network layer construction unit 101 is used to construct a physical capsule network layer based on an equivalent circuit model of power equipment, the physical capsule network layer including line loss capsules and transformer loss capsules. The data capsule network layer construction unit 102 is used to construct a data capsule network layer. The checking and correcting unit 103 is used to check the output results of the physical capsule network layer and the data capsule network layer, and correct the physical capsule network layer and the data capsule network layer when there is an abnormality. The fusion unit 104 is used to perform multi-scale feature fusion on the physical capsule network layer and the data capsule network layer based on a gating feature aggregation mechanism to obtain the physical-data dual driving capsule network model.
[0198] As an example, the line loss prediction system based on the physical-data dual driving capsule network in this embodiment can be used to perform the line loss prediction method based on the physical-data dual driving capsule network as described in Figure 1 and related embodiments.
[0199] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features of the above embodiments are described, but it should be considered that any combination of the technical features is within the scope of the present disclosure as long as there is no contradiction.
[0200] The above embodiments only express several implementation manners of the present application, and the description is specific and detailed, but it should not be understood as a limitation on the patent scope of the application. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the protection scope of the present application. Therefore, the patent protection scope of the present application should be subject to the appended claims.
Claims
1. A line loss prediction method based on a physical-data dual-driven capsule network, characterized in that, include: Constructing a physical-data dual-driven capsule network model includes: building a physical capsule network layer based on the equivalent circuit model of power equipment, wherein the physical capsule network layer includes a line loss capsule and a transformer loss capsule; constructing a data capsule network layer; verifying the output results of the physical capsule network layer and the output results of the data capsule network layer, and correcting the physical capsule network layer and the data capsule network layer when the verification is abnormal; performing multi-scale feature fusion on the physical capsule network layer and the data capsule network layer based on a gated feature aggregation mechanism to obtain the physical-data dual-driven capsule network model; the line loss capsule calculates the line loss based on the following formula: ; ;in, This is the reference value for conductor resistance at 20℃. Where T is the temperature coefficient of resistance, I is the conductor temperature, and T is the real-time current. The transformer loss capsule calculates transformer losses based on the following formula: ; ;in, For load rate, Oil temperature For temperature-related no-load losses, The short-circuit loss is given by the rated load, and a, b, and c are coefficients obtained by fitting factory test data. The data capsule network layer is constructed by: constructing a feature extraction capsule group; and using an attention-based mechanism to construct the data capsule network layer. The physical-data dual-driven capsule network model was trained and optimized using historical line loss data. Line loss prediction is performed based on a trained and optimized physical-data dual-driven capsule network model.
2. The method according to claim 1, characterized in that, The data capsule network layer employs a dynamic routing capsule network to learn the nonlinear loss characteristics not covered by the physical capsule network layer.
3. The method according to claim 1, characterized in that, The output results of the physical capsule network layer and the data capsule network layer are validated. If an anomaly is detected, the physical capsule network layer and the data capsule network layer are corrected, including: The consistency index between the output of the physical capsule network layer and the output of the data capsule network layer is obtained based on the following formula. : in, This is the output of the physical capsule network layer; This is the output of the data capsule network layer; This represents the absolute difference between the output of the physical capsule network layer and the output of the data capsule network layer. When consistency index When the value exceeds a preset threshold, the physical capsule network layer and the data capsule network layer are corrected as follows: Backpropagation sensitivity analysis was performed on the physical capsule network layer to obtain its parameters. Consistency Indicators gradient ; The parameters of the physical capsule network layer are based on the following formula. Perform correction: in, These are the corrected parameters. These are the parameters before correction. For correction factors, This is the output of the physical capsule network layer. This is the output of the data capsule network layer; Reset the coupling coefficient of the abnormal data capsule to its initial value.
4. The method according to claim 3, characterized in that, Parameters of physical capsule network layer The parameters used to calculate the output of the physical capsule network layer include the transformation matrix and coupling coefficients of the physical capsule network layer.
5. The method according to claim 1, characterized in that, Based on a gated feature aggregation mechanism, multi-scale feature fusion is performed on the physical capsule network layer and the data capsule network layer to obtain the physical-data dual-driven capsule network model, including: The gated output value is obtained based on the following formula: in, This is the gated output value. For activation function, This is the weight matrix for the gating mechanism. This is the concatenation operation between the output of the physical capsule network layer and the output of the data capsule network layer. It is the bias vector; Multi-scale feature fusion is performed on the physical capsule network layer and the data capsule network layer based on the gated output value: in, The predicted value of the obtained physical-data dual-driven capsule network model is represented by ⊙, where ⊙ represents element-wise multiplication.
6. The method according to claim 1, characterized in that, The physical-data dual-driven capsule network model is trained and optimized using historical line loss data, including: Construct a composite loss function, the formula of which is as follows: in, To predict error loss, For physical consistency loss, Due to the instability loss caused by dynamic routing, , , These are the weights for prediction error loss, physical consistency loss, and dynamic routing stability loss, respectively. The parameters of the data capsule network layer are fixed, and only the physical parameters of the physical capsule network layer are optimized; An adaptive learning strategy is used to jointly fine-tune the physics-data dual-driven capsule network model; A sliding window is used to incrementally learn the physical-data dual-driven capsule network model.
7. The method according to any one of claims 1 to 6, characterized in that, Before obtaining the physical-data dual-driven capsule network model by performing multi-scale feature fusion on the physical capsule network layer and the data capsule network layer based on the gated feature aggregation mechanism, the method further includes: dynamically adjusting the fusion weights of the physical capsule network layer and the data capsule network layer using an evidence weight fusion algorithm, including: The confidence level of the physical capsule network layer output and the membership level of the data capsule network layer output are obtained based on the following formulas: ; in, The membership degree of the physical capsule network layer output to the k-th cluster. The membership degree of the data capsule network layer output to the k-th cluster. This is the output of the physical capsule network layer. The output of the data capsule network layer. Let be the center vector of the k-th cluster. Let be the variance of the k-th cluster, and K be the total number of clusters. Let l be the center vector of the l-th cluster. Let K be the variance of the l-th cluster, where l ≤ k ≤ K; The Jousselme distance between the membership distribution of the physical capsule network layer output and the membership distribution of the data capsule network layer output is obtained based on the following formula. : in, This represents the membership vector output by the physical capsule network layer. This is the transpose of the membership vector of the output of the physical capsule network layer. This represents the membership vector output by the data capsule network layer. Let D be the transpose of the membership vector of the data capsule network layer output, and D be the positive definite weight matrix. A sliding window mechanism is used to dynamically adjust the fusion weights of the physical capsule network layer and the data capsule network layer. The formula for the fusion weights of the physical capsule network layer is as follows: in, denoted as the fusion weights of the physical capsule network layer; t represents the time step; [Nn, N] represents the time range of the sliding window, which contains n+1 samples from Nn to N; n+1 represents the total number of samples in the sliding window. The Jousselme distance is the membership distribution between the output of the physical capsule network layer and the output of the data capsule network layer at time t. For indicator functions; Threshold for conflict judgment; The fusion weights of the data capsule network layer are obtained based on the following formula: in, For the fusion weights of the data capsule network layer, , which represents the fusion weights of the physical capsule network layer.
8. The method according to claim 7, characterized in that, The fusion weights of the data capsule network layer are adjusted based on the following formula: ; in, The adjusted fusion weights for the data capsule network layer. The fusion weights of the data capsule network layer before adjustment. t represents the initial decay weights of the data capsule network layer, and t represents the number of times the physical-data dual-driven capsule network model has been trained.
9. A line loss prediction system based on a physical-data dual-driven capsule network, characterized in that, Used to perform the line loss prediction method based on physical-data dual-driven capsule networks as described in any one of claims 1 to 8; Line loss prediction systems based on physical-data dual-driven capsule networks include: A physical-data dual-driven capsule network model construction module is used to construct a physical capsule network layer based on the equivalent circuit model of power equipment. The physical capsule network layer includes a line loss capsule and a transformer loss capsule. A data capsule network layer is constructed. The output results of the physical capsule network layer and the data capsule network layer are verified, and corrections are performed on the physical capsule network layer and the data capsule network layer when verification is abnormal. Multi-scale feature fusion is performed on the physical capsule network layer and the data capsule network layer based on a gated feature aggregation mechanism to obtain the physical-data dual-driven capsule network model. The training and optimization module is used to train and optimize the physical-data dual-driven capsule network model using historical line loss data; the trained and optimized physical-data dual-driven capsule network model is used for line loss prediction.
10. The line loss prediction system according to claim 9, characterized in that, The physical-data dual-driven capsule network model construction module includes: A physical capsule network layer construction unit is used to construct a physical capsule network layer based on the equivalent circuit model of power equipment. The physical capsule network layer includes line loss capsules and transformer loss capsules. Data capsule network layer building blocks are used to construct data capsule network layers; The verification and correction unit is used to verify the output results of the physical capsule network layer and the output results of the data capsule network layer, and to correct the physical capsule network layer and the data capsule network layer when the verification is abnormal. The fusion unit is used to perform multi-scale feature fusion on the physical capsule network layer and the data capsule network layer based on a gated feature aggregation mechanism to obtain the physical-data dual-driven capsule network model.
Citation Information
Patent Citations
Power grid line loss rate PINN real-time prediction method and system based on PDE dynamic following
CN119944604A
Power distribution network line loss analysis method and device based on data and model dual drive
CN120277319A