A low-voltage power distribution network line loss prediction method, model training method and related device

By constructing a prediction model that combines periodic time-series feature extraction and hybrid architecture feature fusion, and incorporating the CPO optimization algorithm, the accuracy problem of line loss prediction was solved, achieving efficient line loss prediction in distributed photovoltaic grids connected to low-voltage distribution networks, and improving the model's modeling capability and prediction accuracy.

CN120930887BActive Publication Date: 2026-02-17ZHANJIANG POWER SUPPLY BUREAU OF GUANGDONG POWER GRID CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511461191.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-14
Publication Date
2026-02-17
Estimated Expiration
2045-10-14

AI Technical Summary

Technical Problem

Existing line loss prediction methods struggle to accurately capture the long-term trends of photovoltaic output and load fluctuations after distributed photovoltaic (PV) systems are integrated into low-voltage distribution networks. Furthermore, they are unable to effectively model line loss change patterns, leading to decreased prediction accuracy and an inability to fully explore the interaction between PV output, load behavior, and meteorological factors.

Method used

A prediction model with periodic temporal feature extraction and hybrid architecture feature fusion is constructed. The neural network parameters are optimized using the CPO optimization algorithm, including a temporal feature extraction module, a multi-scale feature extraction module, a deep feature extraction module, and a prediction layer. The model parameters are iteratively updated using the Crown Porcupine optimization algorithm. Combined with the Transformer encoder, GRU network layer, and TCN network layer, the model captures line loss variation patterns at multiple time scales and quantifies prediction uncertainty.

Benefits of technology

It improves the accuracy and stability of line loss prediction, can effectively assess the operation status of the distribution network in the context of distributed photovoltaic access, enhances the modeling ability and generalization performance of the model, and provides reliable prediction results and confidence intervals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120930887B_ABST
    Figure CN120930887B_ABST
Patent Text Reader

Abstract

The application discloses a low-voltage power distribution network line loss prediction method, a model training method and related devices, the model training method: (1) a neural network structure combining a time sequence feature extraction module and a multi-scale feature extraction module can capture the long-term trend of photovoltaic output and load fluctuation, effectively model the line loss change mode under different time scales; (2) the deep feature extraction module introduces a deep feature extraction mechanism with different architectures, improves the expression ability and generalization performance of the model for complex nonlinear relationships; (3) the Guanhao pig optimization algorithm is used to jointly optimize the model parameters and structure, which can realize efficient search in high-dimensional non-convex space, avoid falling into local optimum, and improve the prediction accuracy and stability; the line loss prediction method provided by the application based on the line loss prediction model can be directly used for power distribution network operation situation evaluation and energy efficiency analysis, and has good engineering application value under the background of wide access of distributed photovoltaic.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of power distribution network line loss analysis, and particularly relates to a low-voltage power distribution network line loss prediction method, a model training method and related devices. BACKGROUND

[0002] With the large-scale access of distributed photovoltaic power generation, the operation mode of the power distribution network is increasingly complex, and the traditional load-dominated power supply mode is gradually changing to a "source-load-network" collaborative operation mode. Distributed photovoltaic power generation has significant advantages in improving renewable energy utilization efficiency and reducing carbon emissions, but its high volatility and uncertainty characteristics also bring new challenges to the stable operation of the power distribution network.

[0003] Among them, the line loss problem of the power distribution network becomes an important issue to be solved after the access of distributed photovoltaic power generation. On the one hand, photovoltaic power generation has a significant impact on load power flow direction and power distribution, resulting in more complex line loss variation; on the other hand, photovoltaic power generation is significantly affected by weather conditions, further exacerbating the dynamic fluctuations of the power distribution system operation state, resulting in a significant decrease in the accuracy of modeling methods based on static characteristics. Therefore, how to accurately predict the line loss level of the power distribution network under the condition of photovoltaic access is of great significance to improve the efficiency and economy of system operation.

[0004] After the access of distributed photovoltaic power generation to the low-voltage power distribution network, on the one hand, the line loss needs to consider multiple periodic characteristics, and the randomness of photovoltaic power generation greatly increases the uncertainty of line loss prediction; on the other hand, the current line loss analysis method is insufficient in terms of fusion and effective use of multi-source heterogeneous data, and it is difficult to fully exploit the interaction between photovoltaic output, load behavior and weather factors, and the traditional prediction model is not suitable for systems with complex nonlinear relationships. SUMMARY

[0005] Therefore, the application aims to provide a low-voltage power distribution network line loss prediction method, a model training method and related devices, to build a prediction model with periodic time series feature extraction and hybrid architecture feature fusion, and to use the CPO optimization algorithm to optimize and update the model to improve the accuracy of line loss prediction.

[0006] In a first aspect, the application provides a model training method for training a line loss prediction model, comprising:

[0007] Obtaining a power distribution network operation data training set, the power distribution network operation data training set at least including photovoltaic power generation data;

[0008] The neural network comprising a time sequence feature extraction module, a multi-scale feature extraction module, a deep feature extraction module, and a prediction layer is constructed, wherein the deep feature extraction module comprises at least two deep feature extraction layers with different architectures, and the power grid operation data training set sequentially passes through the time sequence feature extraction module, the multi-scale feature extraction module, the deep feature extraction module, and the prediction layer.

[0009] The power grid operation data set is taken as the input data of the neural network, and the line loss prediction result is taken as the output result. The neural network is trained, the parameters of the neural network are iteratively updated by using the crowding moth optimization algorithm during the training, and the trained neural network is taken as the line loss prediction model.

[0010] Further, the multi-scale feature extraction module comprises a plurality of convolution kernels corresponding to different time scales and a scale feature fusion layer, and the scale features extracted by the convolution kernels are weighted and fused in the scale feature fusion layer to obtain scale fusion features.

[0011] Further, the weighted fusion of the scale features in the scale feature fusion layer to obtain the scale fusion features comprises:

[0012] The weight corresponding to each scale feature is calculated as follows:

[0013] ,

[0014] wherein, indicates the weight corresponding to the scale feature extracted by the kth convolution kernel, indicates a learnable weight parameter, and K indicates the number of convolution kernels;

[0015] The scale fusion features are weighted and fused according to the weights of the scale features, and are represented as:

[0016] ,

[0017] wherein, indicates the scale feature extracted by the kth convolution kernel, indicates the input of the multi-scale feature extraction module.

[0018] Further, the deep feature extraction module further comprises a deep feature fusion layer.

[0019] The scale fusion features output by the multi-scale feature extraction module pass through at least two deep feature extraction layers with different architectures respectively, to obtain at least two deep features, and the deep feature fusion layer fuses the at least two deep features to obtain deep fusion features.

[0020] Further, the deep feature extraction layer comprises a Transformer encoder, a GRU network layer, and a TCN network layer.

[0021] Further, the parameter of the neural network is iteratively updated by using the crow search optimization algorithm during the training, and the parameter of the neural network is iteratively updated by using the crow search optimization algorithm during the training comprises:

[0022] A parameter optimization model is constructed according to the set line loss prediction index;

[0023] The parameter optimization model is solved by using the crow search optimization algorithm to obtain a parameter solution of the neural network.

[0024] Further, the set line loss prediction index comprises a root mean square error, a mean absolute error, a prediction interval coverage rate and a prediction interval average width;

[0025] The parameter optimization model is expressed as:

[0026]

[0027] wherein, 、 、 、 respectively represent the root mean square error, the mean absolute error, the prediction interval coverage rate and the prediction interval average width, represents the parameter of the neural network, 、 、 、 represents a weight coefficient, and satisfies .

[0028] Further, the above method further comprises:

[0029] The number of training iterations of the neural network is determined based on an overfitting strategy.

[0030] In a second aspect, the present application provides a low-voltage power distribution network line loss prediction method, comprising:

[0031] Obtaining power distribution network operation data, the power distribution network operation data at least comprising photovoltaic power generation data;

[0032] Inputting the power distribution network operation data into a line loss prediction model obtained by the model training method of the first aspect to obtain a line loss prediction result.

[0033] In a third aspect, the present application provides a model training device for training a line loss prediction model, comprising:

[0034] A training data acquisition module is configured to acquire a power distribution network operation data training set, the power distribution network operation data training set at least comprising photovoltaic power generation data;

[0035] The training network construction module is configured to construct a neural network comprising a time sequence feature extraction module, a multi-scale feature extraction module, a deep feature extraction module, and a prediction layer, wherein the deep feature extraction module comprises at least two deep feature extraction layers with different architectures, and the power distribution network operation data training set sequentially passes through the time sequence feature extraction module, the multi-scale feature extraction module, the deep feature extraction module, and the prediction layer.

[0036] The network training module is configured to train the neural network by taking the power distribution network operation data set as input data and taking the line loss prediction result as output result, and iteratively update parameters of the neural network by using the crowding moth optimization algorithm during the training, and take the trained neural network as the line loss prediction model.

[0037] In a fourth aspect, the present application provides a low-voltage power distribution network line loss prediction device, comprising:

[0038] The operation data acquisition module is configured to acquire power distribution network operation data, and the power distribution network operation data at least comprises photovoltaic power generation data.

[0039] The line loss prediction module is configured to input the power distribution network operation data into the line loss prediction model obtained by the device of the third aspect, and obtain a line loss prediction result.

[0040] In a fifth aspect, the present application provides an electronic device comprising a memory storing computer executable instructions and a processor, wherein the computer executable instructions, when executed by the processor, cause the device to perform the model training method of the first aspect, and / or each step of the low-voltage power distribution network line loss prediction method of the second aspect.

[0041] In a sixth aspect, the present application provides a readable storage medium storing computer executable programs, wherein the programs, when executed, can implement the model training method of the first aspect, and / or each step of the low-voltage power distribution network line loss prediction method of the second aspect.

[0042] Compared with the existing line loss prediction method, the present application has the following beneficial effects:

[0043] The application provides a low-voltage power distribution network line loss prediction method, a model training method and related devices, wherein the model training method is characterized in that: (1) a neural network structure combining a time sequence feature extraction module and a multi-scale feature extraction module is adopted, which can not only capture the long-term trend of photovoltaic output and load fluctuation, but also effectively model the line loss change mode under different time scales, thereby improving the modeling capability of the model; (2) a deep feature extraction mechanism with different architectures is introduced into the deep feature extraction module, and multi-view deep features are extracted through fusion, thereby improving the expression capability and generalization performance of the model for complex nonlinear relationships; (3) a Guanhuo pig optimization algorithm is used to jointly optimize the model parameters and structure, which can realize efficient search in a high-dimensional non-convex space, avoid falling into local optimum, and improve the prediction accuracy and stability; the line loss prediction method provided by the application based on the line loss prediction model can be directly used for power distribution network operation situation assessment and energy efficiency analysis, and has good engineering application value under the background of wide access of distributed photovoltaic. BRIEF DESCRIPTION OF DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only a part of the embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor based on the provided drawings.

[0045] Figure 1 The model training method provided by the embodiment of the present application realizes a flowchart;

[0046] Figure 2 The low-voltage power distribution network line loss prediction method provided by the embodiment of the present application realizes a flowchart;

[0047] Figure 3 The model training device provided by the embodiment of the present application is a structural schematic diagram;

[0048] Figure 4 The low-voltage power distribution network line loss prediction device provided by the embodiment of the present application is a structural schematic diagram;

[0049] Figure 5 The electronic device architecture provided by the embodiment of the present application is a structural schematic diagram. DETAILED DESCRIPTION

[0050] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0051] Referring to Figure 1 One embodiment of the present application provides a model training method for training a line loss prediction model, comprising the following steps:

[0052] Step S110. Obtain a power distribution network operation data training set, which at least includes photovoltaic power generation data.

[0053] In this step, historical operation data covering the target power distribution network area is obtained to construct a data set required for model training. The power distribution network operation data training set is a multi-source heterogeneous time series data, which can include the following information: (1) network operation data: including historical line loss data, node voltage data, line current data, etc.; (2) photovoltaic power generation data: including the power generation power of each distributed photovoltaic system, grid-connected point voltage and current, etc.; (3) load data: including active power and reactive power of each load point; (4) weather data: including sunshine intensity, temperature, wind speed, cloud cover and other meteorological factors affecting photovoltaic power generation.

[0054] Further, the original data can be pre-processed before being used for neural network training, such as time alignment, missing value filling, time feature extraction, anomaly detection and standardization, to ensure that the input data meet the training needs of the neural network model and maintain the consistency and comparability of the feature sequence. Then, the processed data set is divided into training set, validation set and test set according to the proportion.

[0055] Further, the original data can be normalized, and features of different scales can be normalized to make their value range consistent and improve the model training efficiency. Exemplarily, minimum-maximum normalization or Z-score standardization is adopted.

[0056] Step S120. Construct a neural network comprising a time series feature extraction module, a multi-scale feature extraction module, a deep feature extraction module and a prediction layer, wherein the deep feature extraction module comprises at least two deep feature extraction layers with different architectures, and the power distribution network operation data training set sequentially passes through the time series feature extraction module, the multi-scale feature extraction module, the deep feature extraction module and the prediction layer.

[0057] The time series feature extraction module is used to extract basic time series structure features from the input time series. It can include structure based on cyclic attention mechanism, such as attention-based GRU or LSTM unit, to enhance the attention ability to time series dependence and important time steps; the multi-scale feature extraction module includes multiple convolution kernels with different receptive fields (kernel size or time window) to extract local change features at different time scales, such as short-period fluctuations, medium-term trends and long-term change patterns, the module outputs multiple scale feature maps, and the scale feature fusion layer is used for weighted fusion, and the fusion weight can be automatically learned through training; the deep feature extraction module introduces at least two deep feature extraction networks with different architectures, which further extract the scale fused features, and the deep feature fusion layer is used for weighted combination to obtain the final deep fused feature representation; the prediction layer performs linear mapping or multi-layer perceptron (MLP) operation on the fused features to output the target prediction value, i.e. the line loss value at the predicted time point. The prediction layer can further combine Monte Carlo Dropout and other methods to evaluate the prediction interval and uncertainty.

[0058] Specifically, for the output target of the neural network, line loss prediction is essentially a time series prediction problem. Given a historical time series dataset , the input features include a historical sequence of length L with d-dimensional features (load, photovoltaic output, meteorological data, etc.), and the output is the line loss at the corresponding time.

[0059] The prediction problem can be expressed as:

[0060]

[0061] wherein is a prediction model with parameters , and h is the prediction time domain.

[0062] The network training target is to find the optimal parameters to minimize the prediction error:

[0063]

[0064] wherein is the loss function, and mean square error (MSE) or mean absolute error (MAE) is usually selected.

[0065] Further, due to the uncertainty of photovoltaic output, the embodiments of the present application additionally consider the reliability of the prediction, i.e. obtain the prediction confidence interval , so that , is the significance level (usually 0.05).

[0066] Furthermore, the construction process for each module in the neural network includes the following:

[0067] (1) Temporal feature extraction module

[0068] This invention introduces a recurrent attention mechanism in the temporal feature extraction section to capture periodic patterns in time series data. The input sequence is defined as follows: , where L is the sequence length and d is the feature dimension.

[0069] Recurrent attention first defines a parameter matrix of learnable recurrent patterns. Where C is the period length of the number of rows in matrix Q. Let Q be the number of columns in the model's dimensional moment. This parameter matrix Q is essentially a parameterization of the feature representations at different time points within a complete cycle. For each time step t in the input sequence, its corresponding loop pattern index is:

[0070]

[0071] The above expression represents the modulo operation, where t is an integer and C is another integer. This represents the remainder after t is divided by C. This modulo operation maps time points to their relative positions within the period, enabling explicit modeling of periodic patterns.

[0072] The recurrent attention mechanism is calculated as follows:

[0073] First, for time step t, obtain its corresponding periodic query vector:

[0074]

[0075] here It is a size of The matrix contains the query vector at time step t. These query vectors are used in conjunction with key vectors To pair up, usually It is the dimension of the query vector.

[0076] Then, key-value pairs are generated through a linear transformation:

[0077]

[0078] Next, the attention weights and weighted output are calculated:

[0079]

[0080]

[0081] in It is a learnable weight matrix, used for linear transformations of queries, keys, and values, respectively; It is a scaling factor. It is the dimension of attention, used to stabilize the training process and prevent the dot product value from becoming too large; A represents the input feature vector at time t; A represents the attention weight matrix. This indicates that the input feature X passes through the weight matrix. The transformed values, and the final weighted output Z, represent the feature extraction result after the recurrent attention mechanism.

[0082] Furthermore, to enhance the model's expressive power, it can be extended to a multi-head recurrent attention mechanism:

[0083]

[0084] in, It is the query vector of the i-th attention head. It is the key vector of the i-th attention head. It is the value vector of the i-th attention head, where each attention head focuses on a different subspace or feature of the input data.

[0085] The outputs of all attention heads are merged, and the concatenated result is projected onto the output through a linear transformation:

[0086]

[0087] h is the number of attention heads. It is the output projection matrix, responsible for mapping the concatenated multi-head outputs to the final output space. The multi-head mechanism enables the model to simultaneously focus on multiple different periodic patterns and feature relationships, improving the richness of feature extraction.

[0088] (2) Multi-scale feature extraction module

[0089] Furthermore, the multi-scale feature extraction module includes several convolutional kernels corresponding to different time scales and a scale feature fusion layer. The scale features extracted by each convolutional kernel are weighted and fused in the scale feature fusion layer to obtain scale fused features.

[0090] Specifically, considering that line loss data contains various time scale patterns (e.g., minute-level, hour-level, and day-level changes), the multi-scale feature extraction module extracts multi-scale features through convolution operations with different kernel sizes. For the input features, one-dimensional convolution operations with different kernel sizes are performed to obtain features at different scales:

[0091]

[0092] in: It is a one-dimensional convolution operation with a kernel size of k; BN stands for Batch Normalization, which is used to stabilize the training process; ReLU is the rectified linear unit activation function, which introduces non-linearity; k represents the convolution kernel size, which is usually chosen to be k∈{3,5,7}, corresponding to the short-term, medium-term and long-term time dependencies, respectively.

[0093] By using different kernel sizes, we can capture feature patterns that change at different time scales: small kernel (k=3): captures local, rapidly changing short-term patterns, such as sudden load changes; medium kernel (k=5): captures medium-term dependencies, such as load change trends over several hours; large kernel (k=7): captures long-term dependencies, such as load change trends over a day.

[0094] After multi-scale feature extraction, the key is how to effectively fuse features from different scales. To achieve this goal, the following attention-based adaptive feature fusion mechanism is proposed:

[0095] For each scale feature Calculate the corresponding attention weights :

[0096]

[0097] Then, features from different scales are merged by weighted summation:

[0098]

[0099] in This represents the learnable weight parameters, and K is the number of convolution kernel sizes.

[0100] The physical significance of this adaptive fusion mechanism lies in the fact that the system can dynamically adjust the weight given to features at different time scales based on the complexity of the current prediction scenario. For example, when photovoltaic output changes rapidly, the weight of short-term features increases; when the load changes steadily, the weight of medium- and long-term features increases.

[0101] (3) Deep feature extraction module

[0102] Considering that a single-architecture deep learning model often cannot simultaneously meet the multiple requirements of line loss prediction, this embodiment of the invention utilizes multiple deep feature extraction layers with different architectures to extract features in the deep feature extraction stage, and then performs feature fusion to obtain the final deep fused features.

[0103] Specifically, the deep feature extraction layer includes a Transformer encoder, a GRU network layer, and a TCN network layer. The Transformer encoder captures the dependencies between any positions in the sequence through a self-attention mechanism, making it suitable for handling global dependencies. The GRU (Gated Recurrent Unit) can effectively process sequence data and maintain long-term state information, making it suitable for handling temporal dependencies. The TCN (Temporal Convolutional Network) captures multi-scale temporal features through dilated convolution, making it suitable for handling patterns at different time scales.

[0104] Processed via Transformer encoder:

[0105]

[0106] It contains multiple Transformer blocks, each consisting of a multi-head recurrent attention mechanism and a feedforward neural network. This structure can capture periodic patterns in the input sequence and extract important features from the sequence from multiple perspectives through the multi-head attention mechanism.

[0107] Meanwhile, a bidirectional GRU is used to further handle the temporal dependencies of the sequence. For time step t, the forward and backward GRUs are calculated as follows:

[0108] Forward GRU computation:

[0109]

[0110] in, It is the hidden state of the forward GRU at time t. The input feature is at time t. It is the forward GRU hidden state from the previous moment.

[0111] Backward GRU computation:

[0112]

[0113] in, It is the hidden state of the backward GRU at time t. It is the backward GRU hidden state in subsequent time steps.

[0114] The output of a bidirectional GRU is obtained by concatenating the forward and backward GRU hidden states:

[0115]

[0116] In this way, bidirectional GRU can utilize contextual information of the sequence to enhance the modeling of time dependencies.

[0117] Finally, TCN is used to handle dependencies on longer time scales. TCN, through its dilated convolution structure, effectively expands the receptive field, thus enabling the handling of dependencies in long-term sequences.

[0118]

[0119] The feature fusion layer combines these representations:

[0120]

[0121] in , , It is a learnable weight matrix. , , These represent the deep features obtained after passing through the Transformer encoder, GRU network layer, and TCN network layer, respectively.

[0122] This model architecture can effectively capture short-term and long-term dependencies in time-series data, and improve the ability to model complex time-series tasks by combining the advantages of Transformer, GRU and TCN.

[0123] (4) Prediction layer

[0124] The final prediction is obtained through a fully connected layer:

[0125]

[0126] in This represents the deep fusion feature, the final feature obtained by fusing multiple modules (such as Transformer, GRU, TCN). and These are the output layer parameters, namely the weight matrix and the bias.

[0127] Furthermore, traditional deep learning models typically only provide point predictions, that is, direct predictions of a certain input, but they do not provide uncertainty quantification, that is, uncertainty information about the prediction results. In order to quantify the uncertainty of the model, this embodiment of the invention is based on Bayesian deep learning theory and uses the Monte Carlo Dropout method to achieve uncertainty quantification.

[0128] Monte Carlo Dropout treats Dropout as a Bayesian approximation and achieves this by maintaining Dropout activation during the prediction phase and performing multiple forward propagations. Specifically, it performs *k* forward propagations, each of which is equivalent to sampling a model instance from the model's posterior distribution, resulting in *k* predictions.

[0129]

[0130] in It is the forward propagation function of the model, and the subscript dropout=active indicates that Dropout is kept active during each forward propagation.

[0131] After obtaining M prediction results, the mean and variance of the predictions can be calculated. Then, based on the assumption of normal distribution, the mean can be calculated. and variance To construct the confidence interval for the prediction:

[0132]

[0133]

[0134]

[0135] in It is a standard normal distribution Quantiles.

[0136] The physical significance of this uncertainty quantification method lies in the fact that the system can provide a reliable confidence interval for each prediction, reflecting the reliability of the prediction. When photovoltaic output fluctuates greatly and prediction uncertainty is high, the confidence interval will widen accordingly, providing a risk assessment basis for grid operation decisions.

[0137] Step S130. Using the distribution network operation dataset as the input data of the neural network and the line loss prediction result as the output result, train the neural network. During training, use the Crowned Porcupine optimization algorithm to iteratively update the parameters of the neural network, and use the trained neural network as the line loss prediction model.

[0138] This step utilizes the Crowned Porcupine Optimization (CPO) algorithm to perform a global search and adaptive update of key hyperparameters (such as learning rate, kernel size, network depth, and number of attention heads) and structural parameters (such as hidden layer dimension and Dropout ratio) during model training.

[0139] Specifically, the CPO algorithm is inspired by the group behavior of hooded porcupines, including visual defense mechanisms, auditory defense mechanisms, olfactory defense mechanisms, and physical attack defense mechanisms. In the CPO algorithm, the position update formula for particle i is as follows:

[0140] (1) Visual defense mechanisms (exploratory behavior):

[0141]

[0142] This indicates the position of particle i at time t; This represents the optimal particle position at the current moment (i.e., the global optimal solution). It is a parameter that controls the exploration behavior, representing the step size by which the particle adjusts towards the optimal position; It is the particle's new position at time t+1.

[0143] (2) Sound defense mechanism (Lévy flight):

[0144]

[0145] in: It is the step size adjustment factor, which controls the update amplitude of particles; It is a function of the Lévy flight process, usually a heavy-tailed distribution, which can help particles make large-scale jumps and facilitate global search.

[0146] s is a factor controlled by a stochastic process, typically representing the magnitude of some random motion:

[0147]

[0148]

[0149]

[0150] (3) Odor defense mechanism:

[0151]

[0152] It is the position in the particle's memory, usually the best position or historical position that the particle has visited in the past. It is a regulator of the odor defense mechanism, controlling how particles adjust their positions based on their memory locations. This formula simulates how particles adjust according to their memory of the optimal position, thereby achieving local optimization.

[0153] (4) Physical attack defense mechanism:

[0154]

[0155] It is the globally optimal position, usually representing the optimal position within the entire particle swarm; It is a modulatory factor for the physical attack defense mechanism, controlling the step size by which the particle adjusts according to the global optimal position. This formula simulates the particle's defense mechanism against physical attacks, enhancing the particle's behavior of approaching the global optimal solution.

[0156] Fitness function definition:

[0157]

[0158] in, It is the actual target value; It is the value predicted based on the particle position x; MSE is an index that measures the difference between the predicted value and the true value. The smaller the value, the more accurate the prediction; Orthogonality is an additional constraint term, usually used to measure whether the parameters of the model are independent of each other (orthogonal). If the parameters are highly correlated (non-orthogonal), it may lead to overfitting or redundancy. Therefore, it is necessary to improve the model by adjusting the orthogonality. It is a parameter that adjusts for the influence of orthogonality; correlation measures the linear relationship between the predicted and actual results. A higher correlation indicates a strong linear relationship between the model's predictions and the actual values; It is a parameter that modulates the effect of correlation.

[0159] The fitness function aims to minimize the MSE, which in turn minimizes the error between the predicted and true values. Increasing orthogonality involves adjusting orthogonality to make the parameters in the model as independent as possible, avoiding redundancy. Increasing correlation involves optimizing parameters to make the correlation between the predicted and true values ​​stronger, resulting in more accurate predictions. and These are hyperparameters that control the impact of orthogonality and correlation on the final fitness, helping to balance various objectives.

[0160] Based on the set line loss prediction index, a parameter optimization model is constructed, as follows:

[0161]

[0162] in, It is the set of parameters to be optimized; It is the parameter space containing all feasible solutions; It is the objective function, usually a performance metric on the validation set.

[0163] This problem describes the situation in the feasible parameter space. Find the optimal parameters , so that the objective function Minimize, thereby achieving the optimal performance of the model.

[0164] The set of parameters to be optimized in the model is as follows:

[0165]

[0166] Among them, hyperparameter set include:

[0167]

[0168] Network structure parameter set include:

[0169]

[0170] Each parameter has its own domain constraints, which are set based on deep learning theory and practical experience, as follows:

[0171] learningrate∈[10 -5 10 -2 The range of the learning rate determines the step size of each parameter update, which in turn determines the learning speed during model training.

[0172] batchsize∈{16,32,64,128,256}: Batch size, which is the number of samples processed in each iteration. The choice of batch size affects the training efficiency and the convergence speed of the model.

[0173] dropoutrate∈[0,0.5]: Dropout rate, representing the proportion of neurons that are randomly deactivated, used to prevent overfitting;

[0174] weightdecay: Weight decay coefficient, used in L2 regularization, helps prevent model parameters from becoming too large, thereby reducing overfitting;

[0175] dmodel∈{32,64,128,256}: The hidden layer dimension of the model, i.e. the number of neurons in each hidden layer, which affects the model's capacity and expressive power;

[0176] numheads∈{2,4,8}: The number of heads in multi-head attention, which determines the number of attention heads in each layer of multi-head attention mechanism. Increasing the number of heads helps the model learn different representations in different subspaces;

[0177] numlayers: The number of layers in the model, affecting the model's depth. More layers usually mean stronger expressive power, but may also increase training difficulty and the risk of overfitting;

[0178] usegru, usetcn: indicates whether to enable the GRU and TCN modules. GRU is used to handle temporal dependencies in sequence data, and TCN is used to handle multi-scale temporal relationships.

[0179] cyclelength∈{24,48,168,336,720}: The cycle length of the recurrent attention mechanism, which affects the model's ability to capture periodic features in time series data;

[0180] fusionweights: Weights of the feature fusion layer, used to combine the outputs of multiple modules (such as Transformer, GRU, TCN) in the final layer;

[0181] numtransformerlayers, numtcn_layers: The number of layers in Transformer and TCN, respectively controlling the depth of the model in each architecture.

[0182] Furthermore, the parameter optimization model is designed with multiple objectives, considering multiple line loss prediction indicators, including root mean square error, mean absolute error, prediction interval coverage, and prediction interval average width.

[0183] In the calculation of the following indicators, the following is used: This represents the predicted value output by the line loss prediction model. This represents the true label of the input training sample.

[0184] Specifically, the root mean square error (RMSE) reflects the overall accuracy of the prediction:

[0185]

[0186] The smaller the value, the smaller the prediction error of the model.

[0187] Mean absolute error (MAE) reflects the overall bias in the forecast:

[0188]

[0189] The smaller the value, the smaller the prediction bias.

[0190] Predicted Interval Coverage (PICP) reflects the reliability of uncertainty quantification. A higher value indicates that the model can cover more true values, ensuring higher reliability.

[0191]

[0192] The mean width of the prediction interval (MPIW) reflects the accuracy of uncertainty quantification:

[0193]

[0194] A smaller MPIW value means the model provides a narrower prediction range and has better accuracy.

[0195] The multi-objective parameter optimization model integrates prediction accuracy and uncertainty assessment, as shown below:

[0196]

[0197] in, , , , These are weighting coefficients, satisfying... .

[0198] To balance prediction accuracy and interval quality, an adaptive weighting mechanism is introduced:

[0199]

[0200]

[0201] in and These are the initial weights. It is the significance level of the prediction interval. It is the target prediction interval width, which is the ideal prediction interval width that we hope to obtain during the optimization process.

[0202] To control model complexity, a regularization term is introduced:

[0203]

[0204] in It refers to the number of model parameters. , , It is the regularization coefficient.

[0205] The final parameter optimization model is expressed as:

[0206]

[0207] Based on the above framework, the CPO algorithm can effectively optimize the model's line loss prediction performance in the environment of distributed photovoltaic access to low-voltage distribution network, while taking into account both prediction accuracy and uncertainty quantification.

[0208] Based on the above parameter optimization model, the parameter solution using the CPO algorithm proceeds as follows:

[0209] (1) Initialization phase: In this phase, N individuals are randomly generated, each corresponding to a set of parameter configurations. The initialization formula is as follows:

[0210]

[0211] Where r is a random number in the range [0,1]; and These are the lower and upper bounds of the parameter space, respectively.

[0212] The purpose of this stage is to randomly select a set of initial parameter configurations as the starting point for the search process.

[0213] (2) Evaluation phase: For each individual Build and train the corresponding model, and then calculate the fitness value. The goal of this stage is to evaluate the model performance of each individual parameter configuration and select the individuals with better performance for further optimization.

[0214] (3) Update phase: Update the position of each individual based on the CPO algorithm:

[0215]

[0216] in, It is the position change amount, used to update the position of each individual according to the strategy.

[0217] (4) Boundary handling: Ensure all parameters are within their allowable range:

[0218]

[0219] The purpose of this step is to restrict the updated parameter values ​​for each individual to the valid range of the parameter space.

[0220] (5) Discrete parameter processing: For discrete parameters (such as batch size), rounding is used to map them to the nearest valid value.

[0221]

[0222] in, This represents the updated discrete parameter values; This represents the set of valid values ​​for the discrete parameter. For example, valid values ​​for batch_size could be {16, 32, 64, 128, 256}. Indicates the search for Minimize discrete values That is, among all valid discrete values, find the one that is closest to the current continuous parameter value. The discrete values.

[0223] The physical significance of this optimization process lies in simulating the behavior of the Crowned porcupine population to search for the optimal model configuration in a high-dimensional parameter space, thereby achieving global optimization of model performance.

[0224] Furthermore, to improve computational efficiency, an early stopping strategy is introduced in the neural network training iteration, that is, for each candidate parameter configuration... ,train Wheel, if continuous If the loss does not improve after each round of validation, then stop training.

[0225]

[0226] This represents the loss value on the validation set during the e-th training round.

[0227] The early stopping strategy described above is based on overfitting theory: when the model's performance no longer improves on the validation set, continuing training may lead to overfitting. Stopping training in a timely manner not only saves computational resources but also results in a model with stronger generalization ability.

[0228] See Figure 2 One embodiment of the present invention provides a method for predicting line losses in a low-voltage distribution network, comprising the following steps:

[0229] Step S210. Obtain distribution network operation data, which includes at least photovoltaic power generation data.

[0230] Step S220. Input the distribution network operation data into the line loss prediction model to obtain the line loss prediction results.

[0231] The disclosed method can be implemented using various types of devices. Therefore, the present invention also discloses an apparatus corresponding to the above method, and specific embodiments are given below for detailed description.

[0232] like Figure 3 As shown, one embodiment of the present invention provides a model training apparatus for training a line loss prediction model, comprising:

[0233] The training data acquisition module 302 is used to acquire a training set of distribution network operation data, which includes at least photovoltaic power generation data.

[0234] The training network construction module 304 is used to construct a neural network including a temporal feature extraction module, a multi-scale feature extraction module, a deep feature extraction module and a prediction layer. The deep feature extraction module includes at least two deep feature extraction layers with different architectures. The distribution network operation data training set passes through the temporal feature extraction module, the multi-scale feature extraction module, the deep feature extraction module and the prediction layer in sequence.

[0235] The network training module 306 is used to train the neural network with the distribution network operation dataset as input data and the line loss prediction result as output. During training, the parameters of the neural network are iteratively updated using the Crowned Pig optimization algorithm, and the trained neural network is used as the line loss prediction model.

[0236] See Figure 4 One embodiment of the present invention provides a low-voltage distribution network line loss prediction device, comprising:

[0237] The operation data acquisition module 402 is used to acquire distribution network operation data, which includes at least photovoltaic power generation data.

[0238] The line loss prediction module 404 is used to input the distribution network operation data into the trained line loss prediction model to obtain the line loss prediction results.

[0239] The device provided in this application embodiment has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0240] The methods and related apparatuses mentioned in the above embodiments are described with reference to the method flowcharts and / or structural diagrams provided in the embodiments of this application. Specifically, each block of the method flowchart and / or structural diagram, as well as combinations of blocks in the flowchart and / or block diagram, 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 device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the process. Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The 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 operate 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 A schematic diagram of one or more processes and / or structures. Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 A process or multiple processes and / or structures illustrate the steps of the functions specified in one or more boxes.

[0241] The following embodiments illustrate the application of this method to a computer device. It is understood that the computer device can be any device with computing and processing capabilities, including but not limited to servers or personal laptops. In one embodiment, the computer device can be an application server, which can be a server used to run the application under test.

[0242] See Figure 5This document illustrates a hardware block diagram of an electronic device intended to represent various forms of digital computers, such as laptops, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may 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 present application described and / or claimed herein.

[0243] like Figure 5 As shown, the electronic device includes: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4;

[0244] In this embodiment, the number of processor 1, communication interface 2, memory 3, and communication bus 4 is at least one, and processor 1, communication interface 2, and memory 3 communicate with each other through communication bus 4.

[0245] Processor 1 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.

[0246] Memory 3 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device;

[0247] The memory stores a program, which the processor can call. The program is used to implement the aforementioned model training method and / or the various processing steps of the low-voltage distribution network line loss prediction method.

[0248] This invention also provides a readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the model training method and / or various processing flows of the low-voltage distribution network line loss prediction method provided in any possible implementation of the above embodiments and / or in combination with the embodiments.

[0249] The invention has been described in particular detail above with respect to possible scenarios, and those skilled in the art will recognize that the invention can be practiced through other embodiments. Specific naming of components, capitalization of terms, attributes, data structures, or any other programming or structural aspects are not mandatory or important, and the mechanisms or features of implementing the invention may have different names, forms, or procedures. The system can be implemented through a combination of hardware and software (as described), entirely through hardware elements, or entirely through software elements. The specific division of functions among the various system components described herein is merely exemplary and not mandatory; rather, the functions performed by a single system component can be performed by multiple components, or the functions performed by multiple components can be performed by a single component.

[0250] Those skilled in the art should understand that the various steps of the disclosed methods can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using device-executable program code, which can then be stored in a storage device for execution by the computing device. Alternatively, they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Therefore, the embodiments disclosed in this invention are not limited to any specific hardware and software combination.

[0251] The programs (also referred to as programs, software, software applications, or code) executable by these computing devices include machine instructions of a programmable processor and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms “machine-readable medium” and “computer-readable medium” refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) used to provide machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term “machine-readable signal” refers to any signal used to provide machine instructions and / or data to a programmable processor.

[0252] Certain aspects of this invention include the process steps and instructions described herein in algorithmic form. It should be noted that the process steps and instructions of this invention can be implemented in software, firmware, and / or hardware, and when implemented in software, they can be downloaded, stored on various operating systems and operated from said platforms.

[0253] Those skilled in the art will understand that the structures shown in the figures are merely block diagrams of some structures related to the present application and do not constitute a limitation on the terminal device to which the present application is applied. Specific terminal devices may include more or fewer components than those shown in the figures, or combine certain components, or have different component arrangements.

[0254] In the description of this specification, the use of terms such as "one embodiment," "some embodiments," "example," "specific example," or "possible design," etc., refers to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0255] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A model training method for training a line loss prediction model, characterized in that, include: Obtain a training set of power distribution network operation data, wherein the training set of power distribution network operation data includes at least photovoltaic power generation data; A neural network is constructed, comprising a time-series feature extraction module, a multi-scale feature extraction module, a deep feature extraction module, and a prediction layer. The deep feature extraction module includes a deep feature fusion layer and at least two deep feature extraction layers with different architectures. When training the neural network, the distribution network operation data training set passes through the time-series feature extraction module, the multi-scale feature extraction module, the deep feature extraction module, and the prediction layer in sequence. The deep feature extraction layer includes a Transformer encoder, a GRU network layer, and a TCN network layer. The scale fusion features output by the multi-scale feature extraction module are passed through at least two deep feature extraction layers with different architectures to obtain at least two deep features. The deep feature fusion layer fuses the at least two deep features to obtain deep fused features. The neural network is trained using the power distribution network operation data training set as input data and the line loss prediction result as output. During training, the parameters of the neural network are iteratively updated using the Crown Porcupine optimization algorithm, and the trained neural network is used as the line loss prediction model.

2. The method according to claim 1, characterized in that, The multi-scale feature extraction module includes several convolutional kernels corresponding to different time scales and a scale feature fusion layer. The scale features extracted by each convolutional kernel are weighted and fused in the scale feature fusion layer to obtain scale fused features.

3. The method according to claim 1, characterized in that, The parameters of the neural network iteratively updated during training using the Crowned Porcupine optimization algorithm include: Construct a parameter optimization model based on the set line loss prediction indicators; The parameter optimization model is solved using the hog porcupine optimization algorithm to obtain the parameter solution of the neural network.

4. A method for predicting line losses in a low-voltage distribution network, characterized in that, include: Acquire power distribution network operation data, which includes at least photovoltaic power generation data; The power distribution network operation data is input into the line loss prediction model obtained by the method described in any one of claims 1 to 3 to obtain the line loss prediction result.

5. A model training device, characterized in that, Used to train line loss prediction models, including: The training data acquisition module is used to acquire a training set of power distribution network operation data, which includes at least photovoltaic power generation data. A training network construction module is used to construct a neural network including a temporal feature extraction module, a multi-scale feature extraction module, a deep feature extraction module, and a prediction layer. The deep feature extraction module includes at least two deep feature extraction layers with different architectures. When training the neural network, the distribution network operation data training set passes through the temporal feature extraction module, the multi-scale feature extraction module, the deep feature extraction module, and the prediction layer in sequence. The deep feature extraction layer includes a Transformer encoder, a GRU network layer, and a TCN network layer. The scale fusion features output by the multi-scale feature extraction module are passed through at least two deep feature extraction layers with different architectures to obtain at least two deep features. The deep feature fusion layer fuses the at least two deep features to obtain deep fused features. The network training module is used to train the neural network using the distribution network operation data training set as input data and the line loss prediction result as output. During training, the parameters of the neural network are iteratively updated using the Crowned Porcupine optimization algorithm, and the trained neural network is used as the line loss prediction model.

6. A low-voltage distribution network line loss prediction device, characterized in that, include: The operation data acquisition module is used to acquire distribution network operation data, which includes at least photovoltaic power generation data; The line loss prediction module is used to input the power distribution network operation data into the line loss prediction model obtained by the device described in claim 5, and obtain the line loss prediction result.

7. An electronic device, characterized in that, It includes a memory storing computer-executable instructions and a processor, which, when executed by the processor, causes the device to perform the model training method as described in any one of claims 1 to 3, and / or the low-voltage distribution network line loss prediction method as described in claim 4.

8. A readable storage medium, characterized in that, It stores a computer-executable program that, when executed, can implement the model training method as described in any one of claims 1 to 3, and / or the low-voltage distribution network line loss prediction method as described in claim 4.

Citation Information

Patent Citations

  • Power load prediction system and method based on deep neural network

    CN117977587A

  • Flexible load prediction method and system based on improved TCN neural network model

    CN119726654A