Travel scene traffic flow time sequence prediction method and device, equipment, storage medium and program product

By combining KAN networks and SICM modules with graph convolutional networks, the problem of traffic flow prediction accuracy in cultural and tourism scenarios was solved, enabling the capture of spatiotemporal characteristics of tourist flow and improving traffic management efficiency.

CN121010036AActive Publication Date: 2025-11-25湖南工商大学
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511017449.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2025-03-07
Filing Date
2025-07-23
Publication Date
2025-11-25
Estimated Expiration
2045-07-23

AI Technical Summary

Technical Problem

Existing traffic flow prediction technologies are ill-suited to the dynamic and high-concurrency traffic management needs of cultural and tourism scenarios. They fail to accurately capture the complex characteristics of tourist flow, resulting in inaccurate traffic predictions and impacting the efficiency of visitor flow management and surrounding traffic management in cultural and tourism scenic areas.

Method used

The KAN network module is used for feature extraction, and the SICM module is combined to capture local features and long-distance dependency features through convolutional attention and multi-head attention mechanisms. A graph structure is constructed and spatial feature analysis is performed through a graph convolutional network to generate target attention scores, and finally traffic flow time series prediction is performed.

Benefits of technology

It accurately captures the local peak characteristics and global trend characteristics in cultural and tourism transportation, improves the accuracy of traffic flow prediction in cultural and tourism scenarios, and enhances the efficiency of passenger flow management and surrounding traffic management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121010036A_ABST
    Figure CN121010036A_ABST
Patent Text Reader

Abstract

The invention discloses a travel scene traffic flow time sequence prediction method, device and equipment, a storage medium and a program product, and the method comprises the steps: carrying out the preprocessing of original traffic flow time sequence data, and generating a preparation time sequence, extracting an input sequence feature and a basic sequence feature from the preprocessed original traffic flow time sequence data, extracting a traffic flow time feature, performing spatial feature analysis based on a graph structure constructed based on a preparation time sequence and the preparation time sequence, and splicing and fusing the traffic flow time feature and the spatial feature to obtain a fused traffic flow time sequence; a traffic flow time sequence prediction result of the travel scene is generated based on the spatial-temporal feature fusion result and the basic sequence features, local features and global features in the time sequence are accurately captured, the spatial-temporal features of tourist flow in the travel scene are accurately captured, the accuracy of traffic flow prediction of the travel scene is greatly improved, and the traffic flow prediction efficiency is improved. And the traffic management efficiency of the travel scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cultural and tourism traffic flow prediction, and in particular to a method, apparatus, equipment, storage medium, and program product for predicting time series traffic flow in cultural and tourism scenarios. Background Technology

[0002] Against the backdrop of the coordinated development of urban traffic management and the cultural tourism industry, traffic flow prediction technology is becoming a key link connecting urban infrastructure and cultural tourism resource management. With the booming development of the urban cultural tourism industry, traffic flow around scenic spots exhibits spatiotemporal characteristics that are drastically different from regular urban traffic, primarily manifested in significant differences in traffic patterns between weekdays and holidays. The high correlation between scenic spot opening hours and peak congestion times on surrounding roads, along with phenomena such as a surge in local road network load during large-scale cultural tourism events, all pose new challenges to traditional traffic prediction methods. While current traffic flow prediction technologies have achieved some success in urban road networks, they struggle to adapt to the unique "tidal" traffic changes characteristic of cultural tourism scenarios and the sudden congestion on roads surrounding scenic spots. Therefore, there is an urgent need to develop a new prediction system capable of simultaneously modeling both regular traffic and cultural tourism characteristics.

[0003] At the technical implementation level, existing methods have the following limitations: First, the optimization algorithms are insufficiently adapted to the non-stationarity of cultural and tourism scenarios. When faced with instantaneous congestion caused by a concentrated influx of tourists around scenic spots, the model parameters are difficult to adjust in a timely manner. Second, the graph structure generation method is rigid and cannot dynamically reconstruct road network connections based on real-time cultural and tourism activities, such as the new traffic connections formed between temporary parking lots and main roads during music festivals. These shortcomings make it difficult for existing technologies to provide accurate decision support for cultural and tourism traffic management. They cannot provide early warning of potential traffic paralysis risks around scenic spots, nor can they provide data support for traffic control schemes during cultural and tourism activities. Summary of the Invention

[0004] The main objective of this invention is to provide a method, apparatus, device, storage medium, and program product for predicting traffic flow time series in cultural and tourism scenarios. This invention aims to solve the technical problems of existing traffic flow time series prediction technologies, which are unable to meet the dynamic and high-concurrency traffic management needs in cultural and tourism scenarios, and cannot accurately capture the complex characteristics of tourist flow in cultural and tourism scenarios, resulting in inaccurate traffic prediction and seriously affecting the efficiency of tourist flow management and surrounding traffic management in cultural and tourism scenic spots.

[0005] To achieve the above objectives, this invention provides a method for predicting traffic flow in cultural and tourism scenarios based on time series data. The method, applied to traffic flow prediction in cultural and tourism scenarios, includes the following steps:

[0006] The system acquires raw traffic flow time series data from cultural and tourism scenarios, preprocesses the raw traffic flow time series data, and generates a preparation time series based on the preprocessed raw traffic flow time series data. The raw traffic flow time series data is collected by multiple cultural and tourism scenario sensors deployed in the cultural and tourism scenarios.

[0007] Extract time indices from the preprocessed raw traffic flow time series data and encode the time indices to generate mark variables;

[0008] The mark variable is input into the KAN network module for feature extraction to obtain candidate feature information, and the candidate feature information is segmented to obtain input sequence features and basic sequence features.

[0009] The SICM module performs feature analysis on the features of the preparation time series and the input sequence to obtain traffic flow time features. The traffic flow time features include local features and long-distance dependency features of traffic flow. The SICM module is configured to capture local features and long-distance dependency features of traffic flow through convolutional attention mechanism and multi-head attention mechanism, respectively.

[0010] A graph structure is constructed based on the preparation time series, and the graph structure and the preparation time series are input into the graph convolutional network module for spatial feature analysis to obtain spatial features. The graph structure includes the spatial relationship between sensors in various cultural and tourism scenes. The graph convolutional network module performs weight optimization in advance based on the snow melting optimization algorithm.

[0011] The traffic flow temporal features and spatial features are spliced ​​and fused to generate a target attention score;

[0012] The target attention score is multiplied by the base sequence features to generate a time series prediction result of traffic flow in the cultural and tourism scenario.

[0013] Optionally, the SICM module includes a convolutional attention analysis module, a multi-head attention analysis module, and a feedforward network module; the step of performing feature analysis on the features of the preparation time series and the input sequence through the SICM module to obtain traffic flow time features includes:

[0014] The input sequence features and the preparation time series are linearly projected by the convolutional attention analysis module to obtain the query projection matrix, key projection matrix and value projection matrix;

[0015] The initial attention scores for the query projection matrix and the key projection matrix are calculated using the convolutional attention analysis module.

[0016]

[0017] Where attention_scores represents the initial attention score, Q1 represents the query projection matrix, which is used to focus on the long-distance dependency features of traffic flow in cultural and tourism scenarios, K1 represents the key projection matrix, T represents the matrix transpose, D represents the feature dimension, and the key projection matrix and the value projection matrix are used to encode real-time dynamic features.

[0018] The initial attention score is processed by the convolutional attention analysis module to obtain candidate traffic flow features;

[0019] The candidate traffic flow features are processed by the feedforward network module and the multi-head attention analysis module to obtain the traffic flow time features.

[0020] Optionally, the candidate traffic flow features include the initial global features of the input sequence features and the initial local features of the preparation time series; the step of processing the initial attention score through the convolutional attention analysis module to obtain the candidate traffic flow features includes:

[0021] The initial attention score is normalized using the convolutional attention analysis module to obtain the attention weights.

[0022] attention_weights=softmax(attention_scores)

[0023] Where attention_weight represents attention weight, softmax represents the softmax function, and attention_scores represents the initial attention scores;

[0024] The value projection matrix is ​​weighted and summed based on the attention weights to obtain a context vector, which includes a first context vector corresponding to the input sequence features and a second context vector corresponding to the preparation time series.

[0025] context=attention_weights·V1

[0026] Where context represents the context vector and V1 represents the value projection matrix;

[0027] The context vector is subjected to residual connection and layer normalization to obtain the initial global features of the input sequence features and the initial local features of the prepared time series:

[0028] Out basis=LayerNorm(basis+Dropout(Basis_context))

[0029] Out series =LayerNorm(serirs+Dropout(Series_context))

[0030] Among them, Out basis Out represents the initial global features of the input sequence. series This represents the initial local features for preparing the time series, where `basis` represents the input sequence features, `series` represents the prepared time series, `LayerNorm` represents the layer normalization function, `basis+Dropout(Context)` represents the residual connection between the input sequence features and the context vector, `series+Dropout(Context)` represents the residual connection between the prepared time series and the context vector, `Basis_context` represents the first context vector, and `Series_cpntext` represents the second context vector.

[0031] Optionally, the step of processing the candidate traffic flow features through the feedforward network module and the multi-head attention analysis module to obtain traffic flow temporal features includes:

[0032] The feedforward network module performs a nonlinear transformation on the candidate traffic flow features to obtain candidate global features of the input sequence features and candidate local features of the preparation time series.

[0033] Out′ basis =Out basis +Dropout(Linear(Dropout(ReLU(Linear(Out basis )))))Out′ series

[0034] =Out series +Dropout(Linear(Dropout(ReLU(Linear(Out series )))))

[0035] Among them, Out′ basis Represents candidate global features, Out′ series represents candidate local features, Linear represents linear transformation, ReLU represents non-linear transformation through activation function, and Dropout represents regularization;

[0036] The multi-head attention analysis module performs a linear transformation on the candidate global features and the candidate local features to obtain the target query vector and the target key vector.

[0037] Q2 = Linear query (Out series )

[0038] K2 = Linear key (Out basis )

[0039] Where Q2 represents the target query vector, K2 represents the target key vector, and Linear... query Linear transformation function representing the query vector. key A linear transformation function representing the key vector;

[0040] Determine the target multi-head attention weights based on the target query vector and the target key vector:

[0041]

[0042] Among them, score time This represents the target multi-head attention weights, and scale represents the dimension scaling factor.

[0043] The candidate global features and the candidate local features are weighted according to the target multi-head attention weight to obtain traffic flow time features.

[0044] Optionally, the step of constructing a graph structure based on the prepared time series includes:

[0045] The preparation time series is centralized to eliminate baseline differences among sensor nodes in various cultural and tourism scenarios:

[0046]

[0047] Where Z represents the preparation time series. μ represents the preparation time series after centralization. t This represents the mean over the time dimension. The dimension representing the preparation time series is: B represents the batch size, L represents the sequence length, and C represents the number of sensors in the cultural and tourism scene.

[0048] Construct a covariance matrix based on the preparation time series after central processing;

[0049] The covariance matrix is ​​normalized to obtain the correlation coefficient matrix;

[0050] An initial adjacency matrix is ​​generated based on the correlation coefficient matrix;

[0051] Add an identity matrix to the initial adjacency matrix, perform logical judgments on each element of the initial adjacency matrix after adding the identity matrix, generate a Boolean matrix based on the judgment results, and perform numerical matrix transformation on the Boolean matrix to obtain the target adjacency matrix;

[0052]

[0053] in, Let A represent the target adjacency matrix, I represent the initial adjacency matrix, Π represent the identity matrix, and Π represent the indicator function.

[0054] A graph structure is constructed based on the target adjacency matrix.

[0055] Optionally, the step of preprocessing the original traffic flow time series data and generating a preparation time series based on the preprocessed original traffic flow time series data includes:

[0056] Add a mask matrix to the original traffic flow time series data to obtain the initial traffic flow time series data:

[0057] X masked =X⊙M

[0058] Where X represents the original traffic flow time series data, M represents the mask matrix, and ⊙ represents element-wise multiplication. masked This represents the initial traffic flow time series data;

[0059] Calculate the mean and standard deviation of the initial traffic flow time series data:

[0060]

[0061] Where L represents the sequence length, x i This represents the i-th element in the initial traffic flow time series data, where mean x std represents the average value. x Indicates standard deviation;

[0062] The initial traffic flow time series data is standardized based on the mean and standard deviation to generate a prepared time series.

[0063]

[0064] Where ∈ represents a constant, and Z represents the preparation time series.

[0065] Furthermore, to achieve the above objectives, the present invention also proposes a time series prediction device for traffic flow in cultural and tourism scenarios. This device is applied to traffic flow prediction in cultural and tourism scenarios and includes:

[0066] The data processing module is used to acquire the original traffic flow time series data of the cultural and tourism scene, preprocess the original traffic flow time series data, and generate a preparation time series based on the preprocessed original traffic flow time series data. The original traffic flow time series data is collected by multiple cultural and tourism scene sensors deployed in the cultural and tourism scene.

[0067] The variable generation module is used to extract time indices from the preprocessed raw traffic flow time series data and encode the time indices to generate mark variables;

[0068] The feature extraction module is used to input the mark variable into the KAN network module for feature extraction, obtain candidate feature information, and perform feature segmentation on the candidate feature information to obtain input sequence features and basic sequence features;

[0069] The time feature analysis module is used to perform feature analysis on the features of the prepared time series and the input sequence through the SICM module to obtain traffic flow time features. The traffic flow time features include local features and long-distance dependency features of traffic flow. The SICM module is configured to capture local features and long-distance dependency features of traffic flow through convolutional attention mechanism and multi-head attention mechanism, respectively.

[0070] The spatial feature analysis module is used to construct a graph structure based on the preparation time series, and input the graph structure and the preparation time series into the graph convolutional network module for spatial feature analysis to obtain spatial features. The graph structure includes the spatial relationship between various cultural and tourism scene sensors. The graph convolutional network module pre-optimizes the weights based on the snow melting optimization algorithm.

[0071] The feature fusion module is used to splice and fuse the traffic flow temporal features and the spatial features to generate a target attention score;

[0072] The traffic flow prediction module is used to perform matrix multiplication of the target attention score and the basic sequence features to generate a time series prediction result of traffic flow in the cultural and tourism scenario.

[0073] In addition, to achieve the above objectives, this application also proposes a time series prediction device for traffic flow in cultural and tourism scenarios. The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. The computer program is configured to implement the steps of the time series prediction method for traffic flow in cultural and tourism scenarios as described above.

[0074] In addition, to achieve the above objectives, this application also proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the time series prediction method for traffic flow in cultural and tourism scenarios as described above.

[0075] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the time series prediction method for traffic flow in cultural and tourism scenarios as described above.

[0076] This invention is applied to traffic flow prediction in cultural and tourism scenarios. It acquires raw traffic flow time-series data from these scenarios and preprocesses it. A preparation time series is generated based on the preprocessed data. The raw traffic flow time-series data is collected by multiple sensors deployed in the cultural and tourism scenarios. A time index is extracted from the preprocessed data and encoded to generate a mark variable. This mark variable is input into a KAN network module for feature extraction to obtain candidate feature information. The candidate feature information is then segmented to obtain input sequence features and basic sequence features. A SICM module performs feature analysis on the preparation time series and the input sequence features to obtain traffic flow time features. These traffic flow time features include local features and long-range dependency features. The SICM module is configured to capture local and long-range dependency features using convolutional attention and multi-head attention mechanisms, respectively. A graph structure is constructed based on the preparation time series. The graph structure and the preparation time series are input into the graph convolutional network module for spatial feature analysis to obtain spatial features. The graph structure includes the spatial relationships between sensors in various cultural and tourism scenarios. The graph convolutional network module pre-optimizes the weights based on the snowmelt optimization algorithm. The traffic flow time features and the spatial features are spliced ​​and fused to generate a target attention score. The target attention score is then matrix-multiplied with the basic sequence features to generate the traffic flow time series prediction result for the cultural and tourism scenario. Because the SICM module of this invention performs feature analysis on the preparation time series and input sequence features, it accurately captures the local peak features and global trend features in cultural and tourism traffic. By performing spatial feature analysis on the graph structure and the preparation time series through the graph convolutional network module, the propagation and impact of traffic flow in space can be analyzed. By splicing and fusing the time features and spatial features, the spatiotemporal features of tourist flow in cultural and tourism scenarios can be accurately captured, meeting the dynamic and high-concurrency traffic management needs of cultural and tourism scenarios, significantly improving the accuracy of traffic flow prediction in cultural and tourism scenarios, and effectively improving the efficiency of tourist flow management and surrounding traffic management in cultural and tourism scenic spots. Attached Figure Description

[0077] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0078] 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, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0079] Figure 1 This is a schematic diagram of the structure of a time series prediction device for traffic flow in a cultural and tourism scenario, which is part of the hardware operating environment involved in the embodiments of the present invention.

[0080] Figure 2 This is a flowchart illustrating the first embodiment of the traffic flow time series prediction method for cultural and tourism scenarios of the present invention.

[0081] Figure 3 This is a schematic diagram of the SICM module in one embodiment of the traffic flow time series prediction method for cultural and tourism scenarios of the present invention;

[0082] Figure 4 This is a flowchart illustrating the second embodiment of the traffic flow time series prediction method for cultural and tourism scenarios of the present invention.

[0083] Figure 5 This is a structural block diagram of the first embodiment of the traffic flow time series prediction device for cultural and tourism scenarios of the present invention.

[0084] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0085] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0086] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a time series prediction device for traffic flow in a cultural and tourism scenario, which is part of the hardware operating environment involved in the embodiments of the present invention.

[0087] like Figure 1As shown, the traffic flow time series prediction device for cultural and tourism scenarios may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk storage device. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.

[0088] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the time series prediction device for traffic flow in cultural and tourism scenarios. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0089] like Figure 1 As shown, the memory 1005, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a time series prediction program for traffic flow in cultural and tourism scenarios.

[0090] exist Figure 1 In the time series prediction device for traffic flow in cultural and tourism scenarios shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the time series prediction device for traffic flow in cultural and tourism scenarios of the present invention can be set in the time series prediction device for traffic flow in cultural and tourism scenarios. The time series prediction device for traffic flow in cultural and tourism scenarios calls the time series prediction program for traffic flow in cultural and tourism scenarios stored in the memory 1005 through the processor 1001 and executes the time series prediction method for traffic flow in cultural and tourism scenarios provided in the embodiments of the present invention.

[0091] This invention provides a method for predicting traffic flow time series in cultural and tourism scenarios, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the traffic flow time series prediction method for cultural and tourism scenarios of the present invention.

[0092] In this embodiment, the method for predicting traffic flow time series in cultural and tourism scenarios includes the following steps:

[0093] Step S10: Obtain the original traffic flow time series data of the cultural and tourism scene, preprocess the original traffic flow time series data, and generate a preparation time series based on the preprocessed original traffic flow time series data.

[0094] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or a terminal electronic device capable of performing the above functions. The following description uses a traffic flow time series prediction device for cultural and tourism scenarios (hereinafter referred to as the prediction device) as an example to illustrate this embodiment and the following embodiments.

[0095] It should be noted that the original traffic flow time series data was collected through multiple sensors deployed in the cultural and tourism scenarios. Traffic flow data is typically collected by sensor nodes distributed in various locations. These nodes can be deployed around cultural and tourism hotspots (such as scenic area entrances and cultural venue hubs) to simultaneously monitor the mixed traffic flow patterns of tourist commuters and local residents. Their coordinated changes can reflect the disturbance of cultural activities to regional traffic.

[0096] Understandably, prediction devices can standardize data by calculating the mean and standard deviation, and then perform corresponding mappings to obtain the prepared time series. Standardization eliminates the differences in traffic volume dimensions between different cultural and tourism areas (such as urban centers and suburban scenic areas), improving model training efficiency and traffic prediction efficiency.

[0097] Furthermore, to improve analysis efficiency, step S10 above may include:

[0098] Step S101: Add a mask matrix to the original traffic flow time series data to obtain the initial traffic flow time series data;

[0099] Step S102: Calculate the mean and standard deviation of the initial traffic flow time series data:

[0100]

[0101] Where L represents the sequence length, x i This represents the i-th element in the initial traffic flow time series data, where mean x std represents the average value. x Standard deviation is the average distance of a data point from its mean. A larger standard deviation indicates greater volatility in the data.

[0102] Step S103: Standardize the initial traffic flow time series data based on the mean and the standard deviation to generate a prepared time series.

[0103]

[0104] Where Z represents the preparation time series, and ∈ can be a very small constant to avoid division by zero.

[0105] It should be noted that the prediction device can add a 10% mask to the original traffic flow time series data to simulate the sensor data loss that is common in cultural and tourism scenarios (such as partial data loss due to equipment maintenance or signal interference around scenic spots), thereby enhancing the robustness of traffic flow data prediction to incomplete data.

[0106] It should be noted that the masking process begins with a complete traffic flow time series, which consists of observations at multiple time points. Each time point may contain multiple features, such as traffic flow data recorded by different sensors. To simulate common data gaps in tourism scenarios (such as temporary sensor malfunctions or data transmission delays around scenic spots during peak periods), a random masking matrix is ​​assigned to each observation in the time series. Each element is set to 1 (representing retention) with probability P (10% in some embodiments), and the rest are set to 0 (representing masking). Mathematically, this process can be represented as:

[0107] X masked =X⊙M

[0108] Where X represents the original traffic flow time series data, M represents the mask matrix, and ⊙ represents element-wise multiplication. masked This represents the initial traffic flow time series data. The masked positions (M=0) will be forcibly set to zero to simulate scenarios with missing data or noise interference.

[0109] Step S20: Extract the time index from the preprocessed original traffic flow time series data, and encode the time index to generate a mark variable.

[0110] It should be noted that this embodiment extracts the time index from the original traffic flow time series data and performs time encoding to obtain the mark variable. The time index can provide additional temporal context information for the prediction model, helping it to better understand the temporal dependencies of the data. This step, by introducing the time index, helps the model capture the periodic features related to culture and tourism (such as peak tourist flows at scenic spots on weekends and surges in traffic during Golden Week).

[0111] Step S30: Input the mark variable into the KAN network module for feature extraction, obtain candidate feature information, and perform feature segmentation on the candidate feature information to obtain input sequence features and basic sequence features.

[0112] It's important to note that the KAN (Kolmogorov-Arnold Networks) module can be a pre-built feature extraction module. The core characteristic of KAN networks is the use of learnable activation functions at the network edges, rather than the fixed activation functions used on nodes in traditional neural networks. This design allows each weight parameter in the KAN network to be replaced by a univariate function, typically parameterized as a spline function. This provides high flexibility and enables the simulation of complex functions with fewer parameters, enhancing the model's interpretability.

[0113] It should be noted that in this embodiment, the mark variable is extracted using KAN to extract additional latent features, which are then mapped to a higher-dimensional feature representation and normalized to obtain the final feature information. The KAN module uses adaptive grid and spline interpolation techniques to flexibly capture local changes and complex patterns in traffic flow data (such as sudden increases in traffic flow during scenic area opening hours, instantaneous congestion when a nighttime light show ends, etc.). The candidate feature information is divided into features of the input sequence and features of the base sequence, where the input sequence is used for time feature extraction, and the base sequence is used to generate future traffic flow predictions.

[0114] It should be noted that the KAN network module is composed of a multi-layer function matrix, which is composed of activation functions of multiple neurons, and the activation function is composed of basis functions and spline functions;

[0115] The function matrix includes:

[0116]

[0117] Where, Φ l This represents the function matrix of the l-th layer, where l represents the network layer index, and n... l X represents the number of neurons in the l-th layer. l This represents the output vector of the l-th layer. The nth element in the function matrix l+1 row n l Activation function of the column;

[0118] The activation function includes:

[0119] φ(x)=ω b b(x)+ω s spline(x)

[0120]

[0121] spline(x) = ∑ i c i B i (x)

[0122] Where φ(x) represents the activation function, ω b The weight parameters of the basis functions are represented by b(x), which represents the basis functions, including the silu(x) function and the spline(x) function. ω s c represents the weight parameters of the spline function. i and B i Let represent the trainable parameters of the spline function, and x represent the input vector;

[0123] The KAN network module includes:

[0124]

[0125] Wherein, KAN(x) represents a KAN network module;

[0126] The output of the KAN network module includes:

[0127]

[0128] Here, f(x) represents the output of the KAN network module.

[0129] In some embodiments, the prediction device may perform feature analysis based on the timestamps of each data point in the input dataset to obtain the temporal feature information of the input dataset; enhance the temporal feature information using a pre-built feature analysis model to obtain candidate feature information; perform dimensional mapping on the candidate feature information using the feature analysis model to obtain dimensional mapping feature information; normalize the dimensional mapping feature information to obtain target feature information; and divide the target feature information to obtain input sequence features and basic sequence features.

[0130] Step S40: Perform feature analysis on the prepared time series and the input sequence features using the SICM module to obtain traffic flow time features.

[0131] It should be noted that the traffic flow temporal features include local features and long-distance dependency features of traffic flow, and the SICM module is configured to capture local features and long-distance dependency features of traffic flow through convolutional attention mechanism and multi-head attention mechanism, respectively.

[0132] It should be noted that the SICM module is a neural network attention analysis module encapsulated with multiple attention layers. The traffic flow temporal features include local features and long-range dependency features of traffic flow. The SICM module is configured to capture the local features and long-range dependency features of traffic flow through convolutional attention mechanisms and multi-head attention mechanisms, respectively.

[0133] It should be noted that the SICM module captures local features of traffic flow (such as short-term traffic fluctuations during the morning rush hour in scenic areas) and long-distance dependencies (such as the impact of cross-regional tourist flow on traffic during holidays) through convolutional attention and multi-head attention mechanisms, thereby extracting features from time series data more comprehensively.

[0134] Furthermore, to accurately extract features along the temporal dimension, in some embodiments, the SICM module includes a convolutional attention analysis module, a multi-head attention analysis module, and a feedforward network module, as referred to... Figure 3 , Figure 3 As shown in the structural diagram of the SICM module in one embodiment, step S40 above may include:

[0135] Step S41: Perform linear projection on the input sequence features and the preparation time series through the convolutional attention analysis module to obtain the query projection matrix, key projection matrix and value projection matrix;

[0136] Step S42: Calculate the initial attention scores for the query projection matrix and the key projection matrix using the convolutional attention analysis module;

[0137] Step S43: The initial attention score is processed by the convolutional attention analysis module to obtain candidate traffic flow features;

[0138] Step S44: The candidate traffic flow features are processed by the feedforward network module and the multi-head attention analysis module to obtain traffic flow time features.

[0139] In some embodiments, the prediction device can construct an efficient SICM module by fusing convolutional attention, feedforward / neural / network (FNN) and multi-head attention mechanisms, aiming to improve the accuracy and robustness of time series prediction of cultural and tourism traffic flow.

[0140] In some embodiments, refer to Figure 3The SICM module can be composed of multiple TransformAttention modules, which consist of a convolutional attention analysis module, a multi-head attention analysis module, and a feedforward network module.

[0141] In some embodiments, the prediction device may construct an SICM module that integrates convolutional attention, FNN, and multi-head attention mechanisms. The multi-head attention mechanism in the SICM module captures the local features and long-distance dependencies of traffic flow in cultural and tourism scenarios through local convolutional operations and global attention mechanisms, thereby extracting features from time-series data more comprehensively.

[0142] It should be noted that for input time series data (Where B represents batch size, N represents base quantity, and D represents feature dimension) and prepare time series data. (Where C represents the number of channels) The query projection matrix Q1, key projection matrix K1, and value projection matrix V1 are generated through a single convolution layer. The query projection matrix Q1 focuses on long-term traffic characteristics (such as seasonal tourist growth trends); the key projection matrix K1 and value projection matrix V1 are used to encode real-time dynamics (such as instantaneous congestion caused by festivals).

[0143] The query projection matrix Q1 includes and The key projection matrix K1 includes and The value projection matrix V1 includes and

[0144] The initial attention scores, attention_scores, are calculated using a convolutional attention mechanism based on the following formula: Basis_scores (for the input time series) and Series_scores (for the preparation time series).

[0145]

[0146] Where attention_scores represents the initial attention score, Q1 represents the query projection matrix, which is used to focus on the long-distance dependency features of traffic flow in the cultural and tourism scenario, K1 represents the key projection matrix, T represents the matrix transpose, and D represents the feature dimension. The key projection matrix and the value projection matrix are used to encode real-time dynamic features.

[0147] Furthermore, in order to accurately extract the context vector from traffic flow, adaptively focus on important information in the sequence, and effectively capture local features and global dependencies in the input sequence, in some embodiments, the candidate traffic flow features include the initial global features of the input sequence features and the initial local features of the prepared time series. Step S43 above may include:

[0148] Step S431: Normalize the initial attention score using the convolutional attention analysis module to obtain the attention weights;

[0149] Step S432: Perform a weighted summation on the value projection matrix based on the attention weights to obtain the context vector;

[0150] Step S433: Perform residual connection and layer normalization on the context vector to obtain the initial global features of the input sequence features and the initial local features of the prepared time series.

[0151] It should be noted that the prediction device can generate queries, keys, and values ​​by using the convolutional attention analysis module, thereby adaptively focusing on important information in traffic flow time series while maintaining low computational complexity, and effectively capturing local features of traffic flow (such as short-term traffic fluctuations during the morning rush hour in scenic areas).

[0152] In the specific implementation, the prediction device applies the softmax function to normalize the initial attention scores (including the initial scores Basis_scores of the input time series and the initial scores Series_scores of the preparation time series) to obtain attention weights. The attention weights include the initial scores Basis_weights of the input time series and the initial scores Series_weights of the preparation time series, as shown in the following formula:

[0153] attention_weights=softmax(attention_scores)

[0154] Basis_weights=softmax(Basis_scores)

[0155] Series_weights=softmax(Series_scores)

[0156] Here, attention_weights represents the attention weights, softmax represents the softmax function, and attention_scores represents the initial attention scores.

[0157] The prediction device uses attention weights to perform a weighted summation of the value projection matrix to obtain a context vector. This context vector includes a first context vector corresponding to the input sequence features and a second context vector corresponding to the preparation time series, as shown in the following formula:

[0158] context=attention_weights·V1

[0159] Basis_context=Basis_weights·V_basis

[0160] Series_context=Series_weights·V_series

[0161] Where context represents the context vector and V1 represents the value projection matrix.

[0162] The context vector is passed through a linear layer for residual connection and layer normalization to obtain the initial global features of the input sequence and the initial local features of the prepared time series. Finally, the output dimension is consistent with the input dimension, as shown in the following formula:

[0163] Out basis =LayerNorm(basis+Dropout(Basis_context))

[0164] Out series =LayerNorm(series+Dropout(Series_context))

[0165]

[0166] Among them, Out basis Out represents the initial global features of the input sequence. series This represents the initial local features for preparing the time series, where `basis` represents the input sequence features, `series` represents the prepared time series, `LayerNorm` represents the layer normalization function, `basis+Dropout(Context)` represents the residual connection between the input sequence features and the context vector, `series+Dropout(Context)` represents the residual connection between the prepared time series and the context vector, `Basis_context` represents the first context vector, and `Series_context` represents the second context vector.

[0167] Furthermore, in order to accurately capture long-distance dependencies in traffic flow data (such as the impact of cross-regional tourist flows on traffic during holidays), and thus extract features from time-series data more comprehensively, in some embodiments, step S44 above may include:

[0168] Step S441: The candidate traffic flow features are nonlinearly transformed through the feedforward network module to obtain the candidate global features of the input sequence features and the candidate local features of the preparation time series;

[0169] Step S442: The candidate global features and the candidate local features are linearly transformed by the multi-head attention analysis module to obtain the target query vector and the target key vector;

[0170] Step S443: Determine the target multi-head attention weights based on the target query vector and the target key vector;

[0171] Step S444: Weight the candidate global features and the candidate local features according to the target multi-head attention weight to obtain traffic flow time features.

[0172] It should be noted that the prediction device can perform a nonlinear transformation on the results of the convolutional attention mechanism using a feedforward network (FNN) to obtain candidate global features of the input sequence features and candidate local features of the preparation time series, as shown in the following formula:

[0173] Out′ basis =Out basis +Dropout(Linear(Dropout(ReLU(Linear(Out basis )))))Out′ series

[0174] =Out series +Dropout(Linear(Dropout(ReLU(Linear(Out series )))))

[0176] Among them, Out′ basis Represents candidate global features, Out′ series represents candidate local features, Linear represents linear transformation, ReLU represents nonlinear transformation through activation function, and Dropout represents regularization.

[0177] It should be noted that for each feature and First, a linear transformation maps the features to a higher-dimensional space. Then, an activation function is applied to introduce non-linearity, followed by regularization to prevent overfitting. Next, another linear transformation maps the features back to the original dimensional space. Finally, the features processed by the feedforward network are added to the original features to complete the residual connection, preserving information from the input features while maintaining the same output dimension as the input.

[0178] In practical implementation, prediction devices can use a multi-head attention mechanism to further process the data. Assume each attention head has a dimension of d. k Out′ basis and Out′ series Mapped to respectively Where D = n × d k , where n represents the number of heads. Queries and keys are divided into multiple heads, allowing each head to independently compute attention weights. Then, the similarity between queries and keys is calculated via a dot product and divided by d. k Scaling is performed using the square root of the gradient to stabilize it, as shown in the following formula:

[0179] Q2 = Linear query (Out series )

[0180] K2 = Linear key (Out basis )

[0181]

[0182] Where Q2 represents the target query vector, K2 represents the target key vector, and Linear... query Linear transformation function representing the query vector. key The score represents the linear transformation function of the key vector. time This represents the target multi-head attention weights, and `scale` represents the dimension scaling factor, which can be... Final score time The dimension is

[0183] It should be noted that Out′ basis and Out′ series These represent the global temporal characteristics (such as the periodic congestion on roads around scenic spots during Golden Week) and local temporal characteristics (such as the short-term correlation between morning and evening rush hours) in the cultural tourism transportation scenario. In the multi-head attention mechanism, each attention head independently captures the spatiotemporal interaction patterns of different subspaces (such as one head focusing on holiday traffic and another head focusing on weekday commutes).

[0184] score time Indicates Out' series For Out′ basis The feature attention weight can be understood as how series data combines basis features (used to quantify the dependency relationship between different time steps). For example, a high score indicates strong traffic synergy between the scenic area entrance and the main road during a specific period (such as after a performance), while a low score reflects a weak correlation between traffic in non-cultural and tourism areas (such as residential areas) and scenic area traffic.

[0185] Step S50: Construct a graph structure based on the preparation time series, and input the graph structure and the preparation time series into the graph convolutional network module for spatial feature analysis to obtain spatial features.

[0186] It should be noted that the graph structure includes the spatial relationships between sensors in various cultural and tourism scenarios, and the graph convolutional network module is pre-optimized with weights based on the Snow Avalanche Optimization (SAO) algorithm. The Snow Avalanche Optimization algorithm searches for parameters by simulating the material diffusion and energy exchange during the snow melting process. This algorithm combines an elite retention strategy and an adaptive step size adjustment mechanism, exhibiting strong global search capabilities.

[0187] It should be noted that the Graph Convolutional Network (GCN) module is a deep learning model for processing graph-structured data. It captures graph topological relationships through message passing between nodes and feature aggregation. It utilizes adjacency matrices and node features for hierarchical information propagation, achieving end-to-end learning of graph data.

[0188] In practical implementation, the prediction device can construct an adjacency matrix based on the preparation time series, and create an adaptive graph structure through the adjacency matrix to represent the spatial relationships between different sensors (such as the strong correlation between the main road of the scenic area and the parking lot), avoiding reliance on predefined static road network topology.

[0189] In some embodiments, the prediction device may optimize the current weights of the graph convolutional network module using a snowmelt optimization algorithm before each invocation of the graph convolutional network module, thereby improving the performance of the GCN and enabling it to extract spatial features more accurately.

[0190] In some embodiments, before invoking the GCN network for feature extraction, the prediction device first uses the SAO optimization algorithm to optimize and adjust the weight parameters of the GCN. This process is achieved by constructing an optimization problem based on the current weight parameters.

[0191] First, flatten all trainable parameters of GCN into vectors. Where d represents the total number of parameters. SAO transforms the parameter optimization problem into a problem of minimizing an objective function in the search space, where the objective function is defined as the prediction error of GCN on the current batch of data. Specifically, given the input traffic flow data Z and the adaptive adjacency matrix... The mean squared error of the GCN output corresponding to the objective function f(w):

[0192]

[0193] Where B is the batch size, GCN w Let w represent the GCN model with parameters w. SAO simulates the natural process of snow melting in the search space [lb, ub]. d Internal iterative optimization of parameters.

[0194] SAO employs a swarm intelligence optimization strategy, retaining historical optimal solutions. * The suboptimal solution and the mean of the top 50% of individuals constitute the elite pool. The population is divided into two parts, each updated according to a different strategy:

[0195] Part One: Individual w i By combining the elite solution with the Brownian motion random vector RB i renew:

[0196]

[0197] Among them, w elite The solution is a randomly selected elite solution, r1∈[0,1] is a random number, and ⊙ represents element-wise multiplication.

[0198] The second part involves individuals through temperature coefficients. And the update magnitude is controlled by the dynamic decay factor (DDF):

[0199]

[0200] Where r2∈[-1,1] are random numbers, and the DDF is adaptively adjusted with the number of iterations. Parameters that exceed the search space [lb,ub] are truncated to ensure physical rationality.

[0201] It should be noted that in traffic flow prediction tasks, the core role of GCN is to aggregate spatial information through graph structure. Its processing can be divided into two key stages: adjacency matrix normalization and feature propagation transformation.

[0202] It is understood that this embodiment utilizes graph convolutional networks (GCNs) to extract spatial features from the preparation time series and graph structure, which is crucial for understanding the propagation and impact of traffic flow in space (such as upstream and downstream intersections).

[0203] To maintain numerical stability during feature propagation, GCN first performs symmetric normalization on the original adjacency matrix. Given an adjacency matrix containing self-connections... Calculate its degree matrix D (diagonal matrix, elements) The normalization formula is:

[0204]

[0205] After normalization, This indicates the influence weight of intersection j on intersection i. The weight of intersections with higher elevation values ​​will be reduced to avoid the propagation of dominant features.

[0206] This embodiment uses a two-layer GCN to progressively extract spatial features. In the first layer, it mainly aggregates first-order neighbor information (the traffic impact of direct upstream and downstream intersections):

[0207]

[0208] in, This indicates that the feature of each intersection is a weighted average of its own traffic flow and that of its neighboring intersections. W1 represents mapping the input features (traffic flow, timestamp) to the latent space. For example, if intersection i is connected to intersections j and k, then:

[0209]

[0210] The second layer of GCN is used to capture higher-order spatial dependencies (the indirect effects of more distant intersections through propagation chains). In this case, the features of each intersection include information about its second-order neighbors (neighbors of neighbors), as shown in the formula below. For example, the features of intersection i will be indirectly affected by the neighbor m of intersection j (if j is connected to m).

[0211]

[0212] Step S60: The traffic flow temporal features and spatial features are spliced ​​and fused to generate a target attention score.

[0213] Understandably, the predictive equipment integrates the temporal and spatial characteristics of traffic flow through self-connection to generate a computational score for prediction, enabling the model to utilize both temporal patterns (such as traffic trends during holidays) and spatial patterns (such as the spread of congestion at intersections connecting scenic spots).

[0214] Step S70: Multiply the target attention score with the basic sequence features by matrix multiplication to generate the traffic flow time series prediction result for the cultural and tourism scenario.

[0215] It should be noted that the prediction device performs matrix multiplication between the target attention score obtained from step S60 and the basic sequence features obtained from step S30 to generate the prediction result. This step effectively integrates the attention score and the basic sequence features through matrix multiplication, generating the final prediction result.

[0216] In its implementation, the prediction device uses the obtained base time series and attention score to perform matrix multiplication to obtain the prediction result:

[0217] predict = score fused ×base

[0218] Where, predict represents the prediction result, and score represents the prediction result. fused Let base represent the target attention score, and base represent the candidate prediction sequence, where base ∈ R. B×k×N×L / k L represents the length of the input time series, k represents the number of independent attention computation units running in parallel in the multi-head attention mechanism, each independent attention computation unit corresponds to an independent attention function, and predict represents the initial prediction result, predict∈R. B×C×k×(L / k) .

[0219] In some embodiments, the prediction device transforms the prediction results through the KAN network module, and further optimizes the prediction results through the adaptive grid and spline interpolation techniques of the KAN module, making them more consistent with the actual distribution of traffic flow data.

[0220] The prediction device maps the prediction results to predict∈R B×C×L After determining the dimensions, it is necessary to restore the scale to the scale corresponding to the input dataset. This can be achieved through destandardization, which restores the prediction results to the scale of the original data, facilitating practical application and interpretation. Refer to the following formula:

[0221] predict′=predict×(std x +∈)+mean x

[0222] In the above formula, mean x It is the mean of the input data x, std x is the standard deviation of x, which is a very small value. predict′ represents the final traffic flow time series prediction result, and the final dimensions of predict′ are (B, L, C).

[0223] In some embodiments, the time series prediction method for traffic flow in cultural and tourism scenarios can be executed by a traffic flow prediction model for cultural and tourism scenarios. This model can be a pre-built DST-GAN model, which consists of a data processing module, a SICM module, a KAN module, and an output layer. The traffic flow prediction model for cultural and tourism scenarios is configured to perform the following steps:

[0224] S1: Initialize the system parameters of the data processing module, SICM module, KAN module, and output layer. This step prepares the necessary environment for model building and training, including setting the network structure, activation function, optimizer, etc., to ensure that the model can adapt to the characteristics of traffic flow data;

[0225] S2: Add a 10% mask to the original traffic flow time series data to simulate the sensor data loss that is common in cultural and tourism scenarios (such as partial data loss due to equipment maintenance or signal interference around scenic spots), and enhance the robustness of the model to incomplete data.

[0226] S3: Extract time indices from the time series obtained in S2 to obtain mark variables. These indices can provide the model with additional time context information, helping it to better understand the time dependencies of the data. This step, by introducing time indices, helps the model capture the periodic characteristics related to culture and tourism (such as peak tourist flows at scenic spots on weekends and surges in traffic during Golden Week).

[0227] S4: The feature information obtained in S3 is used to extract additional latent features through KAN and mapped to a higher-dimensional feature representation, and then normalized to obtain the final feature information. The KAN module uses adaptive grid and spline interpolation techniques to flexibly capture local changes and complex patterns in traffic flow data (such as sudden increases in traffic flow during scenic area opening hours, instantaneous congestion when nighttime light shows end, etc.).

[0228] S5: The time series obtained in S2 is standardized by calculating the mean and standard deviation, and then mapped accordingly to obtain the prepared time series. Standardization eliminates the differences in traffic volume dimensions between different cultural and tourism areas (such as urban centers and suburban scenic spots), improving model training efficiency;

[0229] S6: The feature information obtained from S4 is divided into features of the input sequence and features of the base sequence. The input sequence is used for time feature extraction, and the base sequence is used to generate future traffic flow predictions.

[0230] S7: Input the preparation time series obtained from S5 and the input sequence obtained from S6 into the SICM module simultaneously to obtain the temporal features of the traffic flow data. The SICM module captures local features of traffic flow (such as short-term traffic fluctuations during the morning rush hour in scenic areas) and long-distance dependencies (such as the impact of cross-regional tourist flow on traffic during holidays) through convolutional attention and multi-head attention mechanisms, thereby extracting features from the time series data more comprehensively.

[0231] S8: Based on the preparation time series of S5, an adaptive graph structure is created through the adjacency matrix to represent the spatial relationship between different sensors (such as the strong correlation between the main road of the scenic area and the parking lot), avoiding reliance on the predefined static road network topology;

[0232] S9: Before each call to GCN, the current weights of the GCN model are optimized using the Snow Avalanche Optimization (SAO) algorithm, thereby improving the performance of GCN and enabling it to extract spatial features more accurately.

[0233] S10: Spatial features are extracted from the normalized time series obtained from S2 and the graph structure of S8 using graph convolutional networks (GCN). This is crucial for understanding the spatial propagation and impact of traffic flow (such as upstream and downstream intersections).

[0234] S11: The temporal features obtained in S7 and the spatial features obtained in S10 are directly concatenated via self-connection to generate a computational score for prediction. fused This allows the model to utilize both temporal patterns (such as traffic trends during holidays) and spatial patterns (such as the spread of congestion at intersections connecting scenic spots).

[0235] S12: The fusion calculation score obtained from S11 fused Matrix multiplication is performed with the base sequence obtained from S6 to generate the prediction result. This step effectively integrates the attention score and the base time series through matrix multiplication to generate the final prediction result;

[0236] S13: The prediction results obtained in S12 are transformed using the KAN module. This step further optimizes the prediction results through the adaptive grid and spline interpolation techniques of the KAN module, making them more consistent with the actual distribution of traffic flow data;

[0237] S14: Perform destandardization on the prediction results obtained after processing S13 to obtain the final prediction result, and output the final result. Destandardization restores the prediction results to the scale of the original data, which is convenient for practical application and interpretation.

[0238] This embodiment is applied to traffic flow prediction in cultural and tourism scenarios. It acquires raw traffic flow time-series data from these scenarios and preprocesses it. A preparation time series is generated based on the preprocessed data. The raw traffic flow time-series data is collected by multiple sensors deployed in the cultural and tourism scenarios. A time index is extracted from the preprocessed data and encoded to generate a mark variable. This mark variable is input into a KAN network module for feature extraction to obtain candidate feature information. The candidate feature information is then segmented to obtain input sequence features and basic sequence features. A SICM module performs feature analysis on the preparation time series and the input sequence features to obtain traffic flow time features. These traffic flow time features include local features and long-range dependency features. The SICM module is configured to capture local and long-range dependency features using convolutional attention and multi-head attention mechanisms, respectively. A graph structure is constructed based on the preparation time series. The graph structure and the preparation time series are input into the graph convolutional network module for spatial feature analysis to obtain spatial features. The graph structure includes the spatial relationships between sensors in various cultural and tourism scenarios. The graph convolutional network module pre-optimizes the weights based on the snowmelt optimization algorithm. The traffic flow time features and the spatial features are spliced ​​and fused to generate a target attention score. The target attention score is then matrix-multiplied with the basic sequence features to generate the traffic flow time series prediction result for the cultural and tourism scenario. Because the SICM module of this invention performs feature analysis on the preparation time series and input sequence features, it accurately captures the local peak features and global trend features in cultural and tourism traffic. By performing spatial feature analysis on the graph structure and the preparation time series through the graph convolutional network module, the propagation and impact of traffic flow in space can be analyzed. By splicing and fusing the time features and spatial features, the spatiotemporal features of tourist flow in cultural and tourism scenarios can be accurately captured, meeting the dynamic and high-concurrency traffic management needs of cultural and tourism scenarios, significantly improving the accuracy of traffic flow prediction in cultural and tourism scenarios, and effectively improving the efficiency of tourist flow management and surrounding traffic management in cultural and tourism scenic spots.

[0239] refer to Figure 4 , Figure 4 This is a flowchart illustrating the second embodiment of the traffic flow time series prediction method for cultural and tourism scenarios of the present invention.

[0240] Based on the first embodiment described above, in this embodiment, step S50 further includes:

[0241] Step S501: The preparation time series is centralized to eliminate baseline differences between sensor nodes in each cultural and tourism scene;

[0242] Step S502: Construct the covariance matrix based on the prepared time series after centralization processing;

[0243] Step S503: Normalize the covariance matrix to obtain the correlation coefficient matrix;

[0244] Step S504: Generate an initial adjacency matrix based on the correlation coefficient matrix;

[0245] Step S505: Add an identity matrix to the initial adjacency matrix, perform logical judgments on each element in the initial adjacency matrix after adding the identity matrix, generate a Boolean matrix based on the judgment results, perform numerical matrix transformation on the Boolean matrix, and obtain the target adjacency matrix;

[0246] Step S506: Construct a graph structure based on the target adjacency matrix.

[0247] It should be noted that traffic flow data is usually collected by sensor nodes distributed in various locations. These nodes can be deployed around cultural and tourism hotspots (such as scenic area entrances and cultural venue hubs) to simultaneously monitor the mixed traffic flow patterns of tourists commuting and citizens. Their coordinated changes can reflect the disturbance of cultural activities to regional traffic.

[0248] It should be noted that the dimension of the preparation time series used to construct the graph structure is... Where B represents the batch size, L represents the sequence length, and C represents the number of sensors in the cultural and tourism scene (i.e., the number of nodes in the graph). To capture the spatial dependencies between nodes, the data is first processed in a data-driven manner to eliminate baseline differences between nodes, as shown in the following formula:

[0249]

[0250] Where Z represents the preparation time series. μ represents the preparation time series after centralization. t Representing the mean over time, the spatial correlation of traffic flow reflects the often synergistic nature of traffic changes at different nodes. For example, congestion on a main road may lead to increased traffic flow on adjacent secondary roads; this relationship is illustrated by the covariance matrix. Quantization, the elements in the covariance matrix are expressed as:

[0251]

[0252] in, This represents the degree of coordination in flow changes at the b-th batch, the l-th time step, and the i-th sensor. Then, the standard deviation vector is calculated. Its elements are To eliminate the influence of dimensions, the covariance matrix is ​​further normalized to the correlation coefficient matrix. Its element R b,i,j ∈[-1,1] reflects the strength of the linear correlation between node pairs. In traffic scenarios, a positive correlation may reflect the group movement triggered by cultural and tourism activities (such as the simultaneous surge in traffic on main roads and subway stations when a music festival ends), while a negative correlation may reveal tourist diversion strategies (such as alleviating congestion in ancient city protection areas by guiding vehicles to secondary roads through real-time guidance signs).

[0253]

[0254] Here, ∈ is a small constant added for numerical stability. The correlation coefficient matrix is ​​binarized by setting a threshold (0.5 in this embodiment), preserving significant spatial dependencies to generate an initial adjacency matrix A∈{0,1}. B×C×C This step implies the physical characteristics of the transportation network: only highly related node pairs will be connected, such as adjacent intersections or functionally similar areas.

[0255] Simultaneously, self-joins are introduced by adding an identity matrix I to ensure that each node retains its own historical traffic characteristics. The resulting adjacency matrix... It is a dynamically updated graph structure whose edge weights, though binary, encode the spatial interaction patterns of traffic data. This adaptive mechanism is particularly suitable for cultural and tourism sensitive periods such as holidays. When the traditional static road network topology fails (such as in temporarily added night market areas), the data-driven dynamic connection can quickly capture the newly emerging dependencies between tourist gathering areas and transportation hubs, as shown in the following formula;

[0256]

[0257] in, Let A represent the target adjacency matrix, I represent the initial adjacency matrix, and Π represent the indicator function. The target adjacency matrix captures the spatial correlation between sensors. The higher the correlation coefficient, the stronger the connection, thus constructing a data-driven adaptive graph structure.

[0258] This embodiment eliminates baseline differences among sensor nodes in various cultural and tourism scenarios by centralizing the preparation time series. A covariance matrix is ​​constructed based on the centralized preparation time series. This covariance matrix is ​​then normalized to obtain a correlation coefficient matrix. An initial adjacency matrix is ​​generated based on the correlation coefficient matrix. An identity matrix is ​​added to the initial adjacency matrix, and logical judgments are performed on each element of the initial adjacency matrix after adding the identity matrix. A Boolean matrix is ​​generated based on the judgment results, and a numerical matrix transformation is performed on the Boolean matrix to obtain a target adjacency matrix. A graph structure is then constructed based on the target adjacency matrix. This embodiment, by constructing a dynamically updated adaptive graph structure, quickly captures emerging dependencies between tourist gathering areas and transportation hubs, improving the accuracy and timeliness of capturing spatial characteristics of traffic flow in cultural and tourism scenarios, and accurately capturing spatial dependencies in cultural and tourism scenarios.

[0259] Furthermore, this embodiment of the invention also proposes a computer-readable storage medium storing a time series prediction program for traffic flow in cultural and tourism scenarios. When the time series prediction program for traffic flow in cultural and tourism scenarios is executed by a processor, it implements the steps of the time series prediction method for traffic flow in cultural and tourism scenarios as described above.

[0260] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0261] The aforementioned computer-readable storage medium may be included in the time series prediction device for traffic flow in cultural and tourism scenarios; or it may exist independently and not be assembled into the time series prediction device for traffic flow in cultural and tourism scenarios.

[0262] Furthermore, this invention also proposes a computer program product, including a time series prediction program for traffic flow in cultural and tourism scenarios. When the time series prediction program for traffic flow in cultural and tourism scenarios is executed by a processor, it implements the steps of the time series prediction method for traffic flow in cultural and tourism scenarios as described above.

[0263] The specific implementation of the computer program product of the present invention is basically the same as the various embodiments of the above-mentioned method for predicting traffic flow time series in cultural and tourism scenarios, and will not be repeated here.

[0264] Reference Figure 5 , Figure 5 This is a structural block diagram of the first embodiment of the traffic flow time series prediction device for cultural and tourism scenarios of the present invention.

[0265] like Figure 5 As shown, the time series prediction device for traffic flow in cultural and tourism scenarios proposed in this embodiment of the invention is applied to traffic flow prediction in cultural and tourism scenarios. The time series prediction device for traffic flow in cultural and tourism scenarios includes:

[0266] The data processing module 10 is used to acquire the original traffic flow time series data of the cultural and tourism scene, preprocess the original traffic flow time series data, and generate a preparation time series based on the preprocessed original traffic flow time series data. The original traffic flow time series data is collected by multiple cultural and tourism scene sensors deployed in the cultural and tourism scene.

[0267] The variable generation module 20 is used to extract time indices from the preprocessed raw traffic flow time series data and encode the time indices to generate mark variables;

[0268] The feature extraction module 30 is used to input the mark variable into the KAN network module for feature extraction, obtain candidate feature information, and perform feature segmentation on the candidate feature information to obtain input sequence features and basic sequence features;

[0269] The time feature analysis module 40 is used to perform feature analysis on the features of the prepared time series and the input sequence through the SICM module to obtain traffic flow time features. The traffic flow time features include local features and long-distance dependency features of traffic flow. The SICM module is configured to capture local features and long-distance dependency features of traffic flow through convolutional attention mechanism and multi-head attention mechanism, respectively.

[0270] The spatial feature analysis module 50 is used to construct a graph structure based on the preparation time series, and input the graph structure and the preparation time series into the graph convolutional network module for spatial feature analysis to obtain spatial features. The graph structure includes the spatial relationship between various cultural and tourism scene sensors. The graph convolutional network module pre-optimizes the weights based on the snow melting optimization algorithm.

[0271] The feature fusion module 60 is used to splice and fuse the traffic flow temporal features and the spatial features to generate a target attention score;

[0272] The traffic flow prediction module 70 is used to perform matrix multiplication of the target attention score and the basic sequence features to generate a traffic flow time series prediction result for the cultural and tourism scenario.

[0273] This embodiment is applied to traffic flow prediction in cultural and tourism scenarios. It acquires raw traffic flow time-series data from these scenarios and preprocesses it. A preparation time series is generated based on the preprocessed data. The raw traffic flow time-series data is collected by multiple sensors deployed in the cultural and tourism scenarios. A time index is extracted from the preprocessed data and encoded to generate a mark variable. This mark variable is input into a KAN network module for feature extraction to obtain candidate feature information. The candidate feature information is then segmented to obtain input sequence features and basic sequence features. A SICM module performs feature analysis on the preparation time series and the input sequence features to obtain traffic flow time features. These traffic flow time features include local features and long-range dependency features. The SICM module is configured to capture local and long-range dependency features using convolutional attention and multi-head attention mechanisms, respectively. A graph structure is constructed based on the preparation time series. The graph structure and the preparation time series are input into the graph convolutional network module for spatial feature analysis to obtain spatial features. The graph structure includes the spatial relationships between sensors in various cultural and tourism scenarios. The graph convolutional network module pre-optimizes the weights based on the snowmelt optimization algorithm. The traffic flow time features and the spatial features are spliced ​​and fused to generate a target attention score. The target attention score is then matrix-multiplied with the basic sequence features to generate the traffic flow time series prediction result for the cultural and tourism scenario. Because the SICM module of this invention performs feature analysis on the preparation time series and input sequence features, it accurately captures the local peak features and global trend features in cultural and tourism traffic. By performing spatial feature analysis on the graph structure and the preparation time series through the graph convolutional network module, the propagation and impact of traffic flow in space can be analyzed. By splicing and fusing the time features and spatial features, the spatiotemporal features of tourist flow in cultural and tourism scenarios can be accurately captured, meeting the dynamic and high-concurrency traffic management needs of cultural and tourism scenarios, significantly improving the accuracy of traffic flow prediction in cultural and tourism scenarios, and effectively improving the efficiency of tourist flow management and surrounding traffic management in cultural and tourism scenic spots.

[0274] The time series prediction device for traffic flow in cultural and tourism scenarios provided in this application adopts the time series prediction method for traffic flow in cultural and tourism scenarios in the above embodiments, and can solve the technical problem of time series prediction. Compared with the prior art, the beneficial effects of the time series prediction device for traffic flow in cultural and tourism scenarios provided in this application are the same as the beneficial effects of the time series prediction method for traffic flow in cultural and tourism scenarios provided in the above embodiments, and other technical features in the time series prediction device for traffic flow in cultural and tourism scenarios are the same as the features disclosed in the methods of the above embodiments, and will not be repeated here.

[0275] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solution of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any restrictions on this.

[0276] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.

[0277] In addition, for technical details not described in detail in this embodiment, please refer to the time series prediction method for traffic flow in cultural and tourism scenarios provided in any embodiment of the present invention, which will not be repeated here.

[0278] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0279] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0280] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0281] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method for predicting traffic flow time series in cultural and tourism scenarios, characterized in that, The method is applied to traffic flow prediction in cultural and tourism scenarios, and the time series prediction method for traffic flow in cultural and tourism scenarios includes: The system acquires raw traffic flow time series data from cultural and tourism scenarios, preprocesses the raw traffic flow time series data, and generates a preparation time series based on the preprocessed raw traffic flow time series data. The raw traffic flow time series data is collected by multiple cultural and tourism scenario sensors deployed in the cultural and tourism scenarios. Extract time indices from the preprocessed raw traffic flow time series data and encode the time indices to generate mark variables; The mark variable is input into the KAN network module for feature extraction to obtain candidate feature information, and the candidate feature information is segmented to obtain input sequence features and basic sequence features. The SICM module performs feature analysis on the features of the preparation time series and the input sequence to obtain traffic flow time features. The traffic flow time features include local features and long-distance dependency features of traffic flow. The SICM module is configured to capture local features and long-distance dependency features of traffic flow through convolutional attention mechanism and multi-head attention mechanism, respectively. A graph structure is constructed based on the preparation time series, and the graph structure and the preparation time series are input into the graph convolutional network module for spatial feature analysis to obtain spatial features. The graph structure includes the spatial relationship between sensors in various cultural and tourism scenes. The graph convolutional network module performs weight optimization in advance based on the snow melting optimization algorithm. The traffic flow temporal features and spatial features are spliced ​​and fused to generate a target attention score; The target attention score is multiplied by the base sequence features to generate a time series prediction result of traffic flow in the cultural and tourism scenario.

2. The method for predicting traffic flow time series in cultural and tourism scenarios as described in claim 1, characterized in that, The SICM module includes a convolutional attention analysis module, a multi-head attention analysis module, and a feedforward network module; The step of performing feature analysis on the preparation time series and the input sequence features through the SICM module to obtain traffic flow time features includes: The input sequence features and the preparation time series are linearly projected by the convolutional attention analysis module to obtain the query projection matrix, key projection matrix and value projection matrix; The initial attention scores for the query projection matrix and the key projection matrix are calculated using the convolutional attention analysis module. Where attention_scores represents the initial attention score, Q1 represents the query projection matrix, which is used to focus on the long-distance dependency features of traffic flow in cultural and tourism scenarios, K1 represents the key projection matrix, T represents the matrix transpose, D represents the feature dimension, and the key projection matrix and the value projection matrix are used to encode real-time dynamic features. The initial attention score is processed by the convolutional attention analysis module to obtain candidate traffic flow features; The candidate traffic flow features are processed by the feedforward network module and the multi-head attention analysis module to obtain the traffic flow time features.

3. The method for predicting traffic flow time series in cultural and tourism scenarios as described in claim 2, characterized in that, The candidate traffic flow features include the initial global features of the input sequence features and the initial local features of the preparation time series; the process of processing the initial attention score through the convolutional attention analysis module to obtain the candidate traffic flow features includes: The initial attention score is normalized using the convolutional attention analysis module to obtain the attention weights. attention_weights=softmax(attention_scores) Where attention_weights represents attention weights, softmax represents the softmax function, and attention_scores represents the initial attention scores; The value projection matrix is ​​weighted and summed based on the attention weights to obtain a context vector, which includes a first context vector corresponding to the input sequence features and a second context vector corresponding to the preparation time series. context=attention_weights·V1 Where context represents the context vector and V1 represents the value projection matrix; The context vector is subjected to residual connection and layer normalization to obtain the initial global features of the input sequence features and the initial local features of the prepared time series: Out basis =LayerNorm(basis+Dropout(Basis_context)) Out series =LayerNorm(series+Dropout(Series_context)) Among them, Out basis Out represents the initial global features of the input sequence. series This represents the initial local features for preparing the time series, where `basis` represents the input sequence features, `series` represents the prepared time series, `LayerNorm` represents the layer normalization function, `basis+Dropout(Context)` represents the residual connection between the input sequence features and the context vector, `series+Dropout(Context)` represents the residual connection between the prepared time series and the context vector, `Basis_context` represents the first context vector, and `Series_context` represents the second context vector.

4. The method for predicting traffic flow time series in cultural and tourism scenarios as described in claim 3, characterized in that, The process of processing the candidate traffic flow features through the feedforward network module and the multi-head attention analysis module to obtain traffic flow temporal features includes: The feedforward network module performs a nonlinear transformation on the candidate traffic flow features to obtain candidate global features of the input sequence features and candidate local features of the preparation time series. Out′ basis =Out basis +Dropout(Linear(Dropout(ReLU(Linear(Out basis ))))) Out′ series =Out series +Dropout(Linear(Dropout(ReLU(Linear(Out series ))))) Among them, Out′ basis Represents candidate global features, Out′ series represents candidate local features, Linear represents linear transformation, ReLU represents non-linear transformation through activation function, and Dropout represents regularization; The multi-head attention analysis module performs a linear transformation on the candidate global features and the candidate local features to obtain the target query vector and the target key vector. Q2=Linear query (Out series ) K2=Linear key (Out basis ) Where Q2 represents the target query vector, K2 represents the target key vector, and Linear... query Linear transformation function representing the query vector. key A linear transformation function representing the key vector; Determine the target multi-head attention weights based on the target query vector and the target key vector: Among them, score time This represents the target multi-head attention weights, and scale represents the dimension scaling factor. The candidate global features and the candidate local features are weighted according to the target multi-head attention weight to obtain traffic flow time features.

5. The method for predicting traffic flow time series in cultural and tourism scenarios as described in any one of claims 1 to 4, characterized in that, The construction of the graph structure based on the prepared time series includes: The preparation time series is centralized to eliminate baseline differences among sensor nodes in various cultural and tourism scenarios: Where Z represents the preparation time series. μ represents the preparation time series after centralization. t This represents the mean over the time dimension. The dimension representing the preparation time series is: B represents the batch size, L represents the sequence length, and C represents the number of sensors in the cultural and tourism scene. Construct a covariance matrix based on the preparation time series after central processing; The covariance matrix is ​​normalized to obtain the correlation coefficient matrix; An initial adjacency matrix is ​​generated based on the correlation coefficient matrix; Add an identity matrix to the initial adjacency matrix, perform logical judgments on each element of the initial adjacency matrix after adding the identity matrix, generate a Boolean matrix based on the judgment results, and perform numerical matrix transformation on the Boolean matrix to obtain the target adjacency matrix; in, Let A represent the target adjacency matrix, I represent the initial adjacency matrix, Π represent the identity matrix, and Π represent the indicator function. A graph structure is constructed based on the target adjacency matrix.

6. The method for predicting traffic flow time series in cultural and tourism scenarios as described in any one of claims 1 to 4, characterized in that, The step of preprocessing the original traffic flow time series data and generating a prepared time series based on the preprocessed original traffic flow time series data includes: Add a mask matrix to the original traffic flow time series data to obtain the initial traffic flow time series data: X masked =X⊙M Where X represents the original traffic flow time series data, M represents the mask matrix, and ⊙ represents element-wise multiplication. masked This represents the initial traffic flow time series data; Calculate the mean and standard deviation of the initial traffic flow time series data: Where L represents the sequence length, x i This represents the i-th element in the initial traffic flow time series data, where mean x std represents the average value. x Indicates standard deviation; The initial traffic flow time series data is standardized based on the mean and standard deviation to generate a prepared time series. in, ∈ Let Z represent a constant, and Z represent the preparation time series.

7. A time series prediction device for traffic flow in cultural and tourism scenarios, characterized in that, The device is used for traffic flow prediction in cultural and tourism scenarios, and the time series prediction device for traffic flow in cultural and tourism scenarios includes: The data processing module is used to acquire the original traffic flow time series data of the cultural and tourism scene, preprocess the original traffic flow time series data, and generate a preparation time series based on the preprocessed original traffic flow time series data. The original traffic flow time series data is collected by multiple cultural and tourism scene sensors deployed in the cultural and tourism scene. The variable generation module is used to extract time indices from the preprocessed raw traffic flow time series data and encode the time indices to generate mark variables; The feature extraction module is used to input the mark variable into the KAN network module for feature extraction, obtain candidate feature information, and perform feature segmentation on the candidate feature information to obtain input sequence features and basic sequence features; The time feature analysis module is used to perform feature analysis on the features of the prepared time series and the input sequence through the SICM module to obtain traffic flow time features. The traffic flow time features include local features and long-distance dependency features of traffic flow. The SICM module is configured to capture local features and long-distance dependency features of traffic flow through convolutional attention mechanism and multi-head attention mechanism, respectively. The spatial feature analysis module is used to construct a graph structure based on the preparation time series, and input the graph structure and the preparation time series into the graph convolutional network module for spatial feature analysis to obtain spatial features. The graph structure includes the spatial relationship between various cultural and tourism scene sensors. The graph convolutional network module pre-optimizes the weights based on the snow melting optimization algorithm. The feature fusion module is used to splice and fuse the traffic flow temporal features and the spatial features to generate a target attention score; The traffic flow prediction module is used to perform matrix multiplication of the target attention score and the basic sequence features to generate a time series prediction result of traffic flow in the cultural and tourism scenario.

8. A time series prediction device for traffic flow in cultural and tourism scenarios, characterized in that, The time series prediction device for traffic flow in cultural and tourism scenarios includes: a memory, a processor, and a time series prediction program for traffic flow in cultural and tourism scenarios stored in the memory and executable on the processor. The time series prediction program for traffic flow in cultural and tourism scenarios is configured to implement the time series prediction method for traffic flow in cultural and tourism scenarios as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a time series prediction program for traffic flow in cultural and tourism scenarios. When the time series prediction program for traffic flow in cultural and tourism scenarios is executed by a processor, it implements the time series prediction method for traffic flow in cultural and tourism scenarios as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, The computer program product includes a time series prediction program for traffic flow in cultural and tourism scenarios, which, when executed by a processor, implements the steps of the time series prediction method for traffic flow in cultural and tourism scenarios as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Irrigation data assimilation method and device, electronic equipment and storage medium

    CN118094112A

  • Traffic flow prediction system based on deep learning and dynamic network analysis and application method thereof

    CN118675324A

  • Wave height prediction method for multi-strategy snow ablation optimization

    CN119090147A

  • Deep learning-based time series data prediction method

    CN119249128A

  • Vehicle track and traffic flow prediction method based on checkpoint data

    CN119339551A