A deep learning-based smart city environment monitoring method
By improving the D2STGNN model and snow ablation optimization algorithm, and combining them with response obligation objects, the problems of propagation path differentiation and delayed data processing in smart city environmental monitoring were solved, achieving accurate propagation prediction and efficient local updates.
Patent Information
- Application Number
- CN202611403274.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-11-27
AI Technical Summary
Existing smart city environmental monitoring methods struggle to differentiate the contributions of different propagation paths when dealing with the propagation of environmental anomalies, leading to an expansion or omission of the scope of anomaly impacts. Furthermore, monitoring node failures and data delays affect the accuracy and efficiency of the response.
By combining the response obligation object, the improved D2STGNN model and the snow ablation optimization algorithm, the method performs backtracking decomposition before aggregation according to the spatiotemporal local transfer position, retains the unexplained state, updates the dynamic transfer relationship layer by layer, optimizes the position correction coefficient, and restores the propagation path of delayed data.
It achieves accurate prediction of the propagation range of environmental anomalies, improves the identification of propagation paths and the accuracy of prediction, enhances the adaptability to data delays and communication anomalies, and improves the efficiency of local updates.
Smart Images

Figure CN123179355A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of environmental monitoring technology, and in particular to a smart city environmental monitoring method based on deep learning. Background Technology
[0002] Existing smart city environmental monitoring methods typically collect environmental data on air, water bodies, drainage networks, and underground spaces using distributed sensors, and then utilize threshold judgment, time series analysis, or graph neural networks to identify abnormal changes and predict the scope of impact. While these methods can perform unified analysis across multiple monitoring nodes, they lack fine-grained characterization of the transmission process of anomalies between different nodes.
[0003] Existing spatiotemporal graph prediction models typically aggregate information from different source nodes, propagation directions, and time lags to the target node, and then perform feature decomposition on the aggregation result. Signals from different propagation paths mix together after aggregation, making it difficult to distinguish the actual contribution of each path to the prediction result. It is also difficult to continuously correct the propagation relationship based on the unexplained information of a single path, which can easily lead to the expansion or omission of the scope of anomalies.
[0004] In addition, monitoring node failures, communication interruptions, and data delays can lead to a lack of actual response. Existing methods tend to directly identify the absence of response as the termination of propagation. After delayed data arrives, it is usually necessary to recalculate a large-scale monitoring map, making it difficult to restore the original propagation location and only update the affected path, which affects the accuracy of environmental event judgment and processing efficiency.
[0005] Therefore, how to provide a smart city environmental monitoring method based on deep learning is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] One objective of this invention is to propose a deep learning-based smart city environmental monitoring method. This invention employs a combination of response obligation objects, an improved D2STGNN model, and a snow ablation optimization algorithm. By changing the backtracking decomposition after node-level aggregation of diffusion contributions to a backtracking decomposition before aggregation performed according to spatiotemporal local transfer positions, the unexplained state of each propagation position is preserved, and the dynamic transfer relationship is updated layer by layer accordingly, thereby achieving accurate prediction of the propagation range of environmental anomalies. At the same time, the actual response optimization position correction coefficient is used, and only the affected propagation paths are recovered and recalculated when delayed data arrives. This method has the advantages of high propagation path identification, high prediction accuracy, high local update efficiency, and strong adaptability to delayed data.
[0007] A smart city environmental monitoring method based on deep learning according to an embodiment of the present invention includes the following steps: S1. Collect environmental monitoring information and establish environmental monitoring map objects according to the transmission relationship of monitoring nodes; S2. Analyze the changes in environmental monitoring map objects, locate the starting point of environmental anomalies and determine candidate transmission relationships to form environmental event objects; S3. Based on the response conditions of environmental event objects in the candidate transit relationship, form response obligation objects mapped to the positions of the spatiotemporal local transition matrix; S4. Input the response obligation object and the environmental monitoring map object into the improved D2STGNN model, cut off the node aggregation path of diffusion contribution, separate the explained state and the unexplained state by the backtracking branch according to the mapping position, aggregate the explained state and combine it with the unexplained state to form the backtracking decomposition result; S5. Write the unexplained states in the backtracking decomposition results to the same position in the next decoupled spatiotemporal layer, update the dynamic transition relationship and recursively deduce the environmental event object to form the propagation prediction result. S6. The snow melting optimization algorithm optimizes the position correction coefficient according to the deviation between the propagation prediction result and the actual response of the object in the environmental monitoring map. The optimal correction coefficient is written back to the improved D2STGNN model to form the optimized propagation result. S7. Verify the respondent's obligations based on the optimized dissemination results and update the dissemination eligibility of the corresponding transmission relationship to form the scope of the event's impact; S8. When delayed data arrives, locate the unexplained state in the decomposition results according to the environmental event object and the response obligation object, restore the dynamic transfer relationship and continue to calculate the scope of event impact, and output the smart city environmental monitoring results.
[0008] Optionally, S1 specifically includes: S11. Classify environmental monitoring information according to monitoring nodes, and arrange the environmental monitoring information of the same monitoring node according to the sampling time to form a node monitoring sequence; S12. Determine the source monitoring node and the target monitoring node according to the transmission relationship of the monitoring nodes, and form a set of directed edges by the corresponding node indices according to the transmission direction; S13. Establish the monitoring nodes as graph nodes, associate the node monitoring sequence with the corresponding graph nodes, and connect the graph nodes according to the set of directed edges to form an environmental monitoring graph object.
[0009] Optionally, S2 specifically includes: S21. Move the sampling window along the node monitoring sequence, determine the fluctuation range based on the mean and standard deviation of the sampled values of the preceding window, and determine the sampling period that continuously crosses the fluctuation range on the same side as the abnormal segment. S22. Compare the graph nodes corresponding to each abnormal section along the incoming edge. If the starting time of the upstream abnormal section is earlier than that of the current abnormal section and the direction of change is the same, switch to the upstream graph node and determine the graph node with the earliest starting time among the traceability endpoints as the starting position of the environmental anomaly. S23. Compare adjacent abnormal segments along the directed edge from the starting position of the environmental anomaly. If the starting time of the abnormal segment of the target graph node is later than that of the abnormal segment of the source graph node and the change direction is the same, retain the corresponding directed edge. Determine the retained directed edge as a candidate transit relationship and associate it with the starting position of the environmental anomaly and the corresponding abnormal segment to form an environmental event object.
[0010] Optionally, S3 specifically includes: S31. Read the start and end times and abnormal amplitudes of the abnormal sections of the source graph nodes and target graph nodes along the candidate propagation relationship, determine the propagation time range based on the difference between the start and end times, and determine the response attenuation degree based on the change ratio of the abnormal amplitude. S32. Determine the time lag index according to the propagation time range, calculate the minimum response amount of the target graph node according to the abnormal amplitude and response attenuation degree of the source graph node, and read the effective detection lower limit from the environmental monitoring information to form the response conditions; S33. Determine the row position using the target graph node index and the column position using the source graph node index, and combine the time lag index with the row and column positions to form the mapping position; S34. Associate the response conditions with the mapping location to form a response obligation object.
[0011] Optionally, the improved D2STGNN model includes a linear layer, a dynamic graph learning module, multiple decoupled spatiotemporal layers, and a regression layer. The decoupling spatiotemporal layer includes a decoupling block, a diffusion block, and an intrinsic block; The decoupling block includes estimation gates and residual decomposition mechanisms; The diffuse block consists of a spatiotemporal local convolutional layer, a prediction branch, and a backtracking branch; The intrinsic blocks include gated recurrent units, positional encoding, multi-head self-attention layers, prediction branches, and backtracking branches.
[0012] Optionally, the formation of the backtracking decomposition result specifically includes: The dynamic graph learning module calculates two sets of node transition scores based on the node monitoring sequence, time embedding, and two sets of node embeddings. It performs adjacency masking, normalization, multi-order expansion, and spatiotemporal localization according to the transmission relationship of the monitored nodes to form a forward dynamic transition matrix and a reverse dynamic transition matrix. The linear layer maps the node monitoring sequence to input features. The two sets of node embeddings are multiplied by matrix and normalized to form an adaptive transition matrix. The estimation gate calculates the gate value based on the temporal embedding and the two sets of node embeddings, and multiplies the gate value element-wise with the input features to form the diffusion feature. The spatiotemporal local convolutional layer reads three types of transition matrices according to temporal lag and spatial order, multiplies each transition value with the diffusion characteristics of the corresponding source graph node, and forms the diffusion contribution item by item; To preserve the source graph nodes, target graph nodes, time lag, spatial order, and transition matrix type for diffusion contributions, the source graph nodes, target graph nodes, and time lag are aligned with the mapping positions, and the summation of the target graph nodes is moved to after the backtracking branch; The backtracking branch uses shared fully connected parameters to transform each diffusion contribution to form an explained state. The diffusion contribution is then subtracted from the corresponding explained state to form an unexplained state that retains the original index. The explained states are aggregated according to the target graph nodes and sampling time to form node-level backtracking results. The node-level backtracking results are subtracted from the input features to form the diffusion residual. The intrinsic block is transformed and diffused through a gated loop unit, position encoding, and multi-head self-attention layer to form an intrinsic backtracking result through a backtracking branch. The intrinsic backtracking result is formed by subtracting the diffused residual from the intrinsic backtracking result. The node-level residual is then combined with the unexplained state to form the backtracking decomposition result.
[0013] Optionally, S5 specifically includes: S51. Input the forward and reverse dynamic transfer matrices only into the first decoupled spatiotemporal layer, and form the first-layer spatiotemporal local transfer matrix according to the time lag and spatial order. Cut off the shared input path of the two sets of dynamic transfer matrices to the remaining decoupled spatiotemporal layers. S52. Pass the node-level residuals, spatiotemporal local transition matrix, and unexplained states with original indices from the previous decoupled spatiotemporal layer to the next decoupled spatiotemporal layer. S53. Based on the source graph node, target graph node, time lag, spatial order and transition matrix type retained in the unexplained state, locate the same index element in the spatiotemporal local transition matrix, and linearly map the unexplained state to the same index correction quantity along the feature dimension. S54. Add the same index correction to the corresponding spatiotemporal local transition element, renormalize the transition value corresponding to the same target graph node, keep the value of the previous layer for unmatched elements, and form the spatiotemporal local transition matrix of the next decoupled spatiotemporal layer. S55. The next decoupled spatiotemporal layer performs spatiotemporal local convolution and backtracking decomposition based on the node-level residuals, the updated spatiotemporal local transition matrix and the adaptive transition matrix. The same index update is repeated layer by layer, the prediction branch output is summarized and mapped through the regression layer to form the propagation prediction result.
[0014] Optionally, S6 specifically includes: S61. Read the mapping position corresponding to the unexplained state, arrange the position correction coefficients according to the index order of the spatiotemporal local transition elements, associate each dimension of the candidate solution with the corresponding spatiotemporal local transition elements one by one, and generate a candidate solution population within the upper and lower bounds of the coefficients. S62. Scale the corresponding spatiotemporal local transfer elements with the coefficients of each dimension of the candidate solution and renormalize them. Calculate the candidate propagation results, read the actual response from the environmental monitoring map object, and accumulate the absolute deviation according to the map node and sampling time to obtain the fitness. S63. Arrange candidate solutions according to fitness, and form an elite pool by the mean of the best candidate solution, the second best candidate solution, the third best candidate solution, and half of the candidate solutions with better fitness, and randomly divide them into two subpopulations. S64. The first subpopulation selects elite solutions from the elite pool, and combines the difference between the current best candidate solution and the current candidate solution, and the difference between the population mean and the current candidate solution according to random weights. After being adjusted dimension by dimension by Brownian motion random vector, the results are superimposed on the elite solutions to update the candidate solutions of the first subpopulation. S65. The second subpopulation scales the current best candidate solution by the snow melting rate, combines the differences between the two items with random weights, adjusts them one dimension at a time by the Brownian motion random vector, and then superimposes them onto the scaling result to update the candidate solution of the second subpopulation, and expands the size of the first subpopulation round by round. S66. Perform boundary truncation on the out-of-bounds position correction coefficients, recalculate the fitness and update the elite pool, and write the position correction coefficients in the candidate solution with the minimum fitness into the corresponding spatiotemporal local transition elements to form the optimization propagation result.
[0015] Optionally, S7 specifically includes: S71. Based on the environmental event object and mapping location, the expected arrival time and expected response volume in the optimized propagation results are correlated with the propagation time range, minimum response volume and effective detection lower limit in the response obligation object; S72. Read the sampling records within the expected arrival period and the operating status of monitoring nodes and communication links from the environmental monitoring information. If the expected arrival period exceeds the propagation time range, the expected response amount is lower than the minimum response amount, the minimum response amount is lower than the effective detection limit, the sampling records do not cover the expected arrival period, or the operating status is abnormal, the propagation qualification remains unchanged. S73. When the aforementioned verification is passed, retrieve the actual response that is consistent with the direction of change within the expected arrival time period, record the propagation qualification before the update, update it to have propagation qualification when the actual response reaches the minimum response amount, and update it to not have propagation qualification when it does not reach the minimum response amount. S74. Traverse along the candidate propagation relationships from the starting position of the environmental anomaly, and merge the reached graph nodes and anomaly segments into the scope of the event's impact.
[0016] Optionally, S8 specifically includes: S81. Match environmental event objects and response obligation objects according to the monitoring node index and sampling time of the delayed data to determine the mapping location and corresponding candidate transmission relationship; S82. Read the dissemination qualification update record corresponding to the responding obligation object. If an update record exists, cancel the update and restore the dissemination qualification before verification. If no update record exists, maintain the original dissemination qualification. S83. Write the delayed data into the node monitoring sequence, recalculate the input features at the corresponding sampling time, and recalculate the diffusion contribution, explained state and unexplained state from the decoupled spatiotemporal layer that generates the corresponding unexplained state. S84. Replace the original unexplained state with the recalculated unexplained state, recalculate the spatiotemporal local transfer elements and backtracking decomposition results at the same mapping position layer by layer along the hierarchical sequence, and keep the calculation results of unrelated mapping positions unchanged. S85. Recalculate the propagation prediction results and optimize the propagation results along the corresponding candidate propagation relationship, verify the response obligation objects and update the propagation qualifications, merge the graph nodes and abnormal sections obtained by re-traversal with the unaffected parts in the original event impact range, and output the smart city environmental monitoring results.
[0017] The beneficial effects of this invention are: This invention constructs environmental monitoring map objects and environmental event objects, unifying the transmission direction, abnormal sections and response conditions between monitoring nodes, and uses response obligation objects to limit the propagation time range, minimum response amount and mapping position of each candidate transmission relationship. This enables continuous analysis of the starting position, propagation path and impact range of environmental anomalies, reducing misjudgments caused by directly identifying no response as the termination of propagation.
[0018] This invention improves the diffusion block of the D2STGNN model by adjusting the back-decomposition of nodes contributing to diffusion to a back-decomposition before aggregation based on spatiotemporal local transfer positions. This allows the propagation contributions of different source graph nodes, target graph nodes, and time lags to form explained and unexplained states respectively before mixing. The unexplained states are then used to correct the spatiotemporal local transfer relationships at the same positions layer by layer, thereby improving the ability to distinguish complex propagation paths and the accuracy of propagation prediction.
[0019] This invention also optimizes the position correction coefficient based on the deviation between the predicted result and the actual response using a snow melting optimization algorithm, and locates the original response obligation and unexplained state when delayed data arrives, only recovering and continuing to calculate the affected propagation path, avoiding repeated calculation of the entire environmental monitoring map, thereby improving the reliability of environmental monitoring results, local update efficiency and adaptability to data delay and communication anomalies. Attached Figure Description
[0020] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1This is an overall flowchart of a deep learning-based smart city environmental monitoring method proposed in this invention. Figure 2 This is a schematic diagram of the structure of an improved D2STGNN model for a deep learning-based smart city environmental monitoring method proposed in this invention. Figure 3 This diagram illustrates the pre-aggregation backtracking decomposition and same-index update of a deep learning-based smart city environmental monitoring method proposed in this invention. Detailed Implementation
[0021] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0022] refer to Figures 1-3 A smart city environmental monitoring method based on deep learning includes the following steps: S1. Collect environmental monitoring information and establish environmental monitoring map objects according to the transmission relationship of monitoring nodes; S2. Analyze the changes in environmental monitoring map objects, locate the starting point of environmental anomalies and determine candidate transmission relationships to form environmental event objects; S3. Based on the response conditions of environmental event objects in the candidate transit relationship, form response obligation objects mapped to the positions of the spatiotemporal local transition matrix; S4. Input the response obligation object and the environmental monitoring map object into the improved D2STGNN model, cut off the node aggregation path of diffusion contribution, separate the explained state and the unexplained state by the backtracking branch according to the mapping position, aggregate the explained state and combine it with the unexplained state to form the backtracking decomposition result; S5. Write the unexplained states in the backtracking decomposition results to the same position in the next decoupled spatiotemporal layer, update the dynamic transition relationship and recursively deduce the environmental event object to form the propagation prediction result. S6. The snow melting optimization algorithm optimizes the position correction coefficient according to the deviation between the propagation prediction result and the actual response of the object in the environmental monitoring map. The optimal correction coefficient is written back to the improved D2STGNN model to form the optimized propagation result. S7. Verify the respondent's obligations based on the optimized dissemination results and update the dissemination eligibility of the corresponding transmission relationship to form the scope of the event's impact; S8. When delayed data arrives, locate the unexplained state in the decomposition results according to the environmental event object and the response obligation object, restore the dynamic transfer relationship and continue to calculate the scope of event impact, and output the smart city environmental monitoring results.
[0023] In this embodiment, S1 specifically includes: Environmental monitoring information consists of environmental index values output by sensors, sampling time, monitoring node identifier, equipment operating status, and communication status. The monitoring node identifier is generated by concatenating the equipment number and installation location code, and the same monitoring node has a unique identifier within the environmental monitoring system.
[0024] When classifying environmental monitoring information according to monitoring nodes, the merging standard is to use the complete consistency of the monitoring node identifiers, and records corresponding to the same identifier are written into the same data queue. When the acquisition end starts, the time difference between the local clock and the system clock is calculated, and the local sampling time is added to the time difference to convert it into a unified sampling time. When communication is restored, the time difference is recalculated.
[0025] The node monitoring sequence establishes a continuous time axis using the rated sampling period of the monitoring equipment. In one embodiment, the sampling interval can be 30 seconds. When there are multiple valid records at the same sampling time, the arithmetic mean of each environmental indicator value is calculated separately. Records with equipment operating status of fault or inconsistent communication check codes are written into the abnormal record and are not included in the average calculation.
[0026] When a continuous time axis lacks a sampling record, the corresponding sampling time is retained and a missing marker is written, and adjacent sampling values are not used to fill the gap directly. After deduplication, separation of abnormal records and writing of missing markers are completed, each valid record is arranged in ascending order according to the unified sampling time to form a node monitoring sequence.
[0027] The transmission relationship between monitoring nodes is determined by the actual transmission direction of the monitored medium or environment. The transmission starting point is determined as the source monitoring node, and the transmission ending point is determined as the target monitoring node. The source monitoring node index is written first, and the target monitoring node index is written later. Each set of indexes records a directed edge that is directly transmitted. Duplicate index pairs are merged into a single directed edge, and self-join indexes are written with exception records.
[0028] Each unique monitoring node is identified as a graph node, and the graph node index is consistent with the node index in the directed edge set. The node monitoring sequence is associated with the corresponding graph node and the source graph node is connected to the target graph node. When the endpoint of the directed edge is missing a corresponding graph node, an exception record is written. When the environmental monitoring graph data version is generated for the first time, the version number is incremented by 1 when a valid record is written or replaced in the node monitoring sequence. The graph nodes, node monitoring sequences, directed edges and environmental monitoring graph data version after verification are combined to form an environmental monitoring graph object.
[0029] In this embodiment, S2 specifically includes: When moving the sampling window along the node monitoring sequence, the preceding window consists of consecutive valid sampled values before the current sampling time. In one embodiment, the window length can be 20 sampling points, and the moving interval can be 1 sampling point. The window length is determined by the fluctuation period of the environmental indicators during normal operation.
[0030] When calculating the fluctuation range, first add up all valid sampled values in the preceding window and divide by the number of valid samples to obtain the mean. Then, square the difference between each valid sampled value and the mean, sum them up, divide by the number of valid samples, and take the square root to obtain the standard deviation. For example, the fluctuation range can be the numerical interval formed by extending the mean upwards and downwards by 3 times the standard deviation.
[0031] When the number of valid samples in the preceding window is less than 80% of the window length, the current window is marked as incomplete sampling and the anomaly judgment is stopped; when there are multiple records at the same sampling time, the average value formed above is used, and records with equipment fault marks or communication verification errors are not included in the calculation of mean and standard deviation.
[0032] An abnormal segment begins when the sampled value first crosses the upper or lower boundary and three consecutive valid sampled points remain on the same side. When the sampled value crosses the upper boundary, it is recorded as an upward direction, and when it crosses the lower boundary, it is recorded as a downward direction. The current abnormal segment ends when the sampled value returns to the fluctuation range and three consecutive valid sampled points do not cross the boundary again.
[0033] If the consecutive missing values in an abnormal segment do not exceed two sampling periods, and the sampling values before and after the missing value are outside the fluctuation range on the same side, the sampling periods on both sides will be merged and the missing value will be retained. If the consecutive missing values exceed two sampling periods, the current abnormal segment will be terminated, and the data will be re-evaluated from the first valid sampling time after data recovery.
[0034] When comparing graph nodes corresponding to each abnormal segment level by level along the incoming edges, the start time and change direction of each upstream abnormal segment are read; when multiple incoming edges simultaneously satisfy the condition that the start time is earlier than the current abnormal segment and the change direction is consistent, traceback branches are established in ascending order of start time and graph node index, and comparisons continue along each traceback branch.
[0035] After each tracing path is completed, the start time of the abnormal segment corresponding to the tracing endpoint is compared, and the graph node with the earliest start time is determined as the starting position of the environmental anomaly; when multiple tracing endpoints have the same start time, the first graph node is determined in ascending order of graph node index, and the remaining tracing endpoints are retained as parallel propagation branches.
[0036] When comparing adjacent abnormal segments along directed edges from the starting position of the environmental anomaly, if the starting time of the abnormal segment of the target graph node is strictly later than that of the abnormal segment of the source graph node and the direction of change is consistent, the corresponding directed edge is retained; directed edges that do not meet the requirements of time sequence or direction of change are written into the exclusion record and are not included in the candidate transit relationship.
[0037] Environmental event objects are generated using the graph node index of the starting position of the environmental anomaly and the starting time of the anomaly segment. The starting position of the environmental anomaly, the candidate transmission relationship and the corresponding anomaly segment are saved. When the starting positions are the same, the direction of change is consistent and the interval between anomaly segments does not exceed one sampling window, they are merged into the same environmental event object. Other anomaly segments are established as separate environmental event objects.
[0038] In this embodiment, S3 specifically includes: Read the abnormal segments corresponding to the source graph nodes and target graph nodes along the candidate transit relationship. The abnormal amplitude is the arithmetic mean of the offsets of each valid sample value in the abnormal segment relative to the mean of the preceding window. Sample values with missing markers, equipment fault markers, or communication verification errors are not included in the calculation.
[0039] The propagation time range is determined by the start time difference and the end time difference of the two abnormal segments. The source graph node time is subtracted from the target graph node time, and the smaller of the two non-negative time differences is used as the lower bound of propagation, and the larger value is used as the upper bound of propagation. When either time difference is negative, the corresponding candidate transmission relationship is written into the timing anomaly record, and no response obligation object is generated.
[0040] The response attenuation level is obtained by subtracting the ratio of the abnormal amplitude of the target graph node to the abnormal amplitude of the source graph node from 1. When the calculation result is less than 0, it is written as 0, and when it is greater than 1, it is written as 1. When the abnormal amplitude of the source graph node is 0, the response calculation of the current candidate transit relationship is terminated and an amplitude abnormality record is written.
[0041] The minimum response value is obtained by multiplying the abnormal amplitude of the source map node by 1 and subtracting the response attenuation. The effective detection lower limit is the larger of the minimum resolvable change in the monitoring equipment calibration record and three times the standard deviation of the normal sampling window. When the equipment calibration record is missing or the equipment operating status is abnormal, the response condition is written to the pending verification mark and will not participate in the update of the propagation qualification.
[0042] The time lag index is calculated by converting the propagation time range and the uniform sampling interval. The lower bound of propagation is divided by the sampling interval and rounded up to form the starting index, and the upper bound of propagation is divided by the sampling interval and rounded down to form the ending index. When the starting index is greater than the ending index, an index exception record is written and no mapping position is established.
[0043] The spatiotemporal local transition matrix uses the target graph node index to determine the row position and the source graph node index to determine the column position. Each time lag index corresponds to a time slice. The same candidate transit relationship forms a continuous mapping position between the start index and the end index. When the start index exceeds the maximum lag length of the matrix, no mapping position is generated. When the end index exceeds the maximum lag length, it is truncated to the maximum index, and the original propagation upper bound is retained for response verification.
[0044] The response conditions store the propagation time range, minimum response amount, effective detection lower limit, and abnormal change direction. The mapping location stores the target graph node row index, source graph node column index, and time lag index range. The two are established through the same candidate propagation relationship identifier to avoid cross-writing between different environmental events or different propagation branches.
[0045] The response obligation identifier is generated by sequentially combining the environmental event identifier, the candidate transit relationship identifier, the target graph node index, the source graph node index, and the time lag index range. The response obligation object stores the response obligation identifier, the environmental event identifier, the candidate transit relationship identifier, the response conditions, the mapping position, the environmental monitoring graph data version, and the verification status. The response obligation object and the environmental monitoring graph object are jointly entered into the improved D2STGNN model, and the mapping position limits the index alignment range of the diffusion contribution.
[0046] In this embodiment, the improved D2STGNN model includes a linear layer, a dynamic graph learning module, multiple decoupled spatiotemporal layers, and a regression layer: The original D2STGNN model first maps the historical sequences of all monitoring nodes to the hidden feature space. The dynamic graph learning module generates a dynamic transition matrix before the decoupled spatiotemporal layer loop begins. Each decoupled spatiotemporal layer reads the same set of transition matrices. The diffusion block and the intrinsic block output predicted features respectively and generate future monitoring sequences through the regression layer.
[0047] The original D2STGNN model first aggregates the diffusion contributions generated by different source graph nodes, time lags, and spatial orders into hidden features of the target graph nodes within the diffusion block, and then performs reconstruction and residual decomposition by the backtracking branch. Different propagation paths have already been mixed before entering the backtracking branch, and the unexplained information corresponding to a single candidate propagation relationship cannot maintain an independent position.
[0048] The improved D2STGNN model retains the linear layer, dynamic graph learning module, multiple decoupled spatiotemporal layers, and regression layer. The backtracking branch input is moved forward before the diffusion contribution aggregation, and an interface for passing unexplained states to the next decoupled spatiotemporal layer with the index transfer element is added to maintain the continuous correspondence between the response obligation object and the propagation path calculation position.
[0049] The improved D2STGNN model has the following connection order: the linear layer connects to the dynamic graph learning module and the first decoupled spatiotemporal layer; the dynamic graph learning module connects to the first decoupled spatiotemporal layer; the node-level residuals, spatiotemporal local transition matrices, and unexplained states of the previous decoupled spatiotemporal layer connect to the next decoupled spatiotemporal layer; and the prediction branches of each decoupled spatiotemporal layer connect to the regression layer.
[0050] Each decoupled spatiotemporal layer consists of a decoupling block, a diffusion block, and an intrinsic block connected in sequence. The estimation gate in the decoupling block generates diffusion input and retains node features not explained by the current layer by the residual decomposition mechanism. The diffusion block processes the information transmitted between nodes, and the intrinsic block processes the temporal variation information within a single node.
[0051] In one embodiment, the environmental monitoring map object is converted into a four-dimensional tensor with batch dimension, historical time dimension, graph node dimension and input channel dimension arranged in sequence. The tensor size can be 32×30×96×6, where 32 is the number of batch samples, 30 is the number of historical sampling points, 96 is the number of graph nodes, and 6 is the number of environmental indicators and validity status channels.
[0052] The continuous environmental indicators in the input channel are standardized using the mean and standard deviation of the training set. First, the sampled value is subtracted from the mean of the corresponding indicator, and then divided by the standard deviation of the corresponding indicator. When the standard deviation is 0, the standardization result is written as 0. Missing sampled positions are written as 0 and the missing status is recorded by the independent validity channel.
[0053] The linear layer performs parameter multiplication and bias stacking on the 6-dimensional input vector of each sampling time and graph node, and outputs a 32-dimensional hidden vector. The input tensor is transformed from 32×30×96×6 to 32×30×96×32. In one embodiment, the weight size of the linear layer can be 6×32 and the bias vector length can be 32.
[0054] The dynamic graph learning module reads the 32-dimensional node hidden features, node embeddings, temporal embeddings, and directed edge sets in the environmental monitoring graph object, and outputs the forward dynamic transition matrix and the reverse dynamic transition matrix. In one embodiment, the two sets of node embeddings and temporal embeddings can have a dimension of 12, and two sets of 32×96×96 transition matrices are output for each batch.
[0055] The decoupled spatiotemporal layer receives 32×30×96×32 node features and corresponding transition matrices. The estimation gate outputs diffusion features of the same size. The diffusion block outputs predicted features, node-level backtracking results, and unexplained states with retained indices. The intrinsic block receives the diffusion residuals and outputs intrinsic predicted features and node-level residuals.
[0056] In one implementation, the improved D2STGNN model can be configured with three decoupled spatiotemporal layers, with a hidden dimension of 32, a spatial order of 2, and a local temporal range of 3 sampling times. When the dimensions are inconsistent, the number of channels is converted to 32 by linear projection, and samples with a time length of less than 3 sampling times are not included in the training batch.
[0057] The diffusion prediction features and inherent prediction features of each decoupled spatiotemporal layer are arranged in batch dimension, prediction time dimension, graph node dimension and hidden channel dimension. First, element-wise addition is performed at the same prediction time, and then element-wise accumulation is performed across decoupled spatiotemporal layers to form the input of the regression layer.
[0058] The regression layer uses a two-layer fully connected network. The first layer maps the 32-dimensional hidden vector to a 32-dimensional vector and performs modified linear unit activation. The second layer maps the 32-dimensional vector to the environmental indicator output channel. In one embodiment, the output size can be 32×20×96×4, where 20 is the number of predicted sampling points and 4 is the number of channels for water level, flow rate, conductivity and turbidity.
[0059] The training data comes from historical node monitoring sequences, directed edge sets, equipment operation records, communication records, and environmental events verified on-site, all stored in the environmental monitoring system. Normal operation periods and abnormal propagation periods are divided into continuous samples, and samples generated by the same environmental event are only included in one set of the training set, validation set, or test set.
[0060] In one implementation, all samples are divided into a 70% training set, a 15% validation set, and a 15% test set according to the order of events. For each sample, 30 consecutive sampling points are read as model input, and the next 20 sampling points are used as supervision labels.
[0061] The monitoring labels consist of actual environmental indicators for the next 20 sampling times. Invalid labels are written at the locations corresponding to equipment failures or communication verification failures. Valid label masks are written as 1, and invalid label masks are written as 0. Invalid locations are not included in the loss accumulation.
[0062] The response obligation object is generated from the environmental event object identified in each historical sample input window. During training, a sparse index table is used to store the environmental event identifier, source graph node index, target graph node index, time lag range, minimum response amount, and effective detection lower limit. Samples without environmental events are written to an empty index table.
[0063] The model parameters include linear layer weights and biases, node embeddings, temporal embeddings, dynamic graph learning parameters, estimation gate parameters, diffusion block parameters, intrinsic block parameters, same-index correction mapping parameters, and regression layer parameters. The fully connected weights are initialized using a Xavier uniform distribution, the biases are initialized to 0, and the embedding parameters are initialized using a normal distribution with a mean of 0 and a standard deviation of 0.02.
[0064] The training loss uses the mean absolute error of the effective label positions. The absolute value of the difference between the predicted value and the actual label is calculated item by item, multiplied by the effective label mask, and the results of all batches, prediction times, graph nodes and output channels are accumulated. Finally, the result is divided by the number of effective labels. Samples with 0 effective labels are removed from the current batch.
[0065] Backpropagation proceeds sequentially from the regression layer through each prediction branch, intrinsic block, diffusion block, estimation gate, dynamic graph learning module, and linear layer. The backtracking branch before aggregation and the same index correction mapping parameters obtain gradients through the same loss, so that the generation position of unexplained states and the inter-layer transition update simultaneously participate in end-to-end training.
[0066] In one implementation, the optimizer uses Adam, with an initial learning rate of 0.001, a batch size of 32, a weight decay of 0.00001, and a gradient norm that is scaled down to 5 when it exceeds 5. If the validation loss does not decrease for 5 consecutive rounds, the learning rate is multiplied by 0.5, and the minimum learning rate is kept at 0.00001.
[0067] The maximum number of training rounds can be 200. In each round, the forward computation, loss accumulation, gradient backpropagation and parameter update of all training samples are completed, and then the mean absolute error is calculated using the validation set. Training is terminated when the validation error decreases by less than 0.0001 and remains so for 15 consecutive rounds, while retaining all model parameters of the round with the lowest validation error.
[0068] After training, the parameter file with the lowest validation error is fixed. The parameter file also saves the input channel order, standardized mean and standard deviation, node index table, embedding parameters, number of layers, hidden dimension and prediction length. During actual monitoring, only the same parameter file is loaded to perform forward calculation. If the number of nodes or the channel order is inconsistent, the inference is stopped and an abnormal input record is written to the model.
[0069] In this embodiment, the formation of the backtracking decomposition result specifically includes: Before the backtracking branch receives data, the original processing path has already completed the summation of the source graph node dimensions and the channel fusion of multiple types of diffusion results. The contributions corresponding to different propagation paths lose their independent indexes, and the residual decomposition can only obtain node-level residual information. It is impossible to determine which source graph node or which time lag the residual information comes from.
[0070] The dynamic graph learning module reads the node features output by the linear layer. The input tensor is arranged along the batch dimension, historical time dimension, graph node dimension, and hidden channel dimension. In one embodiment, the input size can be 32×30×96×32. The 30×32 historical features of each graph node are expanded into a 960-dimensional vector according to the sampling time and hidden channel order.
[0071] The 960-dimensional vector is multiplied by the first fully connected weight of size 960×64 and a 64-dimensional bias is added. After being processed by the corrected linear unit, it is multiplied by the second fully connected weight of size 64×32 and a 32-dimensional bias is added to form a 32-dimensional dynamic sequence feature.
[0072] The dynamic sequence features are concatenated with intraday time embeddings, intraweek date embeddings, and two sets of node embeddings to form two sets of node representations. The two sets of node representations are then subjected to query projection and key projection, respectively, and then pairwise inner products are performed. The inner product results are divided by the square root of 32 and exponential normalization is performed along the node dimension of the source graph to form two sets of node transition scores.
[0073] The set of directed edges is converted into a forward static transition matrix and a reverse static transition matrix with the target graph nodes as rows and the source graph nodes as columns. Each row element is normalized by dividing by the sum of the corresponding row elements. The two sets of node transition scores are multiplied element by element with the corresponding static transition matrix to form a forward dynamic transition matrix and a reverse dynamic transition matrix. Positions without corresponding directed edges are kept as 0.
[0074] The rows of the forward dynamic transition matrix and the reverse dynamic transition matrix correspond to the target graph nodes, and the columns correspond to the source graph nodes. Each position is written with the normalized transition value passed from the source graph node to the target graph node. In one embodiment, the size of both sets of matrices in each batch can be 96×96.
[0075] The multi-order extension first retains the first-order dynamic transition matrix, then performs matrix multiplication between the current-order matrix and the first-order matrix to form the next-order matrix, and clears the diagonal positions to zero; in one implementation, the spatial order can be 2, and the forward and reverse dynamic transition matrices form the first-order matrix and the second-order matrix, respectively.
[0076] The adaptive transition matrix is obtained by multiplying the transpose of the first set of node embeddings and the second set of node embeddings, removing negative values by correcting the linear unit, and then performing exponential normalization along the node dimension of the source graph. The adaptive transition matrix has a size of 96×96 and adopts the same row and column meanings as the forward and reverse dynamic transition matrices.
[0077] The estimated gatekeeper's intraday time embedding, intraweek date embedding, and two sets of node embeddings are spliced along the channel dimension. First, they are mapped to 32 dimensions through the first fully connected layer and processed by the modified linear unit. Then, they are mapped to 1-dimensional gates through the second fully connected layer and compressed to between 0 and 1 by the logistic function.
[0078] The estimated gate output size is batch size × historical time length × number of graph nodes × 1. The gate value is copied along the 32 hidden channels and multiplied element-wise with the input feature to obtain the diffusion feature. When the gate value or input feature is non-numerical, the corresponding graph node and sampling time are written into the invalid mask and the diffusion calculation at the current time position is stopped.
[0079] The spatiotemporal local convolutional layer reads the diffusion features of continuous time lags along the historical time dimension. In one embodiment, the local time range can take 3 sampling times. The 96×32 diffusion feature corresponding to each time lag is multiplied by an independent 32×32 time transformation weight and superimposed with a 32-dimensional bias. After being processed by the corrected linear unit, it is connected along the source graph node dimension in ascending order of time lag to form a 288×32 spatiotemporal local feature matrix.
[0080] The forward dynamic transition matrix, the reverse dynamic transition matrix, and the adaptive transition matrix are each extended in multiple order, with the diagonal elements of each order matrix written as 0, and then connected laterally along the time lag dimension. In one embodiment, each type of transition matrix and each spatial order form a 96×288 spatiotemporal local transition matrix, with the matrix rows corresponding to the target graph nodes and the matrix columns corresponding to the combination of time lag and source graph nodes.
[0081] The spatiotemporal local convolutional layer reads the transition matrix type, spatial order, target graph node, source graph node, and the transition value corresponding to the time lag one by one. It multiplies the 32-dimensional local features of the corresponding source graph node with the 32×32 convolution weights corresponding to the current transition matrix type and spatial order, and then multiplies it by the transition value to form a 32-dimensional diffusion contribution that retains the original index.
[0082] Each diffusion contribution synchronously records the source graph node index, target graph node index, time lag index, spatial order, and transition matrix type. The index records use the same batch number and sampling time number as the 32-dimensional diffusion contributions to avoid losing the original propagation position after tensor rearrangement.
[0083] The mapping location of the response obligation object provides the target graph node row index, the source graph node column index, and the time lag index range. Index alignment first compares the target graph nodes, then compares the source graph nodes, and finally determines whether the time lag falls within the index range. The spatial order and transition matrix type are retained as sub-indexes under the same mapping location.
[0084] When the same response obligation object hits multiple spatial orders or transition matrix types, each diffusion contribution enters the backtracking branch separately, and is not summed before the backtracking branch; the mapping position of the diffusion contribution that is not hit is written with an invalid flag and an all-zero state vector, and no new transition elements are constructed, nor does it participate in the same index update of the next decoupled spatiotemporal layer.
[0085] The backtracking branch receives a single 32-dimensional diffusion contribution, performs parameter multiplication using the 32×32 fully connected weights shared by each mapping position, and adds a 32-dimensional bias. Then, the negative value is set to 0 by the corrected linear unit to obtain the 32-dimensional explained state at the same index position.
[0086] Unexplained states are obtained by subtracting explained states at the same mapping position from diffusion contributions. The subtraction is performed element-wise along the 32 hidden channels, and the resulting 32-dimensional difference retains the original index and is written into the unexplained state index table.
[0087] The summation of target graph nodes is performed after the output of the backtracking branch. First, the batch number, target sampling time, and target graph nodes are fixed. Then, the explained states are accumulated along the source graph nodes, time lag, spatial order, and transition matrix type to form the node-level backtracking result.
[0088] The node-level backtracking results are arranged along the batch dimension, effective time dimension, graph node dimension, and 32-dimensional hidden channel. The input features are truncated to the same effective time range, and then the node-level backtracking results are subtracted from the truncated input features to form the diffusion residual.
[0089] The intrinsic block inputs the diffusion residuals of each graph node into the gated recurrent unit along the time dimension. The initial hidden state is all zeros. The update gate, reset gate, and candidate state sequentially perform parameter multiplication, bias superposition, and nonlinear calculation to form a 32-dimensional temporal hidden state. The temporal hidden state is then input into a 4-head self-attention layer after adding sine and cosine position codes. Each attention head outputs 8-dimensional features, which are then concatenated into a 32-dimensional intrinsic hidden feature. The intrinsic block backtracking branch is processed by a 32×32 fully connected weight, a 32-dimensional bias, and a corrected linear unit to form the intrinsic backtracking result.
[0090] The node-level residual is obtained by subtracting the inherent backtracking result from the diffusion residual. The backtracking decomposition result is composed of the node-level residual tensor and the unexplained state index table. The unexplained state index table records the environmental event identifier, response obligation identifier, transition matrix type, spatial order, target graph node, time lag, source graph node, decoupling spatiotemporal layer number, 32-dimensional unexplained state, valid label, and environmental monitoring graph data version.
[0091] When the time lag index exceeds the range of the spatiotemporal local transition matrix, the corresponding mapping position is written into the out-of-bounds record and set to invalid, and the out-of-bounds position is not accessed; when the number of hidden channels is inconsistent with 32, it is first converted into 32 dimensions through the linear projection obtained by training. If the batch dimension, graph node dimension or time dimension cannot correspond, the calculation of the current sample is terminated and written into the model input abnormal record.
[0092] Node-level residuals serve as node inputs for the next decoupled spatiotemporal layer, while the unexplained state index table serves as the location object for dynamic transfer and updating within the same index. Records marked as 0 retain only event identifiers and mapping positions without generating correction amounts, thus preventing missing data or index errors from altering the propagation scope of the next layer.
[0093] Compared to the original D2STGNN model, the improvement of this invention lies in the forward propagation organization between the spatiotemporal local convolution and the backtracking branch within the diffusion block. This changes the computational granularity, state landing point, and residual responsibility of the backtracking branch. The backtracking branch changes from interpreting the hidden state of the already mixed target node to interpreting the single-path diffusion contribution with a complete spatiotemporal index. The unexplained information changes from unaddressable node-level residuals to path states that can be directly located by the next decoupled spatiotemporal layer and delayed data. This establishes a closed loop of co-location between diffusion contribution, residual state, dynamic graph update, and local recovery, avoiding the loss of propagation evidence from different sources and with different time lags during node aggregation, and providing a definite internal state starting point for layer-by-layer correction and local continuation.
[0094] In this embodiment, S5 specifically includes: The original D2STGNN model generates a forward dynamic transition matrix and a reverse dynamic transition matrix by the dynamic graph learning module before the computation of multiple decoupled spatiotemporal layers begins. Then, the two sets of matrices are simultaneously connected to the diffusion block of each decoupled spatiotemporal layer, and each layer reads the same transition value to complete spatiotemporal local convolution.
[0095] This shared connection method allows each decoupled spatiotemporal layer to only change node characteristics. The remaining information obtained from the backtracking decomposition of the previous layer cannot change the propagation channel and transfer intensity used by the next layer. The use of dynamic graphs in the multi-layer decoupling process is manifested as repeated reading rather than layer-by-layer correction.
[0096] The forward and reverse dynamic transition matrices are only input to the first decoupled spatiotemporal layer. The model computation graph retains the tensor connection from the dynamic graph learning module to the first diffusion block, and disconnects the direct connection from the dynamic graph learning module to the diffusion blocks of the remaining decoupled spatiotemporal layers.
[0097] The first-level spatiotemporal local transition matrix is generated by the forward dynamic transition matrix and the reverse dynamic transition matrix that have completed multi-order expansion. Each type of transition matrix is stored according to the spatial order and then expanded along the time lag dimension. The matrix rows correspond to the target graph nodes, and the columns are first arranged in ascending order of time lag, and then arranged in ascending order of source graph node index.
[0098] In one embodiment, the number of graph nodes can be 96, the local temporal range can be 3 sampling points, and the spatial order can be 2; each transition matrix type and spatial order corresponds to a set of 96×288 spatiotemporal local transition matrices, and the 288 columns correspond to the combination of 3 time lags and 96 source graph nodes.
[0099] The first decoupled spatiotemporal layer reads the node input, the first-layer spatiotemporal local transition matrix, and the adaptive transition matrix to perform spatiotemporal local convolution. After backtracking decomposition before aggregation, node-level residuals and unexplained states are obtained. The adaptive transition matrix maintains the original node embedding computation path and does not accept corrections for unexplained states.
[0100] The inter-layer transfer interface consists of node-level residual tensors, spatiotemporal local transition matrix sets, and an unexplained state index table. The node-level residual tensors are arranged along the batch dimension, effective time dimension, graph node dimension, and hidden channel dimension. The unexplained state index table is encapsulated using the data version and layer number output from the previous layer.
[0101] In one implementation, the hidden channel dimension of the node-level residual tensor can be 32. The spatiotemporal local transition matrix group retains five levels of indices: transition matrix type, spatial order, target graph node, time lag, and source graph node. The unexplained state index table records the same five levels of indices and the corresponding 32-dimensional state vectors.
[0102] After the previous decoupled spatiotemporal layer completes the calculation, the node-level residual is written to the node input of the next decoupled spatiotemporal layer, the spatiotemporal local transition matrix group is written to the transition input, and the unexplained state index table is written to the same index update end; the three input objects are verified using the same batch number, environmental event identifier, and data version.
[0103] When the batch number, environmental event identifier, or data version is inconsistent, the next decoupled spatiotemporal layer stops the recursion of the current environmental event, retains the propagation prediction state of the previous layer, and writes it into the inter-layer interface exception record; the node-level residuals and unexplained states are only updated with transition elements after they have been verified.
[0104] The index-based positioning method first reads the transition matrix type and spatial order associated with the unexplained state to determine the corresponding matrix group, then reads the target graph node index to determine the row position, and finally multiplies the time lag index by the number of graph nodes and adds the source graph node index to determine the column position.
[0105] When the source graph node index, target graph node index, or time lag index exceeds the matrix range, the valid flag of the corresponding unexplained state is changed to 0 and the original record is retained; when the spatial order or transition matrix type cannot be matched, no correction is generated, and the corresponding spatiotemporal local transition matrix uses the value of the previous layer.
[0106] The index correction is calculated within the linear mapping branch. Each type of transition matrix and each spatial order is configured with an independent 32-dimensional weight vector and a 1-dimensional bias. The 32-dimensional unexplained state is multiplied with the weights channel by channel and then accumulated. The bias is then superimposed to obtain the scalar correction of the corresponding spatiotemporal local transition element.
[0107] The linear mapping parameters are initialized and updated synchronously with the other parameters of the improved D2STGNN model during the aforementioned model training phase. The error gradient is propagated from the prediction loss through the regression layer, prediction branch, and backtracking branch. After the parameters are trained, they are fixed along with the model parameter file and are not adjusted separately during actual inference.
[0108] When multiple valid unexplained states hit the same spatiotemporal local transition element within the same environmental event, the same data version, and the same decoupled spatiotemporal layer, the scalar correction amount is calculated separately first, and then all the scalar correction amounts are added together and divided by the number of valid records to obtain the merge correction amount used for the current element.
[0109] The merged correction is added to the corresponding spatiotemporal local transition value of the previous layer to form a candidate transition value. If the candidate transition value is less than 0, it is written as 0. Elements that do not hit a valid unexplained state are not added, and the transition value of the previous decoupled spatiotemporal layer is maintained.
[0110] Renormalization is limited to the source graph node group corresponding to the same transition matrix type, the same spatial order, the same time lag, and the same target graph node. Different time lags, spatial orders, or transition matrix types are not cumulatively cross-accumulated.
[0111] During normalization, the original transition values of unmatched source graph nodes are first accumulated to obtain a fixed quality, and then the fixed quality is subtracted from 1 to obtain the assignable quality of matched elements. The candidate transition values of each matched element are divided by the sum of the candidate transition values and then multiplied by the assignable quality, while unmatched elements retain their original values.
[0112] When the allocatable quality is less than or equal to 0, the sum of candidate transition values is 0, or the calculation result is non-numerical, the current group is restored to the previous layer's transition value and written to the normalization anomaly record; after normalization is completed normally, the sum of the transition values of each source graph node remains 1.
[0113] The updated spatiotemporal local transition matrix is written into the layer state record of the next decoupled spatiotemporal layer. The layer state record saves the environmental event identifier, layer number, matrix data version, updated element index, correction amount, and normalization result. The next layer only reads the layer state records with consecutive layer numbers and consistent data versions.
[0114] The next decoupled spatiotemporal layer uses node-level residuals as new node features, uses the updated spatiotemporal local transition matrix to handle forward and backward diffusion calculations, uses the adaptive transition matrix to handle node embedding branch calculations, and performs spatiotemporal local convolution, backtracking decomposition before aggregation, and intrinsic feature decomposition again.
[0115] When no valid unexplained state is generated in the current layer, the next layer fully inherits the spatiotemporal local transition matrix of the current layer and performs new feature transformations only on the node-level residuals; when only some indices are valid in the current layer, only the group to which the hit index belongs is updated, and the remaining matrix groups retain the original values of the current data version.
[0116] The diffusion prediction branch and the intrinsic prediction branch of each decoupled spatiotemporal layer output a prediction tensor composed of batch dimension, prediction time dimension, graph node dimension and 32-dimensional hidden channel, respectively. The two branches perform element-wise addition at the same graph node and prediction time to form the prediction feature of the current layer.
[0117] The predicted features of each decoupled spatiotemporal layer are accumulated element by element in ascending order of layer number. The accumulated result is input into the regression layer, which maps the 32-dimensional hidden channel to the environmental indicator channel. The propagation prediction result saves the environmental event identifier, graph node index, predicted sampling time, expected response amount, and the mapping position of the corresponding response obligation object.
[0118] Compared to the original D2STGNN model, this invention reconstructs the supply method and state attributes of the dynamic graph in a multi-layer network. It transforms the one-time dynamic graph, located outside the decoupled spatiotemporal layer and read jointly by all layers, into an inter-layer recursive state driven by the residual information backtracked by each layer and with a clear spatiotemporal address. The unexplained state is transformed from ordinary residual output into an internal graph state that controls the propagation channel and transition intensity of the next layer. The evolution of the dynamic graph is therefore directly related to the degree of interpretation of the propagation evidence. This enables the model to continuously track environmental responses that are not interpreted by the current layer along source graph nodes, target graph nodes, time lag, spatial order, and transition matrix type, enhancing the ability to distinguish multi-branch propagation paths and providing a stable and addressable state basis for recovering computation of delayed data from its original spatiotemporal location.
[0119] In this embodiment, S6 specifically includes: The position correction coefficient is used to adjust the spatiotemporal local transition elements corresponding to the unexplained state. Each coefficient only applies to the index position composed of the same transition matrix type, spatial order, target graph node, time lag, and source graph node.
[0120] Candidate solutions use a one-dimensional vector to store position correction coefficients. The vector dimension is equal to the number of unique indices corresponding to the valid unexplained states within the current environmental event. The indices are first arranged by transition matrix type, and then arranged in ascending order by spatial order, target graph node, time lag, and source graph node.
[0121] When the same index is repeatedly hit by multiple unexplained states, only one candidate solution dimension is set, and the corresponding position correction coefficients are applied to all valid records under that index. When the index is invalid, out of bounds, or the environmental monitoring map data version is inconsistent, no candidate solution is written, and the original spatiotemporal local transfer elements are retained.
[0122] The upper and lower bounds of the position correction coefficient are determined by the ratio of the actual response increment to the predicted response increment of the same index type in the training set. Samples with a predicted response increment of 0 are not included in the proportional statistics. After proportional sorting, the 5th percentile is taken as the lower bound and the 95th percentile is taken as the upper bound.
[0123] When there are fewer than 20 valid historical samples, the upper and lower bounds are determined by the proportional distribution of all mapping positions in the training set. In one implementation, the global lower bound can be 0.70, the global upper bound can be 1.30, and the coefficient 1 indicates that the original spatiotemporal local transfer elements remain unchanged.
[0124] The snow melting optimization algorithm performs uniform random sampling independently on each candidate solution dimension within the upper and lower bounds to form an initial candidate solution population. In one implementation, the population size can be 40, and each candidate solution simultaneously stores the candidate number, index table, and current fitness.
[0125] When candidate solutions are written into the improved D2STGNN model, the position correction coefficients of each dimension are multiplied by the corresponding spatiotemporal local transfer elements, and the elements not indexed by the candidate solutions retain their original values; when the scaling result is less than 0, it is written as 0, and when a non-numerical value appears, the corresponding original value is restored.
[0126] The scaled transition elements are renormalized within the same transition matrix type, spatial order, target graph node, and time lag range. First, the transition values of all source graph nodes in the same group are accumulated, and then each transition value is divided by the accumulated result. When the accumulated result is 0, the entire group is restored to the values before scaling.
[0127] The candidate propagation results are obtained by forward computation of the improved D2STGNN model after writing the candidate solutions. For each response obligation object, the mean of the most recent complete sampling window before the anomaly of the target graph node is used as the benchmark value. The predicted response offset is obtained by subtracting the benchmark value from each predicted value. The continuous predicted sampling segments with the offset direction consistent with the anomaly change direction and the absolute value reaching the minimum response amount form the predicted response segment. The first and last sampling times form the expected arrival time period. The maximum offset in the predicted response segment forms the expected response amount. If there is no predicted response segment, a no-prediction-response flag is written.
[0128] The actual response is read from the environmental monitoring graph object and aligned with the candidate propagation results using the same graph node index and uniform sampling time. When the predicted time is between two valid sampling times, linear interpolation is performed on the sampled values on both sides according to the time distance.
[0129] When an actual response contains a missing tag, a device fault tag, or a communication verification error, an invalid mask is written, and it is not included in the fitness accumulation. When the number of valid actual responses is less than 60% of the total number of positions to be corrected, the fitness of the current candidate solution is written as positive infinity, and it is excluded from the selection range of elite pool members.
[0130] Different environmental indicators are first standardized using the mean and standard deviation saved during the model training phase, and then the absolute value of the difference between the candidate expected response and the actual response is calculated for each indicator. The fitness of the candidate solution is obtained by summing the absolute differences of all valid graph nodes, sampling times and indicator channels and dividing by the number of valid values.
[0131] The smaller the fitness of a candidate solution, the closer the candidate propagation result is to the actual response. When two candidate solutions have the same fitness, the sum of the absolute values of the differences between the position correction coefficients of each dimension and 1 is calculated, and the candidate solution with the smaller sum is retained.
[0132] The elite pool is established after each round of fitness calculation. The candidate solution with the smallest fitness, the second smallest candidate solution, and the third smallest candidate solution are written into the first three members respectively. Then, the arithmetic mean of the coefficients of each dimension of the half of the candidate solutions with better fitness is calculated to form the fourth member.
[0133] Before each round of updates, the candidate solution population is randomly arranged and divided into two subpopulations. In the first round, each subpopulation contains half of the population size. After each round of updates, the first subpopulation adds one candidate solution and the second subpopulation removes one candidate solution, until the first subpopulation contains all candidate solutions.
[0134] When updating the first subpopulation, an elite solution is randomly selected from the elite pool. A random number between 0 and 1 is generated. The difference between the current best candidate solution and the current candidate solution, as well as the difference between the population mean and the current candidate solution, are calculated. This random number is then used and the two differences are weighted by 1 minus the random number. Finally, it is multiplied dimension-by-dimensionally by a Brownian motion random vector composed of independent standard normal random numbers and superimposed onto the elite solution to form the updated candidate solution.
[0135] The snow melting rate is calculated based on the current iteration round and the maximum iteration round. The current iteration round is divided by the maximum iteration round to obtain the iteration progress. The ratio of 0.35 plus 0.25 multiplied by the iteration progress raised to the power of the natural constant minus 1 and then divided by the natural constant minus 1 forms the degree-day factor. The degree-day factor is then multiplied by the negative iteration progress raised to the power of the natural constant to obtain the snow melting rate.
[0136] When updating the second subpopulation, a random number is generated between -1 and 1. First, the snow melt rate is multiplied by the current best candidate solution. Then, the difference between the current best candidate solution and the current candidate solution, as well as the difference between the population mean and the current candidate solution, are weighted by using the random number and 1 minus the random number. The weighted result is then multiplied dimension-by-dimensionally by the Brownian motion random vector and superimposed onto the scaled current best candidate solution.
[0137] After the two subpopulations have completed the update, the position correction coefficients are checked one dimension at a time. If the coefficients are less than the lower bound, they are written as the lower bound; if they are greater than the upper bound, they are written as the upper bound. After the boundary is truncated, the coefficients are rewritten into the improved D2STGNN model, and the candidate propagation results and fitness are calculated.
[0138] After each round, candidate solutions are reordered and the elite pool is updated. When the current best fitness is better than the historical best fitness, candidate solutions, fitness, index table, and environmental monitoring map data version are saved simultaneously. When the environmental monitoring map data version changes, the current optimization is terminated and a new candidate solution population is generated.
[0139] In one implementation, the maximum number of iterations can be 60 rounds, and the system terminates early when the decrease in fitness of the historical best solution is less than 0.0001 for 10 consecutive rounds; when the maximum number of iterations is reached or the early termination condition is met, the historical best candidate solution is read.
[0140] The position correction coefficients in the historical optimal candidate solutions are written into the corresponding spatiotemporal local transition elements dimension by dimension, and then renormalized within the same target graph node, time lag, spatial order and transition matrix type range to form a fixed optimal spatiotemporal local transition matrix.
[0141] The improved D2STGNN model reads the optimal spatiotemporal local transition matrix and re-executes spatiotemporal local convolution, backtracking decomposition before aggregation, and prediction branch summarization to form an optimized propagation result. The optimized propagation result carries the expected arrival time, expected response amount, environmental event identifier, and mapping location, and enters the verification process of the response obligation object.
[0142] In this embodiment, S7 specifically includes: The optimized propagation results use environmental event identifiers and mapping locations as search keys to save the expected arrival start time, expected arrival end time, and expected response volume of target graph nodes. Response obligors can read the corresponding prediction content using the same search key.
[0143] The propagation time range stored by the response obligation object is the time difference range between the response of the target graph node and the start time of the abnormal section of the source graph node. The lower bound and upper bound of propagation are added to the start time of the abnormal section of the source graph node to form the allowed start time and allowed end time of arrival.
[0144] If the effective detection limit is not higher than the minimum response amount, the expected response amount is not lower than the minimum response amount, and there is no unpredictable response marker, then proceed to time verification; if any response amount condition fails, maintain the pre-verification propagation qualification and record the reason for failure.
[0145] Time verification is passed when the expected arrival start time is no earlier than the allowed arrival start time and the expected arrival end time is no later than the allowed arrival end time; if any boundary exceeds the allowed arrival period, the pre-verification propagation qualification is maintained and the excess time is recorded.
[0146] The sampling coverage verification converts the expected arrival time into continuous sampling time. The expected number of samples is obtained by dividing the time period length by the uniform sampling interval, rounding down and adding 1. The sampling is considered complete when there is a valid record for each expected sampling time and the first and last times are covered.
[0147] Records marked with missing information, equipment failure, or communication verification errors are not included in the valid sampling count. When the actual valid sampling count is less than the expected sampling count, the propagation eligibility remains unchanged, and the time of missing sampling is written into the propagation eligibility update record.
[0148] The monitoring node reads the device self-test record and range status. If the device self-test passes and the sampled value does not exceed the range, it is considered to be operating normally. The communication link status reads the message sequence number, verification result and reception time. If the messages are continuous and the verification passes, it is considered to be communicating normally.
[0149] When a monitoring node malfunctions or a communication link malfunctions, no actual response retrieval is performed, and the propagation qualification remains in the state before verification. After the operational status is restored and the missing data is supplemented, the respondent will re-enter the verification process.
[0150] The actual response retrieval reads the valid sampled values of the target graph nodes within the expected arrival time period. The average value of the most recent complete sampling window before the anomaly occurred is used as the benchmark value. The response offset is obtained by subtracting the benchmark value from each sampled value.
[0151] When the sign of the response offset is consistent with the direction of the abnormal change saved by the response obligation object, the corresponding sampled value is retained; when the directions are inconsistent, it is excluded. The maximum value of the absolute value of the offset is retained as the actual response value, and the sampling time corresponding to the maximum value is recorded.
[0152] When the actual response volume reaches the minimum response volume, the propagation qualification of the current candidate propagation relationship is updated to have propagation qualification; when the actual response volume does not reach the minimum response volume, the propagation qualification is updated to not have propagation qualification.
[0153] The dissemination eligibility update record stores environmental event identifiers, response obligation identifiers, candidate transmission relationship identifiers, mapping locations, eligibility before update, eligibility after update, verification time, actual response volume, verification results, reasons for anomalies, and data versions, and is used for revocation and recovery after delayed data arrival.
[0154] When an environmental event object is created, the propagation qualification of each candidate propagation relationship is initialized to pending verification. The propagation qualification is only bound to the current environmental event and the current data version. Changes in qualification do not delete directed edges in the environmental monitoring graph object, nor do they change the physical propagation direction between monitoring nodes.
[0155] The scope of the event's impact is determined by performing a breadth-first traversal starting from the location where the environmental anomaly begins. The starting graph node is written into the access queue. Each time, the first graph node in the queue is read, and the candidate propagation relationship pointed to by that graph node is checked. Only the target graph node that is qualified to propagate is added to the queue.
[0156] Graph nodes that have entered the access queue are written to the access set. When the same graph node is hit again, it will not be added to the queue again to avoid infinite traversal caused by backflow segments or closed loop segments. Candidate transit relationships that do not have the qualification to propagate and are pending verification will not have their traversal range expanded.
[0157] When a node in the same graph corresponds to multiple abnormal segments, they are first arranged in ascending order of their start time. Abnormal segments with overlapping time ranges or adjacent start and end points and the same direction of change are merged. The merged segments are selected based on the earliest start time, the latest end time, and the maximum abnormal amplitude.
[0158] Abnormal segments with non-overlapping time ranges or different directions of change are retained separately. After traversal is completed, the graph nodes in the access set, the merged abnormal segments, and the candidate propagation relationships with propagation qualifications are written into the event impact range for local recovery and range merging to be performed when delayed data arrives.
[0159] In this embodiment, S8 specifically includes: The delayed data carries the monitoring node index, sampling time, sampling record version, environmental indicator values, equipment status, and communication verification results; when communication verification fails or the equipment status is faulty, an abnormal delayed data record is written, and the data is not included in the recovery calculation.
[0160] Based on the monitoring node index of the delayed data, select the response obligation objects with the same target graph node index, add the propagation time range of each response obligation object to the start time of the corresponding abnormal segment of the source graph node to form the allowable arrival time period; when the delayed sampling time falls into the allowable arrival time period and the offset direction of the environmental indicators and the relative pre-abnormal baseline mean is consistent, confirm the match; when multiple environmental events are hit, establish local recovery tasks respectively.
[0161] If no response obligation object is matched, the delayed data is written to the queue to be associated, and the abnormal segment identification and environmental event matching are re-executed; if no match is still found, only the node monitoring sequence is updated, the propagation qualification is not revoked, and the model local recovery is not entered.
[0162] The process for restoring dissemination eligibility first reads the latest valid update record corresponding to the responding obligation object, restores the candidate transmission relationship according to the eligibility before the update saved in the record, and then marks the original update record as revoked; if there is no update record, the current dissemination eligibility is maintained, and delayed data writing continues.
[0163] When a node monitors a sequence, it subtracts the sequence start time from the delayed sampling time and divides it by a uniform sampling interval to obtain the sampling position. If the quotient is an integer, it writes the corresponding position; if the quotient is not an integer, it writes the adjacent position with a smaller time difference; if the time difference exceeds half a sampling interval, it writes a time anomaly record.
[0164] When there are already records at the same sampling location, compare the sampling record versions. If the version of the delayed data is higher, replace the original record and increment the environmental monitoring map data version by 1. If the sampling record versions are the same or lower, retain the original record and write the delayed data into the duplicate record table or the expired record table.
[0165] Input feature recovery reads the node monitoring sequence within the model's historical window from the delayed sampling position backward, standardizes it using the mean and standard deviation saved during the training phase, and then recalculates the input features of the corresponding graph nodes and sampling times using the fixed linear layer parameters.
[0166] The first affected decoupling spatiotemporal layer is determined by the unexplained state index table. According to the environmental event identifier, response obligation identifier and mapping location, the corresponding record is searched in the environmental monitoring map data version before the delayed data was written, and the layer number of the first generation of the corresponding unexplained state is taken. If the layer number is not found, the current environmental event is recalculated from the first decoupling spatiotemporal layer.
[0167] Local recalculation reads the source graph node, target graph node, time lag, spatial order, and transition matrix type corresponding to the mapping position in the first affected decoupling spatiotemporal layer, and recalculates the corresponding diffusion contribution according to the aforementioned time lag feature transformation, convolution weight multiplication, and transition value scaling process.
[0168] The backtracking branch recalculates the corresponding explained and unexplained states using shared fully connected parameters, replacing the states at the original mapping positions with the new states; the new explained states are aggregated with the same target graph nodes and the unaffected explained states at the sampling time, and the node-level backtracking results, diffusion residuals, intrinsic backtracking results, and node-level residuals are recalculated.
[0169] The new unexplained state is linearly mapped to the same index to form a correction amount, which is then superimposed on the corresponding spatiotemporal local transition element and renormalized within the original group. The spatiotemporal local transition elements and states at unassociated mapping positions retain their original results. The updated node-level residuals, unexplained states, and spatiotemporal local transition matrices are passed layer by layer to the next decoupled spatiotemporal layer until the last decoupled spatiotemporal layer.
[0170] The snow melting optimization algorithm only recodes the position correction coefficients corresponding to the affected mapping positions, while the remaining dimensions of the candidate solutions are fixed to the correction coefficients in the original historical best candidate solutions. When the affected positions lack effective actual responses, the re-optimization stops and the original best correction coefficients are used.
[0171] The local optimization follows the original candidate solution boundary, elite pool, twin population, Brownian motion random vector and snow melt rate calculation method. The fitness only accumulates the prediction response deviation of the affected graph nodes and the sampling time. After the original termination condition is reached, the new optimal correction coefficient is written back.
[0172] The affected propagation path starts from the matched candidate propagation relationship, traverses downstream along the connected candidate propagation relationships in the environmental event object, recalculates the propagation prediction results, optimizes the propagation results, and verifies the response obligations; propagation branches not connected to the affected relationship retain their original results.
[0173] When merging the scope of event impact, first remove the graph nodes, candidate propagation relationships, and abnormal segments corresponding to the affected propagation paths from the original scope of event impact, and then write the local recalculation results; at the same time, graph nodes belonging to unaffected branches are retained, and abnormal segments with overlapping time and consistent change direction are merged.
[0174] After the merging is completed, the environmental event object updates its data version, propagation eligibility record, spatiotemporal local transfer status, and event impact range. Unrelated locations continue to use the original calculation results, and the final output is the smart city environmental monitoring result that has completed local recovery.
[0175] Example 1: To verify the feasibility of this invention in practice, it was applied to an environmental monitoring system for a smart city drainage network. Ninety-six monitoring nodes were set up within the monitoring range, and 128 directed edges were established according to the drainage direction of the pipe sections. Each node collected water level, flow rate, conductivity, and turbidity at 30-second sampling intervals. Model training used environmental events confirmed by manual inspection, portable water quality testing, and equipment operation records from the system's historical records. Continuous node monitoring sequences were used as input, and the actual responses of each monitoring node within the corresponding prediction time period were used as supervision results. After standardizing the monitoring data, an improved D2STGNN model was trained, and the model parameters were fixed after training. In one abnormal event, the mean conductivity of monitoring node N18 was 682 μS / cm with a standard deviation of 24 μS / cm over 20 consecutive sampling points. Subsequently, the conductivity increased to 1328 μS / cm, and the turbidity increased from 13.4 NTU to 52.1 NTU. The system identified the sampling period that continuously exceeded the fluctuation range of the preceding window as the abnormal segment. The anomaly propagated along the N18 to N27 and N27 to N35 directions. The monitoring node N22 of another branch lost 5 sampling points due to communication interruption. The original monitoring method misjudged the lack of response as the termination of propagation, and the impact of the event was expanded due to the mixture of responses from different downstream paths.
[0176] After tracing along the directed edge, the system identifies N18 as the starting point of the environmental anomaly. Based on the response records from N18 to N27 in historical events, the propagation time range is determined to be 150s to 240s, the minimum conductivity response increment is determined to be 150μS / cm, and the effective detection limit obtained by the calibrated monitoring equipment is determined to be 40μS / cm. Using N27 as the row index and N18 as the column index, the 5th to 8th time lags are associated with the response conditions to form response obligation objects. The improved D2STGNN model retains the diffusion contributions corresponding to different source graph nodes, target graph nodes, and time lags before target graph node aggregation, and forms explained and unexplained states through backtracking branches. In the first decoupled spatiotemporal layer, the spatiotemporal local transition values for N18 to N27 under the corresponding time lag and spatial order are 0.37. After performing a linear mapping along the feature dimension for the unexplained state, a correction amount of 0.08 with the same index is obtained. The system adds the correction amount to the corresponding transition value and renormalizes the transition values of the source graph nodes under the same target graph node, time lag, spatial order, and transition matrix type, to obtain the spatiotemporal local transition value of 0.44 used in the next decoupled spatiotemporal layer. The snow ablation optimization algorithm uses 40 candidate solutions and 60 iterations to search within the coefficient range of 0.70 to 1.30, obtaining the optimal correction coefficient of 1.12 for positions N18 to N27 and 1.06 for positions N27 to N35. The model predicted that N35 would respond 426 seconds after the anomaly occurred, with an expected conductivity increment of 171 μS / cm. Portable detection and retransmission data confirmed that the actual response time was 438 seconds, with an actual increment of 164 μS / cm. The response time error was 12 seconds, and the response quantity error was 7 μS / cm.
[0177] The monitoring data for N35 arrived 270 seconds late due to communication congestion. During the data gap period, the system maintained the propagation eligibility of N27 to N35 unchanged because the sampling records did not cover the expected arrival time. After the delayed data arrived, the system located the original response obligation object according to the node index and sampling time of N35, revoked the original propagation eligibility update, wrote the delayed data into the monitoring sequence of the corresponding node, and recalculated the corresponding diffusion contribution, explained state, unexplained state, and spatiotemporal local transfer elements starting from the decoupled spatiotemporal layer that generated the unexplained state from N27 to N35. Only the position correction coefficient of the associated mapping position was re-performed with snow ablation optimization, while the original calculation results were used for other mapping positions.
[0178] To verify that the invention is not effective for a single event, the implementers selected 180 abnormal events that were not involved in model training and were confirmed by manual inspection and portable detection for testing, including 42 data delay or communication interruption events. All three methods used the same monitoring data and computing equipment. The F1 value for transmission relationship identification and the F1 value for event impact range identification were calculated based on the results of manual confirmation. The propagation error termination rate was based on the number of error terminations in the 42 data abnormal events. The recalculation time of delayed data was started from the time the delayed data was written to the node monitoring sequence. The statistical results are shown in Table 1 below.
[0179] Table 1 Comparison of the effects of identifying abnormal propagation in drainage pipe networks and recovering delayed data.
[0180] As can be seen from the data in Table 1 above, the method of the present invention outperforms the fixed threshold and fixed topology methods and the original D2STGNN model method in five indicators: accuracy of anomaly initiation location, F1 score of candidate transit relationship identification, F1 score of event impact range identification, propagation error termination rate, and average recalculation time of delayed data. The fixed threshold and fixed topology methods have an anomaly initiation location accuracy of only 78.3%, and F1 scores of candidate transit relationship identification and event impact range identification are 0.746 and 0.718, respectively. This indicates that relying solely on fixed thresholds and static transit relationships is insufficient to adapt to the time delay changes and amplitude attenuation of environmental anomalies between different nodes, easily leading to missed propagation paths or expanded propagation ranges. The original D2STGNN model improves its spatiotemporal correlation analysis capabilities through dynamic graph learning, increasing the anomaly initiation location accuracy to 88.9%. However, because the diffusion contributions of different propagation paths are aggregated at nodes and then back-decomposed, it is still difficult to retain unexplained information of a single propagation location, and its propagation error termination rate remains at 9.5%. The method of this invention achieves an anomaly initiation location accuracy of 94.4%, a candidate propagation relationship identification F1 score of 0.928, an event impact range identification F1 score of 0.916, a propagation error termination rate reduced to 4.8%, and a reduction in the average recalculation time for delayed data from 6.18s in the original D2STGNN model to 0.83s. The anomaly initiation location accuracy reflects the correctness of the environmental anomaly source judgment; the candidate propagation relationship identification F1 score comprehensively reflects the precision and recall capabilities of propagation relationship identification; the event impact range identification F1 score measures the consistency between the predicted range and the manually confirmed range; the propagation error termination rate indicates the proportion of incorrectly determined propagation termination due to data loss, communication interruption, or delayed response; and the average recalculation time for delayed data reflects the computational efficiency of restoring monitoring results after the arrival of supplementary data. These results demonstrate that this invention exhibits high accuracy and stability in anomaly source location, propagation path identification, impact range determination, and delayed data processing.
[0181] This embodiment constructs an environmental monitoring map object according to the drainage direction, associating node monitoring sequences, abnormal sections, candidate propagation relationships, and response conditions as environmental event objects and response obligation objects. This ensures that each candidate propagation relationship has a clear propagation time range, minimum response amount, and spatiotemporal local transfer location. The improved D2STGNN model adjusts the original backtracking decomposition after node aggregation to a backtracking decomposition before aggregation. This allows different source map nodes, target map nodes, and diffusion contributions corresponding to time lags to enter backtracking branches respectively, forming explained and unexplained states at the same location. The explained states are then aggregated to obtain node-level backtracking results, thus avoiding premature mixing of signals from different propagation paths. Unexplained states are progressively corrected along the same index to refine the spatiotemporal local transfer elements of the next decoupled spatiotemporal layer, enabling dynamic propagation relationships to continuously adjust based on unexplained path information. The snow ablation optimization algorithm further optimizes the position correction coefficient based on the deviation between the predicted and actual responses, improving the consistency between propagation prediction and on-site response. When monitoring data arrives with a delay, the system locates the original mapped position based on the node index, sampling time, and the responding entity. It only recalculates the diffusion contribution, unexplained states, spatiotemporal local transfer elements, and optimized propagation results for the affected position; the remaining paths use the original calculation results, thus avoiding redundant reasoning across the entire graph. This embodiment verifies that the present invention can effectively reduce false positives due to lack of response and confusion in propagation paths, improving the accuracy of environmental anomaly propagation monitoring, local update efficiency, and adaptability to communication interruptions and delayed data.
[0182] The above are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A smart city environmental monitoring method based on deep learning, characterized in that, Includes the following steps: S1. Collect environmental monitoring information and establish environmental monitoring map objects according to the transmission relationship of monitoring nodes; S2. Analyze the changes in environmental monitoring map objects, locate the starting point of environmental anomalies and determine candidate transmission relationships to form environmental event objects; S3. Based on the response conditions of environmental event objects in the candidate transit relationship, form response obligation objects mapped to the positions of the spatiotemporal local transition matrix; S4. Input the response obligation object and the environmental monitoring map object into the improved D2STGNN model, cut off the node aggregation path of diffusion contribution, separate the explained state and the unexplained state by the backtracking branch according to the mapping position, aggregate the explained state and combine it with the unexplained state to form the backtracking decomposition result; S5. Write the unexplained states in the backtracking decomposition results to the same position in the next decoupled spatiotemporal layer, update the dynamic transition relationship and recursively deduce the environmental event object to form the propagation prediction result. S6. The snow melting optimization algorithm optimizes the position correction coefficient according to the deviation between the propagation prediction result and the actual response of the object in the environmental monitoring map. The optimal correction coefficient is written back to the improved D2STGNN model to form the optimized propagation result. S7. Verify the respondent's obligations based on the optimized dissemination results and update the dissemination eligibility of the corresponding transmission relationship to form the scope of the event's impact; S8. When delayed data arrives, locate the unexplained state in the decomposition results according to the environmental event object and the response obligation object, restore the dynamic transfer relationship and continue to calculate the scope of event impact, and output the smart city environmental monitoring results.
2. The method for smart city environmental monitoring based on deep learning according to claim 1, characterized in that, S1 specifically includes: S11. Classify environmental monitoring information according to monitoring nodes, and arrange the environmental monitoring information of the same monitoring node according to the sampling time to form a node monitoring sequence; S12. Determine the source monitoring node and the target monitoring node according to the transmission relationship of the monitoring nodes, and form a set of directed edges by the corresponding node indices according to the transmission direction; S13. Establish the monitoring nodes as graph nodes, associate the node monitoring sequence with the corresponding graph nodes, and connect the graph nodes according to the set of directed edges to form an environmental monitoring graph object.
3. The smart city environmental monitoring method based on deep learning according to claim 1, characterized in that, S2 specifically includes: S21. Move the sampling window along the node monitoring sequence, determine the fluctuation range based on the mean and standard deviation of the sampled values of the preceding window, and determine the sampling period that continuously crosses the fluctuation range on the same side as the abnormal segment. S22. Compare the graph nodes corresponding to each abnormal section along the incoming edge. If the starting time of the upstream abnormal section is earlier than that of the current abnormal section and the direction of change is the same, switch to the upstream graph node and determine the graph node with the earliest starting time among the traceability endpoints as the starting position of the environmental anomaly. S23. Compare adjacent abnormal segments along the directed edge from the starting position of the environmental anomaly. If the starting time of the abnormal segment of the target graph node is later than that of the abnormal segment of the source graph node and the change direction is the same, retain the corresponding directed edge. Determine the retained directed edge as a candidate transit relationship and associate it with the starting position of the environmental anomaly and the corresponding abnormal segment to form an environmental event object.
4. The smart city environmental monitoring method based on deep learning according to claim 1, characterized in that, S3 specifically includes: S31. Read the start and end times and abnormal amplitudes of the abnormal sections of the source graph nodes and target graph nodes along the candidate propagation relationship, determine the propagation time range based on the difference between the start and end times, and determine the response attenuation degree based on the change ratio of the abnormal amplitude. S32. Determine the time lag index according to the propagation time range, calculate the minimum response amount of the target graph node according to the abnormal amplitude and response attenuation degree of the source graph node, and read the effective detection lower limit from the environmental monitoring information to form the response conditions; S33. Determine the row position using the target graph node index and the column position using the source graph node index, and combine the time lag index with the row and column positions to form the mapping position; S34. Associate the response conditions with the mapping location to form a response obligation object.
5. The method for smart city environmental monitoring based on deep learning according to claim 1, characterized in that, The improved D2STGNN model includes a linear layer, a dynamic graph learning module, multiple decoupled spatiotemporal layers, and a regression layer. The decoupling spatiotemporal layer includes a decoupling block, a diffusion block, and an intrinsic block; The decoupling block includes estimation gates and residual decomposition mechanisms; The diffuse block consists of a spatiotemporal local convolutional layer, a prediction branch, and a backtracking branch; The intrinsic blocks include gated recurrent units, positional encoding, multi-head self-attention layers, prediction branches, and backtracking branches.
6. The smart city environmental monitoring method based on deep learning according to claim 1, characterized in that, The formation of the backtracking decomposition result specifically includes: The dynamic graph learning module calculates two sets of node transition scores based on the node monitoring sequence, time embedding, and two sets of node embeddings. It performs adjacency masking, normalization, multi-order expansion, and spatiotemporal localization according to the transmission relationship of the monitored nodes to form a forward dynamic transition matrix and a reverse dynamic transition matrix. The linear layer maps the node monitoring sequence to input features. The two sets of node embeddings are multiplied by matrix and normalized to form an adaptive transition matrix. The estimation gate calculates the gate value based on the temporal embedding and the two sets of node embeddings, and multiplies the gate value element-wise with the input features to form the diffusion feature. The spatiotemporal local convolutional layer reads three types of transition matrices according to temporal lag and spatial order, multiplies each transition value with the diffusion characteristics of the corresponding source graph node, and forms the diffusion contribution item by item; To preserve the source graph nodes, target graph nodes, time lag, spatial order, and transition matrix type for diffusion contributions, the source graph nodes, target graph nodes, and time lag are aligned with the mapping positions, and the summation of the target graph nodes is moved to after the backtracking branch; The backtracking branch uses shared fully connected parameters to transform each diffusion contribution to form an explained state. The diffusion contribution is then subtracted from the corresponding explained state to form an unexplained state that retains the original index. The explained states are aggregated according to the target graph nodes and sampling time to form node-level backtracking results. The node-level backtracking results are subtracted from the input features to form the diffusion residual. The intrinsic block is transformed and diffused through a gated loop unit, position encoding, and multi-head self-attention layer to form an intrinsic backtracking result through a backtracking branch. The intrinsic backtracking result is formed by subtracting the diffused residual from the intrinsic backtracking result. The node-level residual is then combined with the unexplained state to form the backtracking decomposition result.
7. The method for smart city environmental monitoring based on deep learning according to claim 1, characterized in that, S5 specifically includes: S51. Input the forward and reverse dynamic transfer matrices only into the first decoupled spatiotemporal layer, and form the first-layer spatiotemporal local transfer matrix according to the time lag and spatial order. Cut off the shared input path of the two sets of dynamic transfer matrices to the remaining decoupled spatiotemporal layers. S52. Pass the node-level residuals, spatiotemporal local transition matrix, and unexplained states with original indices from the previous decoupled spatiotemporal layer to the next decoupled spatiotemporal layer. S53. Based on the source graph node, target graph node, time lag, spatial order and transition matrix type retained in the unexplained state, locate the same index element in the spatiotemporal local transition matrix, and linearly map the unexplained state to the same index correction quantity along the feature dimension. S54. Add the same index correction to the corresponding spatiotemporal local transition element, renormalize the transition value corresponding to the same target graph node, keep the value of the previous layer for unmatched elements, and form the spatiotemporal local transition matrix of the next decoupled spatiotemporal layer. S55. The next decoupled spatiotemporal layer performs spatiotemporal local convolution and backtracking decomposition based on the node-level residuals, the updated spatiotemporal local transition matrix and the adaptive transition matrix. The same index update is repeated layer by layer, the prediction branch output is summarized and mapped through the regression layer to form the propagation prediction result.
8. The smart city environmental monitoring method based on deep learning according to claim 1, characterized in that, S6 specifically includes: S61. Read the mapping position corresponding to the unexplained state, arrange the position correction coefficients according to the index order of the spatiotemporal local transition elements, associate each dimension of the candidate solution with the corresponding spatiotemporal local transition elements one by one, and generate a candidate solution population within the upper and lower bounds of the coefficients. S62. Scale the corresponding spatiotemporal local transfer elements with the coefficients of each dimension of the candidate solution and renormalize them. Calculate the candidate propagation results, read the actual response from the environmental monitoring map object, and accumulate the absolute deviation according to the map node and sampling time to obtain the fitness. S63. Arrange candidate solutions according to fitness, and form an elite pool by the mean of the best candidate solution, the second best candidate solution, the third best candidate solution, and half of the candidate solutions with better fitness, and randomly divide them into two subpopulations. S64. The first subpopulation selects elite solutions from the elite pool, and combines the difference between the current best candidate solution and the current candidate solution, and the difference between the population mean and the current candidate solution according to random weights. After being adjusted dimension by dimension by Brownian motion random vector, the results are superimposed on the elite solutions to update the candidate solutions of the first subpopulation. S65. The second subpopulation scales the current best candidate solution by the snow melting rate, combines the differences between the two items with random weights, adjusts them one dimension at a time by the Brownian motion random vector, and then superimposes them onto the scaling result to update the candidate solution of the second subpopulation, and expands the size of the first subpopulation round by round. S66. Perform boundary truncation on the out-of-bounds position correction coefficients, recalculate the fitness and update the elite pool, and write the position correction coefficients in the candidate solution with the minimum fitness into the corresponding spatiotemporal local transition elements to form the optimization propagation result.
9. The smart city environmental monitoring method based on deep learning according to claim 1, characterized in that, Specifically, S7 includes: S71. Based on the environmental event object and mapping location, the expected arrival time and expected response volume in the optimized propagation results are correlated with the propagation time range, minimum response volume and effective detection lower limit in the response obligation object; S72. Read the sampling records within the expected arrival period and the operating status of monitoring nodes and communication links from the environmental monitoring information. If the expected arrival period exceeds the propagation time range, the expected response amount is lower than the minimum response amount, the minimum response amount is lower than the effective detection limit, the sampling records do not cover the expected arrival period, or the operating status is abnormal, the propagation qualification remains unchanged. S73. When the aforementioned verification is passed, retrieve the actual response that is consistent with the direction of change within the expected arrival time period, record the propagation qualification before the update, update it to have propagation qualification when the actual response reaches the minimum response amount, and update it to not have propagation qualification when it does not reach the minimum response amount. S74. Traverse along the candidate propagation relationships from the starting position of the environmental anomaly, and merge the reached graph nodes and anomaly segments into the scope of the event's impact.
10. A smart city environmental monitoring method based on deep learning according to claim 1, characterized in that, S8 specifically includes: S81. Match environmental event objects and response obligation objects according to the monitoring node index and sampling time of the delayed data to determine the mapping location and corresponding candidate transmission relationship; S82. Read the dissemination qualification update record corresponding to the responding obligation object. If an update record exists, cancel the update and restore the dissemination qualification before verification. If no update record exists, maintain the original dissemination qualification. S83. Write the delayed data into the node monitoring sequence, recalculate the input features at the corresponding sampling time, and recalculate the diffusion contribution, explained state and unexplained state from the decoupled spatiotemporal layer that generates the corresponding unexplained state. S84. Replace the original unexplained state with the recalculated unexplained state, recalculate the spatiotemporal local transfer elements and backtracking decomposition results at the same mapping position layer by layer along the hierarchical sequence, and keep the calculation results of unrelated mapping positions unchanged. S85. Recalculate the propagation prediction results and optimize the propagation results along the corresponding candidate propagation relationship, verify the response obligation objects and update the propagation qualifications, merge the graph nodes and abnormal sections obtained by re-traversal with the unaffected parts in the original event impact range, and output the smart city environmental monitoring results.
