Knowledge graph and causal reasoning based charging station safety risk dynamic scoring system

CN122656342APending Publication Date: 2026-08-28SHENZHEN SAFE CITY EMERGENCY TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610815178.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-08
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

此类方法在图结构构建中仅关注实体间的静态拓扑连接或简单共现关系,未区分不同类型节点在风险传导路径上的逻辑差异,依然依赖条件概率分布进行风险预测,无法识别实体交互过程中的风险传导方向与因果逻辑

Benefits of technology

1.本发明通过构建结构因果模型并引入反事实推理,剥离环境混杂因素导致的伪相关。将设备运行状态设定为处理变量,环境监测数据设定为混杂变量,计算处理变量在反事实状态下的潜在风险概率并与观测事实对比,获取因果效应差异作为修正因子注入概率预测模型。此机制切断了混杂变量对风险评分的伪相关干扰路径,使输出的动态风险评分独立于环境监测数据中的共现噪声,反映设备状态对安全的真实因果贡献,克服评分漂移。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122656342A_ABST
    Figure CN122656342A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of data processing, in particular to a charging place safety risk dynamic scoring system based on knowledge graph and causal reasoning. Multi-source sensing data of a charging place is acquired to construct a four-dimensional space-time evolution knowledge graph, nodes of which represent equipment and environment entities, and edges of which represent time-stamped time sequence interaction relations; a structural causal model is constructed, safety risk scoring is set as a result variable, equipment operation state is set as a processing variable, and environment monitoring data is set as a mixed variable; entity space-time feature representation is extracted through a space-time graph convolution network; based on the feature representation, potential risk probability of the processing variable in an anti-fact state is calculated, a difference in causal effect is obtained by comparing an observed fact risk probability to serve as a correction factor; and the correction factor is injected into a probability prediction model to output a dynamic risk score. The application can strip pseudo-correlation caused by environment mixed factors and overcome risk misjudgment and score drift caused by environment co-occurrence factors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, specifically to a dynamic scoring system for safety risks in charging locations based on knowledge graphs and causal reasoning. Background Technology

[0002] Safety risk assessments of charging sites often employ statistical probability models or association rule methods based on observational data. Existing systems collect equipment operation data and environmental monitoring data from multiple sources, mapping this heterogeneous data into homogeneous feature vectors. Classifiers or regression models are trained based on historical fault data, and conditional probability is used to predict the safety risk score at the current moment. These methods rely on the statistical correlation between data, using environmental monitoring data and equipment operating status as parallel features input to the model, outputting a risk probability value, and assuming that the correlation between the input features and the output result is a causal relationship.

[0003] Some existing technologies introduce knowledge graphs to model the entity relationships in charging locations, mapping entities and associations extracted from sensor data to graph nodes and edges. In risk scoring calculations, graph neural networks based on observation data are used for feature aggregation, and the aggregated node features are directly input into a fully connected layer to output a score. These methods only focus on static topological connections or simple co-occurrence relationships between entities in graph structure construction, failing to distinguish the logical differences between different types of nodes in the risk transmission path. They still rely on conditional probability distributions for risk prediction and cannot identify the direction of risk transmission and causal logic during entity interactions.

[0004] The core problem with the aforementioned existing technologies is that co-occurring environmental factors in complex charging environments lead to misjudgment of risks and score drift. Because there are confounding biases between environmental monitoring data and equipment operating status and safety risks, environmental variables simultaneously affect both equipment status and risk outcomes. Existing statistical correlation models based on conditional probability cannot distinguish between the true root cause of risk transmission and accompanying confounding factors, leading to the misjudgment of co-occurring environmental phenomena as risk root causes, resulting in spurious correlations and causing risk scores to drift with environmental fluctuations. Summary of the Invention

[0005] The purpose of this invention is to provide a dynamic scoring system for safety risks in charging locations based on knowledge graphs and causal reasoning, which can effectively solve the problems mentioned in the background art.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A dynamic scoring system for safety risks in charging locations based on knowledge graphs and causal reasoning includes: A multi-source data fusion and graph construction component is used to acquire multi-source sensor data of charging sites and construct a four-dimensional spatiotemporal evolution knowledge graph based on the multi-source sensor data. The nodes in the four-dimensional spatiotemporal evolution knowledge graph represent device entities and environmental entities, and the edges represent temporal interaction relationships with timestamps. The structural causal model building component is used to build structural causal models, setting safety risk scores as outcome variables, equipment operating status as processing variables, and environmental monitoring data as confounding variables. A spatiotemporal feature extraction component is used to extract spatiotemporal feature representations of entities in the four-dimensional spatiotemporal evolution knowledge graph through a spatiotemporal graph convolutional network; The counterfactual reasoning and correction component is used to calculate the potential risk probability of the processing variable under the counterfactual state based on the spatiotemporal feature representation, compare the risk probability under the observed facts to obtain the difference in causal effect, and use the difference in causal effect as a correction factor. A dynamic scoring output component is used to inject the correction factor into the probability prediction model and output a dynamic risk score based on the true causal contribution.

[0007] Preferably, the multi-source data fusion and graph construction component is specifically used to: extract entity attributes and inter-entity association events from the multi-source sensor data; map the entity attributes to static node features of the four-dimensional spatiotemporal evolution knowledge graph; use the occurrence timestamps and durations of the association events as edge weights to construct dynamic temporal interaction edges representing state transitions; perform periodic updates to the graph structure based on the static node features and the dynamic temporal interaction edges; capture the topological dependencies between different equipment entities and environmental entities in the charging location that evolve over time; and characterize the influence weight of historical interactions on the current risk state through the temporal decay mechanism of the dynamic temporal interaction edges.

[0008] Preferably, the structural causal model construction component is specifically used to map the operating state variables of device entities on the power supply and charging link in the four-dimensional spatiotemporal evolution knowledge graph to the processing variables, to map the monitoring data of environmental entities on the periphery of the power supply and charging link and having physical environmental coupling relationship to the hybrid variables, to map the global indicators characterizing the overall safety status of the charging site to the result variables, to establish directed edges of the hybrid variables pointing to both the processing variables and the result variables, and to form a directed acyclic graph structure characterizing the coexistence of risk transmission and hybrid interference under the charging site's operating conditions.

[0009] Preferably, the spatiotemporal feature extraction component is specifically used to introduce a spatial aggregation function and a temporal convolution kernel into the spatiotemporal graph convolutional network, to perform weighted aggregation of the spatial features of adjacent nodes in the four-dimensional spatiotemporal evolution knowledge graph through the spatial aggregation function, to perform convolution operation on the feature sequences of the same node in different time slices along the time dimension through the temporal convolution kernel, and to perform feature concatenation and nonlinear mapping between the output of the spatial aggregation function and the output of the temporal convolution kernel to generate the spatiotemporal feature representation that integrates spatial topological dependence and temporal evolution trend.

[0010] Preferably, the counterfactual reasoning and correction component is specifically used to: construct a variational autoencoder based on the spatiotemporal feature representation; infer the latent variable posterior distribution of the processing variable under the counterfactual state through the variational autoencoder; sample and generate a counterfactual feature representation from the latent variable posterior distribution; input the counterfactual feature representation into a risk predictor to obtain the potential risk probability; calculate the difference between the potential risk probability and the risk probability under the observed fact as the individual causal effect; and normalize the individual causal effect to generate the correction factor.

[0011] Preferably, the dynamic scoring output component is specifically used to perform multiplicative cross-fusion of the correction factor and the spatiotemporal feature representation to obtain a decontamination feature representation, input the decontamination feature representation into the fully connected layer of the probability prediction model, map it to a risk probability value through the activation function of the fully connected layer, combine the mapping relationship between the risk probability value and the risk level threshold, and output the dynamic risk score based on the true causal contribution, so that the numerical change of the dynamic risk score is independent of the co-occurrence noise in the environmental monitoring data.

[0012] Preferably, the temporal decay mechanism of the dynamic temporal interaction edge specifically involves introducing a time decay function to process the difference between the duration and the current timestamp, calculating the decay weight of the dynamic temporal interaction edge, and when the difference exceeds a preset time window, multiplying the decay weight with the edge weight to suppress the influence of historical related events exceeding the time window on the current node state, retaining recent high-intensity temporal interaction edges, and realizing the sparsity of the four-dimensional spatiotemporal evolution knowledge graph in the time dimension and the strengthening of key topologies.

[0013] Preferably, the hybrid variables are split into global climate variables and local microenvironmental variables. In the directed acyclic graph structure, the directed edges of the global climate variables pointing to all the processing variables and the result variables are set as shared edge weights, and the directed edges of the local microenvironmental variables pointing to specific processing variables and the result variables are set as independent edge weights. By orthogonally decoupling the shared edge weights and the independent edge weights, the superimposed interference of the internal heat accumulation effect of the charging site and the external meteorological changes on the safety risk score is separated.

[0014] Preferably, the weighted aggregation process of the spatial aggregation function specifically involves calculating the joint attention coefficient of the feature similarity and topological distance between the target node and its neighboring nodes, performing a weighted summation of the spatial features of the neighboring nodes based on the joint attention coefficient, introducing node type encoding to bias the result of the weighted summation, eliminating the distribution differences between device entity nodes and environment entity nodes in the feature dimension, and ensuring that the target node features output by the spatial aggregation function contain an aligned representation of multimodal information within the topological local neighborhood.

[0015] Preferably, when the variational autoencoder infers the posterior distribution of latent variables under the counterfactual state, a distribution alignment constraint term is introduced. The Wasserstein distance between the posterior distribution of latent variables under the counterfactual state and the posterior distribution of latent variables under the observed fact is calculated. The Wasserstein distance is added as a penalty term to the loss function of the variational autoencoder, forcing the distribution of the counterfactual feature representation to align with the distribution of the observed fact feature representation in the latent space. This reduces the distribution bias when generating counterfactual samples and improves the estimation stability of the individual causal effect.

[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention constructs a structural causal model and introduces counterfactual reasoning to eliminate spurious correlations caused by environmental confounding factors. Equipment operating status is set as the treatment variable, and environmental monitoring data is set as the confounding variable. The potential risk probability of the treatment variable under counterfactual conditions is calculated and compared with observed facts. The difference in causal effects is obtained as a correction factor injected into the probability prediction model. This mechanism cuts off the spurious correlation interference path of confounding variables on risk scores, making the output dynamic risk score independent of co-occurrence noise in environmental monitoring data, reflecting the true causal contribution of equipment status to safety, and overcoming score drift.

[0017] 2. This invention constructs a four-dimensional spatiotemporal evolution knowledge graph based on multi-source sensor data and extracts spatiotemporal feature representations of entities through a spatiotemporal graph convolutional network. Edges in the graph represent time-stamped temporal interaction relationships, capturing the dynamic dependencies of state transitions between entities. The spatiotemporal graph convolutional network combines spatial aggregation functions and temporal convolution kernels to extract features containing topological dependencies and temporal evolution trends. This architecture avoids information loss caused by the isomorphism processing of multi-source data, providing a fine-grained feature foundation containing temporal interactions and topological structures for counterfactual reasoning, thus improving the accuracy of risk root cause identification.

[0018] 3. In this invention, when inferring the posterior distribution of latent variables under a counterfactual state using a variational autoencoder, a distribution alignment constraint term is introduced. The Wasserstein distance between the counterfactual state and the observed fact's latent variable posterior distribution is calculated as a penalty term, forcing the counterfactual feature representation to align with the observed fact's feature representation in the latent space. This approach reduces the distribution bias during counterfactual sample generation, improves the stability of individual causal effect estimation, and suppresses abnormal score fluctuations caused by feature space inconsistencies. Attached Figure Description

[0019] Figure 1 This is a flowchart illustrating the overall workflow of the dynamic safety risk scoring system for charging locations according to the present invention. Figure 2 This is a flowchart of the construction and temporal decay update of the four-dimensional spatiotemporal evolution knowledge graph of the present invention; Figure 3 This is a flowchart illustrating the construction of the structural causal model and the orthogonal decoupling of confounding variables in this invention. Figure 4 This is a flowchart of the spatiotemporal feature extraction process of the spatiotemporal graph convolutional network of the present invention; Figure 5 This is a flowchart of the counterfactual reasoning and correction factor generation process of the present invention; Figure 6 This is a flowchart of the dynamic risk scoring output and decontamination fusion process of the present invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] Please refer to Figure 1This embodiment provides a dynamic scoring system for safety risks in charging locations based on knowledge graphs and causal reasoning. A multi-source data fusion and graph construction component acquires multi-source sensor data from charging locations, including charging pile voltage and current data, battery temperature data, smoke concentration data, temperature and humidity data, combustible gas concentration data, personnel entry and exit data, and equipment on / off status data. The multi-source data fusion and graph construction component preprocesses the multi-source sensor data, including data cleaning, outlier removal, timestamp alignment, and standardization. During data cleaning, a sliding window mean value filtering method is used to remove sensor noise, with the sliding window size set to 5 sampling points. Outlier removal uses the 3σ criterion, marking data exceeding the mean ± 3 standard deviations as outliers and completing them using linear interpolation. Timestamp alignment unifies all sensor data to the same sampling time interval, set to 1 second. Standardization maps sensor data of different dimensions to the [0,1] interval using a minimum-maximum standardization method.

[0022] The multi-source data fusion and graph construction component constructs a four-dimensional spatiotemporal evolution knowledge graph based on preprocessed multi-source sensor data. Nodes in the four-dimensional spatiotemporal evolution knowledge graph represent device entities and environmental entities. Device entities include charging piles, batteries, distribution cabinets, transformers, circuit breakers, and fire-fighting equipment; environmental entities include temperature sensors, humidity sensors, smoke sensors, combustible gas sensors, and personnel detection equipment. Edges in the four-dimensional spatiotemporal evolution knowledge graph represent time-stamped temporal interaction relationships, including power supply relationships, charging relationships, heat conduction relationships, gas diffusion relationships, and personnel-device interaction relationships.

[0023] The structural causal model building component constructs a structural causal model, setting the safety risk score as the outcome variable, the equipment operating status as the processing variable, and environmental monitoring data as the confounding variable. The structural causal model uses a directed acyclic graph (DAG) structure to represent the causal relationships between variables. Nodes in the DAG correspond to variables, and directed edges correspond to the causal effects between variables. Based on domain knowledge, the component determines the causal direction between variables. The equipment operating status directly affects the safety risk score, while environmental monitoring data simultaneously affects both the equipment operating status and the safety risk score.

[0024] The spatiotemporal feature extraction component extracts spatiotemporal feature representations of entities in a four-dimensional spatiotemporal evolution knowledge graph using a spatiotemporal graph convolutional network. The spatiotemporal graph convolutional network comprises spatial and temporal convolutional layers. The spatial convolutional layers extract spatial topological dependencies between nodes, while the temporal convolutional layers extract the trend features of node features over time. The input to the spatiotemporal graph convolutional network is the adjacency matrix and node feature matrix of the four-dimensional spatiotemporal evolution knowledge graph, and the output is a spatiotemporal feature representation that integrates spatial and temporal information.

[0025] The counterfactual reasoning and correction component calculates the potential risk probability of processing variables under counterfactual conditions based on spatiotemporal characteristics. It compares the risk probability with that under observed facts to obtain the difference in causal effects, using this difference as a correction factor. During counterfactual reasoning, the values ​​of confounding variables are kept constant while the values ​​of processing variables are changed, calculating the difference in risk probability under different processing variable values. The difference in causal effects reflects the true causal contribution of equipment operating status to the safety risk score, eliminating the interference of environmental confounding factors.

[0026] The dynamic scoring output component injects correction factors into the probabilistic prediction model, outputting a dynamic risk score based on the true causal contribution. The probabilistic prediction model employs a multilayer perceptron structure, comprising an input layer, a hidden layer, and an output layer. The input layer receives the fusion features of spatiotemporal feature representation and correction factors; the hidden layer performs a nonlinear transformation on the fusion features; and the output layer outputs the safety risk score. The dynamic risk score ranges from [0,1], with higher values ​​indicating higher safety risk.

[0027] In this embodiment, reference Figure 2 The workflow of the multi-source data fusion and graph construction component is as follows: First, multi-source sensor data is acquired from various sensors and equipment control systems in the charging site through a data acquisition interface that supports multiple communication protocols including Modbus, MQTT, and HTTP. Second, the acquired multi-source sensor data is preprocessed to remove noise and outliers, and to unify timestamps and data formats. Then, entity attributes and associated events between entities are extracted from the preprocessed data. Entity attributes include equipment number, equipment type, equipment location, and equipment operating parameters, while associated events include charging pile initiation, battery temperature rise, smoke concentration exceeding standards, and personnel approaching the equipment. Finally, entity attributes are mapped to node features of a four-dimensional spatiotemporal evolution knowledge graph, and associated events are mapped to edges of the four-dimensional spatiotemporal evolution knowledge graph, thus constructing an initial four-dimensional spatiotemporal evolution knowledge graph.

[0028] refer to Figure 3 The workflow of the structural causal model construction component is as follows: First, variables related to safety risks are extracted from the four-dimensional spatiotemporal evolution knowledge graph, including equipment operating status variables, environmental monitoring variables, and safety risk variables. Second, causal relationships between variables are determined based on domain knowledge, with equipment operating status variables as treatment variables, environmental monitoring variables as confounding variables, and safety risk variables as outcome variables. Then, a directed acyclic graph (DAG) structure is constructed, adding directed edges from confounding variables to treatment variables, from confounding variables to outcome variables, and from treatment variables to outcome variables. Finally, the weights of each edge in the DAG are estimated based on historical data; the weights represent the strength of the causal influence between variables.

[0029] refer to Figure 4The workflow of the spatiotemporal feature extraction component is as follows: First, the four-dimensional spatiotemporal evolution knowledge graph is converted into a format that can be processed by a graph convolutional network, including an adjacency matrix and a node feature matrix. The elements of the adjacency matrix indicate whether there are edges connecting nodes, and the rows of the node feature matrix correspond to nodes, while the columns correspond to the feature dimensions of the nodes. Second, the adjacency matrix and node feature matrix are input into the spatial convolutional layer of the spatiotemporal graph convolutional network. The spatial convolutional layer aggregates the features of adjacent nodes to generate a spatial feature representation. Then, the spatial feature representation is input into the temporal convolutional layer of the spatiotemporal graph convolutional network. The temporal convolutional layer performs convolution operations along the time dimension on the feature sequence to generate a temporal feature representation. Finally, the spatial and temporal feature representations are concatenated, and a non-linear activation function is used to generate a spatiotemporal feature representation.

[0030] refer to Figure 5 The workflow of the counterfactual reasoning and correction component is as follows: First, the spatiotemporal feature representation is input into the risk predictor to obtain the risk probability under the observed facts. The risk predictor adopts the same probability prediction model structure as the dynamic scoring output component. Second, a counterfactual scenario is constructed, keeping the values ​​of the confounding variables the same as the observed facts, and setting the values ​​of the processing variables to the counterfactual state. Then, a counterfactual feature representation is generated based on the counterfactual scenario, and input into the risk predictor to obtain the potential risk probability under the counterfactual state. Finally, the difference between the potential risk probability and the risk probability under the observed facts is calculated to obtain the causal effect difference, and the causal effect difference is normalized to generate a correction factor.

[0031] refer to Figure 6 The workflow of the dynamic scoring output component is as follows: First, the correction factor and spatiotemporal feature representation are fused using element-wise multiplication. Second, the fused features are input into the fully connected layer of the probability prediction model, where the fused features undergo linear transformation and nonlinear activation. Then, the features are mapped to risk probability values ​​in the [0,1] interval using the sigmoid activation function of the output layer. Finally, based on the mapping relationship between the risk probability values ​​and risk level thresholds, the corresponding dynamic risk score is output. The risk level thresholds are divided into three levels: low risk, medium risk, and high risk. Low risk corresponds to a risk probability value of [0,0.3], medium risk corresponds to a risk probability value of (0.3,0.7], and high risk corresponds to a risk probability value of (0.7,1). The definitions of node and edge types in the four-dimensional spatiotemporal evolution knowledge graph are shown in Table 1.

[0032] Table 1. Definitions of Node and Edge Types in the Four-Dimensional Spatiotemporal Evolution Knowledge Graph charging pile Equipment number, equipment type, installation location, rated power, current power, voltage, current Power supply relationship Power supply equipment number, power receiving equipment number, start time, end time, power supply Battery Device number, battery type, rated capacity, current capacity, temperature, voltage, current Charging relationship Charging station number, battery number, start time, end time, charging power power distribution cabinet Equipment number, equipment type, installation location, input voltage, output voltage, current Thermal conduction relationship Source device number, target device number, start time, end time, temperature difference Temperature sensor Equipment number, installation location, measured value, measurement time Gas diffusion relationship Source location, target location, start time, end time, gas concentration difference Smoke sensor Equipment number, installation location, measured value, measurement time Interpersonal relationships Personnel ID, Equipment ID, Start Time, End Time, Interaction Type Table 1 defines the main node and edge types in the four-dimensional spatiotemporal evolution knowledge graph, along with their corresponding attribute information. Node attributes describe the static characteristics and dynamic operating states of entities, while edge attributes describe the temporal and intensity characteristics of interactions between entities. By defining different types of nodes and edges, the states and interactions between equipment entities and environmental entities within a charging site can be comprehensively characterized, providing a foundation for subsequent spatiotemporal feature extraction and causal inference.

[0033] In this embodiment, the construction process of the four-dimensional spatiotemporal evolution knowledge graph adopts an incremental update mechanism, updating the graph at fixed time intervals. During the update process, nodes and edges within the time window are retained, while historical nodes and edges exceeding the time window are deleted. The size of the time window is set according to the risk characteristics of the charging site, typically 24 hours. The incremental update mechanism ensures that the four-dimensional spatiotemporal evolution knowledge graph always reflects the latest state of the charging site, while controlling the scale of the graph and improving the efficiency of subsequent processing.

[0034] In a preferred embodiment, the multi-source data fusion and graph construction component extracts entity attributes and inter-entity association events from multi-source sensor data, maps entity attributes to static node features of a four-dimensional spatiotemporal evolution knowledge graph, uses the occurrence timestamps and durations of associated events as edge weights, constructs dynamic temporal interaction edges representing state changes, and performs periodic updates to the graph structure based on static node features and dynamic temporal interaction edges to capture the topological dependencies between different equipment entities and environmental entities in the charging site that evolve over time. The temporal decay mechanism of the dynamic temporal interaction edges represents the influence weight of historical interactions on the current risk state.

[0035] In the entity attribute extraction process, regular expression matching is used to extract entity attributes from structured data, while a named entity recognition model is used to extract entity attributes from unstructured data. The named entity recognition model employs a bidirectional long short-term memory network combined with a conditional random field structure. The input is a text sequence, and the output is a sequence of entity labels. Entity labels include equipment number, equipment type, equipment location, and operating parameters.

[0036] In the process of related event extraction, an event extraction model is used to extract related events from multi-source sensor data. The event extraction model adopts an end-to-end structure based on a pre-trained language model. The input is the feature representation of the multi-source sensor data, and the output is event type, event trigger words, and event arguments. Event types include charging start, charging end, abnormal temperature, smoke alarm, gas leak, personnel entry, and personnel departure. Event arguments include the time, location, and entities involved in the event.

[0037] In constructing dynamic temporal interaction edges, the occurrence timestamp of the associated event is used as the start time of the edge, and the end timestamp of the associated event is used as the end time of the edge. The duration of the associated event is then calculated. The strength of the associated event is used as the initial weight of the edge, and the strength of the associated event is calculated based on the event type and event parameters. For example, the strength of a charging event is proportional to the charging power, and the strength of a temperature anomaly event is proportional to the degree to which the temperature exceeds the normal range.

[0038] During the periodic update of the graph structure, the four-dimensional spatiotemporal evolution knowledge graph is updated at fixed time intervals. The update process includes node updates and edge updates. During node updates, newly appearing entity nodes are added, and the attribute features of existing entity nodes are updated. During edge updates, dynamic temporal interaction edges corresponding to newly occurring associated events are added, the weights of existing dynamic temporal interaction edges are updated, and dynamic temporal interaction edges that have ended and exceeded the time window are deleted.

[0039] The temporal decay mechanism of dynamic temporal interaction edges is specifically implemented by introducing a time decay function to handle the difference between the duration and the current timestamp, calculating the decay weight of the dynamic temporal interaction edge, and multiplying the decay weight with the edge weight when the difference exceeds a preset time window. This suppresses the influence of historical related events that exceed the time window on the current node state, retains recent high-intensity temporal interaction edges, and realizes the sparsity of the four-dimensional spatiotemporal evolution knowledge graph in the time dimension and the strengthening of key topologies.

[0040] The time decay function uses an exponential decay function, and its mathematical expression is: in, The edge weights after time decay. Let be the initial weight of the edge. The time decay coefficient, This is the difference between the end time of the associated event and the current time. Time decay coefficient. The value is set according to the type of the associated event. For events with a long duration of impact, such as heat accumulation events, The value is relatively small; for events with a short duration of impact, such as transient current surge events, The value is relatively large.

[0041] In this embodiment, the time decay coefficient The value range is [0.001, 0.1]. For heat conduction events, Set to 0.005; for gas diffusion events, Set to 0.01; for charging events, Set to 0.02; for user interaction events, Set to 0.05. By setting different time decay coefficients, the influence of different types of related events on the current risk status over time can be accurately characterized.

[0042] When the difference between the end time of the associated event and the current time Exceeding the preset time window At that time, the decay weight is multiplied by the edge weight. (Preset time window) The value is set based on the risk characteristics of the charging location, and is typically set to 24 hours. When At that time, the edge weights become: At this point, the edge weights no longer change over time and remain a small constant. More than twice the preset time window When this occurs, the edge is removed from the four-dimensional spatiotemporal evolution knowledge graph. The time decay coefficients and time window settings for different types of associated events are shown in Table 2.

[0043] Table 2. Time decay coefficients and time window settings for different types of associated events.

[0044] Table 2 lists the time decay coefficients and time window settings for different types of associated events. By setting different time decay coefficients and time windows for different types of associated events, the impact of historical associated events on the current risk status can be more accurately characterized. For heat conduction events with long durations, setting a smaller time decay coefficient and a larger time window can retain historical heat accumulation information for a longer period of time; for current surge events with short durations, setting a larger time decay coefficient and a smaller time window can quickly decay the impact of historical instantaneous events.

[0045] In this embodiment, the topology of the four-dimensional spatiotemporal evolution knowledge graph changes dynamically over time, capturing the evolution of interactions between entities within the charging area. For example, when a charging pile starts charging the battery, a dynamic temporal interaction edge representing the charging relationship is added between the charging pile node and the battery node. The edge's start time is the charging start time, and its initial weight is proportional to the charging power. As the charging process progresses, the battery temperature gradually rises. A dynamic temporal interaction edge representing the heat conduction relationship is added between the battery node and the temperature sensor node. The edge's start time is the time when the temperature begins to rise, and its initial weight is proportional to the rate of temperature increase. When charging ends, the termination time of the dynamic temporal interaction edge representing the charging relationship is set to the charging end time, and the edge weight begins to gradually decrease according to a time decay function. When the battery temperature returns to normal, the termination time of the dynamic temporal interaction edge representing the heat conduction relationship is set to the time when the temperature returns to normal, and the edge weight begins to gradually decrease according to a time decay function.

[0046] By employing a temporal decay mechanism for dynamic temporal interaction edges, the different impacts of recent high-intensity correlation events and distant low-intensity correlation events on the current risk state can be distinguished. Recent high-intensity correlation events have larger edge weights and a greater impact on the current node state; distant low-intensity correlation events have smaller edge weights and a smaller impact on the current node state. This mechanism enables the four-dimensional spatiotemporal evolution knowledge graph to focus on key topological structures that significantly influence the current risk state, suppress historical noise interference, and improve the accuracy of subsequent spatiotemporal feature extraction.

[0047] In a preferred embodiment, the structural causal model building component maps the operating state variables of device entities on the power supply and charging link in the four-dimensional spatiotemporal evolution knowledge graph to processing variables, maps the monitoring data of environmental entities on the periphery of the power supply and charging link and having physical environmental coupling relationship to hybrid variables, maps the global indicators characterizing the overall safety status of the charging site to result variables, establishes directed edges that point to both processing and result variables for hybrid variables, and forms a directed acyclic graph structure that characterizes the coexistence of risk transmission and hybrid interference under the operating conditions of the charging site.

[0048] The power supply and charging link encompasses the complete power transmission path from grid input to battery charging, involving equipment entities such as transformers, distribution cabinets, circuit breakers, charging piles, and batteries. The operational state variables of these equipment entities include transformer temperature, distribution cabinet input voltage, distribution cabinet output current, circuit breaker status, charging pile output power, charging pile temperature, battery voltage, battery current, battery temperature, and battery internal resistance. These operational state variables directly impact the safety risks of charging sites and are direct causes of safety risks.

[0049] Environmental entities located outside the power supply and charging link and physically coupled with it include temperature sensors, humidity sensors, smoke sensors, combustible gas sensors, wind speed sensors, and air pressure sensors. Monitoring data from these environmental entities includes ambient temperature, ambient humidity, smoke concentration, combustible gas concentration, wind speed, and air pressure. This environmental monitoring data not only directly affects safety risks but also influences the operational status of equipment entities along the power supply and charging link, making it a confounding variable in safety risk assessment.

[0050] Global indicators characterizing the overall safety status of charging facilities include fire risk, explosion risk, electric shock risk, and equipment damage risk. These global indicators comprehensively reflect the safety status of charging facilities and are outcome variables in the structural causal model.

[0051] The directed acyclic graph structure of the structural causal model includes processing variable nodes, confounding variable nodes, and outcome variable nodes. Each confounding variable node has a directed edge from it to each processing variable node, representing the influence of environmental factors on equipment operating status. Each confounding variable node also has a directed edge from it to the outcome variable node, representing the direct influence of environmental factors on safety risks. Finally, each processing variable node has a directed edge from it to the outcome variable node, representing the direct influence of equipment operating status on safety risks.

[0052] The confounding variables are decomposed into global climate variables and local microenvironmental variables. In the directed acyclic graph structure, the directed edges from the global climate variables to all processing variables and outcome variables are set as shared edge weights, and the directed edges from the local microenvironmental variables to specific processing variables and outcome variables are set as independent edge weights. By orthogonally decoupling the shared edge weights and independent edge weights, the superposition interference of the internal heat accumulation effect of the charging site and the external meteorological changes on the safety risk score is separated.

[0053] Global climate variables include ambient temperature, ambient humidity, wind speed, and air pressure. These variables affect all equipment and environmental entities within the charging site, covering the entire charging area. Local microenvironmental variables include the temperature around the charging pile, the temperature around the battery, the temperature around the power distribution cabinet, smoke concentration, and combustible gas concentration. These variables only affect equipment and environmental entities within a specific area, limiting their impact to that local area.

[0054] Shared edge weights represent the combined influence of global climate variables on all treatment and outcome variables; all directed edges originating from global climate variable nodes have the same weight. Independent edge weights represent the independent influence of local microenvironmental variables on specific treatment and outcome variables; each directed edge originating from a local microenvironmental variable node has a different weight.

[0055] The edge weight estimation process employs the maximum likelihood estimation method, which estimates the weights of each edge in the directed acyclic graph based on historical observation data. This historical observation data includes equipment operating status data, environmental monitoring data, and safety risk event data. The objective of maximum likelihood estimation is to maximize the likelihood probability of the observed data under the structural causal model.

[0056] The mathematical expression for the likelihood function is: in, Let the edge weight parameter vector be... The number of samples in historical observation data. For the first The values ​​of the outcome variables for each sample For the first The values ​​of the processing variables for each sample. For the first The values ​​of confounding variables for each sample. Given the treatment variable and confounding variables, the conditional probability of the outcome variable is given. Given confounding variables, the conditional probability of the treatment variable. The marginal probabilities of the confounding variables.

[0057] By maximizing the likelihood function This allows us to obtain the edge weight parameter vector. The estimated value. To avoid overfitting, an L2 regularization term is added to the likelihood function. The mathematical expression for the regularization term is: in, The regularization coefficient is . The squared L2 norm of the edge weight parameter vector. Regularization coefficient. The value of is determined by cross-validation.

[0058] The final objective function is: Minimize the objective function using the gradient descent algorithm. The edge weight parameter vector is obtained. The optimal estimate is shown in Table 3. The classification of variables and the definition of causal relationships in the structural causal model are also shown in Table 3.

[0059] Table 3. Classification of variables and definition of causal relationships in structural causal models. Processing variables Transformer temperature Pointing to the result variable Independent edge weights Processing variables Charging pile output power Pointing to the result variable Independent edge weights Processing variables Battery temperature Pointing to the result variable Independent edge weights Processing variables Battery internal resistance Pointing to the result variable Independent edge weights Global miscellaneous variables Ambient temperature Pointers to all processing variables and result variables Shared edge weight Global miscellaneous variables Ambient humidity Pointers to all processing variables and result variables Shared edge weight Global miscellaneous variables wind speed Pointers to all processing variables and result variables Shared edge weight Local confounding variables Temperature around the charging station Pointing to the output power of the charging pile and the resulting variables Independent edge weights Local confounding variables Battery ambient temperature Pointing to battery temperature and outcome variables Independent edge weights Local confounding variables Smoke Concentration Pointing to the result variable Independent edge weights Outcome variable Safety risk score Pointed to by all processing variables and miscellaneous variables - Table 3 defines the variable classification and causal relationships in the structural causal model. Processing variables include the operational status variables of key equipment on the power supply and charging links, which directly affect the safety risk score. Confounding variables are divided into global and local confounding variables. Global confounding variables affect all processing and outcome variables and are weighted using shared edges; local confounding variables affect only specific processing and outcome variables and are weighted using independent edges. The outcome variable is the safety risk score, which comprehensively reflects the overall safety status of the charging site.

[0060] In this embodiment, by splitting confounding variables into global climate variables and local microenvironmental variables, and setting shared edge weights and independent edge weights respectively, the impact of different types of environmental factors on safety risks can be separated more accurately. The impact of global climate variables is universal, and the shared edge weights can capture their overall impact on the entire charging site; the impact of local microenvironmental variables is local, and the independent edge weights can capture their local impact on specific equipment and areas. This orthogonal decoupling mechanism can effectively separate the superimposed interference of internal heat accumulation effects and external meteorological changes on safety risk scores, improving the accuracy of causal effect estimation.

[0061] In a preferred embodiment, the spatiotemporal feature extraction component introduces a spatial aggregation function and a temporal convolution kernel into the spatiotemporal graph convolutional network. The spatial aggregation function performs weighted aggregation of the spatial features of adjacent nodes in the four-dimensional spatiotemporal evolution knowledge graph, and the temporal convolution kernel performs convolution operation on the feature sequences of the same node in different time slices along the time dimension. The output of the spatial aggregation function and the output of the temporal convolution kernel are concatenated and nonlinearly mapped to generate a spatiotemporal feature representation that integrates spatial topological dependence and temporal evolution trend.

[0062] The spatiotemporal graph convolutional network comprises multiple spatiotemporal convolutional blocks, each consisting of a spatial convolutional layer and a temporal convolutional layer. The spatial convolutional layer employs a graph attention network structure, adaptively learning the weights of neighboring nodes through an attention mechanism. The temporal convolutional layer uses a one-dimensional convolutional neural network structure, extracting features at different time scales through multiple convolutional kernels of varying sizes.

[0063] The weighted aggregation process of the spatial aggregation function is as follows: calculate the joint attention coefficient of the feature similarity and topological distance between the target node and its neighboring nodes; perform weighted summation of the spatial features of the neighboring nodes based on the joint attention coefficient; introduce node type encoding to bias the result of the weighted summation; eliminate the distribution difference between device entity nodes and environment entity nodes in the feature dimension; and make the target node features output by the spatial aggregation function contain the aligned representation of multimodal information in the topological local neighborhood.

[0064] The calculation process for the joint attention coefficient is as follows: First, calculate the feature similarity between the target node and its neighboring nodes. The feature similarity is calculated using cosine similarity, and the mathematical expression is: in, For the target node With neighboring nodes Feature similarity, For the target node eigenvectors, Adjacent nodes eigenvectors.

[0065] Next, the topological distance between the target node and its neighboring nodes is calculated. The topological distance is defined as the shortest path length between two nodes in the four-dimensional spatiotemporal evolution knowledge graph. For directly adjacent nodes, the topological distance is 1; for nodes indirectly adjacent through an intermediate node, the topological distance is 2, and so on.

[0066] Then, the feature similarity and topological distance are fused to obtain the joint attention coefficient, which is mathematically expressed as: in, For the target node With neighboring nodes The joint attention coefficient, For the target node With neighboring nodes Topological distance, This is the weight matrix for feature similarity. This is the weight matrix for topological distance. For bias vectors, It is the sigmoid activation function.

[0067] Finally, for the target node The joint attention coefficients of all neighboring nodes are normalized, and the mathematical expression is: in, The normalized joint attention coefficients are... For the target node The set of all adjacent nodes.

[0068] Based on the normalized joint attention coefficients, the spatial features of adjacent nodes are weighted and summed to obtain the spatial aggregated features of the target node, mathematically expressed as follows: Node type encoding is introduced to bias the weighted summation result. The node type encoding is a learnable vector, with different types of nodes having different type encodings. The mathematical expression for bias correction is: in, The target node spatial features are after bias correction. For the target node Type encoding, For the target node The type.

[0069] The temporal convolutional layer employs a one-dimensional convolutional neural network structure, containing multiple convolutional kernels, each corresponding to a time scale. The sizes of the temporal convolutional kernels are set to 3, 5, and 7, corresponding to short, medium, and long time scales, respectively. The input to the temporal convolutional layer is the feature sequence of the same node on consecutive time slices, and the output is the temporal feature representation at different time scales.

[0070] The mathematical expression for temporal convolution is: in, For nodes In time Use the Temporal features obtained from convolutional kernels For the first The weights of each convolutional kernel, For convolution operations, For nodes From time Time The characteristic sequence, The size of the convolution kernel. For the first The bias of each convolution kernel This is the ReLU activation function.

[0071] By concatenating temporal features from different time scales, nodes are obtained. In time The comprehensive time characteristics are represented by the mathematical expression: in, For nodes In time The comprehensive time characteristics are represented as follows: The number of convolution kernels over time. This is a feature splicing operation.

[0072] By concatenating the spatial features output by the spatial aggregation function with the temporal features output by the temporal convolutional layer, a spatiotemporal feature representation fusing spatial and temporal information is obtained, expressed mathematically as follows: in, For nodes In time The spatiotemporal characteristics are represented. For nodes In time Spatial characteristics, For nodes In time The time characteristics.

[0073] The spatiotemporal feature representation is further transformed through a nonlinear mapping layer. The nonlinear mapping layer adopts a fully connected layer structure, and its mathematical expression is as follows: in, This represents the spatiotemporal features after nonlinear mapping. The weight matrix of the nonlinear mapping layer. The bias vector of the nonlinear mapping layer. The ReLU activation function is used. The parameters for the spatiotemporal graph convolutional network structure are shown in Table 4.

[0074] Table 4. Spatiotemporal graph convolutional network structure parameter settings Input layer Node feature input - 64 Spatiotemporal convolution block 1 Spatial convolutional layer Attention count: 8 128 Spatiotemporal convolution block 1 Temporal convolutional layer Kernel sizes: 3, 5, 7; Number of kernels: 16 128 Spatiotemporal convolution block 2 Spatial convolutional layer Attention count: 8 256 Spatiotemporal convolution block 2 Temporal convolutional layer Kernel sizes: 3, 5, 7; Number: 32 256 Spatiotemporal convolution block 3 Spatial convolutional layer Attention count: 8 512 Spatiotemporal convolution block 3 Temporal convolutional layer Kernel sizes: 3, 5, 7; Number: 64 512 Output layer Fully connected layer - 256 Table 4 lists the structural parameter settings of the spatiotemporal graph convolutional network. The spatiotemporal graph convolutional network contains three spatiotemporal convolutional blocks, each consisting of one spatial convolutional layer and one temporal convolutional layer. The spatial convolutional layer employs a multi-head attention mechanism with 8 attention heads, capable of capturing different types of dependencies between nodes. The temporal convolutional layer uses multiple convolutional kernels of different sizes, enabling the extraction of features at different time scales. As the number of network layers increases, the feature dimensionality gradually increases, allowing the extraction of more abstract and higher-level spatiotemporal features.

[0075] In this embodiment, by combining a spatial aggregation function with a temporal convolution kernel, both spatial topological dependency features and temporal evolution trend features of entities in a four-dimensional spatiotemporal evolution knowledge graph can be extracted simultaneously. The spatial aggregation function adaptively learns the weights of neighboring nodes through a joint attention mechanism, enabling it to capture complex interaction relationships between different types of nodes; the temporal convolution kernel, through multi-scale convolution operations, can capture different patterns of entity state changes over time. Introducing node type encoding to bias-correct the spatial aggregation features can eliminate the differences in feature distribution between device entity nodes and environment entity nodes, improving the consistency of feature representation.

[0076] In a preferred embodiment, the counterfactual reasoning and correction component constructs a variational autoencoder based on spatiotemporal feature representation, infers the posterior distribution of latent variables of the processing variable under the counterfactual state through the variational autoencoder, samples from the posterior distribution of latent variables to generate counterfactual feature representation, inputs the counterfactual feature representation into the risk predictor to obtain the potential risk probability, calculates the difference between the potential risk probability and the risk probability under the observed fact as the individual causal effect, and normalizes the individual causal effect to generate a correction factor.

[0077] A variational autoencoder consists of two parts: an encoder and a decoder. The encoder maps the spatiotemporal features of observed facts to a probability distribution of latent variables, while the decoder samples the latent variables and maps them back to the feature space. The training objective of a variational autoencoder is to minimize the sum of the reconstruction error and the KL divergence.

[0078] The encoder employs a multilayer perceptron architecture, comprising an input layer, hidden layers, and an output layer. The input layer receives spatiotemporal feature representations, the hidden layers perform nonlinear transformations on the features, and the output layer outputs the mean and log-variance of the latent variables. The mathematical expression for the encoder is: in, The spatiotemporal features are represented by the input. Let be the mean of the posterior distribution of the latent variables. Let be the log-variance of the posterior distribution of the latent variable. , Here is the weight matrix of the encoder. , This is the bias vector of the encoder.

[0079] Latent variables are sampled from the posterior distribution of the latent variables, and a reparameterization technique is used. The mathematical expression is: in, The latent variables obtained from sampling, , This is a noise vector sampled from a standard normal distribution. This is an element-wise multiplication operation.

[0080] The decoder employs a multilayer perceptron architecture, comprising an input layer, hidden layers, and an output layer. The input layer receives the sampled latent variables, the hidden layers perform nonlinear transformations on the latent variables, and the output layer outputs the reconstructed feature representation. The mathematical expression for the decoder is: in, For the reconstructed feature representation, Here is the weight matrix of the decoder. This is the bias vector for the decoder.

[0081] The loss function of a variational autoencoder consists of two parts: reconstruction loss and KL divergence. The mathematical expression is: in, To calculate the reconstruction loss, the mean squared error between the input features and the reconstructed features is calculated; For the KL divergence, calculate the difference between the posterior distribution of the latent variables and the standard normal distribution; The weighting coefficients for the KL divergence.

[0082] When the variational autoencoder infers the posterior distribution of latent variables under counterfactual conditions, a distribution alignment constraint term is introduced. The Wasserstein distance between the posterior distribution of latent variables under counterfactual conditions and the posterior distribution of latent variables under observed facts is calculated. The Wasserstein distance is added as a penalty term to the loss function of the variational autoencoder, which forces the distribution of counterfactual feature representations to align with that of observed fact feature representations in the latent space. This reduces the distribution bias when generating counterfactual samples and improves the estimation stability of individual causal effects.

[0083] The mathematical expression for Wasserstein distance is: in, To observe the posterior distribution of latent variables under the given facts, For the posterior distribution of latent variables in a counterfactual state, Let be the set of all joint distributions, and let their marginal distributions be respectively and .

[0084] In practical calculations, the Wasserstein distance is calculated using a dual form, and its mathematical expression is as follows: in, A function that satisfies the 1-Lipschitz condition.

[0085] The variational autoencoder loss function after introducing the distribution alignment constraint term is: in, These are the weighting coefficients for the distribution alignment constraint term.

[0086] The process of generating counterfactual feature representations is as follows: First, the spatiotemporal feature representations under the observed facts are input into the encoder to obtain the posterior distribution of the latent variables under the observed facts. Secondly, the processing variable is set to the counterfactual state, while the confounding variables remain unchanged, to generate input features under the counterfactual scenario. Then, the input features under the counterfactual scenario are input into the encoder to obtain the posterior distribution of the latent variables under the counterfactual state. Finally, from the posterior distribution of latent variables under counterfactual conditions... The latent variables are sampled and input into the decoder to generate counterfactual feature representations.

[0087] The counterfactual feature representation is input into the risk predictor to obtain the potential risk probability under the counterfactual state. The risk predictor adopts a multilayer perceptron structure, including an input layer, a hidden layer, and an output layer. The input layer receives the counterfactual feature representation, the hidden layer performs a nonlinear transformation on the features, and the output layer outputs the risk probability value. The mathematical expression of the risk predictor is: in, The probability of potential risk under a counterfactual state. As a counterfactual feature, This is the weight matrix of the risk predictor. This is the bias vector for the risk predictor. It is the sigmoid activation function.

[0088] The risk probability under observed facts is obtained by inputting the spatiotemporal feature representation of observed facts into the risk predictor, and the mathematical expression is: in, In order to observe the probability of risk under the facts, This represents the spatiotemporal characteristics of observed facts.

[0089] The individual causal effect is the difference between the potential risk probability and the observed risk probability, expressed mathematically as: in, This is an individual causal effect.

[0090] The individual causal effects were normalized to generate correction factors. The normalization process used the min-maximum standardization method, and the mathematical expression is as follows: in, As a correction factor, This represents the minimum value of the individual causal effect. This represents the maximum value of the individual causal effect.

[0091] The dynamic scoring output component multiplicatively cross-fuses the correction factor with the spatiotemporal feature representation to obtain a decontamination feature representation. This decontamination feature representation is then input into the fully connected layer of the probabilistic prediction model and mapped to a risk probability value through the activation function of the fully connected layer. The mapping relationship between the risk probability value and the risk level threshold is combined to output a dynamic risk score based on the true causal contribution, making the numerical change of the dynamic risk score independent of the co-occurrence noise in the environmental monitoring data.

[0092] The mathematical expression for multiplicative cross-fusion is: in, To remove confounding features, This is an element-wise multiplication operation.

[0093] The decontamination feature representation is input into the fully connected layer of the probabilistic prediction model. The mathematical expression of the probabilistic prediction model is: in, This is the final risk probability value. This is the weight matrix of the probabilistic prediction model. This is the bias vector for the probabilistic prediction model.

[0094] Based on the mapping relationship between risk probability values ​​and risk level thresholds, a corresponding dynamic risk score is output. Risk level thresholds are divided into three levels: low risk, medium risk, and high risk. Low risk corresponds to a risk probability value of [0, 0.3], medium risk to (0.3, 0.7], and high risk to (0.7, 1). The dynamic risk score ranges from [0, 100], with low risk corresponding to a score of [0, 30], medium risk to (30, 70], and high risk to (70, 100).

[0095] In this embodiment, by introducing a distribution alignment constraint, the distributions of the counterfactual feature representation and the observed fact feature representation in the latent space are forced to align, reducing the distribution bias during counterfactual sample generation. Distribution bias is a common problem in counterfactual reasoning; when the distribution of counterfactual samples differs significantly from the distribution of observed samples, it leads to inaccurate causal effect estimation. By minimizing the Wasserstein distance between the counterfactual state and the posterior distribution of latent variables under the observed facts, the counterfactual feature representation and the observed fact feature representation can have similar distributional characteristics, improving the stability of individual causal effect estimation.

[0096] By multiplicatively fusing correction factors with spatiotemporal feature representations, the true causal contribution of equipment operating status to safety risk can be injected into the risk score. The correction factor reflects the degree of influence of changes in equipment operating status on risk probability. Through multiplicative fusion, the weights of spatiotemporal feature representations can be adjusted according to the magnitude of the causal effect, ensuring that the final risk score is primarily determined by the true causal contribution of equipment operating status, unaffected by environmental confounding factors. This mechanism can cut off the spurious correlation interference path of confounding variables on the risk score, making the output dynamic risk score independent of co-occurrence noise in environmental monitoring data and overcoming the score drift problem.

Claims

1. A dynamic scoring system for safety risks in charging locations based on knowledge graphs and causal reasoning, characterized in that: include: A multi-source data fusion and graph construction component is used to acquire multi-source sensor data of charging sites and construct a four-dimensional spatiotemporal evolution knowledge graph based on the multi-source sensor data. The nodes in the four-dimensional spatiotemporal evolution knowledge graph represent device entities and environmental entities, and the edges represent temporal interaction relationships with timestamps. The structural causal model building component is used to build structural causal models, setting safety risk scores as outcome variables, equipment operating status as processing variables, and environmental monitoring data as confounding variables. A spatiotemporal feature extraction component is used to extract spatiotemporal feature representations of entities in the four-dimensional spatiotemporal evolution knowledge graph through a spatiotemporal graph convolutional network; The counterfactual reasoning and correction component is used to calculate the potential risk probability of the processing variable under the counterfactual state based on the spatiotemporal feature representation, compare the risk probability under the observed facts to obtain the difference in causal effect, and use the difference in causal effect as a correction factor. A dynamic scoring output component is used to inject the correction factor into the probability prediction model and output a dynamic risk score based on the true causal contribution.

2. The dynamic scoring system for charging site safety risks based on knowledge graphs and causal reasoning as described in claim 1, characterized in that, The multi-source data fusion and graph construction component is specifically used to extract entity attributes and inter-entity association events from the multi-source sensor data, map the entity attributes to static node features of the four-dimensional spatiotemporal evolution knowledge graph, use the occurrence timestamps and durations of the association events as edge weights, construct dynamic temporal interaction edges representing state transitions, periodically update the graph structure based on the static node features and the dynamic temporal interaction edges, capture the topological dependencies between different equipment entities and environmental entities in the charging site that evolve over time, and characterize the influence weight of historical interactions on the current risk state through the temporal decay mechanism of the dynamic temporal interaction edges.

3. The dynamic scoring system for charging site safety risks based on knowledge graphs and causal reasoning according to claim 2, characterized in that, The structural causal model construction component is specifically used to map the operating state variables of device entities on the power supply and charging link in the four-dimensional spatiotemporal evolution knowledge graph to the processing variables, to map the monitoring data of environmental entities on the periphery of the power supply and charging link and having physical environmental coupling relationship to the hybrid variables, to map the global indicators characterizing the overall safety status of the charging site to the result variables, to establish directed edges of the hybrid variables pointing to both the processing variables and the result variables, and to form a directed acyclic graph structure characterizing the coexistence of risk transmission and hybrid interference under the charging site's operating conditions.

4. The dynamic scoring system for charging site safety risks based on knowledge graphs and causal reasoning as described in claim 1, characterized in that, The spatiotemporal feature extraction component is specifically used to introduce a spatial aggregation function and a temporal convolution kernel into the spatiotemporal graph convolutional network. The spatial aggregation function performs weighted aggregation of the spatial features of adjacent nodes in the four-dimensional spatiotemporal evolution knowledge graph. The temporal convolution kernel performs convolution operation on the feature sequences of the same node in different time slices along the time dimension. The output of the spatial aggregation function and the output of the temporal convolution kernel are concatenated and nonlinearly mapped to generate the spatiotemporal feature representation that integrates spatial topological dependence and temporal evolution trend.

5. The dynamic scoring system for charging site safety risks based on knowledge graphs and causal reasoning according to claim 1, characterized in that, The counterfactual reasoning and correction component is specifically used to: construct a variational autoencoder based on the spatiotemporal feature representation; infer the latent variable posterior distribution of the processing variable under the counterfactual state through the variational autoencoder; sample and generate a counterfactual feature representation from the latent variable posterior distribution; input the counterfactual feature representation into a risk predictor to obtain the potential risk probability; calculate the difference between the potential risk probability and the risk probability under the observed fact as the individual causal effect; and normalize the individual causal effect to generate the correction factor.

6. The dynamic scoring system for charging site safety risks based on knowledge graphs and causal reasoning according to claim 1, characterized in that, The dynamic scoring output component is specifically used to perform multiplicative cross-fusion of the correction factor and the spatiotemporal feature representation to obtain a decontamination feature representation, input the decontamination feature representation into the fully connected layer of the probability prediction model, map it to a risk probability value through the activation function of the fully connected layer, combine the mapping relationship between the risk probability value and the risk level threshold, and output the dynamic risk score based on the true causal contribution, so that the numerical change of the dynamic risk score is independent of the co-occurrence noise in the environmental monitoring data.

7. The dynamic scoring system for charging site safety risks based on knowledge graphs and causal reasoning according to claim 2, characterized in that, The temporal decay mechanism of the dynamic temporal interaction edge is specifically as follows: a time decay function is introduced to process the difference between the duration and the current timestamp, and the decay weight of the dynamic temporal interaction edge is calculated. When the difference exceeds a preset time window, the decay weight and the edge weight are multiplied to suppress the influence of historical related events exceeding the time window on the current node state and retain recent high-intensity temporal interaction edges.

8. The dynamic scoring system for charging site safety risks based on knowledge graphs and causal reasoning according to claim 3, characterized in that, The hybrid variables are split into global climate variables and local microenvironmental variables. In the directed acyclic graph structure, the directed edges of the global climate variables pointing to all the processing variables and the result variables are set as shared edge weights, and the directed edges of the local microenvironmental variables pointing to specific processing variables and the result variables are set as independent edge weights. By orthogonally decoupling the shared edge weights and the independent edge weights, the superposition interference of the internal heat accumulation effect of the charging site and the external meteorological changes on the safety risk score is separated.

9. The dynamic scoring system for charging site safety risks based on knowledge graphs and causal reasoning according to claim 4, characterized in that, The weighted aggregation process of the spatial aggregation function specifically involves calculating the joint attention coefficient of the feature similarity and topological distance between the target node and its neighboring nodes, performing a weighted summation of the spatial features of the neighboring nodes based on the joint attention coefficient, and introducing node type encoding to bias the result of the weighted summation so that the target node features output by the spatial aggregation function contain an aligned representation of multimodal information within the topological local neighborhood.

10. The dynamic scoring system for charging site safety risks based on knowledge graphs and causal reasoning according to claim 5, characterized in that, When the variational autoencoder infers the posterior distribution of latent variables under the counterfactual state, a distribution alignment constraint term is introduced. The Wasserstein distance between the posterior distribution of latent variables under the counterfactual state and the posterior distribution of latent variables under the observed fact is calculated. The Wasserstein distance is added as a penalty term to the loss function of the variational autoencoder to force the distribution of the counterfactual feature representation to align with the distribution of the observed fact feature representation in the latent space.