Urban gas pipe network anti-fact generation method based on dynamic evolution

By using a dynamic evolution-based approach, counterfactual data is generated using the Koopman operator and a dual-flow causal diffusion model. This solves the problem of inconsistent physical laws in the generation of spatiotemporal data for urban gas pipeline networks, enabling accurate simulation and quantitative assessment of extreme environments, and supporting leak tracing and fault impact assessment.

CN121935867APending Publication Date: 2026-04-28BEIHANG UNIV +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIHANG UNIV
Filing Date
2025-12-18
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In existing technologies, the generation of spatiotemporal data for urban gas pipeline networks lacks a benchmark for verifying the consistency of physical laws, making it difficult to accurately simulate the source tracing of leaks and the impact of faults caused by non-human factors. Furthermore, existing methods are not applicable to the generation of data for various flow rates and weather information.

Method used

A dynamic evolution-based approach is adopted, which decomposes causal patterns using the Koopman operator, establishes a two-stream causal diffusion model, and combines a denoising network and a self-reflective learning mechanism to generate counterfactual data, preserving the distribution shape and detailed features of the observed data. The CTAP evaluation index is introduced for quantitative verification.

Benefits of technology

It improves the physical consistency and accuracy of the generated results, can simulate pipeline network response in extreme environments, provides quantifiable evaluation methods, supports leak tracing and fault impact assessment, and enhances the application effect of the model in gas pipeline network management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121935867A_ABST
    Figure CN121935867A_ABST
Patent Text Reader

Abstract

The invention relates to an urban gas pipe network anti-fact generation method based on dynamic evolution, belongs to the technical field of urban spatio-temporal data generation of smart cities, solves the problem that in the prior art, pipe network spatio-temporal data generation lacks reasonable evaluation criteria, and comprises the steps that S1, initial data information of an urban gas pipe network is acquired and preprocessed; s2, performing causal mode decomposition based on a Koopman operator to obtain a stable causal component and a dynamic environment component; s3, establishing a denoising network, training to obtain a pre-trained denoising network, and taking the pre-trained denoising network as a causal branch network dominated by a stable causal component; s4, based on the dynamic environment component, establishing an environment branch network modulated by the dynamic environment component; s5, establishing an auto-reflection learning mechanism based on conditional intervention and gradient guidance; s6, establishing a learning training strategy; and S7, generating a sampling strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of urban spatiotemporal data generation technology for smart cities, specifically to a counterfactual generation method for urban gas pipeline networks based on dynamic evolution. Background Technology

[0002] Spatiotemporal data generation, as the core carrier for dynamic monitoring and operational simulation of urban smart pipeline networks, plays an irreplaceable role in the key integrated aspects of "observation, management, and prevention," including pipeline status perception, operational scheduling optimization, and fault risk prevention. In pipeline network decision-making systems operating in open environments, generating high-quality spatiotemporal sequence data (such as pressure, flow rate, and leakage diffusion status) is crucial. This data can effectively predict system operational trends under unknown environments such as extreme weather and sudden faults by simulating spatiotemporal phenomena in pipeline networks that conform to the laws of fluid mechanics and structural mechanics. Furthermore, it compensates for imbalances in pipeline monitoring data, such as the scarcity of fault samples and incomplete environmental coverage, providing data support for accurate perception ("observation"), dynamic scheduling ("management"), and risk prediction ("prevention").

[0003] Currently, the generation of spatiotemporal data for pipeline networks lacks reasonable evaluation standards. Unlike the explicit semantics of image data, the correlation between the physical meaning of pipeline network data (such as pressure, flow rate, and leakage diffusion field) and environmental interventions is difficult to quantify directly. An evaluation system that can quantify and verify the consistency between "generated results and environmental interventions" has not yet been established (for example, it is impossible to verify whether "pressure drop caused by extreme rainfall" is consistent with hydraulic models). Furthermore, there is a lack of verification benchmarks for the consistency of physical laws between environmental constraints (such as a temperature of -10℃) and system responses (such as flow interruptions caused by pipeline freezing). This deficiency not only affects the reproducibility of pipeline network spatiotemporal data generation methods but also hinders the practical deployment of generated models in pipeline network operation scheduling and fault prevention.

[0004] Chinese patent application, publication number CN 112541520A, entitled "Apparatus and Method for Generating Counterfactual Data Samples for a Neural Network," is used for image detection of defective components in manufacturing systems and image detection of objects in autonomous driving scenarios. It uses a neural network to determine the category prediction of input sensor data samples and to estimate the uncertainty of the category prediction, generating candidate counterfactual data samples, determining a loss function, and modifying the candidate counterfactual data samples based on the determined loss function to obtain the counterfactual data samples. However, this method is not applicable to various information and data such as flow rates and weather data in urban gas pipeline networks, in addition to image information, and cannot provide prediction results for aspects of leakage tracing and fault impact assessment that are of concern to urban gas pipeline networks.

[0005] Chinese patent application CN120602236A, entitled "An Artificial Intelligence-Based Power Monitoring System," addresses network attack threats in power systems by extracting disturbance sequences from the system and constructing counterfactual trajectories. It then compares these disturbance sequences with the counterfactual trajectories node-by-node, extracting deviation points and combining them into an attack evolution chain. This allows for the inference of the attacker's next action probability distribution, and the implementation of specific operations to interrupt the attack evolution chain. However, this method is designed for intentional, human-induced attacks and is ill-suited for observing and predicting non-human-induced threats such as leak tracing and fault impact assessment in urban gas pipeline networks caused by uncontrollable factors like weather and environment.

[0006] Therefore, there is a need in this field for improved methods for generating spatiotemporal data of urban gas pipeline networks that can be quantitatively verified and achieve accurate simulation and monitoring. Summary of the Invention

[0007] In view of the above problems, this invention provides a counterfactual generation method for urban gas pipeline networks based on dynamic evolution, solving the problem of lack of verification benchmarks for the consistency of physical laws in existing technologies. The counterfactual generation stage is constrained by causal latent variables characterizing the external environment, but unlike other methods, it edits and adjusts individual data for specific pipe segments or time periods based on known observation data. This results in counterfactual generation retaining the distribution shape and detailed characteristics of the original data (such as the pressure step characteristics caused by a sudden change in pipe diameter in a certain pipe segment), only adjusting the mean of the data distribution. Taking gas pipeline network leakage monitoring data as an example, counterfactual generation is used to answer the question, "Under the current clear weather (no leakage) and flow conditions of a certain pipe segment, if a 5mm diameter leak occurs in that pipe segment, how will the observation results change?" The generated results will retain the original pressure-flow correlation law of that pipe segment (such as flow increasing linearly with increasing pressure), but due to the leakage intervention, the mean flow rate under the same pressure will increase by about 15% (corresponding to the leakage amount), while high-frequency fluctuations (water flow impact characteristics at the leakage point) will appear in local time periods. Counterfactual generation can simulate the response of individual pipe segments to environmental / fault interventions, providing accurate simulation basis for leak tracing and fault impact assessment in the "prevention" stage. This invention presents a counterfactual generation method for urban gas pipeline networks based on dynamic evolution, offering a solution approach starting from dynamics: First, the Koopman operator is used to decompose stable causal components (representing the inherent physical laws of the system) and dynamic environmental components (representing external disturbances) from spatiotemporal observations; based on this, a dual-flow causal diffusion model is constructed (dominated by causal and environmental branches respectively), and a contrastive time-attribute pre-training (CTAP) is proposed as an evaluation index to quantify the consistency between "generation results and intervention conditions," thereby advancing spatiotemporal generation from a "black box" towards "physically interpretable and verifiable."

[0008] According to an embodiment of the present invention, a counterfactual generation method for urban gas pipeline networks based on dynamic evolution is provided, comprising the following steps: S1: Acquire initial data information of the urban gas pipeline network and preprocess it to obtain a processed spatiotemporal observation sequence set, including time series observation data and external environment data; among which, the time series observation data is node-level or cross-section-level time series observation data, including pipeline static parameters, sensor data, and topology information, and the external environment data includes historical weather, historical temperature, historical rainfall, real-time weather, real-time temperature, and real-time rainfall; S2: Perform causal pattern decomposition based on the Koopman operator on the processed spatiotemporal observation sequence set to obtain stable causal components and dynamic environment components; S3: Based on stable causal components and spatiotemporal observation sequences, a denoising network is established, and the denoising network is trained to obtain a pre-trained denoising network, which serves as a causal branch network dominated by stable causal components and is used to constrain stable causal generation. S4: Based on the dynamic environment component, a sub-conditional gradient field network is established and trained to simulate the correction of the denoising direction by various environmental factors. The trained sub-conditional gradient field network is then used as the environmental branch network for the modulation of the dynamic environment component. S5: Based on the causal pattern decomposition of the Koopman operator and the environmental branching network, establish a self-reflective learning mechanism model based on conditional intervention and gradient guidance. S6: Establish a two-stage learning and training strategy to train the self-reflective learning mechanism model and obtain a well-trained self-reflective learning mechanism model. S7: Through causal branching networks and a trained self-reflective learning mechanism model, a sampling strategy is generated, including counterfactual sequences and quantitative assessment reports of urban gas pipeline networks, which are then provided to the urban gas pipeline network management and maintenance process.

[0009] Optionally, S2 includes: S2.1: Establish a nonlinear dynamic system affected by the external environment, and obtain the observation data at the next moment based on the observation data at the current moment and the external environment data through a nonlinear state transition function; S2.2: Establish the Koopman operator and obtain the latent variables in the Koopman subspace based on the Koopman operator; S2.3: By performing spectral decomposition on the dynamic evolution process of each latent variable, the relationship between the initial latent variable and the latent variable at the current time is obtained; S2.4: Perform spectral decomposition on the Koopman operator to obtain the left eigenvector, right eigenvector, and eigenvalues; based on the range of values ​​of each eigenvalue, obtain the mask matrix of the evolution mode decomposition; S2.5: Based on the mask matrix of the obtained evolutionary pattern decomposition, calculate the stable causal component and dynamic environmental component of the causal variable.

[0010] Optionally, S3 includes: S3.1: Establish a denoising network and use it to predict the noise level in the noisy data of the current diffusion step. The stable causal component is used as the conditional information in the denoising process to strengthen the guidance of the stable causal component in the spatiotemporal dynamics on the generation process. S3.2: Establish a loss function for training the denoising network, train the denoising network to obtain a pre-trained denoising network, which serves as a pre-trained causal branch network.

[0011] Optionally, S4 includes: S4.1: Apply intervention conditions to the pre-trained diffusion model using the gradient of the conditional classifier, and transform the intervention effect into a gradient field of the gap between the given spatiotemporal data and the intervention result to obtain a new conditional diffusion model and establish a learnable sub-conditional gradient field. S4.2: Establish a gradient field loss function to train the learnable subconditional gradient field and obtain a pre-trained subconditional gradient field.

[0012] Optionally, S4.1 includes: Establish a diffusion model, apply intervention conditions to the diffusion model using the gradient of the conditional classifier, and transform the intervention effect into the gradient field of the gap between the given spatiotemporal data and the intervention result to obtain a new conditional diffusion model; Based on Bayes' theorem, establish the expression for the conditional gradient field; Model a subconditional gradient field for each environment variable, and use an encoder with learnable parameters to extract generalizable environment variables from the dynamic environment components; The complete conditional gradient field is obtained by summing the individual sub-conditional gradient fields. Establish the reverse diffusion process in a two-stream causal diffusion model; Based on the reverse diffusion process of the two-stream causal diffusion model, a learnable subconditional gradient field is established.

[0013] Optionally, S5 includes: S5.1: Based on the Koopman operator, perform causal pattern decomposition, decompose latent variables into stable causal components and dynamic environment components; use an encoder to calculate each environment variable of the dynamic environment component based on the dynamic environment component; S5.2: Establish a decoupling loss function to minimize the upper bound of mutual information between different environmental variables of the dynamic environmental component, so as to achieve decoupling of environmental variables; S5.3: Establish an objective function to enhance the causal invariance of stable causal components; S5.4: Based on the Tweedie formula, predictive noise is used to predict the generated results; S5.5: Incorporate a self-reflection mechanism based on conditional intervention and gradient guidance into the learning process of the diffusion model.

[0014] Compared with the prior art, the present invention provides a counterfactual generation method for urban gas pipeline networks based on dynamic evolution, which has at least the following beneficial effects.

[0015] 1. Enhanced generation capability with physical consistency: By using dynamic evolution (Koopman subspace) as a conditional constraint for the diffusion model, the generated sequence can maintain consistency with the real physical process in terms of both global regularity and local perturbation, thereby significantly reducing model bias in physically constrained tasks such as pipeline leakage simulation and pressure anomaly inference.

[0016] 2. Controllable intervention and counterfactual generation: Introducing a dual-flow structure of stable causal components and dynamic environmental components, it supports two types of generation tasks: "group intervention (Doing)" and "individual counterfactual (Imaging)," and can accurately adjust the mean and fluctuation characteristics according to the given environmental conditions while preserving the details of the observation context.

[0017] 3. Enhanced Response Capability to Sparse / Long-Tail Environments: Based on sub-conditional gradient fields and a self-reflective learning mechanism, the model can effectively identify and learn the influence paths of sparse environmental factors by actively applying conditional interventions and using gradients to guide the denoising direction, thereby improving its ability to simulate extreme / rare events.

[0018] 4. Provide quantitative consistency assessment methods: propose evaluation indicators such as CTAP (Comparative Time Series-Attribute Pre-training) to quantitatively measure the alignment between the generated results and the intervention in a given environment, and provide measurable criteria for the "generation-verification-deployment" closed loop in the gas pipeline network scenario.

[0019] 5. Available output formats for the project: The model output can be directly used for subsequent operating condition simulation, leak location, fault risk scoring and operation strategy simulation. Under the given leak location and intensity conditions of the gas pipeline network, pressure / flow counterfactual sequences can be generated and used for operation and maintenance decision support. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the embodiments will be briefly introduced below. The features and advantages of the present invention can be more clearly understood by referring to the accompanying drawings. The accompanying drawings are schematic and should not be construed as limiting the present invention in any way. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a schematic diagram of a counterfactual generation method for urban gas pipeline networks based on dynamic evolution, provided according to an embodiment of the present invention.

[0022] Figure 2 This diagram illustrates a self-reflective learning mechanism based on conditional intervention and gradient guidance in a counterfactual generation method for urban gas pipeline networks based on dynamic evolution, provided according to an embodiment of the present invention.

[0023] Figure 3 This is a visual comparison chart of the counterfactual generation results under specific system parameters and specific noise conditions in Embodiment 1 of the present invention, and the generation results of the prior art. Detailed Implementation

[0024] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments of the present invention and the features thereof can be combined with each other.

[0025] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein. Therefore, the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0026] The following describes in detail, with reference to the accompanying drawings, a method for generating counterfactual information about urban gas pipeline networks based on dynamic evolution according to an embodiment of the present invention. The key innovations, logic, and effects of the method for generating counterfactual information about urban gas pipeline networks based on dynamic evolution provided by this embodiment include: (1) Stable-dynamic causal decomposition based on the Koopman operator; by performing spectral analysis on the pre-trained Koopman subspace, the latent variables are decomposed into stable causal components of "|λ|≈1" (representing long-term invariant or slowly changing causal laws) and the remaining dynamic environmental components (representing external disturbances and local fluctuations); Logic: The spectral radius can directly reflect the temporal stability of the model; Effect: It enables the generation process to clearly distinguish between physical laws and environmental disturbances, improving the physical interpretability and transferability of the generation results. (2) Dual-stream causal diffusion architecture (causal branch + environment branch); the causal branch uses classifier-free conditional diffusion to strongly constrain stable causal components, while the environment branch uses classifier guidance (or learnable sub-gradient fields) to flexibly inject environmental intervention; logic: "stability constraints" and "dynamic interventions" are processed separately, without interference and can synergistically influence generation; effect: in counterfactual generation, individual details can be preserved while intervention goals are achieved. (3) Learnable sub-conditional gradient fields (replacing the instability of directly training conditional classifiers); by designing multiple parameterized sub-gradient networks to approximate the intervention effect, the gradient oscillation problem caused by directly training conditional classifiers on noisy data is avoided; logic: the complex conditional field is decomposed into multiple simpler sub-fields and fitted separately; effect: training is more stable and provides clear denoising guidance during sampling. (4) CTAP: A quantitative evaluation system for generation-intervention consistency; design a comparative time-attribute pre-trained model to align the spatiotemporal observation sequence with the environmental / attribute conditions to the same representation space to measure the degree of response of the generated samples to the intervention conditions (providing a measurable "generation correctness" index); logic: use comparative learning to establish a similarity measure between conditions and samples at the feature level; effect: provide an intuitive and quantifiable means of measurement for model parameter tuning, method comparison and engineering acceptance.

[0027] like Figure 1 As shown, a method for generating counterfactual information about urban gas pipeline networks based on dynamic evolution according to an embodiment of the present invention includes the following steps.

[0028] S1: Obtain initial data information of the urban gas pipeline network, including time series observation data of the urban gas pipeline network and external environmental data, perform preprocessing, and obtain the processed spatiotemporal observation sequence set.

[0029] Optionally, the obtained time-series observation data of the urban gas pipeline network can be node-level or cross-sectional-level time-series observation data, specifically including pipeline static parameters, sensor data, topology information, etc.; wherein pipeline static parameters may include: pipe diameter, length, etc.; sensor data may include: node segment flow rate, temperature, etc.; topology information may include: pipeline connectivity matrix, etc. The obtained external environmental data of the urban gas pipeline network. This may include: historical weather, historical temperature, historical rainfall, real-time weather, real-time temperature, real-time rainfall, etc. Optionally, in other embodiments, more or less information than the data listed above may be used for further processing as needed.

[0030] Optionally, the acquired initial data can be preprocessed, including: data cleaning, time alignment (unifying sampling frequency), topological coding, attribute coding, standardization, normalization, and labeling of external environment data. Training and validation segments can also be formed to obtain a processed spatiotemporal observation sequence set. This can be used as a conditioner for subsequent training of Koopman mappings, causal decomposition modules, and diffusion models. Data cleaning may include missing value imputation and outlier detection; time alignment can use a uniform sampling frequency. The time series observation data in the processed spatiotemporal observation sequence set; The external environment data in the processed spatiotemporal observation sequence set, For a moment.

[0031] S2: Perform causal pattern decomposition based on the Koopman operator on the processed spatiotemporal observation sequence set to obtain stable causal components. and dynamic environment components .

[0032] Currently, existing causal pattern decomposition methods typically rely on establishing a learnable static mask parameter matrix. This mask matrix is ​​used to separate the causal and environmental components of feature variables. However, the decomposition rules of such methods depend entirely on the training data distribution, lacking adaptability to the dynamic evolution of open environments. Therefore, this implementation redefines causal pattern decomposition from a dynamic perspective: it reconstructs causal pattern decomposition into a decomposition problem of stable patterns (invariant causal laws) and dynamic patterns (variable environmental perturbations) within a spatiotemporal causal process, thereby improving adaptability to long-tailed events. Step S2 specifically includes the following steps.

[0033] S2.1: Establishment subject to external environment Nonlinear dynamic systems affected:

[0034] in, It is the current Time series observation data at time 10:00. It is the number of spatial nodes. For observation dimensions (e.g., pressure, flow rate, etc.). This refers to the external environment data dimension (external environment data, such as valve status, temperature, weather, etc.). This represents a nonlinear state transition function.

[0035] S2.2: Establish the Koopman operator. It is defined as The infinite-dimensional linear transformation process, in which It is the set of all mapping functions that form the infinite-dimensional Hilbert space. For any one of these mapping functions, ... mapping function All satisfy the following relationship:

[0036] in, This represents the spatiotemporal Koopman operator in Hilbert space, representing the state transition process of the system. Represents the infinite-dimensional Koopman operator. This represents a mapping function that maps data from the observation space to the Hilbert space. The above formula represents the Koopman operator. Acting on the mapping function Above, we get a new function. New function The current moment Time series observation data The state values ​​obtained by mapping to Hilbert space are equal to the original mapping function. In the next moment Time series observation data The state values ​​obtained by mapping to Hilbert space.

[0037] If there exist a finite number of mapping functions in the Hilbert space... ,in Indicates the first A mapping function is used to generate a representation space in the Hilbert space. Meanwhile, for any mapping function All satisfied Relationship, i.e., in the Koopman operator Under the influence of the characterization space If it has completeness, then it is said to be determined by the mapping function. The generated representation space It is a Koopman invariant subspace. Infinite-dimensional operators in infinite-dimensional Hilbert space can be reduced to a dimensionless representation space. A finite-dimensional operator Representation space Dimension equals .

[0038] Establish a Koopman subspace (i.e., representation space) based on the Koopman operator. Hidden variables in ).

[0039] Furthermore, each element in the Koopman subspace is treated as a latent variable, defined as follows: ,in express Time of the first Observational data of each spatial node, express Time of the first The latent variables of each spatial node in the representation space For the index of the spatial node, To characterize the spatial dimension, which is also the number of modes in the decomposition, the evolution process of each latent variable can be defined as:

[0040] in, Indicates in The latent variables of all spatial nodes at time t, with dimension . . express Time of the first The transpose of the latent variables of each spatial node in the representation space. The transpose operation can be used to facilitate matrix operations.

[0041] Furthermore, another key feature of the Koopman operator is its spectral properties. The eigenvalue decomposition consists of a set of left eigenvectors and a set of eigenvalues composition, It is a complex space that satisfies the following relationship:

[0042] in, The modality index represents the eigenvalue decomposition.

[0043] Furthermore, the spectral properties of the Koopman operator can be used to characterize the dynamics of the representation space. For example, Koopman eigenvectors determine the evolution process of the system, and Koopman eigenvalues ​​determine the evolution rules of the system. Eigenvectors are orthogonal and can form a basis for the Koopman subspace. Time of the first Latent variables of spatial nodes Expand using eigenvectors:

[0044] in, yes Time (initial time) Latent variables of spatial nodes In the eigenvectors The projection onto the surface is also called the amplitude.

[0045] S2.3: By analyzing each latent variable The dynamic evolution process is subjected to spectral decomposition to obtain the initial hidden variables. and Latent variables at time Relationship between them:

[0046] in, for of The exponent means the power of . The eigenvalues ​​at time... The value reflects The evolution rules of time-matter dynamics reflect the scaling and rotation of the mode during time evolution; For the initial time, the first Latent variables of spatial nodes In the eigenvector The projection onto the feature reflects the magnitude of the initial state's contribution in that feature direction. The larger the value, the higher the eigenvector. The greater the influence of latent variables on system evolution, the more significant their impact. From the initial state experience Each time step is obtained step by step through dynamic evolution. Based on the above formula (4), it can be seen that due to the amplitude and eigenvectors In latent variables From the initial state The evolution of these remains unaffected by time; only the eigenvalues ​​of the Koopman matrix change. Related, and They are usually complex numbers, therefore eigenvalues The modulus length can reflect the first The stability (decay or growth) of the evolution of the first mode over time, the argument reflects the stability (decay or growth) of the second mode. The oscillation frequency of each mode during the time evolution process.

[0047] S2.4: Perform spectral decomposition on the pre-trained Koopman operator to obtain the left eigenvector, right eigenvector, and eigenvalues; based on the range of values ​​of each eigenvalue, obtain the mask matrix of the evolution mode decomposition.

[0048] By observing this relationship, it can be found that the dynamic evolution of causal variables is always driven by eigenvalues. Control, when the eigenvalue If the causal variable remains constant over any time period, then... Furthermore, all causal variables satisfying this condition become stable causal components, while the remaining causal variables change over time. Based on this property, causal latent variables can be decomposed by examining each eigenvalue in a pre-trained Koopman operator. The stable causal component and the dynamic environmental component in the model.

[0049] First, spectral decomposition is performed on the pre-trained Koopman operator. ,in ,in The left eigenvector, Let be the right eigenvector, and let eigenvalues ​​be eigenvalues. .

[0050] Then, based on the range of values ​​for each eigenvalue, the mask matrix for evolutionary pattern decomposition is obtained, defined as follows:

[0051] in, and These are all relaxation coefficients used to control the number of dynamic modes. The mask matrix represents the evolution pattern decomposition. The mask matrix representing the stable modes. The right eigenvector represents the stable mode. The left eigenvector represents the stable mode. A mask matrix representing causal variables. Represents the right eigenvector of the causal variable. Represents the left eigenvector of the causal variable. Represents the set of stable modes. This represents the set of causal variables.

[0052] S2.5: Based on the mask matrix obtained from the evolutionary pattern decomposition, calculate the stable causal components and dynamic environmental components of the causal variables:

[0053] in, express The stable causal components at any given moment express The dynamic environmental components at any given moment Indicates in Spatiotemporal data of all spatial nodes at any given time The corresponding latent variables have the following dimensions: , This represents the Hadamard product operation.

[0054] S3: Based on stable causal components, establish a causal branch network dominated by stable causal components. In this step, data will be input and output as a whole spatiotemporal observation sequence.

[0055] Optionally, a spatiotemporal observation sequence can be defined as a set of data at each time point, i.e. ,in, Indicates the total time length of the spatiotemporal observation sequence. Indicates the number of spatial nodes. Denotes the spatiotemporal observation sequence dimension, where express The observation data for all spatial nodes at any given time. Similarly, for ease of description, the spatiotemporal observation sequence is... The latent variables in the representation space are represented as ,in express Spatiotemporal data of all spatial nodes at any given time The corresponding latent variables. Similarly, the stable causal components at all time points can be written as a set of stable causal components: Write the dynamic environment components at all points in time as a set of dynamic environment components: The input to a causal branching network is a set of stable causal components. spatiotemporal data sets Training the denoising network To constrain stable causal generation, in which The diffusion step represents the degree to which the diffusion model adds noise to the data. The larger the value, the higher the value of the data. The higher the noise content, This represents the pure, raw data without any added noise. Indicated based on noise level Data The stable causal component is extracted based on step S2. The output of this step is a pre-trained denoising network, which serves as the causal branch network dominated by the stable causal component for subsequent steps S4 and S6.

[0056] Furthermore, for causal branching networks, in order to strengthen and stabilize the influence of causal components on the diffusion model, simulate the causal laws of system evolution under normal conditions, ensure the rationality of the generated results, and make them conform to the physical laws of the real world, this implementation can also use a classifier-free conditional diffusion model to incorporate causal conditions.

[0057] Through the forward diffusion process Noise is added to the original data to obtain noisy spatiotemporal data. ,in, This represents Gaussian noise from random sampling. This indicates that the forward diffusion process increases the noise level by [value]. spatiotemporal data, The diffusion step represents the degree to which the diffusion model adds noise to the data. The larger the value, the higher the value of the data. The higher the noise content, This represents the pure, raw data without any added noise. This represents the total number of diffusion steps. It is the variance parameter that controls the noise step size, and is usually set to... , ensure when Timely satisfaction That is, not in the original data Add any noise, set , That is, in the original data Adding sufficient noise resulted in data with increased noise. It follows a standard Gaussian distribution, resulting in pure Gaussian noise. arrive Typically controlled using linear functions, these are hyperparameters.

[0058] like Figure 1 As shown, the mapping function is constructed using the classic Spatio-Temporal Neural Structural Causal Model (STNSCM). Noisy spatiotemporal data and external environment Commonly mapped to a Koopman subspace with structural causal constraints In this process, causal variables are obtained. Then based on the mask matrix To obtain stable causal components .

[0059] In spatiotemporal dynamics, the causal component is a necessary condition in the generation process, controlling the core content information of the generation result. Therefore, a classifier-less conditional diffusion model with strong conditional control can be selected in this stage. This step S3 may specifically include the following steps.

[0060] S3.1: Establish a learnable denoising network The parameters used are Denoising network predicts current diffusion step Noisy data The noise level in the middle, while stabilizing the causal components. As conditional information in the denoising process, it strengthens the guidance of stable causal components in spatiotemporal dynamics on the generation process. The formal definition is as follows: (7)

[0061] in, Indicates parameters The parameterized probability distribution function is the inverse process of the diffusion model. Indicates the first Stable causal components of causal variables in each diffusion step Indicates the first Noisy spatiotemporal data of each diffusion step, This represents the mean of the data after noise reduction. Indicates diffusion step The variance of the Gaussian distribution is usually It is a constant. Represents the normal distribution function. Indicates diffusion step Noise scheduling parameters, , , indicating an intermediate variable. Represents a noise estimation network. Indicates the diffusion step index for a uniform distribution. These are the learnable parameters of the causal branching network.

[0062] The above formula indicates that in the diffusion step According to noisy data and stable causal components The next noise level is estimated to be Noisy spatiotemporal data The mean value, which is used for the forward diffusion process. This process gradually generates data from the noise until noise-free data is output. This represents the data results generated based on stable causal components. Specifically, firstly, a noise estimation network... Based on the current diffusion step input Noisy data and stable causal components Predict the noise; then extract the noisy data from the current diffusion step. Subtract the scaled prediction noise The result is then rescaled using the scaling parameters. , to obtain the mean And a Gaussian distribution is established based on this mean. Sampling from this distribution yields a noise level of Noisy spatiotemporal data Repeat this operation until... The final noise-free generated data is obtained, and the noise-free data is output. .

[0063] S3.2: Establish the loss function for training the denoising network:

[0064] in, Represents the loss function. This represents the true noise sampled from a standard Gaussian distribution. This represents the initial real input data for diffusion step 0. This represents the expected value.

[0065] The diffusion model process starts with real data. In the middle, based on the formula Increase the level to Gaussian noise was used to obtain noisy data. And record the added noise. Used for subsequent calculation of the loss function, and also based on noisy data. Calculate stable causal components Then, a denoising network is used. Predicted in The noise content is increased, and formula (8) is used as the loss function, with the aim of making the denoising network able to process only the noisy data. and stable causal components Increased noise can be predicted. The denoising network can be trained using the loss function described above, resulting in a pre-trained denoising network. The network parameters can be updated by minimizing this loss using gradient descent. This is to predict, as accurately as possible, the actual noise added to the data during the forward pass, thereby enabling conditional data generation.

[0066] S4: Based on the dynamic environment components, establish an environment branch network for dynamic environment component modulation. The input to this step may include the dynamic environment components. The subconditional gradient field network is trained to simulate the correction of the denoising direction by various environmental factors, and the trained subconditional gradient field network is obtained as the environmental branch network for dynamic environmental component modulation, which is used in subsequent steps S5 and S6.

[0067] S4.1: Establish a diffusion model, apply intervention conditions to the diffusion model using the gradient of the conditional classifier, and transform the intervention effect into a gradient field of the gap between the given spatiotemporal data and the intervention result to obtain a new conditional diffusion model, and establish a learnable sub-conditional gradient field.

[0068] Due to environmental diversity and the flexibility of intervention operations, data from the same time and space can be affected by various different interventions. This renders classifier-less conditional diffusion models, where input data and generation conditions are tightly bound, unsuitable, necessitating a more flexible conditional fusion approach. Therefore, this step employs a classifier-guided conditional diffusion model, utilizing the gradient of the conditional classifier. By applying intervention conditions to the pre-trained diffusion model, the impact of the intervention is transformed into the gradient field of the difference between the given spatiotemporal data and the intervention result, thereby obtaining a new conditional diffusion model:

[0069] like Figure 1 As shown, this process is similar to the stable causal component extraction process, based on the mask matrix. To obtain dynamic environment components Set up real data in an open environment. Depend on Potential environmental factors Intervention, of which Represents noise-free spatiotemporal data, i.e. . Indicates from The dynamic environment component extracted is equivalent to This means that the sum of the effects of all environmental factors produces the current observational data. This process can be formally represented as follows: (10) in, Indicating environmental factors Intervention data generated under certain conditions. For example... Figure 1 As shown, environmental factors Information such as time, weather, proportion of vehicles, water consumption, temperature, and pipe material parameters can all cause corresponding changes in the spatiotemporal observation sequence.

[0070] According to Tweedie's formula, for a Gaussian distribution There is an equation relationship. For the forward diffusion process, the noisy data follows a Gaussian distribution. Then, by using resampling techniques, we can obtain the sampled values ​​of the noisy data. At the same time, according to the Tweedie formula, we have the equation... Therefore, the sampled values ​​of the noisy data can be obtained. With real data The following relationship exists: (11)

[0071] According to Bayes' theorem, the expression for the conditional gradient field can be obtained as follows:

[0072] Among them, conditional gradient fields can be used. Seeking The calculation form, and in Data distribution with conditions Sampling was conducted to simulate the intervention effect.

[0073] Therefore, the main purpose of dynamic environment component extraction is to decouple environmental variables with generalizability. And model subconditional gradient fields for each environmental variable. Therefore, to simulate environmental diversity, a method with learnable parameters is used. encoder From the dynamic environment components Extracting generalizable environmental variables Secondly, according to formula (10), since It is composed of... The direct cause, when taken as When it is a condition, Since they are independent and complete, the complete conditional gradient field is equal to the sum of the individual sub-conditional gradient fields, and can be expressed as follows: (13) Finally, the reverse diffusion process for establishing a complete two-stream causal diffusion model is as follows: (14) Due to the presence of noise in the conditional classifier Since training is difficult and gradient computation is unstable, this implementation proposes a learnable subconditional gradient field, defined as follows:

[0074] in, These are the parameters of the subconditional gradient field network. It is an indicator scalar, indicating that the current value is the [number]th [item]. The calculation process of each sub-gradient field Represents the dynamic environment components Use the Environment variables obtained from an MLP.

[0075] S4.2: Establish the gradient field loss function for training the learnable subconditional gradient field: (16) This stage includes Training is required. This is the result of the first stage of pre-training. In this stage, these parameters are frozen and do not participate in training. Ideally, when the gradient field loss... This indicates that all environment variables can be used. Reconstruct the current original data This satisfies the generalization and completeness of environmental variables. Indicates the first The variance of each diffusion step is used to control the degree of influence of the dynamic environment component on the generation process. It is a hyperparameter, usually set to 1, indicating that the dynamic environment component and the stable causal component have the same ability to influence the generation process.

[0076] The learnable subconditional gradient field is trained using the gradient field loss function to obtain the pre-trained subconditional gradient field.

[0077] S5: Establish a self-reflective learning mechanism model based on conditional intervention and gradient guidance. Optionally, this step uses the output of S4 as input to train the sub-conditional gradient field network. .

[0078] Existing spatiotemporal generation methods typically treat the external environment as negligible noise, modeling the original data distribution solely based on historical data. The resulting generative models may inherit data biases. However, spatiotemporal data generation requires extensive trial and error in a dynamic environment to continuously verify the reliability of the generated results. To address this, this implementation method proposes a self-reflective learning mechanism based on conditional intervention and gradient guidance, such as… Figure 1 and Figure 2 As shown, by actively applying conditional intervention and using gradient information to guide the model's denoising direction, the "trial and error" process in the environment is simulated, breaking through the traditional passive inductive learning method.

[0079] See Figure 2 The core idea of ​​self-reflective learning mechanisms is that if a generative model can accurately distinguish the impact of different environmental interventions on the final generated result, then the extracted environmental variables... It then possesses decoupling and generalizability. For example... Figure 2 As shown, by minimizing each environment variable and Mutual information between them improves the generative model's responsiveness to environmental intervention conditions. Based on noise-free data Extracted here and They can represent the same meaning.

[0080] S5.1: First, define Is using The generated results are sampled from a pre-trained causal branch network. Therefore As a condition, and using The sampling results are then used; then, the mapping function of the pre-trained SCKNO is applied. From the generated results and The latent variables in the Koopman space are extracted, and in the causal pattern decomposition method based on the Koopman operator, the latent variables are decomposed into stable causal components. , and dynamic environment components , Finally, use the encoder. Each environment variable is calculated based on dynamic environment components:

[0081]

[0082] These represent the results generated without environmental intervention. In the Encoder Environment variables generated below and in environmental intervention Under the given conditions, the generated result In the Encoder Environment variables generated below .

[0083] S5.2: Minimize the following decoupling loss function. and Upper bound on mutual information between them, to realize environmental variables Decoupling: (17) in, This represents the decoupling loss.

[0084] S5.3: Strengthen causal invariance using the following objective function: (18) in, This indicates the loss of stable causal components.

[0085] S5.4: During training, to improve computational efficiency, the results can be generated using predictive noise based on the Tweedie formula. The calculation method is as follows:

[0086] (19).

[0087] S5.5: Incorporate a self-reflection mechanism based on conditional intervention and gradient guidance into the learning process of the diffusion model to improve the generative model's responsiveness to environmental interventions.

[0088] S6: Establish a learning training strategy to train the self-reflective learning mechanism model and obtain a well-trained self-reflective learning mechanism model, including two-stage training.

[0089] The first stage involves optimizing the causal branch network and stabilizing the causal components, with the following loss function: (20) in, This represents the loss function for the first stage.

[0090] The second stage involves optimizing the environmental branch network and the decoupling loss function, the loss function of which is: (twenty one) in, This represents the loss function for the second stage.

[0091] The self-reflective learning mechanism model is trained using a training strategy to obtain a well-trained self-reflective learning mechanism model.

[0092] S7: Generate sampling strategies using causal branching networks and a pre-trained self-reflective learning model, including counterfactual sequences and quantitative assessment reports of the urban gas pipeline network, for engineering use in the urban gas pipeline network. In this step, the results of S3 and S4 are input, and the output is the result of given intervention conditions (…). → Generate counterfactual or intervention sequences and evaluate the consistency between the generated results and the intervention using metrics such as CTAP. The output of this step may include counterfactual sequences and quantitative evaluation reports available for engineering use. Optionally, in another implementation, this step may use one or more of causal branch networks, environmental branch networks, and pre-trained self-reflective learning mechanism models to generate the corresponding outputs, as needed.

[0093] During the generation process, given control signals From random noise Spatiotemporal data is generated through progressive sampling, and a denoising diffusion implicit model (DDIM) is used as an accelerated sampler. The generation method varies depending on the different causal structure levels, and the sampling methods at different levels will be introduced below.

[0094] Observation generation: Based on formula (7), it can be seen that observation generation only requires the use of stable causal components to simulate the causal laws of system evolution under normal conditions, ensuring that the generated results conform to the physical laws of the real world. The sampling process is as follows: (twenty two) in, This can be considered as a diffusion step Below, to The estimate.

[0095] Intervention generation: Based on formula (10), it can be seen that intervention generation requires the use of dynamic environmental components and the gradual addition of environmental variables according to needs, so that the diffusion model can be based on the sub-conditional gradient field. response The simulation of environmental changes on the system's local disturbances aims to ensure that the generated results conform to the dynamic fluctuations of the real environment. However, due to... These are feature variables in the latent space, which can be exchanged with environmental variables from other observations to achieve intervention. Let the sample... For the current observation sample, To provide additional samples for intervention, the action procedure is as follows:

[0096] in, and Indicates two different observation samples, and This indicates the extraction of stable causal components and dynamic environmental components from noise-free raw samples. Finally, As an intervention condition The sampling process is as follows: (twenty four) Counterfact generation: As can be seen from the above formula, counterfact generation not only requires the simultaneous use of stable causal components and dynamic environmental components, but also requires the use of given original observation data. Extracting contextual and detailed features, these detailed features can use exogenous variables. Capture. This step utilizes the DDIM forward diffusion process to calculate the raw observation data. initial noise and treat it as an exogenous variable. Starting from this initial noise, counterfactual samples are sampled through the DDIM reverse diffusion process.

[0097] In the counterfactual generation process, the original observation data and corresponding environmental variables are treated as factual features, and superscripts are used. Superscripts are used to label counterfactual data and environmental variables that require transformation. Annotation. Based on the standard counterfactual solution process, the attribution process is as follows: (25) Then, the action process involves changing a certain environment variable to achieve... However, due to These are characteristic variables in the latent space, which can exchange environmental variables from other observations with the environmental variables of the current observation data to achieve counterfactual intervention.

[0098] Finally, the prediction process treats the exogenous variables obtained from attribution as the initial noise of the diffusion model. and will As an intervention condition The prediction process is as follows: (26) According to another embodiment of the present invention, a counterfactual generation system for urban gas pipeline networks based on dynamic evolution is provided. This system executes the counterfactual generation method for urban gas pipeline networks based on dynamic evolution described above and provides counterfactual prediction results. The system may include: a data acquisition module for acquiring and preprocessing data information about the urban gas pipeline network; a causal pattern decomposition module for performing causal pattern decomposition on the input data sequence based on the Koopman operator to obtain stable causal components and dynamic environmental components; a causal branch network module, a denoising network based on the stable causal components; and an environmental branch network module, a sub-conditional gradient field network modulated by the dynamic environmental components. Optionally, the system may further include: a self-reflective learning mechanism model for training the sub-conditional gradient field network based on the output of the environmental branch network module, simulating a trial-and-error process in the environment by actively applying conditional interventions and using gradient information to guide the model's denoising direction.

[0099] Example 1: To better understand the present invention, the following describes a method for generating counterfactual information about urban gas pipeline networks based on dynamic evolution, according to an embodiment of the present invention.

[0100] MQ contains urban gas transmission data for Tongzhou District, Beijing, from January 5 to March 31, 2024. This data was collected from 170 underground pipeline sensors at 5-minute intervals, and the observation dimensions are... Available control signals include The data consists of two types: time point information and weather information. During the generation process, spatiotemporal data for all regions within a single day is generated in one go (total...). 1 node (Time step).

[0101] For real-world datasets, the CTAP score is primarily used to evaluate the alignment between the generating conditions and corresponding generated outcomes at each stage of the causal hierarchy. This application also incorporates more visualization experiments to qualitatively validate the rationality and effectiveness of the proposed method. Counterfactual experiments analyze the differences between the counterfactual distribution and the real data distribution under specific external environments and initial noise conditions. Smaller differences indicate that the generative model can effectively respond to intervention signals while preserving detailed features from the original data. Since the counterfactual generation task requires the generative model to accurately respond to the direction of influence of different intervention conditions, the CTAP score can reflect the alignment between the generated outcome and the given conditions.

[0102] Table 1. Comparative experimental results of counterfactual generation on real datasets.

[0103] As described in the sampling strategy, the intervention operation in Example 1 needs to be performed in the latent space; therefore, for any spatiotemporal observation sequence in the real dataset ( ), randomly select 5 real data that are different from the current control signal ( ), , Composed of intervention data pairs ( ), Using the sampling strategy described in S7, a random environment variable is selected to perform the swap operation. This simulates intervention processes under different environments. Meanwhile, to ensure fairness, the baseline method randomly selects one control signal from the real data as the intervention generation condition. , Therefore, each spatiotemporal observation sequence has 5 intervention outcomes. In the intervention experiment, the initial noise was randomly sampled from a standard normal distribution; in the counterfactual experiment, the initial noise was obtained using the DDIM forward diffusion process. Finally, the average CTAP score between the generated sequence and the given control signal was calculated to measure the correlation between the generated data after intervention and the given control signal. The experimental results are shown in Table 1 above. Figure 3 As shown.

[0104] Due to the diverse spatiotemporal data environments in open settings, most generation methods struggle to respond to environmental changes if the evolutionary patterns of spatiotemporal dynamics are ignored and refined modeling of the influence directions of different control signals is lacking. Both intervention and counterfactual experiments randomly select only one control signal for data generation, judging the CTAP score of the generated result relative to that control signal. Since most methods train the generation model based solely on the complete control signal, they cannot accurately reconstruct the original data when the control signal is missing, leading to a significant drop in the CTAP score. The method in Example 1 independently models intervention conditions as sub-conditional gradient fields and uses a self-reflective learning mechanism to strengthen the influence of each intervention condition. Therefore, the method in Example 1 exhibits better responsiveness to specific control signals.

[0105] All of the above-mentioned optional technical solutions can be combined in any way to form optional embodiments of the present invention, and will not be described in detail here.

[0106] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order and method of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0107] It should be understood that the foregoing only illustrates some embodiments, and changes, modifications, additions, and / or variations can be made without departing from the scope and spirit of the disclosed embodiments. These embodiments are illustrative and not restrictive. Furthermore, the described embodiments relate to those currently considered most practical and preferred, and should be understood as not being limited to the disclosed embodiments, but rather intended to cover different modifications and equivalent arrangements included within the spirit and scope of those embodiments. Moreover, the various embodiments described above can be used in conjunction with other embodiments; for example, an aspect of one embodiment can be combined with an aspect of another embodiment to achieve yet another embodiment. Additionally, individual features or components of any given component can constitute another embodiment.

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

Claims

1. A counterfactual generation method for urban gas pipeline networks based on dynamic evolution, characterized in that, Includes the following steps: S1: Acquire initial data information of the urban gas pipeline network and preprocess it to obtain a processed spatiotemporal observation sequence set, including time series observation data and external environment data; among which, the time series observation data is node-level or cross-section-level time series observation data, including pipeline static parameters, sensor data, and topology information, and the external environment data includes historical weather, historical temperature, historical rainfall, real-time weather, real-time temperature, and real-time rainfall; S2: Perform causal pattern decomposition based on the Koopman operator on the processed spatiotemporal observation sequence set to obtain stable causal components and dynamic environment components; S3: Based on stable causal components and spatiotemporal observation sequences, a denoising network is established, and the denoising network is trained to obtain a pre-trained denoising network, which serves as a causal branch network dominated by stable causal components and is used to constrain stable causal generation. S4: Based on the dynamic environment component, a sub-conditional gradient field network is established and trained to simulate the correction of the denoising direction by various environmental factors. The trained sub-conditional gradient field network is then used as the environmental branch network for the modulation of the dynamic environment component. S5: Based on the causal pattern decomposition of the Koopman operator and the environmental branching network, establish a self-reflective learning mechanism model based on conditional intervention and gradient guidance. S6: Establish a two-stage learning and training strategy to train the self-reflective learning mechanism model and obtain a well-trained self-reflective learning mechanism model. S7: Through causal branching networks and a trained self-reflective learning mechanism model, a sampling strategy is generated, including counterfactual sequences and quantitative assessment reports of urban gas pipeline networks, which are then provided to the urban gas pipeline network management and maintenance process.

2. The method for generating counterfactual information about urban gas pipeline networks based on dynamic evolution according to claim 1, characterized in that, S2 include: S2.1: Establish a nonlinear dynamic system affected by the external environment, and obtain the observation data at the next moment based on the observation data at the current moment and the external environment data through a nonlinear state transition function; S2.2: Establish the Koopman operator and obtain the latent variables in the Koopman subspace based on the Koopman operator; S2.3: By performing spectral decomposition on the dynamic evolution process of each latent variable, the relationship between the initial latent variable and the latent variable at the current time is obtained; S2.4: Perform spectral decomposition on the Koopman operator to obtain the left eigenvector, right eigenvector, and eigenvalues; based on the range of values ​​of each eigenvalue, obtain the mask matrix of the evolution mode decomposition; S2.5: Based on the mask matrix of the obtained evolutionary pattern decomposition, calculate the stable causal component and dynamic environmental component of the causal variable.

3. The method for generating counterfactual information about urban gas pipeline networks based on dynamic evolution according to claim 1, characterized in that, S3 include: S3.1: Establish a denoising network and use it to predict the noise level in the noisy data of the current diffusion step. The stable causal component is used as the conditional information in the denoising process to strengthen the guidance of the stable causal component in the spatiotemporal dynamics on the generation process. S3.2: Establish a loss function for training the denoising network, train the denoising network to obtain a pre-trained denoising network, which serves as a pre-trained causal branch network.

4. The method for generating counterfactual information about urban gas pipeline networks based on dynamic evolution according to claim 1, characterized in that, S4 includes: S4.1: Apply intervention conditions to the pre-trained diffusion model using the gradient of the conditional classifier, and transform the intervention effect into a gradient field of the gap between the given spatiotemporal data and the intervention result to obtain a new conditional diffusion model and establish a learnable sub-conditional gradient field. S4.2: Establish a gradient field loss function to train the learnable subconditional gradient field and obtain a pre-trained subconditional gradient field.

5. The method for generating counterfactual information about urban gas pipeline networks based on dynamic evolution according to claim 4, characterized in that, S4.1 includes: Establish a diffusion model, apply intervention conditions to the diffusion model using the gradient of the conditional classifier, and transform the intervention effect into the gradient field of the gap between the given spatiotemporal data and the intervention result to obtain a new conditional diffusion model; Based on Bayes' theorem, establish the expression for the conditional gradient field; Model a subconditional gradient field for each environment variable, and use an encoder with learnable parameters to extract generalizable environment variables from the dynamic environment components; The complete conditional gradient field is obtained by summing the individual sub-conditional gradient fields. Establish the reverse diffusion process in a two-stream causal diffusion model; Based on the reverse diffusion process of the two-stream causal diffusion model, a learnable subconditional gradient field is established.

6. The method for generating counterfactual information about urban gas pipeline networks based on dynamic evolution according to claim 1, characterized in that, S5 include: S5.1: Based on the Koopman operator, perform causal pattern decomposition, decompose latent variables into stable causal components and dynamic environment components; use an encoder to calculate each environment variable of the dynamic environment component based on the dynamic environment component; S5.2: Establish a decoupling loss function to minimize the upper bound of mutual information between different environmental variables of the dynamic environmental component, so as to achieve decoupling of environmental variables; S5.3: Establish an objective function to enhance the causal invariance of stable causal components; S5.4: Based on the Tweedie formula, predictive noise is used to predict the generated results; S5.5: Incorporate a self-reflection mechanism based on conditional intervention and gradient guidance into the learning process of the diffusion model.

Citation Information

Patent Citations

  • Device and method for generating a counterfactual data sample for a neural network

    CN112541520A

  • Electric power monitoring system based on artificial intelligence

    CN120602236A