Park flow prediction method and device based on spatiotemporal data analysis

By combining spatiotemporal data analysis and graph neural networks, the problems of feature extraction and model optimization in park pedestrian flow prediction were solved, achieving efficient feature extraction and prediction, and improving prediction accuracy and efficiency.

CN122489979APending Publication Date: 2026-07-31ZHEJIANG BREEZE INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG BREEZE INTELLIGENT TECH CO LTD
Filing Date
2026-05-11
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing methods for predicting pedestrian flow in industrial parks have shortcomings in feature extraction, spatiotemporal analysis, and model optimization, resulting in unsatisfactory prediction accuracy. They also lack effective graph structure processing mechanisms and attention calculation strategies, making it difficult to achieve efficient model iteration and accurate prediction.

Method used

By using a spatiotemporal data analysis approach, video data streams collected from park surveillance cameras are collected, density calculations and graph structure encoding are performed, a spatiotemporal graph neural network model is constructed, and feature extraction and prediction are performed by combining graph neural networks and attention mechanisms. A model optimization mechanism is introduced, and the model is iterated through error analysis and weight adjustment.

Benefits of technology

It achieves accurate feature extraction and continuous improvement in prediction, thereby enhancing the accuracy and efficiency of pedestrian flow prediction in the park and overcoming the shortcomings of traditional technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122489979A_ABST
    Figure CN122489979A_ABST
Patent Text Reader

Abstract

This application provides a method and apparatus for predicting pedestrian flow in industrial parks based on spatiotemporal data analysis. It achieves accurate feature extraction through density calculation and graph structure encoding. A prediction mechanism is constructed, combining graph neural networks and attention mechanisms to establish a reliable prediction strategy. Model optimization is introduced, and error analysis and weight adjustment are used to ensure continuous improvement in prediction. This method effectively addresses the shortcomings of traditional techniques in feature extraction, spatiotemporal analysis, and model optimization, providing technical support for pedestrian flow prediction in industrial parks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, specifically to a method and device for predicting pedestrian flow in a park based on spatiotemporal data analysis. Background Technology

[0002] Existing methods for predicting pedestrian flow in industrial parks have significant shortcomings. Traditional systems perform poorly in video processing and density calculation, failing to effectively extract pedestrian flow characteristics and thus affecting prediction results.

[0003] Furthermore, existing technologies face bottlenecks in spatiotemporal analysis and feature fusion. Most systems lack robust graph structure processing mechanisms and attention computation strategies, resulting in suboptimal prediction accuracy.

[0004] The existing system has technical shortcomings in model optimization. It lacks in-depth analysis of prediction errors, making efficient model iteration through online updates difficult and impacting prediction accuracy. Solving these problems is crucial for improving the ability to predict pedestrian flow in industrial parks. Summary of the Invention

[0005] To address the problems in existing technologies, this application provides a method and apparatus for predicting pedestrian flow in parks based on spatiotemporal data analysis. This method effectively solves the shortcomings of traditional technologies in feature extraction, spatiotemporal analysis, and model optimization, providing technical support for predicting pedestrian flow in parks.

[0006] To solve at least one of the above problems, this application provides the following technical solution: Firstly, this application provides a method for predicting pedestrian flow in a park based on spatiotemporal data analysis, including: Based on video data streams collected by park surveillance cameras, the video data streams are decoded to generate raw frame sequences. The raw frame sequences are then used to calculate pedestrian density to generate density feature maps. Based on the density feature maps and the park's electronic map, a regional topology map is constructed to obtain graph structure data. Node encoding is performed on the graph structure data to generate initial feature vectors. The initial feature vectors are then time-series aligned with weather data and calendar information to obtain multi-source feature groups. Data standardization processing is performed on the multi-source feature groups to generate standard feature matrices. A spatiotemporal graph neural network model is constructed based on the standard feature matrix. Parameter optimization is performed on the spatiotemporal graph neural network model to obtain pre-trained model parameters. The pre-trained model parameters are processed by graph convolution and temporal convolution to generate temporal feature vectors. An attention weight matrix is ​​constructed based on the temporal feature vectors to obtain a fusion feature group. Multi-step decoding calculation is performed on the fusion feature group to generate a prediction result sequence. The prediction result sequence is divided into prediction interval groups according to a preset time window. The prediction error is calculated for the prediction interval group to generate an error index table. An online update strategy is constructed based on the error index table to obtain a weight adjustment scheme. The weight adjustment scheme is applied to the spatiotemporal graph neural network model to complete the model iteration.

[0007] Furthermore, it also includes: acquiring real-time video streams based on the acquisition parameter matrix set by the park's surveillance cameras, performing frame rate conversion processing on the real-time video streams to generate original video sequences, mapping the original video sequences through a decoder to obtain image data streams, performing brightness normalization and Gaussian filtering processing on the image data streams to generate enhanced frame sequences, separating foreground targets from the enhanced frame sequences based on background modeling to obtain target detection boxes, and generating density distribution maps by morphological processing of the target detection boxes. Based on the density distribution map, a regional division grid is constructed to obtain a set of regional feature points. The set of regional feature points is then mapped to the park's electronic map to generate a location mapping table. Spatial connectivity analysis is performed on the location mapping table to obtain a regional adjacency matrix. Based on the regional adjacency matrix, a topological connectivity graph is constructed to obtain graph structure data.

[0008] Furthermore, it also includes: extracting features from the node attributes in the graph structure data to obtain a node attribute table; processing the node attribute table through a position embedding encoder to generate a spatial encoding vector; constructing a node representation learner based on the spatial encoding vector to obtain node hidden layer features; performing graph attention calculation on the node hidden layer features to generate a node weight matrix; fusing the node weight matrix with the graph structure topology information to obtain an initial feature vector; and timestamping the initial feature vector to generate a temporal feature sequence. The time-series feature sequence is segmented into feature fragment groups through a time window. Weather data completion is performed on the feature fragment groups to generate a weather feature matrix. The weather feature matrix is ​​aligned with calendar information to obtain a multi-source feature group. Statistical indicators are calculated based on the multi-source feature group to obtain a normalized parameter set. The normalized parameter set is applied to feature transformation to generate a standard feature matrix.

[0009] Furthermore, it also includes: constructing a multi-layer graph convolutional structure based on a standard feature matrix to obtain a basic network architecture; extending the basic network architecture through a gated recurrent unit to generate a temporal processing layer; applying an attention mechanism to the temporal processing layer to obtain an attention encoder; constructing a spatiotemporal feature extractor based on the attention encoder to generate a feature extraction module; combining the feature extraction module with a decoding prediction layer to obtain a spatiotemporal graph neural network model; and inputting a validation dataset into the spatiotemporal graph neural network model to generate an initial parameter set. The initial parameter set is updated to obtain the iterative parameter table through the backpropagation algorithm. Gradient pruning is performed on the iterative parameter table to generate an optimized parameter set. The model loss value is calculated based on the optimized parameter set to obtain a convergence index. The convergence index is compared with a preset threshold to filter and obtain the pre-trained model parameters.

[0010] Furthermore, it also includes: inputting pre-trained model parameters into a graph convolutional layer to obtain spatial aggregation features; performing neighborhood information transfer on the spatial aggregation features to generate node embedding vectors; constructing a causal convolutional network based on the node embedding vectors to obtain a temporal coding sequence; processing the temporal coding sequence through residual connections to generate an enhanced feature group; performing a gating mechanism on the enhanced feature group to filter and obtain a temporal feature vector; and decomposing the temporal feature vector according to a preset rule to generate a multi-scale feature set. Based on the multi-scale feature set, the feature correlation is calculated to obtain a weight coefficient table. The weight coefficient table is then scaled to generate an attention distribution matrix. A weighted aggregation operation is performed on the attention distribution matrix to obtain a fused feature group. An autoregressive predictor is constructed based on the fused feature group to generate a prediction state sequence. The prediction state sequence is then processed through an output mapping layer to obtain a prediction result sequence.

[0011] Furthermore, it also includes: segmenting the predicted result sequence based on timestamp information to obtain a time series segment set; performing overlapping window partitioning on the time series segment set to generate predicted data blocks; constructing an interval boundary detector based on the predicted data blocks to obtain a segmentation point sequence; generating a time interval table by performing boundary alignment processing on the segmentation point sequence; performing data recombination on the time interval table to obtain a predicted interval group; and matching the predicted interval group with the real observation data to generate a comparison sample set. The root mean square error is calculated based on the comparison sample set to obtain the basic error value. The basic error value is normalized to generate a standard error sequence. Statistical analysis is performed on the standard error sequence to obtain an error distribution map. Based on the error distribution map, a multidimensional evaluation index is constructed to generate a performance metric table. The performance metric table is filtered by a threshold to obtain an error index table.

[0012] Furthermore, it also includes: performing index decomposition operations on the error index table to obtain an error contribution matrix; generating a weight update sequence by ranking the error contribution matrix by importance; constructing an elastic learning rate regulator based on the weight update sequence to obtain a learning rate mapping table; matching the learning rate mapping table with the model parameter distribution to generate a parameter sensitivity map; performing hierarchical analysis on the parameter sensitivity map to obtain a weight adjustment scheme; and generating an update instruction set by ranking the weight adjustment scheme by priority. Based on the update instruction set, the spatiotemporal graph neural network model is fine-tuned to obtain an iterative parameter set. The iterative parameter set is then processed through gradient constraints to generate an optimized weight matrix. Model verification is performed on the optimized weight matrix to obtain performance evaluation results. Based on the performance evaluation results, a parameter deployment strategy is constructed to generate a deployment configuration table. The deployment configuration table is then written into the prediction engine to complete the model iteration.

[0013] Secondly, this application provides a park pedestrian flow prediction device based on spatiotemporal data analysis, comprising: The video acquisition module is used to acquire video data streams based on park surveillance cameras, decode the video data streams to generate raw frame sequences, calculate the population density of the raw frame sequences to generate a density feature map, construct a regional topology map based on the density feature map and the park electronic map to obtain graph structure data, perform node encoding on the graph structure data to generate an initial feature vector, perform time-series alignment of the initial feature vector with weather data and calendar information to obtain a multi-source feature group, and perform data standardization processing on the multi-source feature group to generate a standard feature matrix. The crowd flow prediction module is used to construct a spatiotemporal graph neural network model based on the standard feature matrix, perform parameter optimization on the spatiotemporal graph neural network model to obtain pre-trained model parameters, generate temporal feature vectors by processing the pre-trained model parameters through graph convolution and temporal convolution, construct an attention weight matrix based on the temporal feature vectors to obtain a fusion feature group, and perform multi-step decoding calculation on the fusion feature group to generate a prediction result sequence. The model iteration module is used to divide the prediction result sequence into prediction interval groups according to a preset time window, calculate the prediction error for the prediction interval groups to generate an error index table, construct an online update strategy based on the error index table to obtain a weight adjustment scheme, and apply the weight adjustment scheme to the spatiotemporal graph neural network model to complete the model iteration.

[0014] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the park pedestrian flow prediction method based on spatiotemporal data analysis.

[0015] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the aforementioned method for predicting pedestrian flow in a park based on spatiotemporal data analysis.

[0016] Fifthly, this application provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the aforementioned method for predicting pedestrian flow in a park based on spatiotemporal data analysis.

[0017] As can be seen from the above technical solution, this application provides a method and device for predicting pedestrian flow in industrial parks based on spatiotemporal data analysis. It achieves accurate feature extraction through density calculation and graph structure encoding. A prediction mechanism is constructed, combining graph neural networks and attention mechanisms to establish a reliable prediction strategy. Model optimization is introduced, and continuous improvement of predictions is ensured through error analysis and weight adjustment. This method effectively solves the shortcomings of traditional techniques in feature extraction, spatiotemporal analysis, and model optimization, providing technical support for pedestrian flow prediction in industrial parks. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating the park pedestrian flow prediction method based on spatiotemporal data analysis in the embodiments of this application. Figure 2 This is a structural diagram of the park pedestrian flow prediction device based on spatiotemporal data analysis in an embodiment of this application. Detailed Implementation

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

[0021] The acquisition, storage, use, and processing of data in this application all comply with relevant laws and regulations.

[0022] In view of the problems existing in the prior art, this application provides a method and device for predicting pedestrian flow in industrial parks based on spatiotemporal data analysis. It achieves accurate feature extraction through density calculation and graph structure encoding. A prediction mechanism is constructed, combining graph neural networks and attention mechanisms to establish a reliable prediction strategy. Model optimization is introduced, and continuous improvement of prediction is ensured through error analysis and weight adjustment. This method effectively solves the shortcomings of traditional techniques in feature extraction, spatiotemporal analysis, and model optimization, providing technical support for pedestrian flow prediction in industrial parks.

[0023] To effectively address the shortcomings of traditional technologies in feature extraction, spatiotemporal analysis, and model optimization, and to provide technical support for park pedestrian flow prediction, this application provides an embodiment of a park pedestrian flow prediction method based on spatiotemporal data analysis. See [link to embodiment]. Figure 1 The method for predicting pedestrian flow in the park based on spatiotemporal data analysis specifically includes the following: Step S101: Based on the video data stream collected by the park's surveillance cameras, the video data stream is decoded to generate an original frame sequence. The original frame sequence is used to calculate the flow density to generate a density feature map. Based on the density feature map and the park's electronic map, a regional topology map is constructed to obtain graph structure data. Node encoding is performed on the graph structure data to generate an initial feature vector. The initial feature vector is time-series aligned with weather data and calendar information to obtain a multi-source feature group. Data standardization processing is performed on the multi-source feature group to generate a standard feature matrix. First, the real-time video data streams from the park's surveillance cameras are accessed and decoded according to the acquisition parameters to obtain the original frame sequence arranged by timestamps. After access, brightness normalization and noise reduction filtering are performed on each frame sequence, and the frame time, camera identifier, intrinsic parameters, and extrinsic parameters are recorded as indexes for subsequent coordinate mapping and temporal alignment. Frames are extracted and processed according to a fixed step size, and the foreground region is separated by background modeling. Combined with connected component filtering and morphological thinning, a foreground mask for calculation is obtained.

[0024] Based on the foreground mask, the image plane is rasterized according to rules. The proportion of foreground pixels in each raster is statistically analyzed and local smoothing is performed to generate a density feature map aligned with the timestamp. To achieve consistent spatial representation across devices, the density feature map is mapped to the coordinate system of the campus electronic map through homography to obtain the correspondence between pixels and map positions. The mapping residual is retained as a confidence annotation for subsequent weighting.

[0025] Based on the aforementioned coordinate correspondence, the functional area outlines in the electronic map are read, a set of regional feature points is generated, and the density of each grid cell is aggregated to the corresponding region according to the spatial overlap ratio, forming a density time series at the regional granularity. Regional adjacency relationships are calculated by combining road connectivity and pedestrian accessibility, and a regional adjacency matrix is ​​output, resulting in a regional topology map as graph structure data. This graph structure data maintains a one-to-one mapping with timestamps and camera identifiers to ensure that subsequent graph operations are consistent with the timeline.

[0026] Based on the graph structure data, node encoding is performed on each topological node. The encoding content includes recent density segments, observation confidence based on residuals, region type embedding, and structural quantities such as node degree and betweenness, outputting an initial feature vector bound to the node identifier. To enhance temporal traceability, the initial feature vector is accompanied by a source frame range index for external time-series information reference and backfilling.

[0027] Based on the initial feature vector, weather data and calendar information are introduced and time-series aligned. Using the timestamp as the primary key, the codes for temperature, precipitation type, and wind force level are concatenated with weekday markers and hour codes to the time slices of the corresponding nodes, forming multi-source feature groups. Missing segments are interpolated using neighborhood interpolation and labeled with interpolation markers; low-confidence time slices retain confidence weights as the basis for subsequent standardization and weight reduction.

[0028] Data standardization is performed based on the multi-source feature set. First, the mean and scale are estimated within the node's short window, and then the distribution differences of different cameras and region sizes are aligned at the scene level. For time slices with interpolation labels or low confidence weights, their influence on statistical estimation is reduced, a standard feature matrix is ​​output, and a confidence weight vector of the same dimension is output simultaneously to provide a reference for the model's input layer.

[0029] Based on the aforementioned processing, to avoid the superposition of scale and confidence values ​​between different source components before encoding, a simplified fusion loss is calculated to determine the channel proportion and reading order:

[0030] in, This represents a standardized vector formed by concatenating density, weather, and calendar data at the current node and time slice. The reference vector within the short window of the same node is obtained by the aforementioned confidence weights and short window statistical estimation. For the consistency item weight, Weights for sparse terms; The visibility factor is obtained by mapping missing labels to observation confidence and is within the specified range. When minimized, a reading scheme is generated, which gives the splicing order and channel percentage of each component.

[0031] Based on the standard feature matrix and reading scheme, a unified external input interface is formed, including time axis index, node index, standardized feature tensor, and channel proportion. The density component drives spatial aggregation, while the weather and calendar components provide temporal context. The reading scheme constrains the splicing order and channel weights at the input layer to prevent the amplification of abnormal segments.

[0032] Finally, the standard feature matrix, graph structure data, and reading scheme are read by the spatiotemporal graph neural network model in step S102 and enter the encoding process of graph convolution and temporal convolution; wherein the adjacency matrix is ​​used for neighborhood propagation, and the channel proportion is used for weighted filtering before attention. Thus, this embodiment establishes a closed loop between video decoding, density estimation, topology construction, and multi-source alignment, providing consistent input for subsequent temporal feature extraction and decoding prediction.

[0033] Step S102: Construct a spatiotemporal graph neural network model based on the standard feature matrix, perform parameter optimization on the spatiotemporal graph neural network model to obtain pre-trained model parameters, generate temporal feature vectors by processing the pre-trained model parameters through graph convolution and temporal convolution, construct an attention weight matrix based on the temporal feature vectors to obtain a fusion feature group, and perform multi-step decoding calculation on the fusion feature group to generate a prediction result sequence; First, the standard feature matrix, graph structure data, and reading scheme output in step S101 are read. Using the time axis index and node index as input keys, a fixed-dimensional data tensor is established. Based on the above input, a spatiotemporal graph neural network model composed of a spatial subnet and a temporal subnet is constructed, hereinafter referred to as the "joint encoder." The spatial subnet uses the adjacency matrix as a constraint to perform neighborhood aggregation on node features in each time slice; the temporal subnet uses gated units connected in series with fixed-stride convolutions to extract short-window dynamics while maintaining the node dimension.

[0034] In the spatial subnet of the joint encoder, the channel proportions given by the reading scheme are first applied to the density, weather, and calendar components. Then, information is transferred between first-order and second-order neighborhoods according to the adjacency matrix, and the spatial aggregation representation is output. To control numerical stability, layer normalization is applied after each aggregation layer, and the residual connection is fed back to the input channel to retain the original scale information for the temporal subnet to read.

[0035] Based on the spatial aggregation representation, the temporal subnet performs causal convolutions along the time axis, superimposed with gated activations to suppress irrelevant history. The kernel size and dilation rate are set differently at different levels to cover short-term fluctuations and medium-term rhythms. The outputs of each temporal layer remain aligned at the node dimension, forming a temporal coding tensor, which is preserved along with the previous channel proportions for reference during the attention construction phase.

[0036] Based on the temporal coding tensor, an attention weight matrix is ​​calculated to obtain the fused feature group. Specifically, the node representation of the current time slice is used as the query, and the representations of adjacent time slices and adjacent nodes are used as keys and values ​​to generate cross-temporal and cross-spatial relevance weights. During the weight normalization process, the channel proportion is read, and low-visibility components are deweighted. The fused features remain consistent with the input index in the temporal and node dimensions, facilitating subsequent decoding.

[0037] Based on the fused feature set, a multi-step decoding path is constructed. The decoder first concatenates the fused features of the current time slice and its nearest neighbors, inputs the result into the autoregressive unit, and gradually generates the hidden states for several future time slices. Subsequently, the hidden states are restored to region-level pedestrian flow prediction values ​​through the output mapping layer. To avoid the accumulation of errors during the autoregression process, a local summary of the fused features is read at each decoding step and used as a state correction term.

[0038] During the decoding process, the joint encoder undergoes parameter optimization during the training phase to obtain pre-trained model parameters. A block-based learning rate strategy is employed during optimization: the spatial subnet uses a smaller step size to maintain topological stability, while the temporal subnet and attention unit use larger step sizes to accelerate convergence; simultaneously, gradient pruning is enabled to suppress abrupt updates caused by extreme samples. Early stopping is verified to be triggered jointly by window-level loss and temporal continuity error.

[0039] Based on the aforementioned optimization process, the pre-trained model parameters are solidified and backfilled into the spatial subnet, temporal subnet, and attention unit. After solidification, an inference is performed on the same batch of standard feature matrices, outputting a cache of temporal feature vectors, attention weight matrices, and fused feature groups to check the consistency between time and node indices; if the index alignment passes, batch decoding is initiated to generate a sequence of prediction results.

[0040] Finally, the predicted result sequence is consistent with the time index of the temporal feature vector and directly enters the error calculation process in step S103. Simultaneously, the attention weight matrix is ​​recorded as a bypass product and used to identify the source of weight drift during abnormal periods in the subsequent online update strategy. Through the above organization, the model input, encoding, attention fusion, and decoding output form a closed loop, ensuring that subsequent evaluation and update stages can be read using the same key value.

[0041] Step S103: Divide the prediction result sequence into prediction interval groups according to a preset time window, calculate the prediction error for the prediction interval groups to generate an error index table, construct an online update strategy based on the error index table to obtain a weight adjustment scheme, and apply the weight adjustment scheme to the spatiotemporal graph neural network model to complete the model iteration.

[0042] First, the prediction result sequence output in step S102 and its time axis index are read and divided according to a preset time window to obtain prediction interval groups. During the division, the start and end times of the window are used as boundaries to aggregate continuous prediction values ​​of the same node into interval-level sequences, and these sequences are aligned one by one with the corresponding actual observation data according to timestamps. For observation points with missing data, robust interpolation within the neighborhood is used and an interpolation mark is registered. Subsequent error statistics will de-weight this mark to avoid shifting the interval error.

[0043] Based on the predicted interval group, the prediction errors at the node level and interval level are calculated to generate original error entries. Error measures include interval mean square error, relative deviation within the interval, and the concentration of errors at the boundaries, and are backfilled into the entries according to node and time index. To ensure comparability between different nodes, the error entries are standardized within the interval, and the attention weight statistical summary from step S102 is retained as lateral evidence for subsequent attribution.

[0044] Based on the original error entries, an error index table is obtained. The table is grouped by three keys: node, time window, and scene label, forming statistical indicators such as interval mean, variance, and extreme value location. Samples with interpolation labels have their weight reduced. The error index table also records the prediction engagement and data completeness score for each window, used for triggering subsequent online update strategies and allocating learning rates.

[0045] Based on the aforementioned error index table, an online update strategy is constructed, and a weight adjustment scheme is output. This embodiment uses a window-level triggering rule combined with a steady-state threshold to determine whether to initiate incremental learning. Once triggered, the priority channels and levels for updating are determined based on the node's error decomposition results. Specifically, for nodes with significant density channel deviations, spatial aggregation-related weights are labeled as high-sensitivity; for time delays caused by rhythm drift, temporal convolution-related weights are labeled as medium-sensitivity; and for weather and calendar context biases, they are labeled as low-sensitivity in the attention component. These labels correspond to different learning rates and freezing strategies in the weight adjustment scheme.

[0046] Based on the weight adjustment scheme, a constrained parameter fine-tuning is performed on the spatiotemporal graph neural network model. The fine-tuning data comes from multi-source aligned features and corresponding observations from multiple neighboring windows. Learning rates are assigned to different components according to the weight adjustment scheme, and gradient pruning is enabled to control the single-step update magnitude. To prevent historical patterns from being quickly forgotten, the attention weight statistical summary recorded in step S102 is read as a reference for the regularization term to constrain the sharp drift of the attention distribution in the short term.

[0047] During the fine-tuning process, interval-level loss is evaluated in real time at small batch intervals. An early stopping rule is adopted to terminate the update when no improvement is achieved in several consecutive batches, and the update is rolled back to the previous better snapshot. After the fine-tuning is completed, the same batch of standard feature matrices is recalculated, and the new prediction results are compared with the results before the update in the same window. The difference distribution and index consistency are recorded to ensure that the update does not disrupt the input-output key-value relationship.

[0048] After the recalculation and verification are passed, the new parameters are solidified into the iterative version, and an update summary is written to the version record, including the trigger window, participating nodes, affected channels, and learning rate allocation. This provides a basis for subsequent adaptive operation. The iterative version is kept under observation for a limited period, during which incremental statistics of the error index table are continuously collected. If an abnormal increase occurs, the system automatically reverts to the previous version.

[0049] Finally, the reference relationship between the error index table and the weight adjustment scheme is retained for evaluation and backtracking in step S201 and subsequent stages; the new version model outputs a new prediction result sequence under the same input interface and continues to enter the next round of window segmentation and error evaluation. Thus, step S103 forms a closed loop from interval error measurement to online update and then to version solidification, connecting the upstream fusion features and the downstream iterative inference under a unified index.

[0050] As described above, the park pedestrian flow prediction method based on spatiotemporal data analysis provided in this application can achieve accurate feature extraction through density calculation and graph structure encoding. A prediction mechanism is constructed, combining graph neural networks and attention mechanisms to establish a reliable prediction strategy. Model optimization is introduced, and continuous improvement of predictions is ensured through error analysis and weight adjustment. This method effectively solves the shortcomings of traditional techniques in feature extraction, spatiotemporal analysis, and model optimization, providing technical support for park pedestrian flow prediction.

[0051] In one embodiment of the park pedestrian flow prediction method based on spatiotemporal data analysis in this application, it may further include the following: Step S201: Acquire real-time video stream based on the acquisition parameter matrix set by the park surveillance camera, perform frame rate conversion processing on the real-time video stream to generate the original video sequence, map the original video sequence through the decoder to obtain the image data stream, perform brightness normalization and Gaussian filtering processing on the image data stream to generate the enhanced frame sequence, separate the foreground target from the enhanced frame sequence based on background modeling to obtain the target detection box, and generate the density distribution map by morphological processing of the target detection box. Step S202: Based on the density distribution map, construct a regional division grid to obtain a set of regional feature points. Map the set of regional feature points to the park's electronic map to generate a location mapping table. Perform spatial connectivity analysis on the location mapping table to obtain a regional adjacency matrix. Based on the regional adjacency matrix, construct a topological connectivity graph to obtain graph structure data.

[0052] First, the system accesses the acquisition parameter matrix of the park's surveillance cameras, reading the resolution, frame rate, encoding format, and time synchronization offset, and registers them as acquisition sessions according to the camera identifiers. Next, it captures real-time video streams within the acquisition session, performs frame rate conversion based on the target analysis frequency, generates the original video sequence, and retains frame timestamps and dropped frame markers as the basis for subsequent time alignment. The original video sequence is then input into the decoder, mapped into an image data stream, and internal and external parameters are read simultaneously to provide parameters for subsequent coordinate transformation and camera consistency processing.

[0053] Based on the image data stream, brightness normalization and Gaussian filtering are performed sequentially to output an enhanced frame sequence. Brightness normalization is adaptively adjusted according to the brightness histogram of the nearest time window to suppress contrast changes caused by dawn / dusk and shadows; Gaussian filtering removes sensor noise with a fixed kernel width while preserving the low-frequency structure of pedestrian contours. Subsequently, background modeling is performed on the enhanced frame sequence, and a foreground mask is obtained using a foreground separation strategy with a controlled update rate. Candidate regions are then extracted by connecting component aggregation and backfilled into the same frame index to form a set of target detection boxes.

[0054] Based on the target detection bounding box set, morphological processing is performed. First, erosion is used to suppress isolated small noise patches and minor artifacts. Then, dilation is used to restore the continuity and integrity of the foreground boundaries, resulting in a more coherent foreground region. Subsequently, the entire frame is divided into a uniform grid, the proportion of foreground pixels in each grid is calculated, and local smoothing is performed to output a density distribution map. This density distribution map corresponds one-to-one with the frame timestamp and camera identifier, serving as input for subsequent spatial mapping and region aggregation.

[0055] Based on the density distribution map, a regional division grid is constructed. Specifically, the functional area boundaries in the park's electronic map are read, and the image plane is cropped into grids according to the boundary overlap relationship. The centers of grids with high coverage are extracted as the regional feature point set. A correspondence is established between the regional feature point set and the density grid through index mapping to ensure that each region only absorbs the density values ​​within its coverage area during subsequent aggregation.

[0056] Based on the aforementioned set of regional feature points, image coordinates are mapped to coordinates on the park's electronic map to generate a location mapping table. The mapping employs homography and height approximation constraints, utilizing pre-calibrated ground feature points for registration, and recording the mapping residual for each point as a confidence reference. The location mapping table is bound to camera extrinsic parameters for weighted processing when merging multi-camera coverage areas.

[0057] Based on the location mapping table, spatial connectivity analysis is performed to obtain the regional adjacency matrix. During the analysis, road connectivity, walkability, and physical distance thresholds on the map are used as rules to determine whether two regions are adjacent, and directional attributes are separately labeled for connections across floors or corridors. The regional adjacency matrix uses a sparse representation and is indexed by region number and connection type for efficient retrieval during the graph computation stage.

[0058] Based on the aforementioned regional adjacency matrix, a topological connectivity graph is constructed to obtain graph-structured data. The topological connectivity graph uses regions as nodes and adjacency relationships as edges, with edge attributes recording connection type and passage weight. Node attributes reference the aforementioned set of regional feature points and their aggregation rules in the density distribution map. The graph-structured data and the density distribution map share a time index, ensuring that subsequent node-level density time series are aligned with the topological structure on the same time axis.

[0059] Based on the aforementioned graph structure data, subsequent step S101 can directly read the node set and edge set to complete node encoding and multi-source alignment; simultaneously, the density distribution map serves as the original source of historical node density and enters the feature construction process. Through the above connection, video acquisition, foreground extraction, density estimation, and topology modeling form a consistent data link, providing a reusable structured input for spatiotemporal modeling and predictive decoding.

[0060] In one embodiment of the park pedestrian flow prediction method based on spatiotemporal data analysis in this application, it may further include the following: Step S301: Extract the node attributes from the graph structure data to obtain a node attribute table. Process the node attribute table through a position embedding encoder to generate a spatial encoding vector. Construct a node representation learner based on the spatial encoding vector to obtain the node hidden layer features. Perform graph attention calculation on the node hidden layer features to generate a node weight matrix. Fuse the node weight matrix with the graph structure topology information to obtain an initial feature vector. Timestamp the initial feature vector to generate a time-series feature sequence. Step S302: The time-series feature sequence is segmented into feature fragment groups through a time window. Weather data completion is performed on the feature fragment groups to generate a weather feature matrix. The weather feature matrix is ​​aligned with calendar information to obtain a multi-source feature group. Statistical indicators are calculated based on the multi-source feature group to obtain a normalized parameter set. The normalized parameter set is applied to feature transformation to generate a standard feature matrix.

[0061] First, the node attributes in the graph structure data are read, and historical density segments, region type identifiers, observation confidence, and node degree are aggregated by region number to form a node attribute table. After reading, the attribute values ​​are screened for missing values ​​and truncated for anomalies, while retaining the source time index as a reference key for subsequent location coding and time stamping. Short-window smoothing is performed on numerical attributes, and one-hot coding is performed on categorical attributes, with the coding dictionary recorded to ensure that the same node has a consistent feature layout across different time slices.

[0062] Based on the node attribute table, a location embedding encoder is input to generate a spatial encoding vector. The location embedding encoder uses map coordinates, floor markers, and adjacency strength as independent variables, and obtains a dense representation through a learnable mapping. To reduce scale differences, constraint terms are constructed using node degree and geographical span to ensure that neighboring nodes remain moderately close in the encoding space. The spatial encoding vector is aligned with the original dimensions of the node attributes and serves as the input to the node representation learner.

[0063] Based on the spatial encoding vector, a node representation learner is constructed to output the hidden layer features of nodes. The node representation learner reads the spatial encoding of first-order and second-order neighbors according to the graph topology, uses a separable channel aggregation operator to distinguish the contributions of density channels and structure channels, and preserves node self-information through residual paths. The hidden layer features of nodes are registered together with node numbers and time indices to ensure that they can be read by key values ​​in the subsequent attention stage.

[0064] Based on the hidden features of the nodes, graph attention is calculated to generate a node weight matrix. The attention key and the query are derived from the hidden features of the target node and its neighbors, respectively. Weight normalization incorporates the aforementioned observation confidence to suppress the influence of low-confidence neighbors. The node weight matrix is ​​mapped one-to-one with the edge set of the graph structure, and then fused with topological information to obtain an initial feature vector. This vector contains the weighted and aggregated node representations and the retained self-channel components.

[0065] Based on the initial feature vector, timestamp markers are written to generate a temporal feature sequence. The timestamps are derived from the video frame index and window boundaries, and are aligned with a unified clock when crossing cameras. The temporal feature sequence retains missing markers and confidence weights as the basis for subsequent time segmentation and completion, and ensures that the key value with the node number does not drift.

[0066] Based on the temporal feature sequence, it is segmented according to a preset time window to obtain feature segment groups. The segmentation process records the start and end points and coverage of the segments, and an overlap strategy is used for samples crossing the window boundary to avoid information gaps. Subsequently, weather data completion is performed on the feature segment groups. Based on the location of the region and the time index, temperature, precipitation type and wind force codes are read from external weather sources. Neighborhood interpolation is used at missing locations and interpolation markers are added to output a weather feature matrix.

[0067] Based on the weather feature matrix, alignment with calendar information is performed to obtain a multi-source feature group. Alignment uses timestamps as the primary key, concatenating weekday markers and hour codes to the corresponding segments while maintaining consistency with the node number index. To avoid any one component dominating the distribution, statistical indicators such as mean and scale are calculated based on the multi-source feature group according to nodes and time windows to obtain a normalized parameter set; items with interpolation markers are weighted less during statistical analysis.

[0068] Finally, the normalized parameter set is applied to the feature transformation to generate a standard feature matrix, and the fragment and time indices are backfilled. The standard feature matrix is ​​consistent with the upstream matrix in both the node dimension and the time dimension, and will be read by the dual-stream feature encoder in subsequent step S401 to extract spatiotemporal features and enter the cross-attention and decoding stages. The above products simultaneously retain confidence and missing data labels, facilitating loss masking and sample weighting in subsequent training stages.

[0069] In one embodiment of the park pedestrian flow prediction method based on spatiotemporal data analysis in this application, it may further include the following: Step S401: Construct a multi-layer graph convolutional structure based on the standard feature matrix to obtain the basic network architecture. Extend the basic network architecture through gated recurrent units to generate a temporal processing layer. Apply an attention mechanism to the temporal processing layer to obtain an attention encoder. Construct a spatiotemporal feature extractor based on the attention encoder to generate a feature extraction module. Combine the feature extraction module with the decoding prediction layer to obtain a spatiotemporal graph neural network model. Input the validation dataset into the spatiotemporal graph neural network model to generate an initial parameter set. Step S402: Update the initial parameter set to obtain the iterative parameter table through the backpropagation algorithm, perform gradient pruning on the iterative parameter table to generate an optimized parameter set, calculate the model loss value based on the optimized parameter set to obtain a convergence index, and compare the convergence index with a preset threshold to filter and obtain the pre-trained model parameters.

[0070] First, the standard feature matrix and graph structure data output from step S302 are read and assembled into a fixed-dimensional input tensor using time axis indices and node indices. Based on this input, a multi-layer graph convolutional structure is built as the basic network architecture, and information aggregation of first-order and second-order neighborhoods is completed in each time slice according to the adjacency matrix. To maintain numerical stability, layer normalization is applied after each aggregation layer, and node self-channels are reconnected through residual paths, enabling subsequent temporal processing layers to simultaneously read local and neighborhood representations.

[0071] Based on the basic network architecture, a gated recurrent unit is introduced to extend it into a temporal processing layer. Specifically, while maintaining node dimension alignment, the aggregated node representation is updated along the time axis, and a reset gate and an update gate are used to distinguish between short-term fluctuations and slow changes. To reduce the amplification of input noise, the recurrent unit refers to the confidence weights retained in step S302 during input, and accumulates low-confidence time slices with reduced weights, outputting a temporal hidden state sequence consistent with the time index.

[0072] Based on the temporal hidden state sequence, an attention mechanism is applied to obtain an attention encoder. The attention query comes from the node state of the current time slice, and the key and value come from the states of neighboring time slices and adjacent nodes. During weight normalization, channel proportion and visibility markers are read to suppress the interference of missing segments on relevance. After attention weighting, the output is an aggregated representation emphasizing key moments and key adjacency relationships, and maintains strict alignment with the node index, serving as direct input for subsequent feature extraction.

[0073] Based on the attention encoder, a spatiotemporal feature extractor is constructed, generating a feature extraction module. This module concatenates the multi-layer output of the spatial graph convolution with the attention-enhanced temporal representation at the channel level, further compressing redundant dimensions through separable convolutions to form a compact spatiotemporal representation. To accommodate different time scales, temporal convolutional branches with different dilation rates are connected in parallel at the end of the module, merging them to output a feature sequence of uniform length for direct reading by the decoder.

[0074] Based on the feature extraction module, a decoding prediction layer is combined to obtain a spatiotemporal graph neural network model.

[0075] Specifically, the construction process of the spatiotemporal graph neural network model consists of four parts: graph convolutional layers, gated recurrent units, attention encoders, and loss functions, as detailed below: I. Construction of Graph Convolutional Layers. First, a self-connection term is added to the region adjacency matrix. Then, symmetric normalization is performed on the matrix according to the degree of each node to eliminate the influence of differences in neighborhood scale between different nodes on the aggregation result, resulting in a normalized adjacency matrix. Using this normalized adjacency matrix as the propagation operator, a linear transformation is performed on the node feature matrix within each time slice, followed by neighborhood-weighted summation. Then, an activation function is used to introduce nonlinearity, completing one graph convolution. The model uses two stacked graph convolutional layers. The first layer projects the original node features into a low-dimensional dense space, and the second layer further aggregates second-order neighborhood information on the low-dimensional representation, enabling each node's representation to perceive a wider range of topological context. Both layers directly sum the layer inputs to the layer output through residual paths to preserve the original scale information of the node's self-channel. Layer normalization is applied after each aggregation layer to maintain numerical stability, ensuring that subsequent temporal processing layers can simultaneously read stable representations of both local and neighborhood representations.

[0076] II. Construction of the Gated Recurrent Unit. Using the spatial aggregation features output by graph convolution as input, a gated recurrent unit is introduced along the time axis to model temporal dependencies while maintaining node alignment. The gated recurrent unit incorporates two control mechanisms: a reset gate and an update gate. The reset gate calculates a coefficient between zero and one based on the current input and the hidden state from the previous time step, determining the proportion of historical hidden states participating in candidate updates, allowing the model to ignore historical information irrelevant to the current input when necessary. The update gate similarly calculates a mixing coefficient based on the current input and historical states, determining the weights of historical states and current candidate states in the final output, thus distinguishing between short-term fluctuations and medium-to-long-term rhythms. Candidate states are obtained by linearly transforming the reset historical information and the current input and calculating using the hyperbolic tangent function. The final hidden state is output after the update gate performs a weighted mixture of historical and candidate states. During input, the recurrent unit references the confidence weights retained in step S302, accumulating low-confidence time slices with reduced weights to minimize interference from unreliable segments in temporal modeling, outputting a temporal hidden state sequence strictly aligned with the time index.

[0077] III. Construction of the Attention Encoder. The attention encoder achieves spatiotemporal fusion based on a scaled dot product attention mechanism. Specifically, the node state of the current time slice is mapped to a query vector through a linear transformation, and the states of adjacent time slices and adjacent nodes are mapped to key vectors and value vectors, respectively, through linear transformations. The dot product of the query vector and the key vector, divided by the square root of the key vector's dimension, is used as a scaling factor to suppress the risk of gradient vanishing as the dot product amplitude increases with dimension. This is then normalized to obtain the attention weights. Finally, the value vectors are weighted and summed using these weights to obtain an aggregated representation that integrates cross-temporal and cross-spatial correlations. During normalization, the channel proportion is read, and low-visibility components are masked and weighted to suppress the interference of missing time slices on the correlation weights. The output maintains strict consistency with the input index in both the temporal and node dimensions, serving as the direct input to the subsequent feature extraction module.

[0078] IV. Construction of the Loss Function. During the training phase, the difference between the actual pedestrian flow observations and the model predictions at the region granularity is used as the optimization objective. The squared difference is taken as the weighted average of all nodes and time steps, forming the main loss term. The weights are provided by the confidence weight matrix composed of the confidence weights output in step S302 and the visibility markers. The contribution of time slices containing interpolation markers or with low visibility is reduced, thus avoiding the deviation of parameter update direction caused by missing samples. In addition to the main loss term, a regularization term in the form of the L2 norm of all learnable parameters of the model is superimposed, and its influence intensity is controlled by the regularization coefficient, constraining the overall magnitude of the parameters. The regularization term and the gradient pruning strategy work together to prevent parameter explosion or overfitting during training, ensuring that the model can converge stably under different node densities and time window distributions.

[0079] The decoding stage employs an autoregressive structure to progressively generate hidden states for future time slices and then reconstructs them into region-level pedestrian flow values ​​through a linear mapping layer. To avoid error accumulation, each decoding step reads the hidden state from the previous step and a local summary of the current spatiotemporal features for correction. Subsequently, the validation dataset is input into the model, and a forward inference is performed according to the window tick, collecting the initial loss and intermediate activations, generating the initial parameter set, and registering it in the hierarchical index.

[0080] Based on the initial parameter set, backpropagation is performed to obtain the iterative parameter table. During the update process, a block learning rate strategy is adopted: spatial convolutional weights use smaller strides to maintain topological stability, while recurrent and attention-related weights use larger strides to accelerate temporal pattern convergence. To suppress numerical spikes caused by outliers, gradient pruning is performed layer by layer on the iterative parameter table, and the pruning ratio is recorded as a side signal for subsequent convergence monitoring.

[0081] After gradient pruning, an optimized parameter set is obtained, and the model loss and auxiliary consistency term are calculated accordingly, then combined to form a convergence metric. The loss is weighted in windows, with weights derived from the confidence vector in step S302 and the visibility markers during decoding, ensuring that the impact of missing segments is controlled. The convergence metric also records temporal continuity error and deviation measures at boundaries, used to determine whether the short-term and medium-term patterns improve synchronously.

[0082] Based on the convergence metric, the pre-trained model parameters are compared and filtered against a preset threshold. The filtering strategy employs hysteresis conditions to avoid frequent oscillations near the boundary and prioritizes satisfying temporal continuity constraints before considering the overall loss's downward trend. When the filtering passes, the pre-trained model parameters are embedded into the spatial subnet, temporal processing layer, and attention encoder. A recalculation is performed on the same validation set to verify the consistency between the time axis and node indices. Simultaneously, the attention weight distribution is cached as a reference for subsequent online updates.

[0083] Finally, the pre-trained model parameters, feature extraction module, and decoding prediction layer form a stable inference path. Temporal feature vectors and fused attention representations are derived from the same batch of inputs at the end of training, providing a clear source for the read / write interfaces in step S102 for "generating temporal feature vectors through graph convolution operations and temporal convolution processing" and "constructing the attention weight matrix to obtain the fused feature group." This parameter state will be invoked in step S103 for error evaluation and online update triggering.

[0084] In one embodiment of the park pedestrian flow prediction method based on spatiotemporal data analysis in this application, it may further include the following: Step S501: Input the pre-trained model parameters into the graph convolutional layer to obtain spatial aggregation features, perform neighborhood information transfer on the spatial aggregation features to generate node embedding vectors, construct a causal convolutional network based on the node embedding vectors to obtain a temporal coding sequence, process the temporal coding sequence through residual connections to generate an enhanced feature group, perform a gating mechanism on the enhanced feature group to filter and obtain a temporal feature vector, and decompose the temporal feature vector according to a preset rule to generate a multi-scale feature set; Step S502: Calculate the feature correlation based on the multi-scale feature set to obtain a weight coefficient table, generate an attention distribution matrix by scaling transformation of the weight coefficient table, perform weighted aggregation operation on the attention distribution matrix to obtain a fused feature group, construct an autoregressive predictor based on the fused feature group to generate a prediction state sequence, and process the prediction state sequence through an output mapping layer to obtain a prediction result sequence.

[0085] First, the pre-trained model parameters obtained from step S402 and the standard feature matrix and graph structure data output from step S302 are read and assembled into input according to the time axis and node index. The pre-trained model parameters are loaded into the graph convolutional layer, and neighborhood aggregation is performed on the node features within each time slice to obtain spatial aggregated features. During aggregation, first-order and second-order neighborhoods are distinguished based on the adjacency matrix, and neighboring edges with low confidence labels are weighted and included to make the spatial representation closer to the observable relationship. The spatial aggregated features and the original node self-channels are retained together for subsequent time modeling.

[0086] Based on the spatial aggregation features, neighborhood information transfer is performed to generate node embedding vectors. During the transfer process, independent channels are set for different connectivity types, and pedestrian connections, cross-corridor connections, and cross-floor connections are encoded separately before being merged to avoid dilution of topological attributes. The node embedding vectors are aligned with the time index and include the type weights of the source edges, serving as side information during temporal convolution.

[0087] Based on the node embedding vectors, a causal convolutional network is constructed to obtain a temporal encoded sequence. The causal convolution accesses only the current and historical positions along the time axis, employing multi-rate stacking to enhance the receptive field and simultaneously model both abrupt and rhythmic changes. The output of each layer is strictly aligned with the node dimension, preserving the convolution stride and receptive window range to locate corresponding historical dependencies during decoding. The resulting temporal encoded sequence and the spatial residual channels are then residually concatenated to form an enhanced feature set.

[0088] Based on the enhanced feature set, a gating mechanism is introduced for filtering, outputting a temporal feature vector. The gating mechanism reads the confidence weights from step S302 at the channel level, reducing the pass probability for time slices containing interpolation markers to suppress the propagation of unreliable segments. The filtered temporal feature vector is organized with time slices as the primary key and serves as the input for multi-scale decomposition.

[0089] Based on the temporal feature vector, it is decomposed into a multi-scale feature set according to preset rules. The decomposition path includes three paths: short-window summary, medium-window trend, and long-window background. Each path uses a sliding convergence operation of different lengths while maintaining the alignment index with the original time axis. The multi-scale feature set generates three sets of parallel representations for each node and records their respective temporal coverage ranges as scale labels for the attention construction stage.

[0090] Based on the multi-scale feature set, feature correlation is calculated to obtain a weighted coefficient table. The correlation score is compared with the representations of adjacent time slices and adjacent nodes at each scale using the current time slice as the query, yielding cross-scale, cross-time, and cross-space correlation scores. The weighted coefficient table is recorded as a three-dimensional key-value structure, with keys representing time, node, and scale, and values ​​representing the corresponding correlation scores, facilitating subsequent scaling and normalization.

[0091] Based on the weight coefficient table, a scaling transformation is performed to generate an attention distribution matrix. The scaling factor is set according to the scale label and the range of the convolution receptive window, and the visibility markers from the gating stage are used to suppress the weights of abnormal segments. The attention distribution matrix generates normalized weights for different nodes and scales at each time slice, ensuring that the weighted result is consistent with the input index.

[0092] Based on the attention distribution matrix, weighted aggregation is performed to obtain a fused feature group. During aggregation, multi-scale features are linearly synthesized according to the weights of the distribution matrix, and a residual bypass is retained in the node dimension. The original short-window summary is injected at a small proportion to enhance the response to sudden changes. The fused feature group is a comprehensive spatiotemporal representation of a single time point and a single node, and is output in the same dimension as the time index and node index, which facilitates direct decoding.

[0093] Based on the fused feature set, an autoregressive predictor is constructed to generate a predicted state sequence. At each step, the autoregressive unit reads the hidden state from the previous step and the current fused features to update the internal state for the next time step. To limit error propagation, each step additionally reads the local mean of the attention distribution as a correction factor to limit the shift of the hidden state. The length of the predicted state sequence is consistent with the preset number of prediction steps and remains aligned along the node dimension.

[0094] Finally, the predicted state sequence is input into the output mapping layer to obtain the predicted result sequence. The output mapping shares parameters independently by node, mapping the state vector to regional-level pedestrian flow values, while simultaneously backfilling the time index for comparison with actual observations. In step S103, this predicted result sequence is read for window partitioning and error measurement, while the attention distribution matrix and fusion feature groups are recorded as bypass products, providing an explanation for weight drift during the online update phase.

[0095] In one embodiment of the park pedestrian flow prediction method based on spatiotemporal data analysis in this application, it may further include the following: Step S601: The predicted result sequence is segmented based on timestamp information to obtain a time series segment set. Overlapping window division is performed on the time series segment set to generate predicted data blocks. An interval boundary detector is constructed based on the predicted data blocks to obtain a segmentation point sequence. The segmentation point sequence is processed by boundary alignment to generate a time interval table. Data recombination is performed on the time interval table to obtain a predicted interval group. The predicted interval group is matched with the real observation data to generate a comparison sample set. Step S602: Calculate the root mean square error based on the comparison sample set to obtain the basic error value, normalize the basic error value to generate a standard error sequence, perform statistical analysis on the standard error sequence to obtain an error distribution map, construct a multidimensional evaluation index based on the error distribution map to generate a performance metric table, and filter the performance metric table through a threshold to obtain an error index table.

[0096] First, the prediction result sequence output from step S502 and its timestamp index are read, and segmented independently by node to obtain a set of time series segments. During segmentation, segments are truncated at time jumps or day boundaries between adjacent prediction steps, and the start and end points, missing markers, and visibility weights of the segments are recorded as constraints for subsequent windowing. To avoid losing local patterns in short segments, segments shorter than the minimum length are merged with adjacent segments, with the merging rules prioritizing temporal continuity and node consistency.

[0097] Based on the time-series segment set, overlapping windows are divided using a fixed step size and a configurable overlap rate to generate prediction data blocks. Each data block records the start and end times of the window, the coverage ratio, and an attention summary from step S502 for reference during boundary judgment. These data blocks are input into an interval boundary detector, which integrates local variance within the window, slope changes, and attention concentration to output a sequence of segmentation points, marking suspected structural turning points.

[0098] Based on the segmentation point sequence, boundary alignment is performed to generate a time interval table. During alignment, priority is given to aligning with known time anchors such as fixed business hours and shift change times. When multiple segmentation points fall within the neighborhood of the same anchor point, they are merged and the merge source is backfilled. The time interval table remains consistent with the node index and carries the coverage ratio and boundary confidence of each interval for subsequent data reorganization and error weighting.

[0099] Based on the time interval table, the predicted sequence is reorganized to output a set of predicted intervals. During reorganization, predicted values ​​falling within the same interval are aggregated into an interval-level sequence, while simultaneously extracting the corresponding real observation data and matching them by timestamp. For periods with missing observation data, robust interpolation within the neighborhood is used, and the interpolated samples are labeled with reduced weights within the interval to ensure the controllability of error statistics. Finally, a comparison sample set is obtained, where each sample is associated with a node, a time interval, and a set of prediction-observation pairs.

[0100] Based on the aforementioned comparative sample set, the root mean square error is calculated as the baseline error value. To avoid the impact of differences in the magnitude of different nodes on comparability, scale alignment is first performed within the interval, and then the average of the squared residuals is calculated and the square root is taken. The baseline error value is stored by a double key of node and time interval, while retaining the interpolation ratio, coverage ratio, and boundary confidence as a weight reference for subsequent normalization.

[0101] Based on the baseline error values, normalization is performed to obtain the standard error sequence. During normalization, attenuation coefficients are applied to intervals with high interpolation ratios and low coverage ratios to reduce their contribution to the overall error; the confidence weight is increased for intervals with higher boundary confidence to emphasize the error performance during structural periods. The standard error sequence is kept consistent with the time interval table on the time axis for easy aggregation during the statistical analysis phase.

[0102] Based on the standard error sequence, statistical analysis is performed to generate an error distribution map. The statistical dimensions include central tendency at the node level, periodic deviation over time, and error escalation patterns during specific periods. The map is also layered for different scenario labels. The error distribution map uses intervals as the basic unit and includes a comparison view of the aforementioned attention summary to help identify the correspondence between model attention and error peaks.

[0103] Based on the aforementioned error distribution map, a multi-dimensional evaluation index is constructed to form a performance metric table. The indexes cover four categories: interval-level root mean square error, median absolute deviation, error concentration at boundaries, and periodic consistency measurement, describing performance from three aspects: robustness, boundary sensitivity, and time series consistency. Each index calculation uses a standard error sequence and interval weights to ensure comparability between different nodes and different time periods.

[0104] Finally, the performance metrics table is compared and filtered against preset thresholds to obtain an error index table. A hysteresis strategy and minimum sample coverage constraint are used during the filtering process to avoid frequent anomaly labeling due to short-term fluctuations. The error index table records the node number, time interval, values ​​of each index, and weight descriptions, and retains a reference key to the original comparison sample set. This error index table will be read in step S103 to trigger online updates and generate a weight adjustment scheme, forming a closed loop from interval construction to error measurement to model adaptation.

[0105] In one embodiment of the park pedestrian flow prediction method based on spatiotemporal data analysis in this application, it may further include the following: Step S701: Perform index decomposition operation on the error index table to obtain the error contribution matrix, generate a weight update sequence by sorting the error contribution matrix by importance, construct an elastic learning rate regulator based on the weight update sequence to obtain a learning rate mapping table, match the learning rate mapping table with the model parameter distribution to generate a parameter sensitivity map, perform hierarchical analysis on the parameter sensitivity map to obtain a weight adjustment scheme, and generate an update instruction set by sorting the weight adjustment scheme by priority. Step S702: Based on the update instruction set, fine-tune the parameters of the spatiotemporal graph neural network model to obtain an iterative parameter set. Generate an optimized weight matrix by processing the iterative parameter set through gradient constraints. Perform model verification on the optimized weight matrix to obtain performance evaluation results. Based on the performance evaluation results, construct a parameter deployment strategy to generate a deployment configuration table. Write the deployment configuration table into the prediction engine to complete the model iteration.

[0106] First, the error index table output in step S602 is read and grouped by node number and time interval. Index decomposition is then performed to obtain the error contribution matrix. During decomposition, the interval-level root mean square error, median absolute deviation, boundary concentration, and periodic consistency measure are mapped to four channels: spatial aggregation, temporal convolution, attention weight, and decoding residual, respectively. The loss-sensitive records of each channel during training are proportionally allocated. A one-to-one correspondence is established between the error contribution matrix and model components, serving as the basis for subsequent ranking and learning rate configuration.

[0107] Based on the error contribution matrix, importance is ranked to generate a weight update sequence. The ranking rule prioritizes entries with high contributions and wide coverage, followed by consideration of the data completeness and visibility weights of the entry, to prevent inflated contributions due to missing data from entering the top ranks. The weight update sequence is expressed as a triple of "component identifier - channel index - time range," clearly defining the target area and scope of influence for subsequent fine-tuning.

[0108] Based on the weight update sequence, an elastic learning rate regulator is constructed, outputting a learning rate mapping table. The regulator reads the historical update stability, gradient pruning ratio, and early stopping trigger count for each triple, generating a segmented learning rate strategy. When historical instability and a high pruning ratio occur, the learning rate is automatically lowered and the observation steps are extended; when stability is achieved and improvement continues, the learning rate is moderately increased to shorten the convergence time. The learning rate mapping table is aligned with the model's layer index for easy layer-by-layer access.

[0109] Based on the learning rate mapping table, a parameter sensitivity map is generated by combining the model parameter distribution. The sensitivity map records the gradient variance, the error elasticity of the nearest window, and the correlation with attention drift for each parameter block, forming a heat map. To suppress over-updates, parameter blocks with high heat but insufficient source sample coverage are marked as frozen, retaining only fine-tuning clamps. The parameter sensitivity map is cross-referenced with the aforementioned weight update sequence to produce an executable weight adjustment scheme.

[0110] Based on the weight adjustment scheme, a hierarchical analysis is performed and an update instruction set is output. The analysis proceeds in the order of "spatial convolutional layer - temporal convolutional layer - attention unit - decoding layer," allocating learning rate, freeze switch, and regularization strength layer by layer, while specifying the upper limit of training steps and early stopping conditions for each layer. The update instruction set is executed with time intervals as the execution rhythm to ensure that the fine-tuning period is consistent with the error source period, reducing distribution drift.

[0111] First, based on the aforementioned update instruction set, the spatiotemporal graph neural network model is fine-tuned to obtain an iterative parameter set. The fine-tuning data is sampled from multiple time windows adjacent to the error sources, while keeping the nodes and topology unchanged. During training, mixed precision is enabled to control memory usage, and the gradient norm and the proportion of effective samples are recorded at the end of each mini-batch as real-time monitoring signals to trigger early stopping and cooling strategies in the instruction set.

[0112] Based on the iterative parameter set, gradient constraint processing is performed to generate an optimized weight matrix. The constraints include three terms: parameter magnitude clamping, adjacent layer differential smoothing, and attention distribution entropy regularization, to limit the deviation of a single update from the structural behavior of the model. After constraints, an aligned inference is performed on the same validation set to verify the consistency between the time index and the node index, and comparative data of interval-level loss and boundary error are collected.

[0113] Based on the optimized weight matrix, model validation is performed, and performance evaluation results are generated. The evaluation uses windows as units to statistically analyze the improvement magnitude, degradation rate, and proportion of insignificant intervals. Key time periods and key nodes are reported separately to ensure that updates are targeted at business-critical segments. If the degradation rate exceeds the tolerance range, a rollback to the pre-update snapshot is performed according to the instruction set records, and the corresponding parameter block is added to the freeze list.

[0114] Based on the performance evaluation results, a parameter deployment strategy is constructed, and a deployment configuration table is output. The deployment strategy specifies the online region, grayscale ratio, rollback threshold conditions, and observation period, and specifies the sampling frequency of attention weights and channel proportions for bypass records to continuously monitor weight drift after deployment. The deployment configuration table is aligned with the model registration key of the inference service, including version number, hash verification, and loading order to ensure synchronous loading across distributed nodes.

[0115] Finally, the deployment configuration table is written into the prediction engine to complete model iteration. After writing, dual-channel observation is maintained within a limited time. The old version serves as a shadow path for synchronous inference and interval loss is compared. If the stability conditions of the deployment strategy are met, the new version is promoted to the main path; if the rollback threshold condition is triggered, the old version is automatically switched back and the trigger interval and abnormal indicators are recorded to provide a basis for the next round of weight adjustment.

[0116] To effectively address the shortcomings of traditional technologies in feature extraction, spatiotemporal analysis, and model optimization, and to provide technical support for park pedestrian flow prediction, this application provides an embodiment of a spatiotemporal data analysis-based park pedestrian flow prediction device for implementing all or part of the aforementioned spatiotemporal data analysis-based park pedestrian flow prediction method. See [link to embodiment]. Figure 2 The park pedestrian flow prediction device based on spatiotemporal data analysis specifically includes the following components: The video acquisition module 10 is used to acquire video data streams based on park surveillance cameras, decode the video data streams to generate raw frame sequences, calculate the population density of the raw frame sequences to generate a density feature map, construct a regional topology map based on the density feature map and the park electronic map to obtain graph structure data, perform node encoding on the graph structure data to generate an initial feature vector, perform time-series alignment of the initial feature vector with weather data and calendar information to obtain a multi-source feature group, and perform data standardization processing on the multi-source feature group to generate a standard feature matrix. The pedestrian flow prediction module 20 is used to construct a spatiotemporal graph neural network model based on the standard feature matrix, perform parameter optimization on the spatiotemporal graph neural network model to obtain pre-trained model parameters, generate temporal feature vectors by processing the pre-trained model parameters through graph convolution and temporal convolution, construct an attention weight matrix based on the temporal feature vectors to obtain a fusion feature group, and perform multi-step decoding calculation on the fusion feature group to generate a prediction result sequence. The model iteration module 30 is used to divide the prediction result sequence into prediction interval groups according to a preset time window, calculate the prediction error for the prediction interval groups to generate an error index table, construct an online update strategy based on the error index table to obtain a weight adjustment scheme, and apply the weight adjustment scheme to the spatiotemporal graph neural network model to complete the model iteration.

[0117] As described above, the park pedestrian flow prediction device based on spatiotemporal data analysis provided in this application can achieve accurate feature extraction through density calculation and graph structure encoding. A prediction mechanism is constructed, combining graph neural networks and attention mechanisms to establish a reliable prediction strategy. Model optimization is introduced, and continuous improvement of predictions is ensured through error analysis and weight adjustment. This method effectively solves the shortcomings of traditional technologies in feature extraction, spatiotemporal analysis, and model optimization, providing technical support for park pedestrian flow prediction.

[0118] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the park pedestrian flow prediction method based on spatiotemporal data analysis.

[0119] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for predicting pedestrian flow in a park based on spatiotemporal data analysis.

[0120] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-mentioned method for predicting park pedestrian flow based on spatiotemporal data analysis.

[0121] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0122] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0123] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0124] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0125] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for predicting pedestrian flow in a park based on spatiotemporal data analysis, characterized in that, The method includes: Based on video data streams collected by park surveillance cameras, the video data streams are decoded to generate raw frame sequences. The raw frame sequences are then used to calculate pedestrian density to generate density feature maps. Based on the density feature maps and the park's electronic map, a regional topology map is constructed to obtain graph structure data. Node encoding is performed on the graph structure data to generate initial feature vectors. The initial feature vectors are then time-series aligned with weather data and calendar information to obtain multi-source feature groups. Data standardization processing is performed on the multi-source feature groups to generate standard feature matrices. A spatiotemporal graph neural network model is constructed based on the standard feature matrix. Parameter optimization is performed on the spatiotemporal graph neural network model to obtain pre-trained model parameters. The pre-trained model parameters are processed by graph convolution and temporal convolution to generate temporal feature vectors. An attention weight matrix is ​​constructed based on the temporal feature vectors to obtain a fusion feature group. Multi-step decoding calculation is performed on the fusion feature group to generate a prediction result sequence. The prediction result sequence is divided into prediction interval groups according to a preset time window. The prediction error is calculated for the prediction interval group to generate an error index table. An online update strategy is constructed based on the error index table to obtain a weight adjustment scheme. The weight adjustment scheme is applied to the spatiotemporal graph neural network model to complete the model iteration.

2. The method for predicting pedestrian flow in a park based on spatiotemporal data analysis according to claim 1, characterized in that, The process involves collecting video data streams from park surveillance cameras, decoding the video data streams to generate raw frame sequences, calculating pedestrian density in the raw frame sequences to generate density feature maps, and constructing regional topology maps based on the density feature maps and the park's electronic map to obtain graph structure data, including: Real-time video streams are acquired based on the acquisition parameter matrix set by the park's surveillance cameras. Frame rate conversion is performed on the real-time video streams to generate original video sequences. The original video sequences are mapped by a decoder to obtain image data streams. Brightness normalization and Gaussian filtering are performed on the image data streams to generate enhanced frame sequences. Based on background modeling, foreground targets are separated from the enhanced frame sequences to obtain target detection boxes. The target detection boxes are then processed morphologically to generate density distribution maps. Based on the density distribution map, a regional division grid is constructed to obtain a set of regional feature points. The set of regional feature points is then mapped to the park's electronic map to generate a location mapping table. Spatial connectivity analysis is performed on the location mapping table to obtain a regional adjacency matrix. Based on the regional adjacency matrix, a topological connectivity graph is constructed to obtain graph structure data.

3. The method for predicting pedestrian flow in a park based on spatiotemporal data analysis according to claim 1, characterized in that, The process of performing node encoding on the graph structure data to generate an initial feature vector, aligning the initial feature vector with weather data and calendar information in a time sequence to obtain a multi-source feature group, and performing data standardization processing on the multi-source feature group to generate a standard feature matrix includes: The node attribute table is obtained by extracting the node attributes in the graph structure data. The node attribute table is processed by the position embedding encoder to generate a spatial encoding vector. A node representation learner is constructed based on the spatial encoding vector to obtain the node hidden layer features. Graph attention is performed on the node hidden layer features to generate a node weight matrix. The node weight matrix is ​​fused with the graph structure topology information to obtain an initial feature vector. The initial feature vector is timestamped to generate a time-series feature sequence. The time-series feature sequence is segmented into feature fragment groups through a time window. Weather data completion is performed on the feature fragment groups to generate a weather feature matrix. The weather feature matrix is ​​aligned with calendar information to obtain a multi-source feature group. Statistical indicators are calculated based on the multi-source feature group to obtain a normalized parameter set. The normalized parameter set is applied to feature transformation to generate a standard feature matrix.

4. The method for predicting pedestrian flow in a park based on spatiotemporal data analysis according to claim 1, characterized in that, The process of constructing a spatiotemporal graph neural network model based on the standard feature matrix, and optimizing the parameters of the spatiotemporal graph neural network model to obtain pre-trained model parameters, includes: The basic network architecture is obtained by constructing a multi-layer graph convolutional structure based on the standard feature matrix. The basic network architecture is then extended to generate a temporal processing layer through a gated recurrent unit. An attention mechanism is applied to the temporal processing layer to obtain an attention encoder. A spatiotemporal feature extractor is constructed based on the attention encoder to generate a feature extraction module. The feature extraction module is combined with a decoding prediction layer to obtain a spatiotemporal graph neural network model. An initial parameter set is generated by inputting a validation dataset into the spatiotemporal graph neural network model. The initial parameter set is updated to obtain the iterative parameter table through the backpropagation algorithm. Gradient pruning is performed on the iterative parameter table to generate an optimized parameter set. The model loss value is calculated based on the optimized parameter set to obtain a convergence index. The convergence index is compared with a preset threshold to filter and obtain the pre-trained model parameters.

5. The method for predicting pedestrian flow in a park based on spatiotemporal data analysis according to claim 1, characterized in that, The process of generating temporal feature vectors by processing the pre-trained model parameters through graph convolution and temporal convolution, constructing an attention weight matrix based on the temporal feature vectors to obtain a fused feature group, and performing multi-step decoding calculations on the fused feature group to generate a prediction result sequence includes: The pre-trained model parameters are input into the graph convolutional layer to obtain spatial aggregation features. Neighborhood information transfer is performed on the spatial aggregation features to generate node embedding vectors. A causal convolutional network is constructed based on the node embedding vectors to obtain a temporal coding sequence. The temporal coding sequence is processed through residual connections to generate an enhanced feature group. A gating mechanism is performed on the enhanced feature group to filter and obtain a temporal feature vector. The temporal feature vector is decomposed into a multi-scale feature set according to a preset rule. Based on the multi-scale feature set, the feature correlation is calculated to obtain a weight coefficient table. The weight coefficient table is then scaled to generate an attention distribution matrix. A weighted aggregation operation is performed on the attention distribution matrix to obtain a fused feature group. An autoregressive predictor is constructed based on the fused feature group to generate a prediction state sequence. The prediction state sequence is then processed through an output mapping layer to obtain a prediction result sequence.

6. The method for predicting pedestrian flow in a park based on spatiotemporal data analysis according to claim 1, characterized in that, The step of dividing the predicted result sequence into prediction interval groups according to a preset time window, and calculating the prediction error for the prediction interval groups to generate an error index table includes: The predicted result sequence is segmented based on timestamp information to obtain a time series fragment set. Overlapping window partitioning is performed on the time series fragment set to generate predicted data blocks. An interval boundary detector is constructed based on the predicted data blocks to obtain a segmentation point sequence. The segmentation point sequence is processed by boundary alignment to generate a time interval table. Data recombination is performed on the time interval table to obtain a predicted interval group. The predicted interval group is matched with the real observation data to generate a comparison sample set. The root mean square error is calculated based on the comparison sample set to obtain the basic error value. The basic error value is normalized to generate a standard error sequence. Statistical analysis is performed on the standard error sequence to obtain an error distribution map. Based on the error distribution map, a multidimensional evaluation index is constructed to generate a performance metric table. The performance metric table is filtered by a threshold to obtain an error index table.

7. The method for predicting pedestrian flow in a park based on spatiotemporal data analysis according to claim 1, characterized in that, The step of constructing an online update strategy based on the error index table to obtain a weight adjustment scheme, and applying the weight adjustment scheme to the spatiotemporal graph neural network model to complete model iteration, includes: An error contribution matrix is ​​obtained by performing index decomposition on the error index table. The error contribution matrix is ​​then sorted by importance to generate a weight update sequence. An elastic learning rate regulator is constructed based on the weight update sequence to obtain a learning rate mapping table. The learning rate mapping table is matched with the model parameter distribution to generate a parameter sensitivity map. The parameter sensitivity map is then subjected to hierarchical analysis to obtain a weight adjustment scheme. The weight adjustment schemes are sorted by priority to generate an update instruction set. Based on the update instruction set, the spatiotemporal graph neural network model is fine-tuned to obtain an iterative parameter set. The iterative parameter set is then processed through gradient constraints to generate an optimized weight matrix. Model verification is performed on the optimized weight matrix to obtain performance evaluation results. Based on the performance evaluation results, a parameter deployment strategy is constructed to generate a deployment configuration table. The deployment configuration table is then written into the prediction engine to complete the model iteration.

8. A park pedestrian flow prediction device based on spatiotemporal data analysis, characterized in that, The device includes: The video acquisition module is used to acquire video data streams based on park surveillance cameras, decode the video data streams to generate raw frame sequences, calculate the population density of the raw frame sequences to generate a density feature map, construct a regional topology map based on the density feature map and the park electronic map to obtain graph structure data, perform node encoding on the graph structure data to generate an initial feature vector, perform time-series alignment of the initial feature vector with weather data and calendar information to obtain a multi-source feature group, and perform data standardization processing on the multi-source feature group to generate a standard feature matrix. The crowd flow prediction module is used to construct a spatiotemporal graph neural network model based on the standard feature matrix, perform parameter optimization on the spatiotemporal graph neural network model to obtain pre-trained model parameters, generate temporal feature vectors by processing the pre-trained model parameters through graph convolution and temporal convolution, construct an attention weight matrix based on the temporal feature vectors to obtain a fusion feature group, and perform multi-step decoding calculation on the fusion feature group to generate a prediction result sequence. The model iteration module is used to divide the prediction result sequence into prediction interval groups according to a preset time window, calculate the prediction error for the prediction interval groups to generate an error index table, construct an online update strategy based on the error index table to obtain a weight adjustment scheme, and apply the weight adjustment scheme to the spatiotemporal graph neural network model to complete the model iteration.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the park pedestrian flow prediction method based on spatiotemporal data analysis as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the park pedestrian flow prediction method based on spatiotemporal data analysis as described in any one of claims 1 to 7.