Electric power data driven causal network construction method based on two-stage causal inference
By employing a two-stage causal inference method and utilizing adaptive threshold screening and a hybrid binning strategy for power data analysis, the problem of causal relationship detection in multi-category, high-dimensional, non-stationary electricity consumption data in existing technologies has been solved, achieving efficient and accurate causal network construction and result interpretation.
Patent Information
- Application Number
- CN202511826700.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-05
- Publication Date
- 2026-03-17
AI Technical Summary
Existing power data analysis methods suffer from problems such as distorted stationarity assumptions, linear single dependence, low search efficiency, and insufficient interpretability when processing multi-category, high-dimensional, and non-stationary electricity consumption data. They are also unable to effectively detect nonlinear relationships and construct large-scale real-time causal networks.
A two-stage causal inference method is adopted, which uses an adaptive joint significance threshold adjustment mechanism to screen candidate association pairs, and combines the transfer entropy test and Granger causality test of the sliding window mechanism and the hybrid binning strategy to generate a directed acyclic causal network with time delay labeling.
It significantly improves the ability to capture linear and nonlinear causal relationships, reduces computational complexity, enhances detection accuracy and interpretability of results, and generates clear directed acyclic causal graphs.
Smart Images

Figure CN121684081A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of electric power data analysis, and particularly relates to a power data driven causal network construction method based on a two-stage causal inference. BACKGROUND
[0002] As high-frequency and objective indicators of power system activities, power data are closely related to industrial activities and have become an important data source for industrial chain analysis. Current time series causal discovery methods mainly include four types of technical routes: constraint-based methods such as PCMCI, tsFCI, etc., which infer causal relationships through conditional independence tests and require data stationarity assumptions; structure equation model-based methods such as VAR-LiNGAM, TiMINo, etc., which model linear or nonlinear relationships and also require sequence stationarity; Granger causality-based methods which can only handle stationary linear relationships; and information theory-based methods such as transfer entropy, which can detect nonlinear and non-Gaussian dependencies but are sensitive to non-stationary sequences.
[0003] Currently, existing methods have advantages in specific scenarios, but when dealing with multi-category, high-dimensional, and non-stationary power consumption data, a single technology often cannot simultaneously meet the needs of non-stationarity, linearity and nonlinearity, and structural explainability, and has the following limitations when applied to multi-category electricity consumption analysis: 1. Stationarity assumption limitation: existing technologies generally require global stationarity preprocessing (such as differencing or filtering) of the original sequence, but this can distort the time-lag causal characteristics implied by trend and seasonal changes.
[0004] 2. Linear single dependence: the single dependence assumption is prone to miss non-linear causality, and while transfer entropy can capture non-linear dependencies, it has exponential computational complexity in high-dimensional scenarios and is susceptible to noise interference.
[0005] 3. Low search efficiency and extensive candidate pair screening: full sequence pairwise testing or full grid search is inefficient and difficult to support real-time causal network construction under large-scale category combinations.
[0006] 4. Lack of result explainability: the directly constructed causal network often contains directional loops that require manual rules or domain priori for post-processing, and lacks an adaptive loop-free optimization mechanism.
[0007] A power stealing user identification and positioning method based on Granger causality test in high-loss area is disclosed in Chinese Patent No. CN110231503B. The cointegration test method is used to analyze whether there is a balanced relationship between the unit time loss of the high-loss area and the unit time power consumption of each user. Then, the Granger causality test method is used to determine whether the power consumption sequence of the user with a balanced relationship with the loss of the high-loss area has an impact on the loss of the high-loss area. The user that passes the test is considered as a high-risk power stealing user subordinate to the high-loss area. The invention only uses Granger causality test, relies on data stationarity and linear assumptions, and cannot effectively detect nonlinear relationships, which can easily lead to misjudgment. SUMMARY
[0008] The purpose of the present application is to provide a power data driven causal network construction method based on two-stage causal inference to solve the problems of distorted stationarity assumption, low search efficiency and lack of adaptive optimization mechanism in the prior art.
[0009] The technical solution of the present application is as follows: On the one hand, the present application provides a power data driven causal network construction method based on two-stage causal inference, comprising the following steps: Collecting monthly power consumption time series data of multiple categories , wherein is the number of power consumption categories, is the time index, is the number of time points, is is the time point The power consumption data of the category is preliminarily screened for candidate association pairs through an adaptive joint significance threshold adjustment mechanism, and a candidate set is obtained. The candidate set is divided using a sliding window mechanism, and each candidate association pair in the divided candidate set is subjected to transition entropy test and Granger causality test based on a hybrid binning strategy. A weighted fusion index is calculated based on the significance of the transition entropy test and the significance of the Granger causality test for fusion judgment, and a causal edge set is obtained. A causal network is generated based on the causal edge set, and a loop optimization process is performed on the causal network to generate a time-lag-labeled directed acyclic causal network.
[0010] Preferably, the monthly power consumption time series data is preliminarily screened for candidate association pairs through an adaptive joint significance threshold adjustment mechanism, and a candidate set is obtained, specifically: For power consumption time series data of power consumption categories and , define a joint signal-to-noise ratio index:
[0011] wherein, is the power consumption category and is the joint signal-to-noise ratio index; and are the sample standard deviations of the power consumption sequences of the first and second categories of users, respectively, and are the sample means of the power consumption sequences of the first and second categories of users, respectively; is a very small positive number to avoid zero denominator and ensure numerical stability; According to the size of the signal-to-noise ratio, an exponential decay function is used to dynamically adjust the adaptive joint significance threshold:
[0012] wherein, is the adaptive joint significance threshold; is the baseline significance level; is the reference signal-to-noise ratio; is the adjustment sensitivity parameter; The adaptive joint significance threshold is used to screen the candidate association pairs to obtain the screening set:
[0013] wherein, is the candidate set; is the significance calculated by the t-test; is the significance calculated by the approximate normal distribution.
[0014] Preferably, the candidate set is divided by a sliding window mechanism, specifically: The window length and the step size are set for the candidate set, and the time series is divided into overlapping time windows , wherein is the time window index, is the number of time windows, is the time window.
[0015] Preferably, each candidate association pair in the divided candidate set is subjected to a transfer entropy test based on a hybrid binning strategy, specifically: S1: Construct a three-dimensional joint variable based on the candidate set , wherein , are time series indexes, For the lag period, the dimension of the variables within the window. corresponding Calculate its skewness and kurtosis; Based on skewness and skewness determination Based on the distribution characteristics, for data determined to be strongly skewed, quantile binning is used for binning; for data determined to be heavy-tailed, [further details are needed]. Adaptive binning; for data determined to be close to a normal distribution, use... Packaging strategy; The number of data samples within each bin is counted using a 3D histogram, and the sample frequency within each bin is calculated.
[0016] in, For sample frequency; For falling into the sub-box Number of samples within; This represents the total number of samples within the window. "Randomly select a sample to fall into the bin" "China" incident; This represents the total number of bins in each dimension; S2: Calculation based on sample probability from electricity consumption category To electricity category The transfer entropy; S3: Randomly generated using the Fisher-Yates random permutation algorithm For each permutation sequence, repeat steps S1 and S2 to calculate the transition entropy and then count the significance of the transition entropy.
[0017] Preferably, a weighted fusion index is calculated based on the significance of the transfer entropy test and the Granger causality test to determine the causal edge set, which is specifically as follows: In each window divided by the sliding window mechanism The p-value was obtained by performing an ADF test within the test. The stationarity score is calculated based on the p-value: ; Based on the adaptive weights of the significance of the transfer entropy test and the Granger causality test assigned by the stationarity score, a weighted fusion index is calculated:
[0018] In the formula, For weighted fusion indicators; The lag period; The weighting parameters for the transfer entropy test, , As the benchmark weight; These are the weighting parameters for the Granger causality test. ; To test the significance of the transfer entropy; For Granger causality test significance; For each lag period Take the weighted fusion index from all its windows. The maximum value is used as the causal score. ; Scan hysteresis space ,in To preset the maximum lag order based on the time period characteristics of electricity consumption data; select the one that makes... The largest lag period is the optimal lag period. ,if Exceeding the preset threshold Then output the causal edge and record the optimal lag period. and its corresponding causal score This is used to filter out the set of edges with significant causal relationships.
[0019] Preferably, the causal network is subjected to loop optimization processing to generate a directed acyclic causal network with time delay annotation, specifically as follows: Loop detection is performed on causal networks, and directed loop sets are identified based on depth-first search; Iteratively remove the edge with the smallest causal score in each directed cycle within the set of directed cycles until the graph structure of the causal network is acyclic; Generate a directed acyclic causal network with time delay annotations, wherein the edge attributes of the directed acyclic causal network include the optimal lag period and its corresponding causal score.
[0020] On the other hand, the present invention provides a power data-driven causal network construction system based on two-stage causal inference, including a data acquisition and filtering module, a causal edge calculation module, and a causal network construction module; The data acquisition and filtering module is used to collect monthly electricity consumption time-series data for multiple categories. ,in For the number of electricity consumption categories, For time indexing, For time points, for time The electricity consumption data of each category is used to initially screen candidate association pairs from the monthly electricity consumption time series data through an adaptive joint significance threshold adjustment mechanism to obtain a candidate set; The causal edge calculation module is used to divide the candidate set using a sliding window mechanism. For each candidate association pair in the divided candidate set, a transfer entropy test and a Granger causality test based on a hybrid binning strategy are performed. A weighted fusion index is calculated based on the significance of the transfer entropy test and the Granger causality test to make a fusion judgment and obtain the causal edge set. The causal network construction module is used to generate causal networks based on the set of causal edges, perform loop optimization on the causal networks, and generate directed acyclic causal networks with time delay labels.
[0021] In another aspect, the present invention also provides an electronic device, the electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the power data-driven causal network construction method based on two-stage causal inference as described in any embodiment of the present invention.
[0022] In another aspect, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the power data-driven causal network construction method based on two-stage causal inference as described in any embodiment of the present invention.
[0023] Compared with the prior art, the present invention has the following technical effects: 1. Significantly improved overall effectiveness: This invention, through a dual-modal dynamic threshold initial screening and windowed hybrid inference mechanism, can simultaneously capture linear and nonlinear causal relationships; the innovative hybrid binning strategy and adaptive weight allocation mechanism further improve the ability to discover causal relationships in non-Gaussian and non-stationary data, significantly expanding the coverage of potential causal relationships and avoiding missed or false detections caused by the single assumption of traditional methods.
[0024] 2. Significantly optimized computational efficiency: This invention adopts a two-stage architecture of broad-spectrum screening and fine inference, combined with dynamic threshold adjustment based on joint signal-to-noise ratio, which greatly reduces the computational complexity of high-dimensional data; the hybrid binning strategy avoids excessive computational overhead while ensuring accuracy, and is especially suitable for large-scale real-time analysis scenarios with multiple power consumption categories.
[0025] 3. Significantly enhanced detection accuracy: The local stabilization processing based on sliding windows in this invention effectively preserves the time delay characteristics of the original sequence; the hybrid binning strategy significantly improves the recognition accuracy of complex nonlinear causal relationships; the adaptive weight allocation mechanism ensures that the optimal causal inference results can be obtained under different data characteristics, thereby reducing false positive and false negative errors.
[0026] 4. Enhanced interpretability of results: This invention automatically generates directed acyclic graphs with clear structure, well-defined causal directions, and time-delay annotations by using a weighted fusion index based on saliency and an adaptive loop elimination algorithm. Dynamic thresholds and weight allocation make the causal network more interpretable, completely avoiding the subjectivity and tediousness of relying on manual loop correction in the past, and enhancing the credibility and usability of the results. Attached Figure Description
[0027] Figure 1 This is an overall flowchart of the power data-driven causal network construction method based on two-stage causal inference 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 provides a power data-driven causal network construction method based on two-stage causal inference. (See attached document.) Figure 1 As shown, it includes the following steps: Collect monthly electricity consumption time-series data for multiple categories. ,in For the number of electricity consumption categories, For time indexing, For time points, for time The monthly electricity consumption data is initially screened for candidate correlation pairs using an adaptive joint significance threshold adjustment mechanism, resulting in a candidate set and reducing the candidate space. The core objective of this stage is to efficiently and comprehensively capture potential correlations between variables, avoiding the computational bottlenecks of traditional grid search or pairwise tests. This embodiment employs a joint test using Pearson correlation coefficient and Spearman rank correlation coefficient to construct a dual-modal dynamic threshold candidate pair correlation filter, simultaneously capturing linear and monotonic nonlinear correlation signals. Simultaneously, an innovative adaptive significance threshold adjustment mechanism based on joint signal-to-noise ratio is proposed, enabling adaptive screening for different data qualities. This overcomes the problem of traditional fixed thresholds being too loose or too tight when data quality fluctuates, significantly reducing the number of candidate causal pairs and computational complexity. This provides a high-quality, highly correlated candidate set for subsequent refined causal inference, fundamentally improving the feasibility and efficiency of the overall scheme.
[0030] Due to the limitations of traditional methods that preset significance thresholds, this invention proposes an adaptive joint significance threshold adjustment mechanism based on joint signal-to-noise ratio (SNR). This mechanism can automatically adjust the screening strictness according to data quality, overcoming the problem of traditional fixed thresholds being too lenient or too strict when data quality fluctuates. As a preferred embodiment, the adaptive joint significance threshold adjustment mechanism is used to initially screen candidate association pairs from the monthly electricity consumption time-series data to obtain a candidate set, specifically: For electricity consumption categories and Electricity consumption time series data Define the joint signal-to-noise ratio metric:
[0031] in, Electricity consumption category and The joint signal-to-noise ratio; and The first Class and First The sample standard deviation of the electricity consumption series of user classes. and The first Class and First The sample mean of the electricity consumption sequence of user class. It is a very small positive number used to avoid the denominator being zero, thus ensuring the stability of numerical calculations.
[0032] Based on the signal-to-noise ratio, an adaptive joint significance threshold is dynamically adjusted using an exponential decay function.
[0033] in, This is the adaptive joint significance threshold (usually set to 0.05). The baseline significance level; For reference signal-to-noise ratio; To adjust the sensitivity parameters, the adjusted significance threshold is limited to [value missing]. Within the specified range, ensure the stability of the screening process.
[0034] By adaptive joint significance threshold By filtering candidate association pairs, we obtain the filter set:
[0035] In the formula, For candidate sets; The significance of the t-test is calculated. The significance is calculated for an approximate normal distribution. This step will reduce the logarithmic complexity of the test from... Down to This can improve the efficiency of subsequent processing.
[0036] Furthermore, significance was calculated using a t-test. Specifically: Calculate the electricity consumption sequence for each pair of users The linear correlation coefficient (Pearson correlation coefficient):
[0037] in The linear correlation coefficient; , Electricity consumption category; and The first Class and First The sample mean of the electricity consumption sequence of user classes.
[0038] Significance was calculated using a t-test. :
[0039] in It is the standard normal cumulative distribution function.
[0040] Significance is calculated using an approximate normal distribution. Specifically: Transform the original data into an ordered column. Calculate the Spearman rank correlation coefficient:
[0041] Significance is calculated using an approximate normal distribution. :
[0042] in It has degrees of freedom. The cumulative distribution function of the t-distribution.
[0043] A sliding window mechanism is used to divide the candidate set. For each candidate association pair in the divided candidate set, a transition entropy test and a Granger causality test based on a hybrid binning strategy are performed. A weighted fusion index is calculated based on the significance of the transition entropy test and the Granger causality test to make a fusion judgment, and a causal edge set is obtained.
[0044] This embodiment proposes an adaptive piecewise stabilization algorithm based on a sliding window, which divides a globally non-stationary sequence into multiple locally stationary subsequences. This effectively preserves the trend and seasonal characteristics of the original data and completely avoids the time-delay causal information distortion problem caused by traditional global differencing or filtering. As a preferred implementation of this embodiment, a sliding window mechanism is used to divide the candidate set. The non-stationarity handling specifically involves: Set window length for candidate set and step length Divide the time series into Overlapping time windows ,in For time window indexing, Number of time windows For the first A time window. Furthermore, the window length... The selection needs to cover the periodic characteristics of electricity consumption data, and the step size The selection of time windows must ensure sufficient overlap to smoothly capture the time-varying characteristics of causal relationships. Within each time window, the time series data can be approximated as locally stationary.
[0045] In response to traditional To address the issue of insufficient adaptability of binning strategies to non-Gaussian distributions, this invention proposes a hybrid binning strategy. As a preferred implementation method in this embodiment, the specific steps for performing a transition entropy test based on the hybrid binning strategy on each candidate association pair in the partitioned candidate set are as follows: S1: Constructing a three-dimensional joint variable based on the candidate set ,in , For time-series indexes, the dimensions of the variables within the window are... corresponding Calculate its skewness and kurtosis:
[0046]
[0047] In the formula, Skewness; For kurtosis; and These are the component variables within the current window. The mean and standard deviation, This is the preset maximum number of boxes.
[0048] Based on skewness and skewness determination The distribution characteristics are such that the distribution is determined to be strongly skewed (the determination threshold can be determined according to the actual application scenario requirements; this embodiment is preferred). The data was binned using the quantile binning method to ensure that each bin contains an approximate number of samples. The bin boundaries can be represented as:
[0049] In the formula, p represents the binning boundary; p is the binning index. This is the preset maximum number of boxes.
[0050] For distributions classified as heavy-tailed (the threshold for classification can be determined based on the specific application scenario, and this embodiment is preferred), The data is obtained by using... Adaptive binning, the bin boundaries can be represented as:
[0051] in .
[0052] For those determined to be close to a normal distribution (the determination threshold can be determined according to the actual application scenario requirements, and this embodiment is preferred). and The data is obtained by using... The binning strategy, where the binning boundary can be represented as:
[0053] The hybrid binning strategy described in this embodiment ensures that binning can adaptively match the local volatility of data within each window, while ensuring that all data points are covered by binning, preventing any data points (especially outliers or extreme values at the edges) from being missed when calculating probabilities.
[0054] The number of data samples within each bin is counted using a 3D histogram, and the sample frequency within each bin is calculated.
[0055] in, For sample frequency; For falling into the sub-box Number of samples within; This represents the total number of samples within the window. "Randomly select a sample to fall into the bin" "China" incident; This represents the total number of bins in each dimension.
[0056] S2: Calculation based on sample probability from electricity consumption category To electricity category Transition entropy:
[0057] in In the first A window, lag Under the premise of the period, from the category of electricity consumption To electricity category The transfer entropy value; For the current moment Electricity consumption category Electricity consumption value; For the past moment Electricity consumption category Electricity consumption value; For the past moment Electricity consumption category Electricity consumption value; Information entropy is used to measure the uncertainty of random variables; Three-dimensional variables The value falls into a specific three-dimensional bin. The probability of it; They are respectively ,Right now ; For a known past moment and past moments Under the conditions, the current moment The probability of occurrence; For a known past moment Under the conditions, the current moment The probability of occurrence; For all satisfied The total number of samples within a specific bin, i.e. ; For all satisfied and At the same time, the total number of samples within a specific bin combination, i.e. ; For all satisfied and At the same time, the total number of samples within a specific bin combination, i.e. .
[0058] S3: Randomly generated using the Fisher-Yates random permutation algorithm Permutation sequences:
[0059] in The Fisher-Yates random permutation algorithm is used. Electricity consumption category In the The original time series data without permutation within each window; The length of the sliding window; For the first The replacement sequence is generated after random permutations.
[0060] Repeat steps S1 and S2 for each permutation sequence to calculate the transition entropy and then calculate the significance of the transition entropy.
[0061] in In the first Within a time window, from the electricity consumption category To electricity category The transfer entropy The significance level; For the first The transition entropy value calculated from the replacement time series data generated after the permutation; This is an indicator function.
[0062] In a preferred embodiment of this practice, performing a Granger causality test on each candidate association pair in the partitioned candidate set specifically involves: Step 1: In the window Internal bivariate VAR ( )Model:
[0063] in It is the autoregressive coefficient matrix of the VAR model, which is obtained by estimating the parameters of the bivariate VAR(l) model using the least squares method; This represents the residual term of the model.
[0064] Step 2: F-test 1. To test Is it Granger cause, based on bivariate VAR ( In the model about The equation, for variables Establish a constrained model without causality:
[0065] in , This represents the regression coefficient vector of the constrained model. Let be the residual vector of the constrained model. The sum of squared residuals is obtained by estimating the constrained model using the least squares method. .
[0066] 2. Regarding variables Establish an unconstrained model with causality:
[0067] in , This represents the regression coefficient vector of the unconstrained model. This represents the residual vector of the unconstrained model. The sum of squared residuals is obtained by estimating the constrained model using the least squares method. .
[0068] 3. Calculation Statistic:
[0069] in This is the F-statistic; It follows an F-distribution. (Through...) Calculate the significance of Granger causality using distributions :
[0070] in The first degree of freedom is The second degree of freedom is The cumulative distribution function of the F-distribution.
[0071] Within the sliding window framework, this embodiment innovatively proposes a hybrid binning strategy based on skewness and kurtosis analysis, adaptively selecting quantile binning according to data distribution characteristics. Adaptive binning or Binning significantly improves the accuracy of transition entropy estimation for non-Gaussian data. Simultaneously, improved Granger causality tests and transition entropy tests are performed, employing cross-validation from both information theory and statistics perspectives to jointly infer the causal direction and optimal lag time, comprehensively enhancing the comprehensiveness and reliability of the identification results.
[0072] This embodiment proposes an adaptive weight allocation mechanism based on the ADF test and a causal strength evaluation system based on a weighted fusion index. It integrates the statistical significance of transfer entropy and the Granger test, dynamically adjusting the test weights according to the stationarity of data within the window to enhance adaptability to non-stationary time series and construct a unified causal strength index. Furthermore, it develops an iterative weakest edge removal strategy to automatically identify and eliminate directed cycles in the causal graph, generating a directed acyclic graph (DAG) with explicit time delay labels, significantly improving the interpretability and automation level of the results.
[0073] Since traditional weighted fusion uses fixed weights and does not consider the local characteristics of data within a window, this embodiment proposes an adaptive weight allocation mechanism based on the Augmented Dickey-Fuller (ADF) stationarity test. As a preferred implementation of this embodiment, a weighted fusion index is calculated based on the significance of the transition entropy test and the Granger causality test to determine the fusion process, resulting in the following causal edge set: In each window divided by the sliding window mechanism Perform an ADF test (preferably a model with an intercept and a trend in this embodiment) to obtain the p-value. The stationarity score is calculated based on the p-value: ; Based on the adaptive weights of the significance of the transfer entropy test and the Granger causality test assigned by the stationarity score, a weighted fusion index is calculated:
[0074] In the formula, For weighted fusion indicators; The lag period; The weighting parameters for the transfer entropy test, , As the benchmark weight; These are the weighting parameters for the Granger causality test. ; To test the significance of the transfer entropy; The significance of the Granger causality test is given. It should be noted that for windows with lower stationarity scores, the transfer entropy test is more reliable; for windows with higher stationarity scores, the Granger causality test is more reliable.
[0075] For each lag period Take the weighted fusion index from all its windows. The maximum value is used as the causal score. ; Scan hysteresis space ,in To preset the maximum lag order based on the time period characteristics of electricity consumption data; select the one that makes... The largest lag period is the optimal lag period. ,if Exceeding the preset threshold Then output the causal edge and record the optimal lag period. and its corresponding causal score To filter out the set of edges with significant causal relationships. , is represented as:
[0076]
[0077] in This is the optimal lag period. For edges with a significant causal relationship and optimal lag time, use the edge with the optimal lag time.
[0078] A causal network is generated based on a set of causal edges. Loop optimization is then performed on the causal network to generate a directed acyclic causal network with time delay annotation.
[0079] As a preferred embodiment of this practice, loop optimization is performed on the causal network to generate a directed acyclic causal network with time delay annotations, specifically as follows: Loop detection in causal networks, using depth-first search to identify sets of directed cycles, has a time complexity of O(n log n). .
[0080] Iteratively remove each directed cycle from the set of directed cycles. The edge with the smallest causal score is found until the graph structure of the causal network is acyclic; Generate directed acyclic causal networks with time delay annotations. The edge attributes in the directed acyclic causal network include the optimal lag time. Its corresponding causal score .
[0081] Example 2 Accordingly, this embodiment provides a power data-driven causal network construction system based on two-stage causal inference, which is used to implement the power data-driven causal network construction method based on two-stage causal inference as described in Embodiment 1, including a data acquisition and filtering module, a causal edge calculation module, and a causal network construction module.
[0082] The data acquisition and filtering module is used to collect monthly electricity consumption time-series data for multiple categories. ,in For the number of electricity consumption categories, For time indexing, For time points, for time The monthly electricity consumption data is initially screened for candidate association pairs through an adaptive joint significance threshold adjustment mechanism to obtain a candidate set.
[0083] The causal edge calculation module is used to divide the candidate set using a sliding window mechanism. For each candidate association pair in the divided candidate set, a transition entropy test and a Granger causality test based on a hybrid binning strategy are performed. A weighted fusion index is calculated based on the significance of the transition entropy test and the Granger causality test to perform fusion judgment and obtain the causal edge set.
[0084] The causal network construction module is used to generate causal networks based on the set of causal edges, perform loop optimization on the causal networks, and generate directed acyclic causal networks with time delay labels.
[0085] Example 3 This embodiment provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the power data-driven causal network construction method based on two-stage causal inference as described in Embodiment 1 of this invention.
[0086] Example 4 This embodiment provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the power data-driven causal network construction method based on two-stage causal inference as described in Embodiment 1 of the present invention.
[0087] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, A and B simultaneously, or B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.
[0088] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented using electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0089] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0090] In the several embodiments provided in this application, any function, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0091] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for constructing a causal network driven by power data based on two-stage causal inference, characterized in that, Includes the following steps: Collect monthly electricity consumption time-series data for multiple categories. ,in For the number of electricity consumption categories, For time indexing, For time points, for time The electricity consumption data of each category is used to initially screen candidate association pairs from the monthly electricity consumption time series data through an adaptive joint significance threshold adjustment mechanism to obtain a candidate set; A sliding window mechanism is used to divide the candidate set. For each candidate association pair in the divided candidate set, a transfer entropy test and a Granger causality test based on a hybrid binning strategy are performed. A weighted fusion index is calculated based on the significance of the transfer entropy test and the Granger causality test to make a fusion judgment and obtain a set of causal edges. A causal network is generated based on a set of causal edges. Loop optimization is then performed on the causal network to generate a directed acyclic causal network with time delay annotation.
2. The method for constructing a power data-driven causal network based on two-stage causal inference according to claim 1, characterized in that, The monthly electricity consumption time-series data is initially screened for candidate association pairs using an adaptive joint significance threshold adjustment mechanism to obtain a candidate set, specifically: For electricity consumption categories and Electricity consumption time series data Define the joint signal-to-noise ratio metric: in, Electricity consumption category and The joint signal-to-noise ratio; and The first Class and First The sample standard deviation of the electricity consumption series of user classes. and The first Class and First The sample mean of the electricity consumption sequence of user class; It is a very small positive number, used to avoid the denominator being zero and to ensure the stability of numerical calculations; Based on the signal-to-noise ratio, an adaptive joint significance threshold is dynamically adjusted using an exponential decay function. in, An adaptive joint significance threshold; The baseline significance level; For reference signal-to-noise ratio; To adjust the sensitivity parameters; By adaptive joint significance threshold By filtering candidate association pairs, we obtain the filter set: In the formula, For candidate sets; The significance of the t-test is calculated. The significance is calculated for an approximate normal distribution.
3. The method for constructing a power data-driven causal network based on two-stage causal inference according to claim 1, characterized in that, The sliding window mechanism is used to divide the candidate set as follows: Set window length for candidate set and step length Divide the time series into Overlapping time windows ,in For time window indexing, Number of time windows For the first A time window.
4. The method for constructing a power data-driven causal network based on two-stage causal inference according to claim 3, characterized in that, The specific steps for performing a transition entropy test based on a hybrid binning strategy on each candidate association pair in the partitioned candidate set are as follows: S1: Constructing a three-dimensional joint variable based on the candidate set ,in , For time-series indexes, For the lag period, the dimensions of the variables within the window are... corresponding Calculate its skewness and kurtosis; Based on skewness and skewness determination Based on the distribution characteristics, for data determined to be strongly skewed, quantile binning is used for binning; for data determined to be heavy-tailed, [further details are needed]. Adaptive binning; for data determined to be close to a normal distribution, use... Packaging strategy; The number of data samples within each bin is counted using a 3D histogram, and the sample frequency within each bin is calculated. in, For sample frequency; For falling into the sub-box Number of samples within; This represents the total number of samples within the window. For "randomly selecting a sample to fall into a bin" "China" incident; This represents the total number of bins in each dimension; S2: Calculation based on sample probability from electricity consumption category To electricity category The transfer entropy; S3: Randomly generated using the Fisher-Yates random permutation algorithm For each permutation sequence, repeat steps S1 and S2 to calculate the transition entropy and then count the significance of the transition entropy.
5. The method for constructing a power data-driven causal network based on two-stage causal inference according to claim 3, characterized in that, The fusion determination is based on a weighted fusion index calculated using the significance of the transfer entropy test and the Granger causality test, resulting in the following causal edge set: In each window divided by the sliding window mechanism The p-value was obtained by performing an ADF test. The stationarity score is calculated based on the p-value: ; Based on the adaptive weights of the significance of the transfer entropy test and the Granger causality test assigned by the stationarity score, a weighted fusion index is calculated: In the formula, For weighted fusion indicators; The lag period; The weighting parameters for the transfer entropy test, , As the benchmark weight; These are the weight parameters for the Granger causality test. ; To test the significance of the transfer entropy; For Granger causality test significance; For each lag period Take the weighted fusion index from all its windows. The maximum value is used as the causal score. ; Scan hysteresis space ,in To preset the maximum lag order based on the time period characteristics of electricity consumption data; select the one that makes... The largest lag period is the optimal lag period. ,if Exceeding the preset threshold Then output the causal edge and record the optimal lag period. and its corresponding causal score This is used to filter out the set of edges with significant causal relationships.
6. The method for constructing a power data-driven causal network based on two-stage causal inference according to claim 1, characterized in that, The causal network is optimized by performing loop optimization to generate a directed acyclic causal network with time delay annotations, specifically as follows: Loop detection is performed on causal networks, and directed loop sets are identified based on depth-first search; Iteratively remove the edge with the smallest causal score in each directed cycle within the set of directed cycles until the graph structure of the causal network is acyclic; Generate a directed acyclic causal network with time delay annotations, wherein the edge attributes of the directed acyclic causal network include the optimal lag period and its corresponding causal score.
7. A power data-driven causal network construction system based on two-stage causal inference, characterized in that, The system is used to implement the power data-driven causal network construction method based on two-stage causal inference as described in any one of claims 1 to 6, including a data acquisition and filtering module, a causal edge calculation module, and a causal network construction module; The data acquisition and filtering module is used to collect monthly electricity consumption time-series data for multiple categories. ,in For the number of electricity consumption categories, For time indexing, For time points, for time The electricity consumption data of each category is used to initially screen candidate association pairs from the monthly electricity consumption time series data through an adaptive joint significance threshold adjustment mechanism to obtain a candidate set; The causal edge calculation module is used to divide the candidate set using a sliding window mechanism. For each candidate association pair in the divided candidate set, a transfer entropy test and a Granger causality test based on a hybrid binning strategy are performed. A weighted fusion index is calculated based on the significance of the transfer entropy test and the Granger causality test to make a fusion judgment and obtain the causal edge set. The causal network construction module is used to generate causal networks based on the set of causal edges, perform loop optimization on the causal networks, and generate directed acyclic causal networks with time delay labels.
8. An electronic device, the electronic device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, it implements the power data-driven causal network construction method based on two-stage causal inference as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the power data-driven causal network construction method based on two-stage causal inference as described in any one of claims 1 to 6.
Citation Information
Patent Citations
A Method for Identifying and Locating Electricity Theft Users in High-Loss Transformer Areas Based on Granger Causality Test
CN110231503B