Power consumer transaction traceability-oriented causal conduction path modeling method and system
By constructing a time series feature set of user behavior and a causal transmission path model, abnormal points of power users are identified, and typical behavior path clusters are generated. This solves the problems of accuracy and controllability in tracing the source of power users' electricity consumption behavior, and realizes accurate understanding and response analysis of user behavior.
Patent Information
- Application Number
- CN202511755482.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies for tracing abnormal electricity consumption behavior of power users are insufficient in accuracy, predictability, interpretability, and controllability, and are difficult to identify the causal transmission path and response pattern behind user behavior.
A time series feature set of user behavior is constructed, an anomaly detection model is used to identify the anomaly points, a multivariate causal graph is constructed based on the structural causal model, causal transmission paths are identified through intervention calculations, and typical behavior path clusters are generated using clustering algorithms, which are then matched in conjunction with adaptive review rules.
It enables precise tracing of abnormal behavior of electricity users, improves the accuracy of causal inference and the intelligence level of system decision-making, supports the targeted formulation of electricity pricing strategies and response incentive rules, and enhances the guiding effect of market signals.
Smart Images

Figure CN121660049A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power system optimization technology, and specifically relates to a causal transmission path modeling method for tracing the source of power user anomalies. Background Technology
[0002] With the continuous advancement of my country's power market reform, user participation and market responsiveness have significantly increased, and electricity pricing policies are gradually shifting from unified standards to market-oriented and personalized approaches. Against this backdrop, user electricity consumption behavior exhibits highly differentiated and dynamically evolving characteristics. Policy adjustments, price fluctuations, and external events can all trigger nonlinear anomalies in user behavior. These anomalies not only affect grid dispatch and market stability but also pose challenges to the accuracy of volume-based billing. Therefore, it is urgent to construct a causal transmission path modeling method for user behavior anomalies, conduct source analysis from the origin of behavior, extract the impact chain, and support accurate metering and intelligent accounting.
[0003] In the field of user behavior prediction, Chinese invention patent application CN106529711A discloses a user behavior prediction method and apparatus. The method includes: collecting behavior record data from at least two users; clustering the behavior record data of each user to form multiple clusters; filtering the multiple clusters corresponding to each user to obtain a long-term behavior feature cluster for each user; and determining the similarity between users based on the long-term behavior feature cluster for each user, thereby predicting user behavior. This disclosure utilizes the long-term behavior feature cluster of a single user to obtain similar users for predicting user behavior, enabling more accurate and refined behavior prediction for individual users; it also filters out short-term behaviors in user behavior, improving prediction accuracy.
[0004] However, due to the complex evolution of user electricity consumption behavior, frequent adjustments to the electricity price mechanism, and the hidden impact path of user behavior, existing research on the transmission mechanism and causal tracing between electricity factors and user electricity consumption behavior still faces the following challenges: (1) Complex evolution of user electricity consumption behavior, lack of systematic modeling support for tracing abnormal behavior. The behavior patterns of electricity users are affected by multiple factors such as policy guidance, industrial activities, holidays, and weather changes, exhibiting a coexistence of periodicity and suddenness. Existing analysis methods mostly remain at the level of statistical changes, lacking in-depth exploration of the evolution mechanism behind user behavior, making it difficult to accurately determine the causal chain and impact path of abnormal behavior. (2) Frequent adjustments to the electricity price mechanism, resulting in severe differentiation in user response effects. In pilot areas of market-based electricity pricing, time-of-use pricing policies and spot market prices are promoted in parallel, and users' perception and response capabilities to different pricing strategies vary significantly. On the one hand, some users arbitrage by flexibly scheduling loads based on spot market signals; on the other hand, some small and medium-sized users react slowly to policy changes, exhibit strong behavioral inertia, and find it difficult to achieve the expected guidance goals. At present, a systematic response evaluation mechanism based on user characteristics, scenario adaptation and historical behavior has not been formed. The accuracy of causal inference behind abnormal events is low, which is not conducive to scientifically judging the specific impact path of price mechanism adjustment on behavior patterns and restricts the evaluation and optimization of electricity price guidance capabilities. (3) The impact path of user behavior is hidden and the causal relationship is difficult to mine. Changes in electricity consumption behavior are often driven by the interaction of multiple potential factors and have multiple lag effects and nonlinear paths. Traditional regression analysis is difficult to identify the real causal structure. In this context, how to effectively characterize the propagation path, response mode and main influencing factors of user abnormality by using artificial intelligence methods such as graph modeling and causal reasoning, and build a causal transmission model with interpretability, simulation and controllability, is the key technical bottleneck to realize intelligent understanding and accurate tracing of user behavior. Summary of the Invention
[0005] This invention provides a causal transmission path modeling method and system for tracing the source of power user anomalies, aiming to solve the problems of insufficient accuracy, lack of predictability, interpretability and controllability in existing technologies.
[0006] To address the aforementioned technical problems, this invention proposes a causal transmission path modeling method for tracing anomalies in power users, comprising the following steps: Constructing a time series feature set of user behavior based on multi-source data; A change point detection model is used to identify behavioral anomalies and anomaly intervals in the feature set. For behavioral anomalies, a multivariate causal graph is constructed based on a structural causal model, and intervention calculations are used to identify and quantify the causal transmission path from external influencing factors to user behavioral anomalies. The causal transmission path is vectorized, and a clustering algorithm is used to perform pattern recognition on the causal transmission path under multiple users and multiple scenarios to obtain typical behavior path clusters. Based on the prediction results of the typical behavior path clusters and behavior transmission simulation, a matching model between user behavior patterns and review rules is constructed.
[0007] Preferably, the method further includes the following steps: using a reinforcement learning mechanism to adaptively optimize and personalize the review rules, thereby achieving dynamic adaptation between user behavior patterns and review rules.
[0008] Preferably, the multi-source data includes user load data, electricity purchase curves, contract information, electricity pricing strategy records, weather information, and holiday markers.
[0009] Preferably, the method for constructing the feature set is as follows: Integrate multi-source heterogeneous data based on a timeline to construct a standardized behavioral time series; set trigger points for electricity price policy adjustment events. And extract user behavior features before and after the event using a sliding time window method. The formula is as follows:
[0010] In the formula, Indicates user A set of behavioral characteristics For the first The value of the class feature at time point t, The sliding window width is used to generate high-dimensional time-series sample data that can be used for causal analysis through normalization, missing value imputation, and multimodal feature fusion.
[0011] Preferably, the change point detection model is modeled based on the cumulative sum of residual variances and the Bayesian online change point detection algorithm. The modeling representation of the cumulative sum method is as follows:
[0012] In the formula, Represents the cumulative deviation function. For the first time series One basic data point, The mean of the historical behavior sequence; , To set the trigger point time, The width of the sliding window is set; when When the cumulative sum exceeds the set threshold, the corresponding data point in the time series is determined to be an outlier.
[0013] Preferably, the method for generating the causal transmission path is as follows: The multivariate causal graph is constructed using a directed acyclic graph G=(V,E), where node V represents a set of variables including electricity price, time period, temperature and user behavior, and edge E represents a potential causal path between variables. Introduce the user response dependent variable Y, the causal variable X, and the mediator variable M to construct a causal relationship:
[0014]
[0015] In the formula, and As a potential unobserved factor, and These represent stable and invariant causal mechanisms or generation rules that map their respective causal variables to their outcome variables; The Do calculus was used to solve the response distribution P(Y|do(X)) of the user response dependent variable Y after intervention, in order to identify and quantify the direct and indirect action paths, and to screen out the dominant causal pathways based on the quantification results.
[0016] Preferably, the method for identifying and quantifying direct and indirect action paths is as follows: Introducing a latent unobserved factor that is strongly correlated with the causal variable X. , Independent instrumental variable Z; The causal variable X is fitted based on the instrumental variable Z to obtain the predicted value of X. The fitted model is:
[0017] Where W is the observed covariate. The coefficients to be estimated are... This is the error term; Using predicted values To estimate the user response dependent variable Y and correct for causal effects, the estimation model is as follows:
[0018] in As the corrected target causal effect, as a quantification result, The coefficients to be estimated are... This is the error term.
[0019] Preferably, the method for generating the typical behavior path cluster is as follows: The causal transmission path is transformed into a high-dimensional vector representation using a causal path embedding encoding method. A hierarchical clustering algorithm is used to perform pattern recognition with the goal of minimizing the sum of squared distances between each vector within a cluster and the cluster center vector, thereby obtaining the typical behavioral path clusters. The pattern recognition method is specifically as follows:
[0020] In the formula, Indicates the first Causal path clusters, The class center vector, This is the preset number of clusters.
[0021] Preferably, the method for constructing the matching model is as follows: For different user groups, rule matching functions are constructed based on their typical behavior paths, response time latency characteristics, and consumption elasticity parameters:
[0022] in, For users In time The corresponding adaptation rule set, For user behavior characteristics, For the user's main causal path set, For the pre-defined set of rule candidates in the strategy library, This is a rule selection function based on path similarity and influence strength.
[0023] On the other hand, the present invention also proposes a causal transmission path modeling system for tracing the source of power user anomalies, the system being used to implement the modeling method as described in the first aspect of the present invention, including: The feature construction module is used to construct time series feature sets of user behavior based on multi-source data; Anomaly detection module is used to identify behavioral anomalies and anomaly intervals in the feature set using a change point detection model; The causal path construction module is used to construct a multivariate causal graph based on a structural causal model for the aforementioned behavioral anomalies, and to identify and quantify the causal transmission path from external influencing factors to user behavioral anomalies through intervention calculations. The pattern recognition module is used to vectorize the causal transmission path and use a clustering algorithm to perform pattern recognition on the causal transmission path under multiple users and multiple scenarios to obtain typical behavioral path clusters. The rule matching module is used to construct a matching model between user behavior patterns and review rules based on the prediction results of the typical behavior path clusters and behavior transmission simulation.
[0024] Compared with the prior art, the present invention has the following technical effects: 1. The modeling method proposed in this invention constructs a time-series feature set of user behavior and integrates multi-source heterogeneous data, such as electricity trading data, electricity price change information, meteorological indicators, and holiday factors, to systematically characterize the periodicity, suddenness, and evolutionary trend of user behavior. Based on this, by utilizing change detection and causal modeling techniques, a complete chain from anomaly identification to source tracing is formed, achieving a panoramic reconstruction of abnormal events and significantly improving the systematicness and accuracy of identifying the causes of behavioral changes.
[0025] 2. The modeling method proposed in this invention introduces a user behavior causal transmission path construction method based on structural causal modeling. Combining user feature tags, historical response patterns, and scenario conditions, it accurately identifies the response chain triggered by electricity price changes. Through causal path clustering and simulation, it enables predictive analysis of the response capabilities and behavioral evolution trends of different user groups, supports the development of targeted electricity pricing strategies and response incentive rules, strengthens the guiding effect of market signals, and achieves predictable, interpretable, and controllable user-side responses.
[0026] 3. The modeling method proposed in this invention employs a combination of graph neural networks and structural causal reasoning to model and mine the nonlinear and multi-lag relationships hidden in user behavior. It constructs an interpretable causal transmission path graph, effectively identifying the dominant variables and their transmission mechanisms behind behavioral anomalies. Combined with an adaptive review rule matching mechanism, it achieves accurate understanding and real-time response to complex behavioral events, improving the accuracy of causal inference while enhancing the system's decision-making intelligence. Attached Figure Description
[0027] Figure 1 This is a flowchart illustrating the modeling method described in this invention. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with specific embodiments of the present application and with reference to the accompanying drawings.
[0029] Example 1 This embodiment presents a causal transmission path modeling method for tracing anomalies in power users, such as... Figure 1 As shown, it includes the following steps one through five: Step 1: Construct a time series feature set of user behavior based on multi-source data.
[0030] In this embodiment, the multi-source data includes user load data, electricity purchase curves, contract information, electricity pricing strategy records, weather information, and holiday markers.
[0031] The specific method for constructing the feature set is as follows: Integrate multi-source heterogeneous data based on a timeline to construct a standardized behavioral time series; set trigger points for electricity price policy adjustment events. And extract user behavior features before and after the event using a sliding time window method. The formula is as follows:
[0032] In the formula, Indicates user A set of behavioral characteristics For the first The value of the class feature at time point t, The sliding window width is used to generate high-dimensional time-series sample data that can be used for causal analysis through normalization, missing value imputation, and multimodal feature fusion.
[0033] This embodiment aims to explain in detail how to construct a standardized, multi-dimensional time series feature set for a specific electricity user before and after a specific event, which can be used for subsequent causal analysis.
[0034] As an example of this embodiment, the following scenario is set up: Analysis subject: A large manufacturing enterprise, denoted as User A. This user has strong production planning capabilities and is highly sensitive to electricity prices; Key event: The local government released a new time-of-use electricity pricing policy, which officially took effect at midnight on July 1, 2024. This event is defined as the trigger point. .
[0035] Analysis Window: To fully capture behavioral changes before and after policy implementation, a sliding window width w is set to 30 days. Therefore, the analysis time interval is... That is, from June 1, 2024 to July 30, 2024.
[0036] First, collect and integrate multi-source heterogeneous data related to user A. This data specifically includes: User load data, obtained from the user-side system, shows the electricity load data (kW) recorded by user A every 15 minutes during the above time period. Electricity purchase curve, obtained from the power trading center, is the electricity purchase curve (kWh) of user A's daily declaration for the next 24 hours. Contract information: User A's annual contract with the electricity sales company, extracting key constraint information such as maximum demand and monthly electricity packages; Electricity pricing strategy records detail the peak, flat, valley, and peak time periods and corresponding electricity price standards (yuan / kWh) for the new and old time-of-use electricity pricing policies. Weather information is obtained from public meteorological service platforms, including daily maximum / minimum temperature (°C) and average humidity (%) for the region. Holiday marking is performed based on the national calendar to indicate whether each day within the analysis period is a weekday, weekend, or statutory holiday.
[0037] Subsequently, all data are aligned using hours as the unified time granularity to form a preliminary time series data table, such as aggregating 15-minute load data into an hourly average load.
[0038] Around the trigger point (00:00 on July 1, 2024) and window width w (30 days) are used to extract the behavioral characteristics of user A. At this time, the range of the time variable t is [00:00 on June 1, 2024, 23:00 on July 30, 2024].
[0039] Extracted features Example: Hourly average load – the average power consumption of user A at time t. Peak-valley load difference – the difference between the highest and lowest load of user A on the natural day t, used to measure load fluctuation. Declaration-Actual Deviation Rate—The percentage difference between user A's actual electricity consumption and declared electricity purchase amount at time t. Hourly electricity price – the electricity price at time t recorded according to the electricity pricing strategy. The highest temperature of the day—the highest temperature of the natural day at time t. Holiday type - the type of day at time t (e.g., 0 - weekday, 1 - weekend, 2 - statutory holiday). .
[0040] This ultimately forms the set of behavioral characteristics for user A. Its formalized expression is as follows:
[0041] in, .
[0042] To generate high-quality data that can be directly used for subsequent analysis, the extracted original feature set is preprocessed, such as normalization, missing value imputation, and multimodal feature fusion.
[0043] For numerical features such as hourly average load and daily maximum temperature, normalization is performed using the max-min normalization method to scale their numerical range to the [0,1] interval to eliminate the influence of dimensions. Missing value imputation is performed using the average load at the same time point before and after the given date. Multimodal feature fusion encodes categorical features such as holiday types using one-hot encoding, converting them into binary vectors that can participate in calculations. Finally, all processed numerical and categorical features are concatenated on the time axis.
[0044] Following the above steps, a high-dimensional time-series sample matrix was generated for User A. Each row of this matrix represents one hour, and each column represents a feature dimension, providing a complete and standardized description of the user's multi-dimensional behavioral dynamics and external environment over the 60 days before and after the electricity price policy adjustment. This matrix will serve as the direct input for steps two and three, providing a solid data foundation for accurately tracing user behavioral anomalies.
[0045] Step two involves using a change point detection model to identify behavioral anomalies and their intervals within the feature set. In this embodiment, the change point detection model is based on the Cumulative Sum (CUSUM) method combined with a Bayesian online change point detection algorithm.
[0046] Specifically, this step aims to analyze the standardized time series feature set generated in step one to accurately identify the starting point and impact range of user A's behavioral anomalies after the electricity price policy adjustment (trigger point).
[0047] The input data comes from the high-dimensional time series sample matrix constructed for user A in step one, with a time range from June 1 to July 30, 2024.
[0048] In a preferred embodiment of the present invention, this embodiment uses a cumulative summation method based on residual variance for modeling to detect whether key indicators of user behavior have undergone systematic shifts. Specifically, the modeling representation of the cumulative summation method is as follows:
[0049] In the formula, Represents the cumulative deviation function. For the first time series One basic data point, The mean of the historical behavior sequence; , To set the trigger point time, The width of the sliding window is set; when When the cumulative sum exceeds the set threshold, the corresponding data point in the time series is determined to be an outlier.
[0050] To sensitively capture user responses to time-of-use pricing policies, this embodiment selects the daily peak-valley load difference as the core analysis sequence from the feature set generated in step one. This indicator effectively reflects whether users are reducing electricity costs through peak shaving and valley filling. Therefore, It is a time series containing 60 data points, where t represents each day from June 1st to July 30th.
[0051] Before calculation, the mean of the historical behavior sequence needs to be determined. This embodiment selects data from the period prior to policy implementation, namely June 1st to June 30th, 2024 (30 days in total), as the historical baseline, and calculates the average daily peak-valley load difference over these 30 days:
[0052] Assuming that calculations show that This value represents the average daily load fluctuation level of user A under the old electricity pricing policy.
[0053] After obtaining the average value, the CUSUM statistic needs to be applied for anomaly detection, starting from the trigger point. Starting from July 1st, this embodiment calculates the cumulative deviation function daily. .
[0054] July 1st: Calculate the peak-to-valley difference for the day. Assuming the power is 5100kW; then ; July 2nd: Calculate the peak-to-valley difference for the day. Assuming the user begins to adjust, and the peak-to-valley difference is 4800kW on that day; then ; This process continues until July 30th.
[0055] Finally, based on the standard deviation of the historical baseline data (June data), set a reasonable cumulative sum threshold h. For example, h can be set to 5 times the baseline standard deviation, assuming the calculated h = 12000.
[0056] Continuous monitoring during daily calculations Does it exceed h? Assuming the calculation continues until July 8th, what is the cumulative deviation? The absolute value exceeded the threshold of 12000 for the first time.
[0057] According to the determination rules, this embodiment identifies July 8, 2024 as the point of significant change in user A's behavior pattern. This indicates that after an adaptation period of approximately one week, the user's load adjustment behavior began to exhibit systematic and statistically significant changes.
[0058] Based on the identified anomalies, this embodiment defines the period [2024-07-08, 2024-07-30] as the behavioral anomaly interval. To quantify the magnitude of the behavioral differences, average feature vectors for two time periods are constructed: a baseline behavioral vector—the mean vector of all features within the interval [2024-06-01, 2024-06-30]; and an anomaly behavioral vector—the mean vector of all features within the interval [2024-07-08, 2024-07-30].
[0059] Calculate the Euclidean distance between these two high-dimensional vectors to obtain a quantitative index that comprehensively reflects the overall change in users across multiple dimensions, including load, electricity purchasing habits, and response patterns.
[0060] In another embodiment of the invention, the change point detection model in this step is based on a Bayesian online change point detection algorithm. The Bayesian online change point detection algorithm analyzes the sequence generated in step one to identify behavioral anomalies in user A. The input data is the same as in the CUSUM embodiment, using the daily peak-valley load difference time series of user A generated in step one. The time frame is from June 1 to July 30, 2024.
[0061] The core idea of the Bayesian online change point detection algorithm differs from CUSUM's threshold-based approach. It describes the probability of a change point occurring using probability. The algorithm maintains a confidence distribution in real time, which is the run length from the previous change point at the current time t. For each new data point... The algorithm updates this confidence distribution. If the new data point differs significantly from the historical data pattern, the probability of a run length of 0 will increase dramatically.
[0062] Specifically, before the analysis begins (t=0), since there is no data, the model assumes that the probability of the run length being 0 is 100%.
[0063] Starting from July 1, 2024 (the policy implementation date), the algorithm will receive new daily peak-valley load difference data points every day. And execute the following update loop: predict the distribution at the current time step based on the run length distribution at the previous time step; receive new data points. Using the new data points, Bayes' theorem is used to calculate the updated posterior probability of the run length. This posterior probability distribution quantifies the confidence level at time t with run length r. If If it matches the previous data pattern well, then the probability of r+1 will increase. If The data pattern is very different from the previous one, so the probability of r=0 will increase significantly.
[0064] In the update loop, the posterior probability of a run length of 0 is continuously monitored. Between July 1st and July 7th, user behavior did not change significantly. The pattern is largely consistent with historical data from June, therefore It has consistently remained at a very low level. Assuming that after inputting data from July 8, 2024, the data point representing the peak-to-valley difference for that day deviates significantly from the statistical model used in June, the updated model calculates... The probability value for this value soared to 0.98, far exceeding the probability for all other run lengths.
[0065] When the probability of a run length of 0 becomes the highest and exceeds a high confidence threshold, the corresponding time, July 8, 2024, is determined to be a behavioral anomaly point.
[0066] This embodiment also successfully identified the behavioral anomaly point of user A as July 8, 2024 by using the Bayesian online change point detection algorithm. The subsequent definition of the anomaly interval and the difference quantification process are the same as those in the CUSUM embodiment.
[0067] Compared to the CUSUM method, the Bayesian online change point detection algorithm not only provides a yes / no judgment, but also gives the probability of the change point occurring at each time step, providing richer information. Furthermore, this algorithm is naturally suitable for real-time monitoring scenarios of data streams and is generally less sensitive to preset thresholds than the CUSUM method.
[0068] Step 3: For behavioral anomalies, construct a multivariate causal graph based on a structural causal model, and identify and quantify the causal transmission path from external influencing factors to user behavioral anomalies through intervention calculations.
[0069] In this embodiment, the method for generating the causal transmission path is as follows: Specifically, the core objective of this step is to delve into and quantify the causal transmission path between the external factor of the new time-of-use pricing policy and the behavioral anomaly of the reduced peak-valley load difference for user A, based on the behavioral anomaly interval [2024-07-08, 2024-07-30] identified in step two. The input data includes the high-dimensional time-series sample data covering the entire analysis window constructed in step one, as well as the anomaly point (July 8th) and anomaly interval identified in step two.
[0070] First, a directed acyclic graph (DAG) is defined to describe the potential causal relationships between the variables. In this embodiment, a DAG G=(V,E) is used to construct the multivariate causal graph, where node V represents a set of variables including electricity price, time period, temperature, and user behavior, and edge E represents a potential causal path between variables.
[0071] As an example, the node set V includes the new electricity pricing policy X, daily maximum temperature T, working day W, production plan adjustment M, and daily peak-valley load difference Y. Here, X is a binary variable, 0 before July 1st (old policy) and 1 after July 1st (new policy); T is a continuous variable that may affect production heat dissipation and air conditioning load, representing a potential confounding factor; W is a binary variable, 1 representing a working day and 0 representing a weekend / holiday, affecting production plans; M is a potential mediating variable indicating whether users have adjusted the operating time of high-energy-consuming equipment; and Y is the core outcome variable, directly reflecting changes in the user's load curve.
[0072] The edge set E represents potential causal paths, including: X→M: The implementation of the new electricity pricing policy prompts users to adjust their production plans to reduce costs; M→Y: Adjustments to production plans (such as moving high-energy-consuming equipment to valley operation) directly lead to a reduction in the daily peak-valley load difference; T→Y: Rising temperatures will increase daytime air conditioning load, which may directly increase the peak-valley difference, counteracting the policy's effects; W→M: Whether it is a working day directly determines the basic production plan; X→Y: Whether there are other direct impact paths of the policy that do not involve adjustments to production plans.
[0073] Next, the causal graph is transformed into a mathematical equation to describe the generation mechanism between variables. This embodiment introduces the user response dependent variable Y, the causal variable X, and the mediator variable M to construct a causal relationship:
[0074]
[0075] In the formula, and As a potential unobserved factor, and Each represents a stable and invariant causal mechanism or generation rule that maps its respective causal variable to its outcome variable. Finally, the Do-Calculus is used to solve the response distribution P(Y|do(X)) of the user's response dependent variable Y after intervention, in order to identify and quantify the direct and indirect action paths, and to screen out the dominant causal pathway based on the quantification results.
[0076] The goal is to calculate the difference between P(Y|do(X=1)) and P(Y|do(X=0)). P(Y|do(X=0)) represents the peak-to-trough difference in user data if the new policy (do(X=1)) is enforced on all samples, compared to the case where the new policy is enforced on none (do(X=0)). This calculation method effectively eliminates the interference of confounding factors (such as temperature T). Through model calculation, this embodiment obtains the following causal effects: Overall causal effect: The overall change in peak-to-valley difference after the implementation of the new policy; Natural direct effect: X→Y; the impact of policy change alone, even if users do not adjust their production plans. Natural indirect effects: X→M→Y. The impact resulting from changes in user production plans.
[0077] The analysis results show that approximately 90% of the total causal effect comes from natural indirect effects, indicating that the new electricity pricing policy mainly reduces the daily peak-valley load difference by prompting user A to actively adjust its production plan. X→M→Y was identified as the dominant causal pathway for this behavioral anomaly. The model quantifies that the implementation of the new policy (do(X=1)) can lead to an average decrease of 800kW in user A's daily peak-valley load difference.
[0078] In another embodiment of the present invention, the method for generating the quantization result is as follows: Introducing a latent unobserved factor that is strongly correlated with the causal variable X. , Independent instrumental variable Z; The causal variable X is fitted based on the instrumental variable Z to obtain the predicted value of X. The fitted model is:
[0079] Where W is the observed covariate. The coefficients to be estimated are... This is the error term; Using predicted values To estimate the user response dependent variable Y and correct for causal effects, the estimation model is as follows:
[0080] in As the corrected target causal effect, as a quantification result, The coefficients to be estimated are... This is the error term.
[0081] Step four involves vectorizing the causal transmission path and using a clustering algorithm to perform pattern recognition on the causal transmission paths across multiple users and scenarios, resulting in typical behavioral path clusters. This step aims to generalize the causal path identified for a single user (User A) in Step three by clustering it with the causal paths of other users within the power grid, thereby uncovering common user behavior response patterns, i.e., typical behavioral path clusters. Input data includes the dominant causal pathway X→M→Y identified for User A in Step three, along with its quantitative indicators (path strength 90%, response delay 8 days, effect -800kW), and the respective causal transmission paths and quantitative indicators generated for a large number of other users within the power grid (such as Users B, C, D, etc.) through the same process from Step one to Step three.
[0082] In this embodiment, the method for generating the typical behavior path cluster is as follows: The causal path embedding coding method is used to transform the causal transmission path into a high-dimensional vector representation; specifically, the causal path of each user is transformed into a high-dimensional vector that can be mathematically computed. The dimensions of this vector are composed of key features of the path: Dimension 1, Path Strength - the percentage of the total effect caused by indirect effects (through mediating variables); Dimension 2, Response Elasticity - the load change (kW) caused by a change in unit electricity price (yuan / kWh); Dimension 3, Response Amplitude - the absolute average change of core indicators (such as peak-valley difference) within the period of behavioral anomalies; Dimension 4, Response Delay - from policy implementation (… The time span (days) from the point of behavioral change to the point of behavioral change.
[0083] Based on this rule, path vectors are generated for different users: User A, as analyzed in step three, has a path of X→M→Y, and the vector... =[0.90,-50.5,-800,8]; User B's path may be X→Y, meaning it primarily responds directly by reducing the air conditioning load, without any obvious intermediate process, vector =[0.10,-15.2,-150,2]; User C has a rigid electricity load, is insensitive to price, and no significant anomalies were detected; Vector =[0,0,0,∞].
[0084] A hierarchical clustering algorithm is used to perform pattern recognition with the goal of minimizing the sum of squared distances between each vector within a cluster and the cluster center vector, thereby obtaining the typical behavioral path clusters.
[0085] The pattern recognition method is specifically as follows:
[0086] In the formula, Indicates the first Causal path clusters, The class center vector, This is the preset number of clusters.
[0087] In this embodiment, path vectors have been generated for 1000 industrial and commercial users. The number of clusters, k, needs to be preset. Through preliminary phylogenetic analysis, this embodiment finds that dividing the user group into k=3 categories results in the most significant intra-cluster similarity and inter-cluster differences. A clustering algorithm is then used to process the 1000 path vectors. Assigned to 3 clusters In this way, the objective function of the pattern recognition method is minimized.
[0088] After clustering, three typical behavioral path clusters were obtained.
[0089] Cluster 1: Price-driven - Production scheduling type (C1), center vector =[0.85,-45.0,-750,7], its behavioral anomalies are mainly driven by the indirect path of electricity price → production plan adjustment → load transfer, with a large response range and elasticity, but there is a certain delay in decision-making and adjustment.
[0090] Cluster 2: Price-driven - Direct load reduction type (C2), center vector =[0.20,-18.0,-200,3], its behavior change path is more inclined to direct response, such as adjusting air conditioning, lighting, etc., with fast response speed, but limited amplitude and flexibility.
[0091] Cluster 3: Behavioral inertia-price insensitive type (C3), center vector =[0.01,-0.5,-10,∞], For users with rigid loads such as data centers and hospitals, their behavior patterns are basically unaffected under the current electricity price incentives.
[0092] Based on clustering, the center vector of cluster C1 is selected. The typical user group is simulated in a simulation environment to respond to a new future electricity pricing policy (such as the introduction of a "peak electricity price"). Using a Markov decision process, the state transition probabilities between maintaining the original plan and shifting peak load are simulated, ultimately outputting a set of predicted behavioral paths. The prediction results show that under the "peak electricity price," this type of user will further shift approximately 15% of their peak load to the nighttime.
[0093] Step 5: Based on the predicted results of the typical behavior path clusters and behavior transmission simulation, construct a matching model between user behavior patterns and audit rules. The core objective of this step is to utilize the analysis results from the previous steps to construct and match optimal electricity bill auditing and metering accounting rules for different types of user groups, thereby improving the accuracy and efficiency of settlement.
[0094] The input data includes: the typical behavioral path clusters output in step four, namely price-driven production scheduling type (C1), price-driven direct load reduction type (C2), and behavioral inertia-price insensitive type (C3); the behavioral transmission simulation prediction results output in step four, such as predicting that C1 users will further shift load under the future "peak electricity price" policy; the complete feature and causal path profiles constructed for individual users in steps one to three, such as the profile of user A, which clearly indicates that it belongs to the C1 cluster; and a preset audit rule strategy library (C), which contains a variety of audit rules for different scenarios, such as routine statistical verification rules, key period load anomaly early warning rules, and relaxed tolerance rules for declaration-actual deviation.
[0095] In this embodiment, the method for constructing the matching model is as follows: For different user groups, rule matching functions are constructed based on their typical behavior paths, response time latency characteristics, and consumption elasticity parameters:
[0096] in, For users In time The corresponding adaptation rule set, For user time Real-time behavioral characteristics For the user's main causal path set, For the pre-defined set of rule candidates in the strategy library, This is a rule-based selection function based on path similarity and influence strength. This function will select each user in the power grid... At a specific time Dynamically select the most suitable set of review rules. . The core logic of the function is based on matching path similarity with influence intensity. It first... Determine which cluster the user belongs to, and then combine real-time features with the rules in the corresponding rule subset of that cluster. Make the optimal choice.
[0097] After completing step five, the model can be used to predict power fluctuations in real time.
[0098] For example, for users in cluster C1 (user A, production scheduling type), abnormal behavior is mainly due to planned production adjustments, not metering failures. Their reported load curves may deviate significantly from actual load during the policy adaptation period. The strategy library C will prioritize selecting the following for user A: during the adaptation period after policy implementation (e.g., one month), appropriately relax the assessment threshold for the deviation between their electricity purchase curve and actual electricity consumption; and focus on whether their load during peak and valley periods undergoes a systematic shift consistent with the declared direction, rather than random fluctuations.
[0099] For C2 cluster users (user B, direct reduction type), these users respond quickly, their behavior changes directly, and they are easier to predict. Function The system will select: If the load does not decrease as expected during peak hours after the implementation of the new policy, an early warning will be triggered, indicating that there may be substandard behavioral response or abnormal metering.
[0100] For users in cluster C3 (user C, with inertial behavior), these users exhibit stable behavior unaffected by electricity prices; any large fluctuations could be considered abnormal. (Function) The following criteria will be applied: a rigorous routine check will be performed using traditional statistical control charts based on historical data (such as mean-range charts), and any fluctuations that exceed the historical range should be marked as high-priority anomalies.
[0101] In one embodiment of the present invention, the rule candidate set C consists of a set of updatable parameter templates. Each template defines a general logic for a rule and configures a learnable weight or an adjustable threshold for the rule, so that the whole is trainable, transferable and scalable.
[0102] To better illustrate this, here are two example rule templates from the policy library C.
[0103] Rule Template 1: Load-Declaration Deviation Threshold Rule logic: ; Adjustable parameter: Threshold For users in cluster C1 (production scheduling type), the initial threshold value may be set relatively high; while for users in cluster C3 (behavioral inertia type), it is set very strictly. During reinforcement learning, the system will automatically fine-tune the threshold for each user cluster based on historical false positive and false negative rates. value.
[0104] Rule Template 2: Peak-Valley Response Pattern Matching Rule logic: ; Adjustable parameter: similarity threshold ; Learnable weights This indicates the weight of this rule in the overall review decision. For example, the weight of this rule for price-sensitive C1 cluster users. They can become very high through learning because their behavior patterns are highly correlated with electricity pricing policies.
[0105] In another embodiment of the present invention, the method further includes step six: using a reinforcement learning mechanism to adaptively optimize and personalize the review rules, thereby achieving dynamic adaptation between user behavior patterns and review rules.
[0106] After the model is deployed and running, a feedback loop is introduced to continuously optimize the rules through a reinforcement learning mechanism. State represents the current user's behavioral characteristics. And its associated path cluster. An action represents selecting a set of auditing rules from the policy library. And it is applied. The reward indicates that if the rule is applied and a genuine measurement error is successfully identified (+1 reward), or a normal behavior adjustment is accurately passed (+0.5 reward), a negative reward is given if an error is missed (-1 penalty) or a normal adjustment is misjudged as an anomaly (-0.5 penalty). The reinforcement learning agent learns and optimizes the rule selection function through continuous state-action-reward cycles. Its internal parameters enable it to make more accurate rule matching decisions in the future, achieving dynamic self-adaptation of review rules.
[0107] Example 2 This embodiment is a causal transmission path modeling system for tracing anomalies in power users. The system is used to implement the modeling method described in Embodiment 1, including: The feature construction module is used to construct time series feature sets of user behavior based on multi-source data; Anomaly detection module is used to identify behavioral anomalies and anomaly intervals in the feature set using a change point detection model; The causal path construction module is used to construct a multivariate causal graph based on a structural causal model for the aforementioned behavioral anomalies, and to identify and quantify the causal transmission path from external influencing factors to user behavioral anomalies through intervention calculations. The pattern recognition module is used to vectorize the causal transmission path and use a clustering algorithm to perform pattern recognition on the causal transmission path under multiple users and multiple scenarios to obtain typical behavioral path clusters. The rule matching module is used to construct a matching model between user behavior patterns and review rules based on the prediction results of the typical behavior path clusters and behavior transmission simulation.
[0108] In another embodiment of the present invention, the system further includes a reinforcement learning module, which uses a reinforcement learning mechanism to adaptively optimize and personalize the review rules, thereby achieving dynamic adaptation between user behavior patterns and review rules.
[0109] The above description is only a preferred embodiment of the present invention. It should be noted that those skilled in the art can make several modifications and improvements without departing from the inventive concept of the present invention, and these all fall within the protection scope of the present invention.
Claims
1. A causal transmission path modeling method for tracing anomalies in power users, characterized in that, Includes the following steps: Constructing a time series feature set of user behavior based on multi-source data; A change point detection model is used to identify behavioral anomalies and anomaly intervals in the feature set. For behavioral anomalies, a multivariate causal graph is constructed based on a structural causal model, and intervention calculations are used to identify and quantify the causal transmission path from external influencing factors to user behavioral anomalies. The causal transmission path is vectorized, and a clustering algorithm is used to perform pattern recognition on the causal transmission path under multiple users and multiple scenarios to obtain typical behavior path clusters. Based on the prediction results of the typical behavior path clusters and behavior transmission simulation, a matching model between user behavior patterns and review rules is constructed.
2. The method according to claim 1, characterized in that, The method further includes the following steps: using a reinforcement learning mechanism to adaptively optimize and personalize the review rules, thereby achieving dynamic adaptation between user behavior patterns and review rules.
3. The method according to claim 1, characterized in that, The multi-source data includes user load data, electricity purchase curves, contract information, electricity pricing strategy records, weather information, and holiday markers.
4. The method according to claim 3, characterized in that, The specific method for constructing the feature set is as follows: Integrate multi-source heterogeneous data based on a timeline to construct a standardized behavioral time series; set trigger points for electricity price policy adjustment events. And extract user behavior features before and after the event using a sliding time window method. The formula is as follows: In the formula, Indicates user A set of behavioral characteristics For the first The value of the class feature at time point t, The sliding window width is used to generate high-dimensional time-series sample data that can be used for causal analysis through normalization, missing value imputation, and multimodal feature fusion.
5. The method according to claim 1, characterized in that, The change point detection model is modeled based on the cumulative sum of residual variances or the Bayesian online change point detection algorithm. The modeling representation of the cumulative sum method is as follows: In the formula, Represents the cumulative deviation function. For the first time series One basic data point, The mean of the historical behavior sequence; , To set the trigger point time, The width of the sliding window is set; when When the cumulative sum exceeds the set threshold, the corresponding data point in the time series is determined to be an outlier.
6. The method according to claim 1, characterized in that, The method for generating the causal transmission path is as follows: The multivariate causal graph is constructed using a directed acyclic graph G=(V,E), where node V represents a set of variables including electricity price, time period, temperature and user behavior, and edge E represents a potential causal path between variables. Introduce the user response dependent variable Y, the causal variable X, and the mediator variable M to construct a causal relationship: In the formula, and As a potential unobserved factor, and These represent stable and invariant causal mechanisms or generation rules that map their respective causal variables to their outcome variables; The Do calculus was used to solve the response distribution P(Y|do(X)) of the user response dependent variable Y after intervention, in order to identify and quantify the direct and indirect action paths, and to screen out the dominant causal pathways based on the quantification results.
7. The method according to claim 6, characterized in that, The method for identifying and quantifying direct and indirect action paths is as follows: Introducing a latent unobserved factor that is strongly correlated with the causal variable X. , Independent instrumental variable Z; The causal variable X is fitted based on the instrumental variable Z to obtain the predicted value of X. The fitted model is: Where W is the observed covariate. The coefficients to be estimated are... This is the error term; Using predicted values To estimate the user response dependent variable Y and correct for causal effects, the estimation model is as follows: in As the corrected target causal effect, as a quantification result, The coefficients to be estimated are... This is the error term.
8. The method according to claim 1, characterized in that, The method for generating the typical behavior path cluster is as follows: The causal transmission path is transformed into a high-dimensional vector representation using a causal path embedding encoding method. A hierarchical clustering algorithm is used to perform pattern recognition with the goal of minimizing the sum of squared distances between each vector within a cluster and the cluster center vector, thereby obtaining the typical behavioral path clusters. The pattern recognition method is specifically as follows: In the formula, Indicates the first Causal path clusters, The class center vector, This is the preset number of clusters.
9. The method according to claim 1, characterized in that, The matching model is constructed as follows: For different user groups, rule matching functions are constructed based on their typical behavior paths, response time latency characteristics, and consumption elasticity parameters: in, For users In time The corresponding adaptation rule set, For user behavior characteristics, For the user's main causal path set, For the pre-defined set of rule candidates in the strategy library, This is a rule selection function based on path similarity and influence strength.
10. A causal transmission path modeling system for tracing anomalies in power users, characterized in that, The system is used to implement the modeling method as described in any one of claims 1-9, including: The feature construction module is used to construct time series feature sets of user behavior based on multi-source data; Anomaly detection module is used to identify behavioral anomalies and anomaly intervals in the feature set using a change point detection model; The causal path construction module is used to construct a multivariate causal graph based on a structural causal model for the aforementioned behavioral anomalies, and to identify and quantify the causal transmission path from external influencing factors to user behavioral anomalies through intervention calculations. The pattern recognition module is used to vectorize the causal transmission path and use a clustering algorithm to perform pattern recognition on the causal transmission path under multiple users and multiple scenarios to obtain typical behavioral path clusters. The rule matching module is used to construct a matching model between user behavior patterns and review rules based on the prediction results of the typical behavior path clusters and behavior transmission simulation.
Citation Information
Patent Citations
Method and apparatus for predicting user behavior
CN106529711A