Power distribution energy consumption diagnosis method based on machine learning
By constructing a modeling mechanism guided by structured input data and topology, combined with multi-scale periodic windows and sample enhancement strategies, the limitations of existing distribution energy consumption diagnosis methods in structural modeling and dynamic training are overcome, and accurate identification of energy consumption anomalies and efficient location of fault nodes in the distribution system are achieved, thereby improving the robustness and adaptability of the diagnosis system.
Patent Information
- Application Number
- CN202510810181.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-09-23
AI Technical Summary
Existing distribution energy consumption diagnosis methods have obvious limitations in structural modeling capabilities, multi-scale time series expression, dynamic training mechanisms, sample enhancement strategies, diagnostic closed-loop collaboration and online update capabilities, and are unable to meet the comprehensive needs of modern distribution networks in high-frequency sampling, real-time feedback, precise fault location and continuous learning.
By constructing structured input data, integrating topological structure and time series features, designing a topology-guided modeling mechanism, combining multi-scale periodic windows to extract periodic embedding features, and introducing sample enhancement strategies to optimize the training process, we can achieve accurate identification of energy consumption anomalies in the distribution system and effective location of fault nodes.
The model's structural expression ability and diagnostic accuracy have been improved, its adaptability to load changes has been enhanced, the accuracy of anomaly identification and fault location has been improved, and it has the ability to learn online and adapt to dynamic changes in the distribution system.
Smart Images

Figure CN120687779A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent diagnosis of power distribution energy consumption, and in particular to a power distribution energy consumption diagnosis method based on machine learning. Background Art
[0002] Energy consumption monitoring and anomaly diagnosis in distribution systems play a vital role in smart grids, energy optimization, and power operations and maintenance management. With the increasing complexity of distribution network structures and the continued expansion of terminal device types, distribution data exhibits strong topological correlations, high temporal dimensions, high mutation rates, and significant periodicity. Against this backdrop, achieving real-time monitoring of energy consumption at distribution nodes, accurately identifying anomalies, and efficiently locating potential faults have become key challenges for intelligent power system diagnosis.
[0003] Most traditional energy consumption diagnosis methods rely on fixed thresholds, statistical averages, or artificial rules to construct detection logic. These methods often rely on single-node data and lack the ability to model the connectivity between devices in the distribution network. Consequently, they are unable to capture the interconnected energy consumption fluctuations caused by the structural coupling between nodes. Furthermore, node anomaly information is spatially propagated within the distribution topology. Traditional methods cannot determine the anomaly's source based on the structural path, making it difficult to locate the fault source node.
[0004] Some existing research has introduced machine learning models to fit and classify energy consumption curves. However, most approaches treat nodes as independent training examples, and the model inputs only include local features, ignoring the relative position of devices in the network structure and the influence of upstream or downstream nodes. Furthermore, most of these methods lack structural awareness mechanisms and are unable to incorporate grid topology into node predictions as a modeling basis, resulting in a lack of ability to identify structural issues such as abnormal conduction and boundary anomalies.
[0005] In terms of time series modeling, distribution loads exhibit significant multi-scale periodicity, such as daily load fluctuations, weekly power consumption patterns, and seasonal trends. Conventional time series forecasting models (such as LSTM, GRU, and ARIMA) are limited by window length and fixed-scale modeling methods, making them ineffective in identifying both long- and short-term cycle characteristics. This is particularly true during holidays, peak power consumption, and emergencies. The models are unable to accurately represent complex load fluctuations, thus impacting diagnostic accuracy and forecast stability.
[0006] At the same time, most existing models employ static learning strategies. These typically use a fixed learning rate, a preset number of rounds, and global training parameters during training, lacking the dynamic scheduling capabilities to coordinate with the cyclical operating conditions of power distribution. When loads fluctuate significantly or system conditions change dramatically, fixed training strategies are unable to adjust the optimization path in a timely manner, leading to a shift in the model's convergence direction and ultimately compromising anomaly detection and fault identification capabilities.
[0007] Existing techniques often use generalized sample augmentation methods, such as random masking and noise perturbation, that fail to incorporate the periodic and fluctuating characteristics of power data over time. These augmentation methods are disconnected from the data's characteristics, easily introducing interference or invalid samples and reducing model generalization performance. This is especially true at boundary nodes or in sections with sudden load fluctuations, where the augmented data lacks representativeness, making it difficult for the model to respond to sudden anomalies or low-frequency events.
[0008] During the operational phase after model deployment, distribution system data exhibits long-term trends of change, such as load growth, changes in operating conditions, and the addition or decommissioning of equipment. This causes the training data to gradually diverge from the current data distribution, leading to a decline in model performance. Existing methods lack effective online update mechanisms, making it impossible to dynamically monitor performance drift or automatically trigger structural adjustments. Even some methods that incorporate retraining often employ a full retraining model, which is inefficient, has high latency, and consumes large amounts of computing resources. This makes it difficult to meet the dual requirements of real-time diagnostics and long-term stability in actual distribution systems.
[0009] Furthermore, current anomaly detection and fault location processes mostly employ separate modeling approaches, with independent prediction models, anomaly identification models, and location modules lacking coordination mechanisms. In complex networks, anomalous nodes often have interconnected propagation paths, and relying solely on single-node threshold judgments or residual scores cannot accurately pinpoint the source of anomalies. Topological phenomena such as path overlap and multi-node confluence can interfere with the diagnostic process. Existing models lack mechanisms for tracking anomalies and determining convergence through structural paths, resulting in often biased or unstable fault location results.
[0010] During the long-term operation of the model, the system also faces the problems of persistent error accumulation and structural mismatch. Traditional methods lack a multi-level feedback mechanism and are unable to adjust local module structures based on real-time prediction deviations, resulting in a decrease in diagnostic performance over time. Furthermore, existing methods typically update modules at the model-wide level, lacking a local incremental update strategy based on the combined judgment of performance drift and structural sensitivity, resulting in wasted training resources and reduced model robustness.
[0011] In summary, existing distribution energy consumption diagnosis methods still have obvious limitations in terms of structural modeling capabilities, multi-scale temporal expression, dynamic training mechanisms, sample enhancement strategies, diagnostic closed-loop collaboration and online update capabilities, and are unable to meet the comprehensive needs of modern distribution networks in terms of high-frequency sampling, real-time feedback, precise fault location and continuous learning.
[0012] Therefore, how to provide a power distribution energy consumption diagnosis method based on machine learning is an urgent problem that technicians in this field need to solve. Summary of the Invention
[0013] One purpose of the present invention is to propose a distribution energy consumption diagnosis method based on machine learning. The present invention constructs structured input data, integrates topological structure and time series features, designs a topology-guided modeling mechanism, combines multi-scale periodic windows to extract periodic embedding features, and introduces a sample enhancement strategy to improve model robustness. The training process is optimized through periodic scheduling and warm-up mechanisms, thereby achieving accurate identification of energy consumption anomalies in the distribution system and effective positioning of fault nodes. It has the advantages of strong structural expression ability, high diagnostic accuracy and strong adaptability to load changes.
[0014] A method for diagnosing power distribution energy consumption based on machine learning according to an embodiment of the present invention includes the following steps:
[0015] S1. Collect the operating data and connection relationships of each node in the power distribution system, normalize and time-align the collected data, and construct a structured input tensor;
[0016] S2. Construct a directed graph model based on the connection relationship, where nodes in the graph represent power distribution units and edges represent power transmission paths between nodes, and map the structured input tensor to graph node attributes;
[0017] S3. Calculate the node structure weighted features based on the graph attention mechanism, combine the structure weighted features with the time series features, and generate topology-guided time series input;
[0018] S4. Perform multi-scale sliding window partitioning on the topology-guided time series input, extract short-cycle, medium-cycle, and long-cycle features, and form a period embedding representation through convolution and pooling operations;
[0019] S5. Construct an enhancement strategy based on periodicity and volatility indicators, generate enhanced samples through perturbation mask and time sequence switching, and use them for feature stability training. During the training process, the parameters of each node are updated according to the gradient weighted adjustment of its topological structure importance factor;
[0020] S6. Build a cycle-synchronized learning rate scheduling strategy, change the training learning rate along the main load cycle in a cosine function manner, and use a linear warm-up method to start model training in the early stage;
[0021] S7. Perform energy consumption prediction based on the periodic embedded representation, calculate the residual between the predicted value and the actual value, mark the node with the residual exceeding the limit as an abnormal candidate, analyze the abnormal diffusion path based on the graph structure, and determine the fault source node;
[0022] S8. Construct a dynamic loss weighting factor based on the prediction residual, assign residual-related weights to the training samples, and output the future energy consumption prediction value, anomaly identification and fault location results of each node.
[0023] Optionally, the S1 specifically includes:
[0024] S11. Select multiple monitoring nodes including transformer nodes, distribution branch nodes, and end-user nodes in the power distribution system, collect operating data of each node, and mark the collection time;
[0025] S12. Resample the running data of each node according to a unified time step to construct a node feature vector group in the form of a time series. The feature vector group is arranged in time order to form a fixed-length input sequence;
[0026] S13, extracting the physical connection relationship of the monitoring node in the power distribution network, and constructing a topological connection table according to the node number, wherein the topological connection table stores the downstream and upstream adjacent nodes of each node in a directed adjacent index manner;
[0027] S14. Generate a structured data item for each node, where the structured data item includes a node number, a node feature time series, and a node adjacency index vector;
[0028] S15. Combine the data items of all nodes to form a structured input data tensor. The tensor includes node dimension, time step dimension and feature dimension in the dimensional structure, and retains the adjacency index mapping information between nodes in the tensor structure.
[0029] Optionally, the S2 specifically includes:
[0030] S21. Determine a set of monitoring nodes in the power distribution system, assign a unique number to each monitoring node, and establish a correspondence between the node number and the device identifier;
[0031] S22. Collect the power connection relationship between the monitoring nodes, record the starting node and target node of each connection, and mark the connection direction;
[0032] S23, sorting the connection records and establishing a connection record table, where each connection record includes a starting node number, a target node number, and a connection direction identifier;
[0033] S24. Using the node number as an index, extract the set of direct upstream nodes and the set of direct downstream nodes of each node from the connection record table to construct an adjacency index list;
[0034] S25. Add connection attribute tags to the adjacency index list, where the tags include a trunk line identifier, a branch line identifier, and a connection direction identifier, and keep the connection order consistent with the node number.
[0035] S26, integrating the node number, the adjacency index list, and the connection attribute tag to form structure input data, where the structure input data is represented by a unified field structure;
[0036] S27. Combine the structural input data with the time series feature data of each node to form a structural modeling input set, which serves as the input content of the graph structure modeling module.
[0037] Optionally, the S3 specifically includes:
[0038] S31, read the structural input data and time series characteristic data of each monitoring node;
[0039] S32, establishing a topological weight distribution rule, extracting the connection strength factor between nodes from the structural input data according to the number of adjacent nodes and the connection direction of each node;
[0040] S33, merging the structural input data of each node and the time series feature data of the adjacent nodes to generate a combined sequence containing the state information of the node itself and the adjacent nodes;
[0041] S34, using the connection strength factor as a weighting coefficient, calculating a structural weighted result between nodes according to a topological weight distribution rule, wherein the structural weighted result covers the adjacent node eigenvalues corresponding to each time step;
[0042] S35, concatenating the structural weighted result with the time series feature data of the node itself to form a topology-guided time series input, where the topology-guided time series input includes a structural influence item and a node state item at each time step;
[0043] S36. Arrange the topology-guided time series inputs of all nodes according to the node numbers to form a topology-guided input set. The topology-guided input set serves as the input content of the structure-aware modeling module.
[0044] Optionally, the S4 specifically includes:
[0045] S41, setting the time range and time step of the node time series to generate a fixed-length modeling time segment;
[0046] S42, dividing the modeling time segment into multiple period windows, where the period windows include a short period window, a medium period window, and a long period window, and each period window covers a data segment of a different period scale;
[0047] S43, performing a sliding operation within each period window to generate multiple overlapping sub-segments, each sub-segment containing a feature sequence within consecutive time steps;
[0048] S44. Extract the characteristic value x(t) of each time step in the sub-segment and calculate the characteristic mean within the sub-segment and the time index mean μ k and standard deviation σ k ;
[0049] S45. Calculate the periodic embedding characteristic value of the sub-segment according to the following expression:
[0050]
[0051] Among them, c k is the embedding feature of the kth sub-segment, n k is the number of time steps in this sub-segment;
[0052] S46, arranging all embedded features of the same node in different period windows in sequence to form a multi-scale periodic embedded feature sequence of the node;
[0053] S47. Arrange the multi-scale periodic embedding feature sequences of all nodes in numerical order to generate a periodic modeling input set, which serves as input data for the structure-aware modeling module.
[0054] Optionally, the S5 specifically includes:
[0055] S51. Read the time series characteristic data of each node at a unified time step, and extract the periodicity index and volatility index of each time series;
[0056] S52. Divide the time series into high-period segments and low-period segments based on the periodicity index, and divide the time series into stable segments and sudden change segments based on the volatility index, and generate a feature marker array;
[0057] S53, constructing a sample enhancement strategy based on the feature label array, the enhancement strategy includes three methods: time step perturbation, feature position exchange and local feature masking;
[0058] S54, performing a time step perturbation operation in the high volatility mutation segment to randomly perturb the order of the continuous time indexes of the time series;
[0059] S55, performing a feature position exchange operation in the stable segment to exchange the node feature value positions between the specified time steps;
[0060] S56, performing a local feature masking operation in some randomly selected time periods, setting some feature values of the selected time steps to null value marks;
[0061] S57. The samples processed by the three enhancement methods are used as enhanced samples, and are merged with the original samples to form an extended version of the training set, and the extended version of the training set is input into the modeling module.
[0062] Optionally, the S6 specifically includes:
[0063] S61, setting the total number of rounds of the training process and the number of training steps in each round, and constructing a training step index;
[0064] S62, setting the initial maximum learning rate value and the main cycle length parameter to establish a learning rate scheduling curve;
[0065] S63, dividing the training rounds into a warm-up phase and an annealing phase, wherein the number of steps in the warm-up phase is the first percentage segment of the total number of steps;
[0066] S64. During the warm-up phase, the learning rate is set in a linear growth manner, with the initial step learning rate being zero and the final step learning rate being the set maximum value, and the linear growth is calculated by the ratio of the current training step number to the total warm-up step number;
[0067] S65. In the annealing phase, the cosine scheduling strategy is used to set the learning rate. The learning rate corresponding to the current step number is calculated by the following expression:
[0068]
[0069] Among them, η t is the learning rate of the current step, η max is the maximum learning rate, t is the current step number, t warmup is the number of steps at the end of the warm-up phase, and T is the total number of training steps;
[0070] S66. Inject the learning rate corresponding to each step into the model optimizer to complete the dynamic scheduling control of the entire training phase.
[0071] Optionally, the S7 specifically includes:
[0072] S71. Obtain the modeled predicted value and the actual time series value of each node, and calculate the prediction residual for each time step. The prediction residual is the difference sequence between the predicted value and the actual value;
[0073] S72, setting a residual threshold interval, performing a threshold comparison on the prediction residual sequence of each node, and marking the time step where the residual exceeds the threshold as an abnormal time step;
[0074] S73, counting the number of abnormal time steps of each node in the specified time window, and determining whether the number of abnormal steps exceeds a set ratio of the total number of windows. If so, marking the node as an abnormal candidate node;
[0075] S74, based on the adjacency index list of the topological structure, performing structural path tracing from the abnormal candidate node to its upstream node;
[0076] S75. During the path tracing process, record the number of times each upstream node is converged by multiple abnormal candidate node paths;
[0077] S76. Sort all convergence nodes according to convergence times, and select the upstream node with the largest convergence time as the fault source node number;
[0078] S77. Combine the predicted value of each node, the abnormal time step mark and the fault source node number into a diagnostic reasoning result.
[0079] Optionally, the S8 specifically includes:
[0080] S81. During the model operation, record the validation set loss value for each time period and establish a performance indicator sequence of validation loss over time.
[0081] S82. Set a drift detection interval and calculate the rate of change of verification loss between the current time period and the previous time period as the performance change rate;
[0082] S83, determining whether the performance change rate exceeds a set threshold; if so, entering the module-level structure fluctuation detection step;
[0083] S84. Based on the model structure, extract the historical gradient information of each module during the detection period, calculate the gradient variance value of each module, and establish a structural fluctuation index;
[0084] S85, comparing the structural fluctuation index of each module with the structural threshold, and marking the module as a module to be updated if it exceeds the threshold;
[0085] S86, selecting a module with a valid mark from all modules to be updated, and executing a local parameter update process, while keeping the structure and parameters of the unmarked modules unchanged during the update process;
[0086] S87, re-register the updated model structure to the inference process, replace the original parameter version, and continue to perform the diagnosis task;
[0087] S88. After the update cycle ends, re-enter the performance indicator recording process to form a circular chain of online model updates.
[0088] The beneficial effects of the present invention are:
[0089] (1) By constructing a topological graph model of the distribution network and introducing the node adjacency relationship and connection strength factor into the time series modeling process, the energy consumption characteristics fusion under structure guidance is realized, which effectively solves the problem of missing expression of abnormal propagation paths caused by ignoring the electrical connections between nodes in traditional methods, and improves the structural perception ability of the model in abnormal tracing and fault location.
[0090] (2) A multi-scale period window division method is used to extract the trend characteristics and time position change characteristics of the distribution load, and a period embedding representation is constructed, which enhances the model's ability to capture load changes of different period lengths. It overcomes the limitations of the existing model's single period information expression and difficulty in adapting to multi-granularity load patterns, and improves the diagnostic system's ability to jointly model high-frequency fluctuations and low-frequency trends.
[0091] (3) A sample enhancement strategy is constructed based on the periodicity and volatility indicators of the node time series, and time perturbation, position exchange and feature masking operations are performed respectively, so that the generated enhanced samples are more consistent with the boundary state of the actual load behavior, enhancing the training performance of the model in scenarios such as edge samples and mutation nodes, and improving the robustness of the overall model and the accuracy of anomaly recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0092] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0093] Figure 1 This is a system structure diagram of a distribution energy consumption diagnosis method based on machine learning proposed in the present invention. DETAILED DESCRIPTION
[0094] The present invention will now be described in further detail with reference to the accompanying drawings, which are simplified schematic diagrams that illustrate the basic structure of the present invention in a schematic manner.
[0095] refer to Figure 1 , a power distribution energy consumption diagnosis method based on machine learning, including the following steps:
[0096] S1. Collect the operating data and connection relationships of each node in the power distribution system, normalize and time-align the collected data, and construct a structured input tensor;
[0097] S2. Construct a directed graph model based on the connection relationship, where nodes in the graph represent power distribution units and edges represent power transmission paths between nodes, and map the structured input tensor to graph node attributes;
[0098] S3. Calculate the node structure weighted features based on the graph attention mechanism, combine the structure weighted features with the time series features, and generate topology-guided time series input;
[0099] S4. Perform multi-scale sliding window partitioning on the topology-guided time series input, extract short-cycle, medium-cycle, and long-cycle features, and form a period embedding representation through convolution and pooling operations;
[0100] S5. Construct an enhancement strategy based on periodicity and volatility indicators, generate enhanced samples through perturbation mask and time sequence switching, and use them for feature stability training. During the training process, the parameters of each node are updated according to the gradient weighted adjustment of its topological structure importance factor;
[0101] S6. Build a cycle-synchronized learning rate scheduling strategy, change the training learning rate along the main load cycle in a cosine function manner, and use a linear warm-up method to start model training in the early stage;
[0102] S7. Perform energy consumption prediction based on the periodic embedded representation, calculate the residual between the predicted value and the actual value, mark the node with the residual exceeding the limit as an abnormal candidate, analyze the abnormal diffusion path based on the graph structure, and determine the fault source node;
[0103] S8. Construct a dynamic loss weighting factor based on the prediction residual, assign residual-related weights to the training samples, and output the future energy consumption prediction value, anomaly identification and fault location results of each node.
[0104] In this embodiment, S1 specifically includes:
[0105] S11. Select multiple monitoring nodes including transformer nodes, distribution branch nodes, and end-user nodes in the power distribution system, collect operating data of each node, and mark the collection time;
[0106] S12. Resample the running data of each node according to a unified time step to construct a node feature vector group in the form of a time series. The feature vector group is arranged in time order to form a fixed-length input sequence;
[0107] S13, extracting the physical connection relationship of the monitoring node in the power distribution network, and constructing a topological connection table according to the node number, wherein the topological connection table stores the downstream and upstream adjacent nodes of each node in a directed adjacent index manner;
[0108] S14. Generate a structured data item for each node, where the structured data item includes a node number, a node feature time series, and a node adjacency index vector;
[0109] S15. Combine the data items of all nodes to form a structured input data tensor. The tensor includes node dimension, time step dimension and feature dimension in the dimensional structure, and retains the adjacency index mapping information between nodes in the tensor structure.
[0110] This implementation method realizes the standardized transformation from raw measurement data to unified input tensors, ensuring the consistency of data in time and structure dimensions, and providing an accurate and complete data foundation for subsequent graph structure modeling and sequence analysis.
[0111] In this embodiment, S2 specifically includes:
[0112] S21. Determine a set of monitoring nodes in the power distribution system, assign a unique number to each monitoring node, and establish a correspondence between the node number and the device identifier;
[0113] S22. Collect the power connection relationship between the monitoring nodes, record the starting node and target node of each connection, and mark the connection direction;
[0114] S23, sorting the connection records and establishing a connection record table, where each connection record includes a starting node number, a target node number, and a connection direction identifier;
[0115] S24. Using the node number as an index, extract the set of direct upstream nodes and the set of direct downstream nodes of each node from the connection record table to construct an adjacency index list;
[0116] S25. Add connection attribute tags to the adjacency index list, where the tags include a trunk line identifier, a branch line identifier, and a connection direction identifier, and keep the connection order consistent with the node number.
[0117] S26, integrating the node number, the adjacency index list, and the connection attribute tag to form structure input data, where the structure input data is represented by a unified field structure;
[0118] S27. Combine the structural input data with the time series feature data of each node to form a structural modeling input set, which serves as the input content of the graph structure modeling module.
[0119] This implementation method uses discretized encoding of the topological structure to enable the model to receive the physical connection information of the distribution system in a graphical form, thereby realizing structural path modeling, connection strength modeling and direction perception, and effectively improving the abnormality tracing capability.
[0120] In this embodiment, S3 specifically includes:
[0121] S31, read the structural input data and time series characteristic data of each monitoring node;
[0122] S32, establishing a topological weight distribution rule, extracting the connection strength factor between nodes from the structural input data according to the number of adjacent nodes and the connection direction of each node;
[0123] S33, merging the structural input data of each node and the time series feature data of the adjacent nodes to generate a combined sequence containing the state information of the node itself and the adjacent nodes;
[0124] S34, using the connection strength factor as a weighting coefficient, calculating a structural weighted result between nodes according to a topological weight distribution rule, wherein the structural weighted result covers the adjacent node eigenvalues corresponding to each time step;
[0125] S35, concatenating the structural weighted result with the time series feature data of the node itself to form a topology-guided time series input, where the topology-guided time series input includes a structural influence item and a node state item at each time step;
[0126] S36. Arrange the topology-guided time series inputs of all nodes according to the node numbers to form a topology-guided input set. The topology-guided input set serves as the input content of the structure-aware modeling module.
[0127] This implementation deeply integrates topological information into the timing input, enabling the model to be aware of structural context and thus respond to the conduction patterns of adjacent abnormal behaviors, which helps to improve the accuracy and anti-interference ability of local diagnosis.
[0128] In this embodiment, the S4 specifically includes:
[0129] S41, setting the time range and time step of the node time series to generate a fixed-length modeling time segment;
[0130] S42, dividing the modeling time segment into multiple period windows, where the period windows include a short period window, a medium period window, and a long period window, and each period window covers a data segment of a different period scale;
[0131] S43, performing a sliding operation within each period window to generate multiple overlapping sub-segments, each sub-segment containing a feature sequence within consecutive time steps;
[0132] S44. Extract the characteristic value x(t) of each time step in the sub-segment and calculate the characteristic mean within the sub-segment and the time index mean μ k and standard deviation σ k ;
[0133] S45. Calculate the periodic embedding characteristic value of the sub-segment according to the following expression:
[0134]
[0135] Among them, c k is the embedding feature of the kth sub-segment, n k is the number of time steps in this sub-segment;
[0136] S46, arranging all embedded features of the same node in different period windows in sequence to form a multi-scale periodic embedded feature sequence of the node;
[0137] S47. Arrange the multi-scale periodic embedding feature sequences of all nodes in numerical order to generate a periodic modeling input set, which serves as input data for the structure-aware modeling module.
[0138] This implementation method realizes the expansion of time series modeling from single-scale to multi-scale. The model can simultaneously perceive short-term disturbances and long-term trends, making the diagnostic system more expressive and stable in periodically sensitive scenarios such as daily load fluctuations, peak hours, and holiday anomalies.
[0139] In this embodiment, the S5 specifically includes:
[0140] S51. Read the time series characteristic data of each node at a unified time step, and extract the periodicity index and volatility index of each time series;
[0141] S52. Divide the time series into high-period segments and low-period segments based on the periodicity index, and divide the time series into stable segments and sudden change segments based on the volatility index, and generate a feature marker array;
[0142] S53, constructing a sample enhancement strategy based on the feature label array, the enhancement strategy includes three methods: time step perturbation, feature position exchange and local feature masking;
[0143] S54, performing a time step perturbation operation in the high volatility mutation segment to randomly perturb the order of the continuous time indexes of the time series;
[0144] S55, performing a feature position exchange operation in the stable segment to exchange the node feature value positions between the specified time steps;
[0145] S56, performing a local feature masking operation in some randomly selected time periods, setting some feature values of the selected time steps to null value marks;
[0146] S57. The samples processed by the three enhancement methods are used as enhanced samples, and are merged with the original samples to form an extended version of the training set, and the extended version of the training set is input into the modeling module.
[0147] This implementation method deeply associates the generation of enhanced samples with the dynamic characteristics of the data itself, avoids information deviation caused by random enhancement, effectively improves the model's ability to recognize boundary anomalies, sudden states, and small sample nodes, and enhances the system's training robustness in complex power usage environments.
[0148] In this embodiment, S6 specifically includes:
[0149] S61, setting the total number of rounds of the training process and the number of training steps in each round, and constructing a training step index;
[0150] S62, setting the initial maximum learning rate value and the main cycle length parameter to establish a learning rate scheduling curve;
[0151] S63, dividing the training rounds into a warm-up phase and an annealing phase, wherein the number of steps in the warm-up phase is the first percentage segment of the total number of steps;
[0152] S64. During the warm-up phase, the learning rate is set in a linear growth manner, with the initial step learning rate being zero and the final step learning rate being the set maximum value, and the linear growth is calculated by the ratio of the current training step number to the total warm-up step number;
[0153] S65. In the annealing phase, the cosine scheduling strategy is used to set the learning rate. The learning rate corresponding to the current step number is calculated by the following expression:
[0154]
[0155] Among them, η t is the learning rate of the current step, η max is the maximum learning rate, t is the current step number, t warmup is the number of steps at the end of the warm-up phase, and T is the total number of training steps;
[0156] S66. Inject the learning rate corresponding to each step into the model optimizer to complete the dynamic scheduling control of the entire training phase.
[0157] This implementation introduces a dynamic control mechanism into the training process, enabling the model to match the corresponding learning rhythm under different load modes, avoiding underfitting or overfitting caused by the fixed learning rate training strategy, and improving the model's convergence speed and adaptability to periodic load scenarios.
[0158] In this embodiment, the S7 specifically includes:
[0159] S71. Obtain the modeled predicted value and the actual time series value of each node, and calculate the prediction residual for each time step. The prediction residual is the difference sequence between the predicted value and the actual value;
[0160] S72, setting a residual threshold interval, performing a threshold comparison on the prediction residual sequence of each node, and marking the time step where the residual exceeds the threshold as an abnormal time step;
[0161] S73, counting the number of abnormal time steps of each node in the specified time window, and determining whether the number of abnormal steps exceeds a set ratio of the total number of windows. If so, marking the node as an abnormal candidate node;
[0162] S74, based on the adjacency index list of the topological structure, performing structural path tracing from the abnormal candidate node to its upstream node;
[0163] S75. During the path tracing process, record the number of times each upstream node is converged by multiple abnormal candidate node paths;
[0164] S76. Sort all convergence nodes according to convergence times, and select the upstream node with the largest convergence time as the fault source node number;
[0165] S77. Combine the predicted value of each node, the abnormal time step mark and the fault source node number into a diagnostic reasoning result.
[0166] This implementation extends anomaly judgment from isolated nodes to network paths by introducing structural path tracking and multi-point anomaly fusion mechanisms, thereby improving the global accuracy and network-level robustness of fault location. It is particularly suitable for scenarios with multiple abnormal nodes concurrently in complex distribution networks.
[0167] In this embodiment, S8 specifically includes:
[0168] S81. During the model operation, record the validation set loss value for each time period and establish a performance indicator sequence of validation loss over time.
[0169] S82. Set a drift detection interval and calculate the rate of change of verification loss between the current time period and the previous time period as the performance change rate;
[0170] S83, determining whether the performance change rate exceeds a set threshold; if so, entering the module-level structure fluctuation detection step;
[0171] S84. Based on the model structure, extract the historical gradient information of each module during the detection period, calculate the gradient variance value of each module, and establish a structural fluctuation index;
[0172] S85, comparing the structural fluctuation index of each module with the structural threshold, and marking the module as a module to be updated if it exceeds the threshold;
[0173] S86, selecting a module with a valid mark from all modules to be updated, and executing a local parameter update process, while keeping the structure and parameters of the unmarked modules unchanged during the update process;
[0174] S87, re-register the updated model structure to the inference process, replace the original parameter version, and continue to perform the diagnosis task;
[0175] S88. After the update cycle ends, re-enter the performance indicator recording process to form a circular chain of online model updates.
[0176] This implementation method achieves adaptive iteration of the distribution diagnosis model by introducing a local structure update mechanism driven by performance feedback, enabling it to have online continuous learning capabilities, effectively respond to scenarios such as model aging, data drift, and dynamic structural changes, and ensure the long-term stability and accuracy of the diagnosis system.
[0177] Example 1:
[0178] To verify the feasibility of this invention, a typical industrial power distribution system was tested. This system consists of 187 monitoring nodes, including several transformer nodes, feeder nodes, and end-user nodes, covering a variety of power usage scenarios, including workshops, office buildings, lighting, and cooling. The system continuously samples data every five minutes over an eight-month testing period, collecting over eight million valid data points.
[0179] Under the current operating mechanism, the system uses a diagnostic approach based on fixed thresholds and empirical rules. This approach maintains basic monitoring functionality under stable load conditions, but it frequently experiences misjudgments and missed detections during periods of frequent load fluctuations, peak hours, and system disturbances. Some abnormal behaviors are missed, and critical fault nodes are inaccurately located, leading to delayed maintenance responses, wasted resources, and potential system security risks.
[0180] After deployment, the system first identifies all monitoring nodes using a unified numbering system. Real-time operational data, such as voltage, current, active power, and reactive power, is collected for each node. Electrical connections are then extracted and a topological diagram is constructed. The connection directions, structural hierarchy, and device attributes between all nodes are organized into an adjacency index table and fed into the structure-aware modeling module.
[0181] During the structural modeling phase, the system introduces a connection strength factor to measure the structural dependencies between nodes. It then fuses the time series features of each node and its neighbors to form a topologically guided sequence. To capture cyclical variations at different levels, the model divides the data into three periodic windows, covering 12 hours, 48 hours, and 168 hours of data, respectively. Trend changes and time offsets are extracted, generating a multi-scale periodic embedding representation.
[0182] During training, a combined linear warm-up and periodic cosine scheduling mechanism was used to adjust the learning rate, improving the model's adaptability at different training stages. In actual operation, the model error converged smoothly, and the fluctuation of the prediction residual decreased by approximately 25% compared to traditional fixed optimization strategies. In the sample enhancement phase, the system determined the perturbation sensitivity of different data segments based on load volatility and periodicity indicators, and performed time step perturbations, feature masking, and position swapping operations. The enhanced training set had a significant improvement in the anomaly recognition rate.
[0183] During the diagnostic phase, the model identifies abnormal nodes by comparing the residuals between predicted and actual values, and then traces the path upstream of the abnormal node based on the topological connection path. During one test, the model detected continuous high-frequency anomalies at a downstream node of a branch within the 15th minute of system operation. Path confluence analysis successfully located the anomaly at a trunk feeder node, and subsequent on-site verification confirmed the presence of a potential line overheating risk. Compared to traditional methods that only issue local anomaly alerts and cannot determine the scope of the fault, this system achieves pinpoint anomaly tracing, significantly reducing diagnostic time.
[0184] During the long-term model operation, the system continuously records the validation error curve and tracks the gradient change rate of different structural modules. During testing, the model performance drifted three times. The system automatically identified performance degradation and triggered local parameter updates for the corresponding modules. Compared with traditional full model retraining, local updates significantly save training resources and response time.
[0185] The following is some comparative data, showing the performance differences between the present invention and traditional methods in multiple key indicators:
[0186] Table 1 Performance comparison between the method of the present invention and the traditional method in power distribution energy consumption diagnosis
[0187] index Traditional methods Method of the present invention Anomaly recognition accuracy 81.3% 94.6% Fault location accuracy 72.5% 92.1% Average false alarm rate 13.7% 4.3% Response delay (average minutes) 45 12 Long-term operation maintenance interval (days) 30 >90 Model Update Mode Manual retraining Module-level local increment
[0188] In summary, this embodiment fully demonstrates the comprehensive advantages of the present invention in terms of structural modeling capabilities, periodic expression capabilities, abnormal diagnosis closed-loop and model adaptive mechanism, and provides an accurate, stable and sustainable energy consumption anomaly identification and intelligent operation and maintenance solution for actual power distribution systems.
[0189] By explicitly incorporating topological information into the modeling process, this paper advances the paradigm shift from "independent node diagnosis" to "structural path-level traceability." The diagnostic model not only identifies local node anomalies but also integrates upstream and downstream relationships to determine fault propagation direction and path aggregation, thereby accurately locating the fault source node. This significantly reduces misdiagnosis rates and false alarms, enhancing the system's structurally aware diagnostic capabilities.
[0190] In terms of periodic feature modeling, this paper innovatively introduces a multi-scale period window partitioning and period embedding representation construction method. This model can simultaneously capture daily load fluctuations, weekly power consumption rhythms, and long-term trends, addressing the problem of traditional models' single response to the periodic dimension and coarse modeling. By extracting the trend-position joint feature within the periodic window, it achieves detailed modeling of periodic behavior and boundary detection of sudden events, enhancing the model's adaptability to complex load patterns.
[0191] In terms of sample enhancement, this invention breaks through the traditional enhancement method's single-mode approach to random perturbations in time series data. For the first time, it uses the periodicity and volatility of the load series to drive the sample enhancement strategy, achieving an enhanced sample generation mechanism that closely matches the load characteristics. This data-driven enhancement approach improves the model's performance under abnormal boundary conditions and sudden load fluctuations, significantly improving recognition accuracy under marginal conditions.
[0192] Furthermore, the proposed local incremental update mechanism, based on the combined assessment of performance drift and structural fluctuations, effectively addresses the problem of model degradation and performance degradation over long periods of time. Compared to traditional full-model retraining approaches, this module-level update mechanism significantly reduces computational resource consumption while maintaining the model's inheritance of historical parameters, enhancing the system's online adaptability and ease of maintenance.
[0193] Finally, the present invention realizes a complete closed-loop diagnostic process of data acquisition - structural modeling - cycle modeling - enhanced training - dynamic optimization - fault identification - path tracing - online update, which has the comprehensive advantages of high diagnostic accuracy, fast response speed, high update efficiency, and strong system stability. It is especially suitable for modern intelligent distribution system scenarios with high-frequency fluctuations and high reliability requirements, and has good application promotion prospects and engineering implementation value.
[0194] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.
Claims
1. A power distribution energy consumption diagnosis method based on machine learning, characterized in that: The steps include: S1. Collect the operating data and connection relationships of each node in the power distribution system, normalize and time-align the collected data, and construct a structured input tensor; S2. Construct a directed graph model based on the connection relationship, where nodes in the graph represent power distribution units and edges represent power transmission paths between nodes, and map the structured input tensor to graph node attributes; S3. Calculate the node structure weighted features based on the graph attention mechanism, combine the structure weighted features with the time series features, and generate topology-guided time series input; S4. Perform multi-scale sliding window partitioning on the topology-guided time series input, extract short-cycle, medium-cycle, and long-cycle features, and form a period embedding representation through convolution and pooling operations; S5. Construct an enhancement strategy based on periodicity and volatility indicators, generate enhanced samples through perturbation mask and time sequence switching, and use them for feature stability training. During the training process, the parameters of each node are updated according to the gradient weighted adjustment of its topological structure importance factor; S6. Build a cycle-synchronized learning rate scheduling strategy, change the training learning rate along the main load cycle in a cosine function manner, and use a linear warm-up method to start model training in the early stage; S7. Perform energy consumption prediction based on the periodic embedded representation, calculate the residual between the predicted value and the actual value, mark the node with the residual exceeding the limit as an abnormal candidate, analyze the abnormal diffusion path based on the graph structure, and determine the fault source node; S8. Construct a dynamic loss weighting factor based on the prediction residual, assign residual-related weights to the training samples, and output the future energy consumption prediction value, anomaly identification and fault location results of each node.
2. The method for diagnosing power distribution energy consumption based on machine learning according to claim 1, characterized in that: Said S1 specifically includes: S11. Select multiple monitoring nodes including transformer nodes, distribution branch nodes, and end-user nodes in the power distribution system, collect operating data of each node, and mark the collection time; S12. Resample the running data of each node according to a unified time step to construct a node feature vector group in the form of a time series. The feature vector group is arranged in time order to form a fixed-length input sequence; S13, extracting the physical connection relationship of the monitoring node in the power distribution network, and constructing a topological connection table according to the node number, wherein the topological connection table stores the downstream and upstream adjacent nodes of each node in a directed adjacent index manner; S14. Generate a structured data item for each node, where the structured data item includes a node number, a node feature time series, and a node adjacency index vector; S15. Combine the data items of all nodes to form a structured input data tensor. The tensor includes node dimension, time step dimension and feature dimension in the dimensional structure, and retains the adjacency index mapping information between nodes in the tensor structure.
3. The power distribution energy consumption diagnosis method based on machine learning according to claim 1, characterized in that: The S2 specifically includes: S21. Determine a set of monitoring nodes in the power distribution system, assign a unique number to each monitoring node, and establish a correspondence between the node number and the device identifier; S22. Collect the power connection relationship between the monitoring nodes, record the starting node and target node of each connection, and mark the connection direction; S23, sorting the connection records and establishing a connection record table, where each connection record includes a starting node number, a target node number, and a connection direction identifier; S24. Using the node number as an index, extract the set of direct upstream nodes and the set of direct downstream nodes of each node from the connection record table to construct an adjacency index list; S25. Add connection attribute tags to the adjacency index list, where the tags include a trunk line identifier, a branch line identifier, and a connection direction identifier, and keep the connection order consistent with the node number. S26, integrating the node number, the adjacency index list, and the connection attribute tag to form structure input data, where the structure input data is represented by a unified field structure; S27. Combine the structural input data with the time series feature data of each node to form a structural modeling input set, which serves as the input content of the graph structure modeling module.
4. The method for diagnosing power distribution energy consumption based on machine learning according to claim 1, characterized in that: The S3 specifically includes: S31, read the structural input data and time series characteristic data of each monitoring node; S32, establishing a topological weight distribution rule, extracting the connection strength factor between nodes from the structural input data according to the number of adjacent nodes and the connection direction of each node; S33, merging the structural input data of each node and the time series feature data of the adjacent nodes to generate a combined sequence containing the state information of the node itself and the adjacent nodes; S34, using the connection strength factor as a weighting coefficient, calculating a structural weighted result between nodes according to a topological weight distribution rule, wherein the structural weighted result covers the adjacent node eigenvalues corresponding to each time step; S35, concatenating the structural weighted result with the time series feature data of the node itself to form a topology-guided time series input, where the topology-guided time series input includes a structural influence item and a node state item at each time step; S36. Arrange the topology-guided time series inputs of all nodes according to the node numbers to form a topology-guided input set. The topology-guided input set serves as the input content of the structure-aware modeling module.
5. The method for diagnosing power distribution energy consumption based on machine learning according to claim 1, characterized in that: The S4 specifically includes: S41, setting the time range and time step of the node time series to generate a fixed-length modeling time segment; S42, dividing the modeling time segment into multiple period windows, where the period windows include a short period window, a medium period window, and a long period window, and each period window covers a data segment of a different period scale; S43, performing a sliding operation within each period window to generate multiple overlapping sub-segments, each sub-segment containing a feature sequence within consecutive time steps; S44. Extract the characteristic value x(t) of each time step in the sub-segment and calculate the characteristic mean within the sub-segment and the time index mean μ k and standard deviation σ k ; S45. Calculate the periodic embedding characteristic value of the sub-segment according to the following expression: Among them, c k is the embedding feature of the kth sub-segment, n k is the number of time steps in this sub-segment; S46, arranging all embedded features of the same node in different period windows in sequence to form a multi-scale periodic embedded feature sequence of the node; S47. Arrange the multi-scale periodic embedding feature sequences of all nodes in numerical order to generate a periodic modeling input set, which serves as input data for the structure-aware modeling module.
6. The method for diagnosing power distribution energy consumption based on machine learning according to claim 1, characterized in that: The S5 specifically includes: S51. Read the time series characteristic data of each node at a unified time step, and extract the periodicity index and volatility index of each time series; S52. Divide the time series into high-period segments and low-period segments based on the periodicity index, and divide the time series into stable segments and sudden change segments based on the volatility index, and generate a feature marker array; S53, constructing a sample enhancement strategy based on the feature label array, the enhancement strategy includes three methods: time step perturbation, feature position exchange and local feature masking; S54, performing a time step perturbation operation in the high volatility mutation segment to randomly perturb the order of the continuous time indexes of the time series; S55, performing a feature position exchange operation in the stable segment to exchange the node feature value positions between the specified time steps; S56, performing a local feature masking operation in some randomly selected time periods, setting some feature values of the selected time steps to null value marks; S57. The samples processed by the three enhancement methods are used as enhanced samples, and are merged with the original samples to form an extended version of the training set, and the extended version of the training set is input into the modeling module.
7. The method for diagnosing power distribution energy consumption based on machine learning according to claim 1, characterized in that: The S6 specifically includes: S61, setting the total number of rounds of the training process and the number of training steps in each round, and constructing a training step index; S62, setting the initial maximum learning rate value and the main cycle length parameter to establish a learning rate scheduling curve; S63, dividing the training rounds into a warm-up phase and an annealing phase, wherein the number of steps in the warm-up phase is the first percentage segment of the total number of steps; S64. During the warm-up phase, the learning rate is set in a linear growth manner, with the initial step learning rate being zero and the final step learning rate being the set maximum value, and the linear growth is calculated by the ratio of the current training step number to the total warm-up step number; S65. In the annealing phase, the cosine scheduling strategy is used to set the learning rate. The learning rate corresponding to the current step number is calculated by the following expression: Among them, η t is the learning rate of the current step, η max is the maximum learning rate, t is the current step number, t warmup is the number of steps at the end of the warm-up phase, and T is the total number of training steps; S66. Inject the learning rate corresponding to each step into the model optimizer to complete the dynamic scheduling control of the entire training phase.
8. The method for diagnosing power distribution energy consumption based on machine learning according to claim 1, characterized in that: The S7 specifically includes: S71. Obtain the modeled predicted value and the actual time series value of each node, and calculate the prediction residual for each time step. The prediction residual is the difference sequence between the predicted value and the actual value; S72, setting a residual threshold interval, performing a threshold comparison on the prediction residual sequence of each node, and marking the time step where the residual exceeds the threshold as an abnormal time step; S73, counting the number of abnormal time steps of each node in the specified time window, and determining whether the number of abnormal steps exceeds a set ratio of the total number of windows. If so, marking the node as an abnormal candidate node; S74, based on the adjacency index list of the topological structure, performing structural path tracing from the abnormal candidate node to its upstream node; S75. During the path tracing process, record the number of times each upstream node is converged by multiple abnormal candidate node paths; S76. Sort all convergence nodes according to convergence times, and select the upstream node with the largest convergence time as the fault source node number; S77. Combine the predicted value of each node, the abnormal time step mark and the fault source node number into a diagnostic reasoning result.
9. The method for diagnosing power distribution energy consumption based on machine learning according to claim 1, characterized in that: The S8 specifically includes: S81. During the model operation, record the validation set loss value for each time period and establish a performance indicator sequence of validation loss over time. S82. Set a drift detection interval and calculate the rate of change of verification loss between the current time period and the previous time period as the performance change rate; S83, determining whether the performance change rate exceeds a set threshold; if so, entering the module-level structure fluctuation detection step; S84. Based on the model structure, extract the historical gradient information of each module during the detection period, calculate the gradient variance value of each module, and establish a structural fluctuation index; S85, comparing the structural fluctuation index of each module with the structural threshold, and marking the module as a module to be updated if it exceeds the threshold; S86, selecting a module with a valid mark from all modules to be updated, and executing a local parameter update process, while keeping the structure and parameters of the unmarked modules unchanged during the update process; S87, re-register the updated model structure to the inference process, replace the original parameter version, and continue to perform the diagnosis task; S88. After the update cycle ends, re-enter the performance indicator recording process to form a circular chain of online model updates.
Citation Information
Cited By
Energy management method and system based on deep reinforcement learning
CN120879587A