Power dynamic allocation method for electric energy metering box based on load prediction
Patent Information
- Application Number
- CN202610951212.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-29
- Publication Date
- 2026-09-29
AI Technical Summary
[0005]本申请提供基于负荷预测的电能计量箱功率动态分配方法,旨在解决上述背景技术中提到的用电行为难以实现统一语义建模,行为间因果、共现和空间依赖关系挖掘不充分问题
本申请构建了一个具备高时效响应、强隐私保护、低计算依赖与持续自进化能力的边缘智能用电管理架构。所有数据处理与模型推理均在具备AI加速能力的智能电能计量箱本地完成,原始用户行为数据无需上传至中心平台,从根本上满足电力终端对数据安全与隐私合规的严苛要求;同时,整个流程摆脱了对大规模历史数据积累的依赖,特别适用于新用户接入、节假日模式切换、极端天气冲击等典型小样本突变场景,具备良好的工程落地性与广泛适用性。
Smart Images

Figure CN122844192A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power metering and load dispatching technology, and in particular to a method for dynamic power allocation of power metering boxes based on load forecasting. Background Technology
[0002] Currently, electricity metering boxes and their load dispatching systems have been widely used in fields such as smart electricity consumption, intelligent power distribution, and microgrid management. Mainstream solutions generally adopt time series prediction models (such as LSTM, GRU, Transformer, etc.) based on users' historical load data to predict users' future electricity consumption trends, and then combine them with static user profiles or set priority rules to achieve dynamic power allocation and priority dispatching of various types of loads.
[0003] Existing technical solutions incorporate multi-source information such as individual user historical behavioral characteristics, family profiles, weather information, and holiday data to enrich the input of prediction models. However, the main modeling granularity is still based on numerical vectors or tabular structures, making it difficult to characterize the rich semantic relationships between multi-source heterogeneous behaviors. For temporary behavioral intentions, such as users actively booking high-power equipment or sudden medical needs, the system mostly uses predefined rules for processing, making it difficult to achieve real-time and effective perception and priority adjustment of sudden behaviors. In addition, due to the limited computing power, storage resources, and communication bandwidth of edge devices, the existing mechanism of full-data training and parameter synchronization relying on large cloud models also has limitations in ensuring real-time response and user privacy.
[0004] In summary, existing technologies for predicting user behavior and prioritizing loads in electricity metering boxes have the following shortcomings: the generalization ability of electricity behavior prediction models to sudden and non-periodic events is limited; unified semantic modeling of multi-source heterogeneous electricity behavior is difficult, and the mining of causal, co-occurrence, and spatial dependencies between behaviors is insufficient; real-time dynamic priority adjustment relies on full model retraining, making it difficult to balance end-side efficiency and response speed; and there is a lack of an effective human-machine collaborative closed-loop feedback mechanism, hindering the rapid correction of model misjudgments and the accumulation of adjustment experience. Therefore, a novel dynamic priority allocation method for electricity metering boxes is urgently needed. This method can integrate multi-source semantic knowledge, support local incremental learning, adapt to complex dynamic electricity consumption scenarios, and possess human-machine collaborative feedback capabilities to improve the dispatching system's responsiveness to complex and variable electricity demands and its overall operational intelligence. Summary of the Invention
[0005] This application provides a dynamic power allocation method for electricity metering boxes based on load forecasting, aiming to solve the problems mentioned in the background art, such as the difficulty in achieving unified semantic modeling of electricity consumption behavior and the insufficient mining of causal, co-occurrence and spatial dependency relationships between behaviors.
[0006] The power dynamic allocation method for electricity metering boxes based on load forecasting provided in this application specifically includes: S1: Obtain the original data of multi-dimensional electricity consumption behavior of users under the jurisdiction of the electricity metering box, and map the original data of multi-dimensional electricity consumption behavior into a heterogeneous data set; S2: Based on the causal relationships, co-occurrence relationships, temporal dependencies, and spatial proximity in the heterogeneous data set, construct a semantic graph of electricity consumption behavior; S3: Extract graph subgraph slices from the electricity consumption behavior semantic graph, input the graph subgraph slices into the graph neural network, extract features through the encoder and process them through the pluggable task adapter head to generate behavior prediction tensors; S4: Monitor whether there is a sudden event in the behavior prediction tensor. If so, extract the local subgraph consisting of the corresponding node and its first-order neighbors, calculate the minimum necessary parameter perturbation direction by combining the graph embedding difference before and after the behavior change, and execute the local incremental update strategy based on gradient projection to update the weights in the graph neural network. S5: Couple the behavior prediction tensor with the real-time load state and construct a ternary tensor based on behavior determinism, load urgency and grid constraint relaxation. Calculate and generate a priority potential field based on the ternary tensor. S6: Based on the priority potential field, perform dynamic power allocation operation, generate dynamic priority pre-allocation instructions for each user in the power metering box, and adjust the power supply quota of each branch according to the dynamic priority pre-allocation instructions to complete the dynamic pre-allocation of priorities. S7: Receive the misjudgment reason labels marked by the operation and maintenance personnel for the significant decrease in satisfaction after scheduling execution, add the misjudgment reason labels as new edges to the electricity consumption behavior semantic graph, trigger the local graph structure reconnection based on the new edges, and call the local incremental update strategy based on gradient projection to recalibrate the graph neural network to generate the corrected behavior prediction tensor.
[0007] The power dynamic allocation method for electricity metering boxes based on load forecasting provided in this application has the following advantages: This application constructs an edge intelligent power management architecture with high timeliness, strong privacy protection, low computational dependence, and continuous self-evolution capabilities. All data processing and model inference are completed locally in intelligent power metering boxes with AI acceleration capabilities. Raw user behavior data does not need to be uploaded to the central platform, fundamentally meeting the stringent requirements of power terminals for data security and privacy compliance. At the same time, the entire process eliminates the dependence on the accumulation of large-scale historical data, making it particularly suitable for typical small-sample mutation scenarios such as new user access, holiday mode switching, and extreme weather impacts, demonstrating good engineering feasibility and wide applicability. Attached Figure Description
[0008] Figure 1This is the main flowchart of the dynamic power allocation method for electricity metering boxes based on load forecasting.
[0009] Figure 2 This is a sub-flowchart of the dynamic power allocation method for electricity metering boxes based on load forecasting. Detailed Implementation
[0010] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0011] The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0012] like Figure 1 As shown, this application provides a method for dynamic power allocation of electricity metering boxes based on load forecasting, specifically including: S1: Obtain the original data of multi-dimensional electricity consumption behavior of users under the jurisdiction of the electricity metering box, and map the original data of multi-dimensional electricity consumption behavior into a heterogeneous data set; S2: Based on the causal relationships, co-occurrence relationships, temporal dependencies, and spatial proximity in the heterogeneous data set, construct a semantic graph of electricity consumption behavior; S3: Extract graph subgraph slices from the electricity consumption behavior semantic graph, input the graph subgraph slices into the graph neural network, extract features through the encoder and process them through the pluggable task adapter head to generate behavior prediction tensors; S4: Monitor whether there is a sudden event in the behavior prediction tensor. If so, extract the local subgraph consisting of the corresponding node and its first-order neighbors, calculate the minimum necessary parameter perturbation direction by combining the graph embedding difference before and after the behavior change, and execute the local incremental update strategy based on gradient projection to update the weights in the graph neural network. S5: Couple the behavior prediction tensor with the real-time load state and construct a ternary tensor based on behavior determinism, load urgency and grid constraint relaxation. Calculate and generate a priority potential field based on the ternary tensor. S6: Based on the priority potential field, perform dynamic power allocation operation, generate dynamic priority pre-allocation instructions for each user in the power metering box, and adjust the power supply quota of each branch according to the dynamic priority pre-allocation instructions to complete the dynamic pre-allocation of priorities. S7: Receive the misjudgment reason labels marked by the operation and maintenance personnel for the significant decrease in satisfaction after scheduling execution, add the misjudgment reason labels as new edges to the electricity consumption behavior semantic graph, trigger the local graph structure reconnection based on the new edges, and call the local incremental update strategy based on gradient projection to recalibrate the graph neural network to generate the corrected behavior prediction tensor.
[0013] Step S1: Obtain the original multi-dimensional electricity consumption behavior data of users under the jurisdiction of the electricity metering box, and map the original multi-dimensional electricity consumption behavior data into a heterogeneous data set. Specifically, this includes: S1.1: Acquire time-of-use power curve data, switch event sequence data, equipment start / stop tag data, local short-term weather change data, and temporary load intention command data actively reported by user terminals from the power metering box. Perform timestamp alignment and missing value interpolation processing on the original data of the multi-dimensional electricity consumption behavior to generate a standardized original data stream with a unified time base.
[0014] Step S1.1 aims to perform spatiotemporal alignment and cleaning of the heterogeneous raw electricity consumption data from multiple sources, eliminating timing deviations caused by data heterogeneity. The electricity metering box acquires the time-sharing power curves of each branch through a high-frequency sampling module, synchronously records the switching event sequences and equipment start / stop tags of the smart circuit breakers, and accesses short-term temperature, humidity, and light change data provided by the local weather station. It also receives structured temporary load intent commands from the user terminal APP. To address the timestamp asynchrony issue in the aforementioned multi-source data, a linear interpolation method is used to resample each data stream, using the standard grid time signal as the reference time axis, uniformly mapping data from different sampling frequencies to a minute-level time granularity. For missing segments of the power curve due to communication packet loss or sensor failure, the historical average within a sliding window combined with the first-order differential trend of adjacent times is used for missing value interpolation to ensure the continuity of power data. For jitter noise in the switching event sequences, a jitter-reducing filter logic is applied to remove invalid state transitions with a duration less than a preset threshold. For unstructured intent text reported by users, keyword extraction and semantic standardization mapping are performed to transform it into intent label vectors with clear time attributes. Through the above timestamp alignment and missing value imputation processing, the discrete, heterogeneous and noisy raw data stream is transformed into a standardized raw data stream with a unified time base, consistent dimensions and complete data, providing a high-quality data foundation for subsequent entity extraction.
[0015] S1.2: Based on the user identification information, device unique code, time period index, meteorological parameter vector and intent text description in the standardized raw data stream, the entity extraction method is used to identify and classify user entity objects, device entity objects, time period entity objects, environmental factor entity objects and intent type entity objects to generate a multi-dimensional entity candidate set to be mapped.
[0016] Receive a standardized raw data stream after timestamp alignment and missing value imputation. This data stream contains user ID, device MAC address, time window index, meteorological parameter fields, and intent text string.
[0017] Entity extraction operations based on rule matching and regular expressions are performed on the standardized raw data stream. For the user ID field, a deterministic hash mapping algorithm is used to extract unique user entity objects, ensuring the consistency of node identity for the same physical user in the graph.
[0018] Based on the device MAC address and device start / stop label, a predefined device fingerprint database is used for pattern matching to identify and classify specific device entities such as air conditioners, water heaters, and electric vehicle charging piles, and a unique type label attribute is assigned to each device.
[0019] Discretization intervals are performed on the time window index, mapping continuous timestamps to standardized time period entities, such as "morning peak", "off-peak", and "valley", to capture the periodic temporal characteristics of electricity consumption behavior.
[0020] The temperature, humidity, and wind speed values in local short-term meteorological data are analyzed to construct a multidimensional meteorological parameter vector, which is then encapsulated as an environmental factor entity object to characterize the potential impact of external climate conditions on load fluctuations.
[0021] For the temporary load intent command text actively reported by the user terminal, a lightweight natural language processing model is invoked to fill semantic slots, extract the intent action (such as "charging" or "heating") and the expected duration, and generate an intent type entity object.
[0022] The extracted user entities, device entities, time period entities, environmental factor entities, and intent type entities are structurally assembled to establish a preliminary association index between entities, generating a multidimensional entity candidate set to be mapped.
[0023] By using entity extraction and classification, the unstructured or semi-structured raw data from the previous step is transformed into a set of heterogeneous entity objects with clear semantic definitions, thereby achieving semantic dimensionality enhancement from the original signal to the candidate set of graph nodes. This provides a standardized topological vertex foundation for the subsequent construction of a semantic graph of electricity consumption behavior.
[0024] S1.3: Receive the multidimensional entity candidate set, define the corresponding attribute feature dimension for each type of entity object, use a numerical normalization function to scale the continuous attributes and use one-hot encoding technology to vectorize the discrete attributes to generate an initial attribute feature vector with a fixed dimension length.
[0025] The system receives the multi-dimensional entity candidate set generated by S1.2 and defines feature dimension spaces containing static and dynamic attributes for five types of entity objects: users, devices, time periods, environmental factors, and intent types. For user nodes, it extracts historical electricity preference index and credit rating tags; for device nodes, it extracts rated power, energy efficiency rating, and start / stop frequency statistics; for time period nodes, it extracts hourly index and weekday / holiday identifiers; for environmental factor nodes, it extracts temperature, humidity, and light intensity values; and for intent type nodes, it extracts instruction urgency level and expected duration.
[0026] For the extracted continuous attribute data, a Min-Max normalization method is used for linear scaling to map the original values to the [0,1] interval, eliminating the interference of dimensional differences on subsequent map calculations. The normalization formula is expressed as:
[0027] Where x is the original attribute value. and These are the minimum and maximum values of the attribute within the training set statistics window, respectively. These are the normalized attribute values.
[0028] For discrete attribute data, including device type encoding, intent text category, and weather condition classification, one-hot encoding is performed. A binary vector is constructed based on the cardinality of each discrete attribute value, and each category is mapped to a sparse vector with only one bit set to 1 and the rest to 0. This ensures that different categories are equidistant in the vector space and avoids introducing false ordering relationships.
[0029] The normalized continuous attribute vector and the one-hot encoded discrete attribute vector are concatenated and fused according to a preset dimensional order. For attributes with missing dimensions, a zero-padding strategy is used to complete them, ensuring that the initial attribute feature vectors generated for all entity objects have a uniform fixed dimensional length, forming a structured and aligned feature representation.
[0030] By combining numerical normalization and one-hot encoding, the heterogeneous and dimensionally inconsistent multidimensional entity candidate set in the previous step is transformed into an initial attribute feature vector with unified mathematical properties and a fixed dimension length. This achieves standardized alignment of multi-source data in the feature space, providing a consistent input basis for subsequent construction of graph node embedding.
[0031] For example, for a residential user node, its historical average monthly electricity consumption of 500 kWh (maximum 2000 kWh, minimum 50 kWh) is extracted and normalized to 0.31; the device node is a Level 1 energy-efficient air conditioner with a rated power of 1500W, which is normalized to 0.75, and the device type "air conditioner" is mapped to a 5-dimensional unique heat vector [0,0,1,0,0]; the intent node "reserved charging" is mapped to a 3-dimensional vector [1,0,0]. All components are concatenated to generate a 64-dimensional fixed-length initial attribute feature vector, eliminating the difference between power units and text categories, and significantly improving the efficiency of graph construction.
[0032] S1.4: Based on the initial attribute feature vector, construct a mapping transformation matrix from the original data space to the graph node space, and map the initial attribute feature vector into a node embedding representation in the graph space through a linear projection operation to generate a standardized node attribute matrix containing user node embedding, device node embedding, time period node embedding, environmental factor node embedding and intent type node embedding.
[0033] Receive the initial attribute feature vector with a fixed dimension length generated by S1.3. The initial attribute feature vector contains numerical or one-hot encoded data of user, device, time period, environmental factors and intent type.
[0034] A linear projection transformation matrix is constructed from the original high-dimensional feature space to the low-dimensional graph embedding space. The transformation matrix is initialized with learnable parameter weights for each type of node to ensure that nodes of different semantic types have a unified hidden layer dimension after mapping.
[0035] Matrix multiplication is performed on the initial attribute feature vectors of each type of node to project the high-dimensional sparse or dense features onto a continuous vector space of a preset dimension, generating a preliminary node embedding representation.
[0036] The generated initial node embedding representation is normalized using the L2 norm to eliminate the inconsistency in vector magnitude caused by the difference in the original data units, thus ensuring the numerical stability of the attention mechanism or message passing process in the subsequent graph neural network.
[0037] The normalized user node embedding, device node embedding, time period node embedding, environmental factor node embedding, and intent type node embedding are structurally assembled according to the node identifier index.
[0038] By using linear projection and normalization, the discrete or continuous features from the previous step are transformed into a standardized node attribute matrix of a unified dimension, thereby achieving semantic alignment and computability of multi-source heterogeneous data in the graph space.
[0039] S1.5: Integrate all the node embedding representations in the standardized node attribute matrix, and encapsulate them into a heterogeneous data set containing user nodes, device nodes, time period nodes, environmental factor nodes and intent type nodes according to a preset data structure format, so as to output a standardized heterogeneous data input object for subsequent steps to construct the electricity behavior semantic graph.
[0040] Step S2: Based on the causal relationships, co-occurrence relationships, temporal dependencies, and spatial proximity in the heterogeneous data set, construct a semantic graph of electricity consumption behavior. Specifically, this includes: S2.1: Based on the user nodes, device nodes, time period nodes, environmental factor nodes, and intent type nodes in the heterogeneous data set, perform standardized mapping processing on the attribute vectors of various types of nodes to generate an initial graph vertex set with unified dimensional features, ensuring that the original data from different sources have a computable semantic representation basis in the graph space.
[0041] S2.2: Using the time series alignment method, perform time series dependency analysis on the device start / stop labels and time-sharing power curves of adjacent time period nodes in the initial graph vertex set to extract time series dependency edges that reflect the continuous change law of load, and add the time series dependency edges as connection structures to the initial graph vertex set to form a preliminary time series topology graph.
[0042] The device start / stop tag sequence and the corresponding time-division power curve data of adjacent time period nodes in the initial graph vertex set are received as the original input objects for time-series dependency analysis.
[0043] Discrete event encoding is performed on the device start / stop tag sequence to map the switch state into a binary time series vector. At the same time, sliding window smoothing is performed on the time-division power curve to eliminate high-frequency noise interference and generate a standardized time series feature matrix.
[0044] The dynamic time warping method is used to calculate the morphological similarity distance matrix of power curves between nodes in different time periods. The optimal alignment path is found by recursively accumulating the cost function, thereby quantifying the continuity characteristics of load changes.
[0045] Based on the calculated similarity distance matrix, a dynamic threshold is set to filter out time period node pairs with significant temporal correlation, and a directed temporal dependency edge reflecting the continuous change pattern of load is constructed.
[0046] The generated temporal dependency edges are added to the initial graph vertex set according to the topological relationship between the source node and the target node, forming a preliminary temporal topology graph containing temporal evolution logic.
[0047] By using dynamic time warping and threshold filtering, the standardized time-series characteristics from the previous step are transformed into a time-dependent edge structure that represents the continuous change pattern of the load, thus achieving the expected technical effect of graphical representation of the time-series logic of electricity consumption behavior.
[0048] S2.3: Based on the user nodes and device nodes in the preliminary time series topology graph, perform statistical co-occurrence frequency calculation to identify high-frequency simultaneous action patterns, and combine local short-term meteorological change data and environmental factor nodes to perform causal inference verification to generate causal relationship edges and co-occurrence relationship edges that represent strong causal relationships. Then, integrate the causal relationship edges and co-occurrence relationship edges into the preliminary time series topology graph to construct an enhanced semantic connection graph.
[0049] The system receives user node and device node association data from the initial time-series topology graph and extracts the device start-stop event sequence for each user within a preset time window. It then performs sliding window statistics on the device start-stop event sequences to calculate the co-occurrence frequency of different device types within the same time slice, generating an initial co-occurrence matrix. A co-occurrence frequency threshold is set, and device combinations exceeding the threshold are filtered out and identified as high-frequency simultaneous operation modes, thus constructing an initial set of co-occurrence relationship edges.
[0050] Local short-term meteorological change data and environmental factor node attributes are acquired, and meteorological parameter vectors are spatiotemporally aligned with environmental factor nodes. For identified high-frequency simultaneous action patterns, Granger causality tests or mutual information methods are used to analyze the causal dependency between meteorological and environmental changes and equipment start-up and shutdown behavior. Causal confidence scores are calculated, spurious correlations are eliminated, and statistically significant causal pairs are retained to generate a set of causal edges.
[0051] The generated sets of co-occurrence edges and causal association edges are mapped to the graph space, and the weight attributes of the edges are defined. The weights of co-occurrence edges are determined based on the normalization of co-occurrence frequency, while the weights of causal association edges are determined based on the causal confidence score. These two types of edges are merged into the preliminary temporal topology graph, and the adjacency matrix between nodes is updated to form an enhanced semantic connectivity graph containing semantically enhanced connections.
[0052] By using co-occurrence frequency statistics and causal inference testing, the preliminary time-series topology graph from the previous step is transformed into enhanced semantic connectivity graph data containing strong semantic associations, thereby achieving the expected technical effect of explicitly representing the implicit environmental driving and habit coupling relationship in electricity consumption behavior.
[0053] For example, a time window of 24 hours and a sliding step of 15 minutes are set. Statistics show that air conditioners and fans co-occur 85 times in the summer afternoon, exceeding the threshold of 50 times. A co-occurrence edge is established with a weight of 0.85. Meteorological data shows that the probability of air conditioner activation increases significantly when the temperature is above 30℃. A Granger causality test shows a p-value less than 0.01 and a causal confidence level of 0.92. A causal edge from the temperature node to the air conditioner node is established with a weight of 0.92. Integrating these two types of edges into the graph allows the model to distinguish between air conditioner activation due to high temperatures (causal drive) and the user's habitual simultaneous use of fans (co-occurrence habit), significantly improving the accuracy of analyzing composite load behavior.
[0054] S2.4: Calculate the geospatial distance matrix between user nodes based on the operational status data of community public facilities, and determine the spatial proximity of user nodes in the enhanced semantic connection graph based on a preset spatial proximity threshold to generate spatial proximity edges that represent the degree of physical proximity, and inject the spatial proximity edges into the enhanced semantic connection graph to form a complete electricity consumption behavior semantic graph containing multi-dimensional logical relationships.
[0055] The system acquires the geographic coordinates of user nodes in the enhanced semantic connectivity graph and the operational status logs of community public facilities, parsing out the latitude and longitude vectors of each user node on a two-dimensional plane. Based on these latitude and longitude vectors, the Euclidean distance method is used to calculate the physical spatial distance between any two user nodes, constructing an initial geospatial distance matrix. The initial geospatial distance matrix is then normalized to eliminate dimensional differences, generating a standardized spatial distance matrix.
[0056] A spatial proximity determination threshold is set, which is determined based on the power supply radius of the electricity metering box and the topological characteristics of the low-voltage distribution network. Elements in the standardized spatial distance matrix are traversed, and distance values less than or equal to the spatial proximity determination threshold are marked as valid proximity relationships, while the rest are marked as non-proximity relationships.
[0057] For user node pairs marked as having a valid proximity relationship, undirected spatial proximity edges are constructed. The weight coefficients of these edges are calculated; these weight coefficients are inversely proportional to the physical distance between the nodes, reflecting the strength of the influence of spatial proximity on the synergy of electricity consumption behavior. The weights of the spatial proximity edges are calculated using the following formula:
[0058] in, For spatial proximity edge weights, Let be the normalized physical distance between user node i and user node j.
[0059] The generated spatial proximity edges and their weights are injected into the enhanced semantic connectivity graph and merged with existing temporal dependency edges, causal relationship edges, and co-occurrence relationship edges. The adjacency matrix of the graph is updated to form a complete semantic graph of electricity consumption behavior containing multi-dimensional logical relationships.
[0060] Through the above processing method, the enhanced semantic connectivity graph of the previous step is transformed into a complete semantic graph of electricity consumption behavior that includes spatial dimension constraints. This enables a quantitative representation of the coupling relationship of electricity consumption behavior caused by the physical proximity of users, and improves the graph's ability to capture regional load fluctuation characteristics.
[0061] For example, a spatial proximity threshold of 50 meters is set. User node A has coordinates of (116.40, 39.90), and user node B has coordinates of (116.4004, 39.9003). The calculated physical distance between A and B is approximately 45 meters, which is less than the threshold. The normalized distance is 0.9. Substituting these values into the formula, the edge weight is calculated to be 1 / (1+0.9)≈0.526. This weight is assigned to the spatial proximity edge between A and B and added to the graph. If user C is 60 meters away from A, no spatial proximity edge is established. This process significantly enhances the modeling accuracy of the graph for the synchronization of electricity usage in the same building or between adjacent residents.
[0062] S2.5: Execute a dynamic evolution update mechanism on the complete electricity consumption behavior semantic graph, monitor the intention instructions of newly connected temporary loads and recalculate the edge weights of the affected local subgraphs in real time, so as to output a dynamic evolution electricity consumption behavior semantic graph with real-time update capability, and finally form a graph representation system that can accurately represent the semantic relationship of multi-source heterogeneous electricity consumption behavior for subsequent model calls.
[0063] The system receives a complete semantic graph of electricity consumption behavior generated by S2.4, containing multi-dimensional logical relationships, and establishes a real-time monitoring channel for newly added temporary load intent commands. It parses the structured semantic commands reported by user terminals, extracting the intent type, expected start time, and duration fields, and locates the corresponding user and device nodes in the graph. If the target node does not exist, a new intent type node is instantiated and its attribute vector is initialized, then embedded into the graph vertex set. The semantic similarity between the new intent node and the current time period node and environmental factor nodes is calculated, and initial connection weights are generated based on the cosine distance method. The causal association edge weight coefficients from the intent node to the device node are dynamically adjusted based on the user's execution probability of this type of intent in historical behavior patterns. A sliding time window mechanism is used to recalculate the temporal dependency strength of each edge in the local subgraph affected by the new intent, updating the corresponding element values in the adjacency matrix. The node embedding representation of the local subgraph is smoothed using the graph Laplacian regularization method to ensure the stability of the graph topology after the introduction of new edges. The updated local subgraph edge weights are synchronized to the global graph storage area, marking this part of the graph as a state to be evolved. Through the aforementioned dynamic evolution and update mechanism, the intentions of newly connected temporary loads are integrated into the electricity consumption behavior semantic graph in real time, outputting a dynamic evolution electricity consumption behavior semantic graph with real-time update capabilities, thus realizing rapid response to sudden electricity demand and immediate correction of graph representation.
[0064] Step S3: Extract graph sub-graph slices from the electricity consumption behavior semantic graph, input the graph sub-graph slices into a graph neural network, extract features through an encoder, and process them through a pluggable task adapter to generate a behavior prediction tensor. Specifically, this includes: S3.1: Based on the timestamp index in the electricity consumption behavior semantic graph, with the current time as the center point, backtrack N time steps and predict M time steps forward, perform spatiotemporal window pruning on the graph vertex set and edge set to generate a graph subgraph slice limited to a specific scheduling window. This graph subgraph slice serves as the input object for subsequent feature extraction.
[0065] The S3.1 sub-step aims to accurately extract spatiotemporal context windows from the dynamically evolving semantic graph of electricity consumption behavior, providing standardized input slices for the graph neural network. This step follows the complete graph structure generated in S2, and performs strict spatiotemporal boundary definition and data pruning operations based on the timestamp index of the current scheduling moment.
[0066] Read the global time axis index of the electricity consumption behavior semantic graph, locate the reference time t0 where the current scheduling decision occurred, and set it as the center time anchor point of the graph subgraph slice. Based on the preset historical backtracking step size N and future prediction step size M, calculate the time window boundary of the graph subgraph and determine the starting time t. start =t0-N and termination time tend =t0+M.
[0067] Traverse the set of vertices in the graph and filter out those whose time attributes fall within the interval [t]. start , t end A subset of candidate vertices is constructed from all user nodes, device nodes, time period nodes, environmental factor nodes, and intent type nodes within the specified time window. For long-term dependencies that span time boundaries, only node instances that fall entirely within that time window are retained to ensure the integrity of the temporal causal chain.
[0068] Based on the candidate vertex subset, the edge set in the original graph is retrieved, and all edges connecting two candidate vertices that belong to causal association, co-occurrence relationship, temporal dependency, or spatial proximity are extracted to construct the candidate edge subset. Isolated edges whose end nodes are not in the candidate vertex subset are removed to ensure the connectivity and self-consistency of the subgraph topology.
[0069] The candidate vertex subset and candidate edge subset are structurally encapsulated to generate a graph subgraph slice object containing a node attribute matrix and an adjacency matrix. This slice object preserves the semantic association features of multi-source heterogeneous data in the original graph, while limiting the computational scale to adapt to the processing capabilities of edge devices.
[0070] Through the spatiotemporal window pruning process described above, the full dynamic evolution graph generated in the previous step is transformed into graph subgraph slices limited to a specific scheduling window. This achieves dimensionality reduction mapping from a global complex network to a locally computable subgraph, providing standardized input objects for efficient feature extraction of subsequent graph neural networks and significantly reducing the computational complexity and memory usage of model inference.
[0071] S3.2: Obtain the node attribute matrix and adjacency relation matrix in the subgraph slice of the graph, perform multi-layer graph convolution aggregation operation using the parameter-frozen backbone encoder, and perform high-order feature fusion processing on the causal association and temporal dependency between nodes to generate a global graph embedding vector that represents the semantic relationship of multi-source heterogeneous electricity consumption behavior.
[0072] The node attribute matrix and adjacency matrix of the graph subgraph slices are obtained as the input data source for the backbone encoder of the graph neural network. A linear transformation operation is performed on the node attribute matrix to map the high-dimensional original features to the low-dimensional hidden space, generating initial node embedding representations, reducing computational complexity while preserving key semantic information. Based on the message passing mechanism defined by the adjacency matrix, the first-order neighbor node features of each target node are aggregated, and local topological structure information is fused through weighted summation to capture the direct interaction patterns between users and devices. A non-linear activation function is introduced to transform the aggregated feature vector, enhancing the model's ability to express non-linear relationships in electricity consumption behavior, generating the first layer of graph convolution output. Multi-layer graph convolution aggregation operations are repeatedly performed, with each layer using the output of the previous layer as input, gradually expanding the receptive field to capture the causal associations and temporal dependencies of higher-order neighbor nodes, achieving deep fusion of multi-hop semantic information. During the aggregation process, an attention mechanism is used to dynamically allocate neighbor node weights, distinguishing the importance of causal associations, co-occurrence relationships, and temporal dependencies based on edge type, and suppressing the interference of noisy connections on feature expression. After K-layer graph convolution processing, global average pooling or readout function processing is performed on the feature vectors of all user nodes, compressing the scattered node-level features into fixed-dimensional global graph embedding vectors. This process transforms the graph sub-graph slices from the previous step into global graph embedding vectors representing the semantic relationships of multi-source heterogeneous electricity consumption behaviors, enabling the effective extraction of high-order features in complex electricity consumption scenarios and providing a feature foundation rich in contextual information for subsequent task adaptation heads.
[0073] For example, a graph sub-slice is set to contain 50 user nodes and associated device and time period nodes, with node attribute dimensions of 128. The backbone encoder is set as a 3-layer graph convolutional network with hidden layer dimensions of 64. The first layer of graph convolution maps the 128-dimensional input to 64 dimensions and aggregates first-order neighbor features; the second layer aggregates second-order neighbors to capture co-occurrence patterns of electricity consumption behavior within the community; the third layer aggregates third-order neighbors to fuse long-term temporal dependencies. In the attention mechanism, the weight coefficients of causal association edges are set to 0.6, temporal dependency edges to 0.3, and co-occurrence relationship edges to 0.1. After the 3-layer aggregation, global average pooling is performed on the 64-dimensional feature vectors of the 50 user nodes to generate a 64-dimensional global graph embedding vector. This vector effectively integrates users' historical electricity consumption habits, current environmental factors, and device status, significantly improving the feature representation ability of sudden high-power load behavior, enabling subsequent prediction modules to more accurately identify non-periodic electricity consumption mutations.
[0074] S3.3: Based on the global graph embedding vector, call the classification branch and regression branch in the pluggable task adapter head to perform softmax normalization mapping and linear transformation operations respectively, so as to decouple the output of behavioral deterministic score representing the probability of future electricity consumption behavior and priority sensitivity coefficient representing the load's response to power grid fluctuations.
[0075] It receives a global graph embedding vector generated by the preceding steps, which incorporates multi-dimensional semantic features of the user, device, and environment, and serves as the input data source for the task adapter head.
[0076] The global graph embedding vector is fed into the classification branch of the pluggable task adapter head, and a nonlinear mapping is performed through a fully connected layer to extract the logits value, which represents the probability of future electricity consumption behavior.
[0077] Perform a softmax normalization mapping operation on the logits values to convert the non-standardized predicted values into behavioral deterministic scores in the probability distribution space, ensuring that the score range converges to the interval [0,1].
[0078] The global graph embedding vector is simultaneously fed into the regression branch of the task adapter head, and a mapping relationship from the high-dimensional semantic space to the scalar response space is established through a linear transformation layer.
[0079] An activation function is applied to the linear transformation output to generate a priority sensitivity coefficient that characterizes the load’s response to grid fluctuations, reflecting the load’s adjustability under power constraints.
[0080] By decoupling the processing methods of classification and regression tasks, the global graph embedding vector from the previous step is transformed into behavioral deterministic scores and priority sensitivity coefficients, achieving dual quantification of user behavior probability and load adjustment potential, and providing accurate data support for the subsequent construction of differentiated priority potential fields.
[0081] S3.4: Receive the behavioral deterministic score and the priority sensitivity coefficient, perform tensor recombination and dimension alignment processing according to the user identifier index, and aggregate the discrete scalar scores into a structured high-dimensional array to generate a behavioral prediction tensor covering all users under the jurisdiction of the power metering box in the future scheduling window.
[0082] S3.5: Based on the behavior prediction tensor, execute outlier detection and confidence verification logic to remove invalid prediction components caused by graph sparsity, and perform standardized encoding processing on the remaining valid components to output the final standard behavior prediction tensor used for priority potential field calculation.
[0083] Receive the behavior prediction tensor covering all users generated in the previous steps. This tensor contains the original data of each user's behavior deterministic score and priority sensitivity coefficient in the future scheduling window.
[0084] Perform graph connectivity analysis on each user node in the behavior prediction tensor, calculate the degree centrality and local clustering coefficient of the node in the electricity consumption behavior semantic graph, and generate a topological sparsity index that characterizes the sparsity of the data.
[0085] A dynamic confidence threshold is set based on the topological sparsity index. Isolated nodes or weakly connected nodes with degree centrality lower than the preset threshold are marked as low-confidence prediction objects.
[0086] The Mahalanobis distance method is used to calculate the deviation of the behavioral certainty score of low-confidence prediction objects from the center of their historical behavior distribution, and to identify statistical outliers caused by missing graph structure.
[0087] Predicted components whose Mahalanobis distance exceeds 3 times the standard deviation are identified as invalid predicted components. A masking operation is performed to remove them from the behavior prediction tensor to prevent noisy data from interfering with the subsequent potential field construction.
[0088] The remaining effective prediction components are subjected to Min-Max normalization, which maps the behavioral determinism score to the [0,1] interval and the priority sensitivity coefficient to the standardized dimension.
[0089] By using outlier detection and confidence verification logic, the noisy behavior prediction tensor generated in the previous step is transformed into a standard behavior prediction tensor with invalid components removed and dimensions unified, thereby achieving the expected technical effect of improving the robustness of priority potential field calculation.
[0090] For example, for 50 households under a certain electricity metering box, the degree centrality of each user node in the semantic graph is calculated. A degree centrality threshold of 2 is set, and 3 newly connected users are identified as low-confidence objects. The Mahalanobis distance of the behavioral deterministic scores of these 3 users is calculated. One user's score vector is [0.9, 0.8], with a historical mean of [0.4, 0.3], and the inverse of the covariance matrix is the identity matrix. The calculated Mahalanobis distance is 0.71, which does not exceed the threshold of 3, so this data is retained. Another user's score vector is [0.1, 0.1] due to missing data, and the calculated Mahalanobis distance is 4.5, exceeding the threshold, so it is determined as an invalid component and removed. The behavioral deterministic scores of the remaining 49 valid users are normalized using Min-Max, with the maximum value of 0.95 mapped to 1 and the minimum value of 0.2 mapped to 0, generating a standardized behavioral prediction tensor to ensure the accuracy and stability of subsequent priority potential field calculations.
[0091] Step S4: Monitor whether there is a sudden change in electricity consumption behavior in the behavior prediction tensor. If so, extract the local subgraph consisting of the corresponding node and its first-order neighbors, calculate the minimum necessary parameter perturbation direction by combining the graph embedding difference before and after the behavior change, and execute a local incremental update strategy based on gradient projection to update the weights in the graph neural network. Specifically, this includes: S4.1: Perform time-series sliding window statistical processing on the deterministic score of each user behavior in the behavior prediction tensor to generate a set of behavioral mutation event markers containing three consecutive high-power load trigger records during atypical periods, which will serve as the triggering conditions for subsequent local subgraph extraction.
[0092] S4.2: Based on the target user node identifier in the behavioral mutation event tag set, perform a first-order neighbor topology traversal operation in the electricity consumption behavior semantic graph to generate a local subgraph data block composed of the target user node and its directly associated device nodes and time period nodes.
[0093] The system receives the target user node identifier from the behavioral mutation event tag set and loads the adjacency list index structure of the electricity consumption behavior semantic graph into memory. Based on the target user node identifier, it retrieves the graph vertex database to locate the corresponding user node entity object and its stored physical address pointer. Based on this user node entity object, it traverses its outgoing and incoming edge sets, filtering out all directly connected first-order neighbor nodes. These first-order neighbor nodes include smart appliance nodes bound to the user, associated specific time period nodes, and controlled environmental factor nodes. It performs attribute integrity checks on the filtered first-order neighbor nodes, eliminating null or isolated nodes caused by data synchronization delays to ensure the connectivity of the local topology. It extracts the node embedding vectors, node type labels, and timestamp attributes of the target user node and all first-order neighbor nodes to construct a local node feature matrix. Based on the edge weight information in the original graph, it reconstructs the connection relationship between the target user node and its first-order neighbor nodes, generating a local adjacency matrix, where the edge weights retain the causal association strength and temporal dependency coefficients from the original graph. The local node feature matrix and local adjacency matrix are encapsulated into structured data objects, forming local subgraph data blocks consisting of target user nodes and their directly associated device nodes and time period nodes. Through the above topology traversal and data encapsulation processing methods, the specific user behavior context in the global graph is transformed into compact local subgraph data blocks, enabling refined feature focusing on abrupt changes and providing a low-computational-complexity input foundation for subsequent incremental learning.
[0094] S4.3: Using the parameter-frozen backbone encoder, feature difference calculations are performed on the spectral embedding vectors at the time before and after the behavior mutation in the local subgraph data blocks to generate a spectral embedding difference gradient vector representing the direction of power consumption pattern offset.
[0095] The process begins by acquiring local subgraph data blocks extracted in previous steps. These blocks contain the topological structure and node attribute information of the target user node and its first-order neighbors before and after the behavioral mutation. A graph neural network backbone encoder with frozen parameters is invoked, inputting the local subgraph before the behavioral mutation into the network. Multi-layer graph convolution aggregation is performed to capture the static semantic features of historical electricity consumption patterns. Global pooling is applied to the aggregated node representations through the readout layer of the backbone encoder to generate high-dimensional graph embedding vectors representing the baseline state of electricity consumption behavior before the mutation. Keeping the backbone encoder weights unchanged, the same local subgraph after the behavioral mutation is input into the same backbone encoder, performing graph convolution aggregation and global pooling operations with the same structure. This generates high-dimensional graph embedding vectors representing the immediate electricity consumption behavior state after the mutation, ensuring that the two embedding vectors are in the same feature space dimension. A difference operator is constructed to subtract the graph embedding vector before the mutation from the graph embedding vector after the mutation, performing element-wise subtraction to eliminate common background noise. The spectral embedding difference gradient vector, representing the direction of power consumption mode offset, is calculated using the following formula:
[0096] in, To embed differential gradient vectors into the graph, This represents the graph embedding vector at the time point following the behavioral mutation. This is the graph embedding vector at the moment before the behavioral mutation. The calculated difference gradient vector is normalized using the L2 norm to eliminate the interference of vector magnitude on direction determination, preserving pure semantic offset direction information. Through difference calculation and normalization, the graph embeddings at the previous and subsequent moments are transformed into graph embedding difference gradient vectors representing the offset direction of electricity consumption patterns. This achieves accurate quantification of the trajectory of sudden, non-periodic electricity consumption behavior changes, providing precise directional guidance for the minimum necessary perturbation of subsequent local model weights.
[0097] S4.4: The gradient projection method based on the graph embedding differential gradient vector is used to constrain the gradient direction of the global loss function to the parameter subspace corresponding to the local subgraph data block, so as to generate the minimum necessary parameter perturbation direction matrix only for the target user node and its first-order neighbors.
[0098] Receive the graph embedding difference gradient vector generated by S4.3, which represents the feature shift direction and magnitude of the target user and its first-order neighbors before and after the behavioral mutation.
[0099] Construct the parameter subspace projection matrix corresponding to the local subgraph, extract the weight parameter indices that are directly connected to the target user node and first-order neighbor nodes in the pluggable task adapter part of the graph neural network, and form a sparse parameter mask matrix.
[0100] The sparse parameter mask matrix is used to filter the complete gradient vector of the global loss function, retaining only the gradient components related to the local subgraph topology and removing gradient noise interference from irrelevant nodes.
[0101] The gradient projection method is used to orthogonally project the filtered local gradient vector onto the tangent space of the parametric manifold defined by the historical normal power consumption behavior pattern, and calculate the projection residual to obtain the minimum necessary parameter perturbation direction.
[0102] Norm normalization is performed on the obtained parameter perturbation direction to ensure that the update step size is within the preset safety threshold range, and to prevent the model parameters from diverging due to sudden data noise.
[0103] By using gradient projection processing, the graph embedding differences from the previous step are transformed into a minimum necessary parameter perturbation direction matrix for local subgraphs, achieving the expected technical effect of rapid adaptive calibration of sudden behaviors without compromising the generalization ability of the global model.
[0104] S4.5: Based on the minimum necessary parameter perturbation direction matrix, perform local fine-tuning update operation on the weight parameters of the pluggable task adapter part in the graph neural network to generate updated local model weights that adapt to the characteristics of sudden power consumption behavior.
[0105] Receive the minimum necessary parameter perturbation direction matrix generated by the preceding steps. This matrix represents the weight adjustment vector required for the target user and its first-order neighbor subgraph in response to sudden power consumption behavior.
[0106] The pluggable task adapter part in the graph neural network is parameter locked and isolated. Only the weight tensors of the classification branch and regression branch related to the current mutation event are selected as the objects to be updated, keeping the parameters of the backbone encoder frozen.
[0107] A local fine-tuning loss function is constructed, which takes the cross-entropy error between the true load label after behavioral mutation and the model prediction as the optimization objective. An L2 regularization term is introduced to constrain the weight update magnitude and prevent overfitting caused by small sample data.
[0108] By using the stochastic gradient descent algorithm and combining the minimum necessary parameter perturbation direction matrix, the weights of the task adapter head are updated in one or more steps. The projection components of the gradient vector in the perturbation direction are calculated to ensure that the update path is strictly limited to the subspace defined by the graph embedding difference.
[0109] The updated weight parameters are reloaded into the task adapter head module, replacing the original static weight configuration, completing the real-time calibration of the local model, and generating updated local model weights that adapt to the characteristics of sudden power consumption behavior.
[0110] By combining the general feature extraction capability of the global model with the specific behavioral patterns of local users through the aforementioned gradient projection-based local fine-tuning mechanism, rapid adaptation is achieved without disrupting the original knowledge distribution, significantly improving the model's generalization prediction accuracy for non-periodic electricity consumption behavior.
[0111] Step S5: Couple and map the behavior prediction tensor with the real-time load state; construct a ternary tensor based on behavior determinism, load urgency, and grid constraint relaxation; and calculate and generate a priority potential field based on the ternary tensor. Specifically, this includes: S5.1: Obtain the behavior deterministic score data and priority sensitivity coefficient data in the behavior prediction tensor, perform normalization mapping processing on the behavior deterministic score data to generate a standardized behavior deterministic vector, and perform threshold truncation processing on the priority sensitivity coefficient data to generate an effective priority sensitivity vector, thereby obtaining a standard behavior feature set.
[0112] Receive the behavior prediction tensor output from step S3. This tensor contains the original data of the behavior deterministic scores and priority sensitivity coefficients of all users under the jurisdiction of the power metering box in the future scheduling window.
[0113] The behavioral deterministic scoring data is processed by Min-Max normalization mapping, and the effective range of the score is set to [0,1]. The original score is compressed to the standard normal distribution range by using a linear transformation function to eliminate the dimensional influence caused by the difference in the historical electricity consumption base of different users and generate a standardized behavioral deterministic vector.
[0114] The deterministic value of standardized behavior is calculated using the following formula:
[0115] in, For the determination of the original behavior, and These are the minimum and maximum user ratings for the current scheduling period, respectively. This represents the deterministic value of the standardized behavior after normalization.
[0116] Dynamic threshold truncation is performed on the priority sensitivity coefficient data. The upper and lower thresholds of sensitivity are set according to the power grid safety operation regulations to eliminate extreme outliers caused by spectrum sparsity or model noise, and to prevent invalid high-sensitivity indicators from interfering with the subsequent potential field construction.
[0117] The truncated priority sensitivity coefficients are reorganized into an effective priority sensitivity vector, ensuring that the vector dimension is strictly aligned with the standardized behavioral deterministic vector, forming a set of standard behavioral features that includes indicators of the credibility of users' future behavior.
[0118] By using the above-mentioned normalization mapping and threshold truncation processing, the behavior prediction tensor of the previous step is transformed into a standard behavior feature set with uniform dimensions and denoised, thereby achieving the expected technical effect of eliminating data heterogeneity and improving the stability of subsequent priority potential field calculation.
[0119] S5.2: Collect real-time power load data and remaining capacity data of each branch of the power metering box, calculate the instantaneous load rate based on the real-time power load data and perform time differentiation operation to generate a load change rate sequence, and perform reciprocal weighting processing in combination with the remaining capacity data to generate a power grid constraint relaxation vector, thereby obtaining a real-time state feature set.
[0120] S5.3: Extract the dimensional data and pre-set power grid safety boundary parameters from the coupled state data cube, perform nonlinear potential function transformation on the coupled state data cube based on the power grid safety boundary parameters to introduce constraint penalty terms, and optimize the weight distribution of the constraint penalty terms through the gradient descent algorithm to generate a corrected potential energy distribution matrix, thereby obtaining the basic data of the smooth priority potential field.
[0121] The system receives the standardized behavioral determinism vector and effective priority sensitivity vector generated by S5.1, as well as the load change rate sequence generated by S5.2, as the input data source for constructing the coupled state data cube.
[0122] Perform a dimension expansion operation on the standardized behavioral deterministic vector, mapping it from a one-dimensional user space to the first dimension of a three-dimensional spatiotemporal tensor space, and establish the basic coordinate axis of user behavior credibility in the coupled model.
[0123] The effective priority sensitivity vector is mapped to the second dimension of the three-dimensional spatiotemporal tensor space to characterize the sensitivity of each user load to power grid fluctuations, forming the vertical component of the priority response.
[0124] The load change rate sequence is mapped to the third dimension of the three-dimensional spatiotemporal tensor space to reflect the dynamic change trend of the real-time carrying capacity of the physical power grid, which constitutes the horizontal component of the constraint condition.
[0125] The initial ternary tensor is constructed by performing the outer product operation on the three orthogonal dimension vectors mentioned above using the multidimensional tensor product operator. This operation is implemented by the following formula:
[0126] in, For the initial ternary tensor, For standardized behavioral deterministic vectors, For the effective priority sensitivity vector, For the load change rate sequence, the symbol is... This represents the tensor outer product operation.
[0127] A sparsity check is performed on the generated initial ternary tensor to remove zero-value elements caused by missing data or communication interruption, ensuring the numerical integrity of the coupled state data cube.
[0128] Normalization is performed on non-zero elements to eliminate the order-of-magnitude differences between different physical dimensions, making behavioral determinism, sensitivity and load change rate comparable within a unified numerical range.
[0129] By mapping the standardized behavioral deterministic vector, effective priority sensitivity vector, and load change rate sequence in three-dimensional space using the multidimensional tensor product operator, an initial ternary tensor is generated, thereby obtaining a coupled state data cube that integrates user behavior trends and physical load dynamics. This achieves structured coupling of multi-source heterogeneous features in a unified geometric space, providing a high-dimensional data foundation for subsequent potential field calculations.
[0130] S5.4: Extract the dimensional data and pre-set power grid safety boundary parameters from the coupled state data cube, perform nonlinear potential function transformation on the coupled state data cube based on the power grid safety boundary parameters to introduce constraint penalty terms, and optimize the weight distribution of the constraint penalty terms through the gradient descent algorithm to generate a corrected potential energy distribution matrix, thereby obtaining the basic data of the smooth priority potential field.
[0131] Dimensional data is extracted from the coupled state data cube, and pre-defined power grid safety boundary parameters, including the maximum allowable load rate threshold, voltage fluctuation upper limit, and frequency deviation tolerance, are read. Based on these parameters, a nonlinear potential function model is constructed, mapping the coupled state data cube to the potential energy space. An exponential penalty function is used to nonlinearly transform the dimensional data exceeding the safety boundary, introducing constraint penalty terms to suppress the risk of exceeding limits. The weight distribution of the constraint penalty terms is optimized using a gradient descent algorithm, and the partial derivatives of the potential energy function with respect to each dimension are calculated to generate a gradient vector. The potential energy distribution matrix is iteratively updated according to the gradient direction, smoothing abrupt changes in the potential energy surface and eliminating scheduling deadlocks caused by local minima. The updated potential energy distribution matrix is normalized to generate smooth priority potential field base data that eliminates the risk of exceeding limits. Through nonlinear potential function transformation and gradient optimization, the coupled state data from the previous step is transformed into smooth priority potential field base data with safety constraints, minimizing power grid operation risk and improving the stability of scheduling decisions.
[0132] S5.5: Read the potential energy values in the basic data of the smoothed priority potential field, perform equipotential surface clustering analysis on the potential energy values to identify different response gradient regions, and calculate the potential energy drop value based on the different response gradient regions to generate the priority potential field.
[0133] The potential energy numerical matrix in the smoothed priority potential field basic data is read. This matrix represents the multidimensional coupling state of fusion behavior determinism, load urgency, and grid constraint relaxation. Density-based spatial clustering analysis is performed on the potential energy numerical matrix to identify boundary regions with significant potential energy gradient changes, dividing the continuous potential energy space into high-response, transition, and low-response regions. The local potential energy gradient vector of each user node within the clustered region is calculated, quantifying the potential energy difference between adjacent nodes. This difference directly reflects the relative intensity of the difference in scheduling priorities. A potential energy difference mapping function is constructed to nonlinearly map the difference value into priority weight coefficients, ensuring that high-deterministic, low-urgency loads and low-deterministic, high-urgency loads receive differentiated response gradients. The final priority potential field, containing the priority weight coefficients of each user node, is generated as the direct basis for dynamic power allocation.
[0134] By using equipotential surface clustering analysis and potential energy drop calculation, the smooth potential energy distribution from the previous step is transformed into priority potential field data with quantified differentiated response gradients, thereby achieving the expected technical effect of fine-grained differentiation of load priorities and dynamic pre-allocation in complex power consumption scenarios.
[0135] Step S6: Based on the priority potential field, perform dynamic power allocation operation to generate dynamic priority pre-allocation instructions for each user in the power metering box, and adjust the power supply quota of each branch according to the dynamic priority pre-allocation instructions to complete the dynamic pre-allocation of priorities. Specifically, this includes: S6.1: Obtain the priority potential field data generated by the previous steps and the real-time load status parameters of each branch in the power metering box. Use the multidimensional tensor mapping method to decouple the behavioral deterministic component, load urgency component and grid constraint relaxation component in the priority potential field to generate a set of potential gradient vectors containing the differentiated response gradients of each user node within the scheduling window.
[0136] Obtain the priority potential field data matrix and real-time load status parameters of each branch of the power metering box generated in the previous steps, including instantaneous power value, voltage amplitude, and remaining capacity margin. Perform dimensional analysis on the priority potential field data to separate the behavioral deterministic component tensor, the load urgency component tensor, and the grid constraint relaxation component tensor, ensuring that each component maintains strict alignment on the user node index. Construct a multidimensional tensor mapping operator to map the above three independent component tensors to a unified three-dimensional feature space, eliminating the numerical dominance effect caused by dimensional differences. Use the Jacobian matrix calculation method to calculate the partial derivative of the mapped joint potential energy function with respect to the power allocation variables of each user node, and calculate the potential energy gradient vector. Perform L2 norm normalization on the calculated original gradient vector to eliminate the influence of absolute numerical magnitude on scheduling sensitivity, generating a unit direction vector. Combine the real-time load change rate to dynamically weight the normalized gradient, enhance the response sensitivity to sudden load changes, and generate a set of potential energy gradient vectors containing the differentiated response gradients of each user node within the scheduling window. By using multidimensional tensor mapping and gradient decoupling, the static potential field from the previous step is transformed into a dynamic response gradient index, enabling the quantitative separation of the urgency and credibility of each user's power demand, and providing accurate input for subsequent fuzzy logic weight allocation.
[0137] S6.2: Receive the potential energy gradient vector set as input conditions, construct a dynamic weight allocation matrix based on fuzzy logic reasoning mechanism, perform normalization calculation and conflict resolution processing on the differentiated response gradient of each user in the potential energy gradient vector set, and generate a dynamic priority sorting sequence that represents the relative priority order of each user in the current scheduling period.
[0138] S6.3: Based on the dynamic priority sorting sequence and the total available power limit of the power metering box, the power quota iterative allocation operation is performed using the constraint satisfaction optimization method. High-priority users in the dynamic priority sorting sequence are mapped to high power supply weights, and the initial power supply quota instruction set for each user branch in the power metering box is calculated and generated.
[0139] The system receives dynamic priority ranking sequences and the total available power limit data of the power metering boxes, and constructs a constraint satisfaction optimization model with the objective of maximizing weighted satisfaction. The decision variable is defined as the user branch power quota vector, and the objective function is to maximize the sum of the products of each user's priority weight and allocated power.
[0140] The Lagrange multiplier method is used to handle the total power conservation constraint. An augmented Lagrange function is constructed to transform the hard constraint into a penalty term that is incorporated into the objective function, ensuring that the optimal solution is found within the power limit.
[0141] By taking the partial derivative of the Lagrange function with respect to the power quota of each user and setting it to zero, an analytical solution is derived in which the power allocation ratio is proportional to the priority weight, so that high-priority users can obtain a higher power share.
[0142] By introducing nonnegativity constraints and physical limits on maximum power for a single user, a projection gradient descent algorithm is used to iteratively update the power quota vector. After each iteration, the values exceeding the boundary are projected into the feasible region to ensure the physical validity of the solution.
[0143] The convergence threshold is set to the Euclidean distance between two adjacent iterations of the power allocation vectors being less than a preset precision value. When the convergence condition is met, the iteration is terminated, and a stable initial power supply quota instruction set is output.
[0144] By iteratively solving the constraint satisfaction optimization method, the dynamic priority ranking sequence is transformed into an initial power supply quota instruction set that conforms to the total grid capacity limit and reflects differentiated priorities, thereby achieving efficient and fair allocation of power resources.
[0145] S6.4: Monitor the physical boundary between the initial power supply quota instruction set and the hardware execution mechanism of the power metering box, and use a smooth transition filtering method to perform ramp rate limiting processing on the power values with sudden jumps in the initial power supply quota instruction set, so as to generate the final dynamic priority pre-allocation instruction that complies with electrical safety specifications and has smooth transition characteristics.
[0146] Receive the initial power supply quota instruction set generated by S6.3, and extract the target power value sequence of each branch in the current scheduling period T and the actual executed power value sequence of the previous period.
[0147] Calculate the power change of each branch during adjacent scheduling cycles, construct a power jump vector, and identify abrupt changes that exceed a preset safety threshold.
[0148] For the identified abrupt change components, a slope rate limiting filter is introduced, and a maximum allowable power change slope parameter is set. This parameter is determined based on the mechanical response characteristics of the intelligent circuit breaker in the power metering box and the load thermal stability time constant.
[0149] A first-order low-pass filter is used to smooth the abrupt component. The smoothing calculation is performed iteratively until the power command change rate of all branches is lower than the maximum allowable slope threshold, generating an intermediate power command sequence with continuous gradual change characteristics.
[0150] Verify whether the intermediate power command sequence meets the upper limit of the total power of the power metering box and the minimum maintenance power constraints of each branch. If there are any violations, scale the increment of each branch proportionally until the global constraints are met.
[0151] The output is a smoothed final dynamic priority pre-assignment instruction that complies with electrical safety regulations.
[0152] By using slope rate limiting filtering and global constraint verification, the abrupt power values existing in the previous step are transformed into smooth power command data that conforms to the physical constraints of the hardware actuator, thereby achieving the expected technical effects of eliminating current surges, protecting circuit breaker contacts, and improving power supply stability.
[0153] S6.5: Issue the final dynamic priority pre-allocation instruction to the intelligent circuit breaker controllers of each branch of the power metering box, and drive each branch intelligent circuit breaker controller to adjust the relay opening and closing duty cycle or output voltage amplitude according to the final dynamic priority pre-allocation instruction, so as to complete the real-time correction of the power supply quota of each branch to realize the dynamic pre-allocation of priority.
[0154] Receive the final dynamic priority pre-allocation instruction after smooth transition filtering, and parse the target power quota values of each branch and the corresponding execution time window identifier contained therein.
[0155] The analyzed target power quota is mapped to the pulse width modulation signal parameters of the intelligent circuit breaker. Based on the rated voltage level of the power metering box and the maximum allowable current of the branch, the theoretical duty cycle of the relay switch is calculated.
[0156] A discrete proportional-integral-derivative (PID) control method is adopted. By comparing the deviation between the real-time sampled power of the current branch and the target power quota, the duty cycle adjustment step size is dynamically adjusted to suppress power oscillation and obtain the duty cycle command.
[0157] The obtained duty cycle command is converted into a low-level hardware drive signal and transmitted to the actuator of each branch solid-state relay or smart circuit breaker through an opto-isolation module.
[0158] The drive actuator can quickly switch the circuit on and off according to a specified duty cycle, or adjust the output voltage amplitude in scenarios that support voltage regulation, thereby achieving precise clamping of the average power of the branch.
[0159] Real-time monitoring of branch current and voltage waveforms verifies whether the actual output power converges to the target quota. If an over-limit risk is detected, the emergency disconnection protection logic is immediately triggered.
[0160] Through the aforementioned closed-loop control mechanism, the abstract priority potential field potential energy difference is transformed into a specific physical power quota, thereby achieving millisecond-level dynamic pre-allocation and precise control of the power supply to each user branch.
[0161] Step S7: Receive misjudgment reason labels from maintenance personnel regarding significant decreases in satisfaction after scheduling execution; add these misjudgment reason labels as new edges to the electricity consumption behavior semantic graph; trigger local graph structure reconnection based on the new edges; and invoke the gradient projection-based local incremental update strategy to recalibrate the graph neural network to generate a corrected behavior prediction tensor. Specifically, this includes: S7.1: Obtain the misjudgment reason tags for the significant decrease in satisfaction after scheduling execution input by the operation and maintenance personnel through the mobile terminal interactive interface, and perform natural language semantic parsing processing on the misjudgment reason tags to extract structured semantic triple data containing user identity identifier, trigger event type and correction logic description.
[0162] S7.2: Based on the user identity identifier, trigger event type, and correction logic description in the structured semantic triple data, locate the corresponding user node and event node in the electricity consumption behavior semantic graph, and construct a directed new edge connecting the user node, event node, and newly generated correction label node to complete the graph mapping of misjudgment feedback information.
[0163] Receive the structured semantic triple data output by S7.1, extract the user identity field, perform hash matching retrieval in the node index library of the electricity consumption behavior semantic graph, locate the unique corresponding user node entity, and obtain the globally unique ID and attribute vector storage address of the user node in the current graph.
[0164] Based on the trigger event type field in the triple, the event ontology dictionary of the graph is queried. If the event type is an existing basic event type, the corresponding event node ID is directly reused; if it is a newly defined composite event type, a new event node is instantiated in the graph, and its timestamp attribute and event category label are initialized to generate the target event node object to be connected.
[0165] The text describing the correction logic in the triples is parsed, and the text is mapped into a high-dimensional semantic vector using a pre-trained semantic embedding model. This vector serves as the initial attribute feature for the newly generated correction label node. At the same time, a unique correction label node instance is created in the graph namespace and given a "human feedback" source label to distinguish it from automatically inferred edges.
[0166] Construct directed edges from user nodes to event nodes, define the edge type as "trigger association", initialize the edge weight to 1.0, representing the direct triggering relationship between the user and a specific event, and write the edge into the adjacency list structure of the graph to establish the topological connection between user behavior and specific events.
[0167] Construct directed edges from event nodes to correction label nodes, defining the edge type as "semantic correction". The edge weight is determined by the confidence score of the correction logic description. The semantic similarity is mapped to the 0-1 interval using the Sigmoid function, forming the weight assignment logic, as shown in the formula:
[0168] in, The weights after assignment. The semantic similarity score is given.
[0169] Construct directed edges from the corrected label node back to the user node. The edge type is defined as "feedback loop". This is used to pass gradient update signals in subsequent incremental learning, completing the full mapping of misjudgment feedback information from natural language description to graph topology.
[0170] Through the above multi-step node location, instantiation, and directed edge construction operations, the unstructured labels of reasons for misjudgment by operation and maintenance personnel are transformed into computable topological connections in the graph, realizing the graph-based mapping of misjudgment feedback information, and providing an accurate structured data foundation for subsequent local graph structure reconnection and model recalibration.
[0171] S7.3: Utilize the newly added edges to perform dynamic reconnection operations on the affected local topology in the electricity consumption behavior semantic graph, update the causal association weights and temporal dependencies between relevant nodes, and generate a corrected local subgraph structure that reflects the latest operation and maintenance feedback information.
[0172] It receives directed new edge data containing user nodes, event nodes, and correction label nodes, which serve as trigger signals for dynamic adjustment of the graph topology.
[0173] Based on the source and target node identifiers of the newly added edges, the affected local subgraph region is located in the adjacency matrix of the electricity consumption behavior semantic graph, and all directly connected first-order neighbor nodes and their associated edge sets within the region are extracted.
[0174] Traverse the set of first-order neighbor nodes, calculate the perturbation effect of the introduction of new edges on the original causal association weights, and redistribute the connection strength between adjacent nodes using the attention mechanism to generate a preliminary updated local weight matrix.
[0175] For temporal dependencies, the difference between the timestamp of the event represented by the newly added edge and the timestamp of the historical temporal path is compared. The weight coefficient of the relevant temporal edge is adjusted by the time decay function to reflect the coverage effect of the latest behavior on the historical pattern.
[0176] The updated local weight matrix is regularized using the graph Laplacian smoothing method to eliminate the severe weight oscillations caused by single-point feedback, thus ensuring the numerical stability and topological connectivity of the local subgraph structure.
[0177] The smoothed local weight matrix is mapped back to the corresponding position in the global electricity consumption behavior semantic graph, replacing the original old weight data, thus completing the dynamic reconnection operation of the local topology.
[0178] By using the above-mentioned dynamic reconnection and weight update processing methods, the misjudgment feedback from operation and maintenance personnel is transformed into a substantial correction of the graph structure, generating a corrected local subgraph structure that reflects the latest real user behavior logic, thereby enabling the graph to quickly adapt to non-periodic sudden behaviors and accumulate knowledge.
[0179] S7.4: Based on the difference in graph embedding before and after behavioral mutation extracted from the modified local subgraph structure, the minimum necessary parameter perturbation direction is calculated by calling the local incremental update strategy based on gradient projection, and the task adapter head parameters of the graph neural network are fine-tuned and updated to generate updated local model weights with error correction capabilities.
[0180] The system receives the node attribute matrix and the graph embedding vectors before and after the behavioral mutation in the corrected local subgraph structure as the input basis for updating the model parameters.
[0181] Extract the current weight parameter matrix of the task adapter part in the graph neural network, lock the parameter subspace range to be optimized, and ensure that the parameters of the global backbone encoder remain frozen.
[0182] The difference between the spectral embedding vector at the moment after the behavioral mutation and the spectral embedding vector at the moment before the behavioral mutation is calculated, and an error gradient vector representing the direction of the power consumption mode offset is generated.
[0183] We construct a loss function based on gradient projection to minimize prediction error while constraining the magnitude of parameter updates and preventing catastrophic forgetting.
[0184] The obtained parameter perturbation matrix is superimposed on the original weight parameters of the task adapter head, and a local fine-tuning update operation is performed.
[0185] The updated local model weights are regularized to ensure that the weight values are distributed within a preset stable range, thus avoiding gradient explosion or vanishing.
[0186] By adopting a local incremental update strategy based on gradient projection, the map structure correction information from the previous step is transformed into updated local model weights with error correction capabilities, thereby achieving rapid adaptation to sudden non-periodic electricity consumption behavior and restoration of prediction accuracy.
[0187] S7.5: Load the updated local model weights into the inference engine of the graph neural network, and re-perform forward propagation calculation on the graph subgraph slice at the current time to output a corrected behavior prediction tensor that eliminates previous misjudgment bias and adapts to the latest user behavior characteristics.
[0188] For those skilled in the art, various other corresponding changes and modifications can be made based on the technical solutions and concepts described above, and all such changes and modifications should fall within the protection scope of the claims of this invention.
[0189] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains. The terms “first,” “second,” “third,” and similar terms used in this patent application specification and claims do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms “an” or “a” and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms “comprising” or “including” and similar terms mean that the elements or objects preceding “comprising” or “including” encompass the elements or objects listed following “comprising” or “including” and their equivalents, and do not exclude other elements or objects. The “multiple” mentioned in the embodiments of this application refers to two or more. A and / or B indicate three possibilities: A; B; and A and B.
[0190] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for dynamic power allocation of electricity metering boxes based on load forecasting, characterized in that, Includes the following steps: S1: Obtain the original data of multi-dimensional electricity consumption behavior of users under the jurisdiction of the electricity metering box, and map the original data of multi-dimensional electricity consumption behavior into a heterogeneous data set; S2: Based on the causal relationships, co-occurrence relationships, temporal dependencies, and spatial proximity in the heterogeneous data set, construct a semantic graph of electricity consumption behavior; S3: Extract graph subgraph slices from the electricity consumption behavior semantic graph, input the graph subgraph slices into the graph neural network, extract features through the encoder and process them through the pluggable task adapter head to generate behavior prediction tensors; S4: Monitor whether there is a sudden event in the behavior prediction tensor. If so, extract the local subgraph consisting of the corresponding node and its first-order neighbors, calculate the minimum necessary parameter perturbation direction by combining the graph embedding difference before and after the behavior change, and execute the local incremental update strategy based on gradient projection to update the weights in the graph neural network. S5: Couple the behavior prediction tensor with the real-time load state and construct a ternary tensor based on behavior determinism, load urgency and grid constraint relaxation. Calculate and generate a priority potential field based on the ternary tensor. S6: Based on the priority potential field, perform dynamic power allocation operation, generate dynamic priority pre-allocation instructions for each user in the power metering box, and adjust the power supply quota of each branch according to the dynamic priority pre-allocation instructions to complete the dynamic pre-allocation of priorities.
2. The method for dynamic power allocation of electricity metering boxes based on load forecasting according to claim 1, characterized in that, Following step S6, the following steps are also included: S7: Receive the misjudgment reason labels marked by the operation and maintenance personnel for the significant decrease in satisfaction after scheduling execution, add the misjudgment reason labels as new edges to the electricity consumption behavior semantic graph, trigger the local graph structure reconnection based on the new edges, and call the local incremental update strategy based on gradient projection to recalibrate the graph neural network to generate the corrected behavior prediction tensor.
3. The method for dynamic power allocation of electricity metering boxes based on load forecasting according to claim 1, characterized in that, The raw data of the multidimensional electricity consumption behavior includes time-of-use power curves, switch event sequences, equipment start-up and shutdown tags, local short-term weather change data, and temporary load intention commands actively reported by user terminals.
4. The method for dynamic power allocation of electricity metering boxes based on load forecasting according to claim 1, characterized in that, The heterogeneous data set includes user nodes, device nodes, time period nodes, environmental factor nodes, and intent type nodes.
5. The method for dynamic power allocation of electricity metering boxes based on load forecasting according to claim 4, characterized in that, The electricity consumption behavior semantic graph uses user nodes, device nodes, time period nodes, environmental factor nodes, and intent type nodes as vertices.
6. The method for dynamic power allocation of electricity metering boxes based on load forecasting according to claim 1, characterized in that, The behavior prediction tensor includes each user's behavioral deterministic score and priority sensitivity coefficient within the future scheduling window.
7. The method for dynamic power allocation of electricity metering boxes based on load forecasting according to claim 1, characterized in that, The aforementioned abrupt change in electricity consumption behavior is defined as three consecutive events in which high-power loads are triggered during off-peak electricity consumption periods.
8. The method for dynamic power allocation of electricity metering boxes based on load forecasting according to claim 6, characterized in that, Step S5 specifically includes: Obtain the behavioral deterministic score data and priority sensitivity coefficient data from the behavioral prediction tensor. Perform normalization mapping processing on the behavioral deterministic score data to generate a standardized behavioral deterministic vector, and perform threshold truncation processing on the priority sensitivity coefficient data to generate an effective priority sensitivity vector, thereby obtaining a standard behavioral feature set. Real-time power load data and remaining capacity data of each branch of the power metering box are collected. The load change rate sequence is calculated based on the real-time power load data. The remaining capacity data is combined with the reciprocal weighted processing to generate the grid constraint relaxation vector, thereby obtaining the real-time state feature set. The multidimensional tensor product operator is used to perform three-dimensional spatial mapping based on the standard behavioral feature set and the real-time state feature set to generate an initial ternary tensor, thereby obtaining a coupled state data cube; Extract the dimensional data and pre-set power grid safety boundary parameters from the coupled state data cube, perform nonlinear potential function transformation on the coupled state data cube based on the power grid safety boundary parameters to introduce constraint penalty terms, and optimize the weight distribution of the constraint penalty terms to generate a corrected potential energy distribution matrix, thereby obtaining the basic data of the smooth priority potential field. Read the potential energy values in the basic data of the smooth priority potential field, perform equipotential surface clustering analysis on the potential energy values to identify different response gradient regions, and calculate the potential energy drop value based on the different response gradient regions to generate the priority potential field.
9. The method for dynamic power allocation of electricity metering boxes based on load forecasting according to claim 8, characterized in that, The load change rate sequence is calculated based on the real-time power load data, specifically as follows: The instantaneous load rate is calculated based on the real-time power load data, and time differentiation is performed to generate a load change rate sequence.
10. The method for dynamic power allocation of electricity metering boxes based on load forecasting according to claim 8, characterized in that, The process involves optimizing the weight distribution of the constraint penalty term to generate the corrected potential energy distribution matrix, specifically as follows: The weight distribution of the constraint penalty term is optimized using the gradient descent algorithm to generate a corrected potential energy distribution matrix.