Attracting flow prediction method, device, equipment, medium and program product

By combining the whale optimization algorithm and the Informer model, multi-level wavelet decomposition and multi-scale feature fusion of the BiLSTM module are performed to solve the problem of nonlinear and periodic fluctuations in scenic spot traffic, and achieve high-precision traffic prediction.

CN120633956BActive Publication Date: 2025-10-21湖南工商大学

Patent Information

Application Number
CN202511130408.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-13
Publication Date
2025-10-21
Estimated Expiration
2045-08-13

Smart Images

  • Figure CN120633956B_ABST
    Figure CN120633956B_ABST
Patent Text Reader

Abstract

The application discloses a scenic spot flow prediction method, device, equipment, medium and program product, the method is applied to the scenic spot tourist flow prediction, the method comprises the following steps: based on the flow time series of the target scenic spot after preprocessing, the whale optimization algorithm is solved, the algorithm result parameter is acquired, the first prediction model is constructed based on the algorithm result parameter, and the time series is carried out multi-scale decomposition, the first prediction model is used for prediction from two branches of low frequency and high frequency respectively, and the high frequency prediction feature and the low frequency prediction feature are input into the second prediction model for prediction; the flow time series is decomposed into a plurality of frequency bands through wavelet decomposition, the accuracy and efficiency of flow prediction are improved through frequency prediction of the first prediction model, accurate analysis of long-term trend and short-term fluctuation of the scenic spot flow is realized, multi-scale fusion and prediction are carried out through the second prediction model, context features are further extracted, the prediction result is effectively optimized, and accurate prediction of the scenic spot flow is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of tourist attraction flow prediction, and in particular to a tourist attraction flow prediction method, device, equipment, medium and program product. Background Art

[0002] As a core technology in smart tourism and urban management, scenic spot flow prediction has received great attention in recent years. Its main task is to predict the flow trend of tourists in the scenic area within a certain period of time in the future based on previous tourist flow data and other related factors. Accurate flow prediction results can play an important role in scenic spot resource scheduling, safety management and service optimization. Traditional linear prediction models are no longer able to fully adapt to the needs of social development due to limitations such as limited data acquisition channels and limited computing power. Nowadays, they are gradually being replaced by more complex models.

[0003] While some current recursive neural networks are somewhat effective at depicting temporal dependencies, they are still limited in their ability to handle nonlinear, multi-periodic, and multi-scale oscillations such as scenic area traffic. Traditional time series forecasting methods perform poorly in dealing with the nonlinear fluctuations, sudden peaks, and cyclical changes common in scenic area traffic. They struggle to effectively model the nonlinear trends, sudden peaks, and cyclical fluctuations present in visitor traffic data, resulting in low prediction accuracy. This makes it impossible to effectively address the complex scenic area traffic forecasting challenges caused by factors such as holidays and weather, leading to an inability to accurately predict visitor traffic. Summary of the Invention

[0004] The main purpose of the present invention is to provide a method, device, equipment, medium and program product for predicting tourist flow, aiming to solve the technical problem that the existing technology cannot effectively deal with the nonlinear trends, sudden peaks and periodic fluctuations in tourist flow data, resulting in low accuracy of tourist flow prediction.

[0005] To achieve the above object, the present invention provides a method for predicting tourist flow at a scenic spot, which is applied to predicting tourist flow at a scenic spot and comprises the following steps:

[0006] Obtaining a traffic time series from historical tourist traffic data of a target attraction, and preprocessing the traffic time series to generate a data set, wherein the historical tourist traffic data includes information on the number of tourists at multiple time nodes;

[0007] Initializing a whale optimization algorithm, and solving the initialized whale optimization algorithm based on the data set to obtain algorithm result parameters, wherein the algorithm result parameters include the number of wavelet decomposition layers, regularization parameters, and prediction model hyperparameters;

[0008] Constructing a first prediction model based on the prediction model hyperparameters and the regularization parameters, where the first prediction model is an Informer model;

[0009] Performing multi-level wavelet decomposition on the data set according to the wavelet decomposition layer number to obtain target high-frequency information and target low-frequency information, wherein the target high-frequency information includes multiple high-frequency subsequences and the target low-frequency information includes multiple low-frequency subsequences;

[0010] Inputting the target high-frequency information and the target low-frequency information into the first prediction model for prediction respectively to obtain high-frequency prediction features and low-frequency prediction features;

[0011] The high-frequency prediction features and the low-frequency prediction features are input into the second prediction model for prediction to obtain the traffic prediction result of the target scenic spot, wherein the traffic prediction result includes the number of tourists within the prediction time step. The second prediction model is constructed based on the BiLSTM module. The second prediction model is used to perform multi-scale feature fusion on the high-frequency prediction features and the low-frequency prediction features, and perform traffic prediction based on the multi-scale feature fusion result.

[0012] Optionally, the data set includes a training set, a test set, and a validation set; obtaining a traffic time series from historical tourist traffic data of a target attraction, and preprocessing the traffic time series to generate a data set includes:

[0013] Obtain the traffic time series from the historical tourist traffic data of the target scenic spot and perform normalization on the traffic time series:

[0014]

[0015] in, represents the normalized data points, represents the original data points in the traffic time series, represents the data mean of the traffic time series, Represents the standard deviation of the flow time series data;

[0016] The total number of windows is determined based on the sequence length of the traffic time series and the forecast time step:

[0017]

[0018] in, Indicates the total number of windows, represents the sequence length, Indicates the window length, represents the prediction time step;

[0019] The normalized traffic time series is divided into sliding windows according to the total number of windows to obtain multiple continuous subsequences;

[0020] Perform time feature encoding on each subsequence to generate encoding feature data;

[0021] Based on the time order of the traffic time series, the coded feature data is divided into a training set, a test set and a validation set. The training set is used to train the first prediction model and the second prediction model, the test set is used to test the first prediction model and the second prediction model, and the validation set is used to verify the prediction results of the first prediction model and the second prediction model.

[0022] Optionally, the initializing the whale optimization algorithm and solving the initialized whale optimization algorithm based on the data set to obtain algorithm result parameters include:

[0023] Determining initialization parameters based on the predicted time step of the target scenic spot, wherein the initialization parameters include the number of whale individuals and the iteration number threshold;

[0024] Initializing the whale optimization algorithm according to the initialization parameters;

[0025] Iteratively update the current position of each whale based on the search expansion coefficient:

[0026]

[0027]

[0028]

[0029]

[0030] in, Indicates the position difference, Indicates the current location, Indicates the location of the current optimal solution, represents the coefficient vector for adjusting the search range, Indicates the updated current position, represents the shrinkage and expansion coefficient that controls the search range, represents the control factor, represents a random number, represents the randomly selected individual position, Used to control the shape and size of the spiral trajectory, is a constant used to control the tightness of the spiral trajectory. is a random number used to generate different spiral trajectories. Direction used to generate spiral trajectories;

[0031] When the current iterative update number reaches the iteration number threshold, the target individual is screened out from the whale individuals, and the updated current position of the target individual is output as the algorithm result parameter.

[0032] Optionally, performing multi-level wavelet decomposition on the data set according to the number of wavelet decomposition layers to obtain target high-frequency information and target low-frequency information includes:

[0033] Performing wavelet decomposition on the data set according to the wavelet decomposition layer number to extract original low-frequency information and original high-frequency information;

[0034] Extract high-frequency supplementary features of the high-frequency feature extraction ratio from the original high-frequency information, and concatenate the high-frequency supplementary features with the original low-frequency information to generate target low-frequency information:

[0035]

[0036] in, Represents the target low-frequency information, Represents the original low-frequency information, represents the original high-frequency information, Indicates the ratio of high-frequency feature extraction;

[0037] Extract low-frequency supplementary features of the low-frequency feature extraction ratio from the original low-frequency information, and concatenate the low-frequency supplementary features with the original high-frequency information to generate target high-frequency information:

[0038]

[0039] in, Represents the target high-frequency information, Indicates the ratio of low-frequency feature extraction.

[0040] Optionally, the first prediction model includes a low-frequency prediction model and a high-frequency prediction model, each of the low-frequency prediction model and the high-frequency prediction model being composed of a multi-layer embedding module, a probabilistic sparse attention module, an encoder, and a decoder;

[0041] The high-frequency prediction model is used to make predictions based on the target high-frequency information and output high-frequency prediction features;

[0042] The low-frequency prediction model is used to make predictions based on target low-frequency information and output low-frequency prediction features;

[0043] The multi-layer embedding module is used to perform linear projection on the target high-frequency information and / or the target low-frequency information, and embed the linear projection result into a vector representation to obtain the target embedding vector:

[0044]

[0045]

[0046] in, represents a numerical embedding vector, represents the position embedding vector, represents the time embedding vector, represents the target embedding vector;

[0047] The probabilistic sparse attention module is used to linearly transform the target embedding vector into a query vector and calculate the information entropy of each query vector:

[0048]

[0049] in, Represents the query vector The information entropy function, represents the vector dimension, represents the bond matrix, represents transpose, represents the scaling factor, Represents the Kullback-Leibler divergence, which is used to measure The difference between the distribution and the benchmark distribution, As a benchmark distribution, Represents the normalization function, which is used to convert the dot product result Convert to probability distribution;

[0050] The probabilistic sparse attention module is further configured to screen the query vector based on the information entropy to generate a key query vector set, and perform sparse attention analysis based on the key query vector set to obtain a sparse attention result. The key query vector set includes multiple key query vectors. The sparse attention result is calculated according to the following formula:

[0051]

[0052] in, represents the sparse attention result, represent the query matrix, key matrix and value matrix respectively, represents the key query vector, Represents a set of key query vectors;

[0053] The encoder is used to perform feature concatenation on the sparse attention results of multiple attention heads in the probabilistic sparse attention module and perform linear transformation to obtain the multi-head attention output result:

[0054]

[0055] in, Indicates the The sparse attention results of attention heads, represents the linear transformation matrix, Represents the output of multi-head attention;

[0056] The decoder is used to convert the output result of the encoder into a key vector and a value vector, and perform cross attention analysis based on the historical traffic time series, the key vector and the value vector to obtain a cross attention result. The cross attention result is calculated according to the following formula:

[0057]

[0058] in, represents the cross attention result, and Represent the key vector and value vector converted based on the encoder output results, respectively. represents the query vector based on the transformation of historical traffic time series, represents the scaling factor;

[0059] The decoder is also used to input the cross-attention result into a feedforward neural network module for nonlinear modeling, and linearly map the output result of the feedforward neural network module to output high-frequency prediction features and / or low-frequency prediction features. The feedforward neural network module includes two linear transformation layers and a nonlinear activation function.

[0060] Optionally, the second prediction model includes a multi-scale feature fusion module, a BiLSTM encoder, a multi-head attention module, a BiLSTM decoder and a linear layer;

[0061] The multi-scale feature fusion module is used to perform multi-scale feature fusion on the high-frequency prediction features and the low-frequency prediction features to generate fused prediction features:

[0062]

[0063] in, represents the fusion prediction feature, represents low-frequency prediction features, Represents high-frequency prediction features;

[0064] The BiLSTM encoder is used to perform bidirectional traversal encoding on the fused prediction features, extract the forward temporal hidden state and the reverse temporal hidden state, and concatenate the forward temporal hidden state and the reverse temporal hidden state of each time step to obtain bidirectional temporal feature information:

[0065]

[0066]

[0067]

[0068]

[0069] in, Represents the time step Forward timing hidden state, Represents the time step Reverse timing hidden state, represents the forward LSTM encoding, represents the reverse LSTM encoding, Represents the time step The fusion prediction features of Represents the time step The forward sequential hidden state of Represents the time step The reverse timing hidden state, Represents the time step The bidirectional temporal hidden state of Represents bidirectional time series feature information, represents the hidden state dimension, represents the set of real numbers;

[0070] The multi-head attention module is used to perform context modeling on the bidirectional temporal feature information and obtain the multi-head attention output result:

[0071]

[0072] in, They represent the query matrix, key matrix and value matrix obtained by linear transformation of bidirectional temporal feature information, represents the transpose of the key matrix, Used for calculation and The similarity matrix of represents the scaling factor, Represents the multi-head attention output result, Used to normalize the similarity matrix to obtain attention weights, wherein the normalization includes row normalization;

[0073] The multi-head attention module is further used to perform feature splicing on the multi-head attention output results to obtain a target attention output result, copy the attention output result of the last time step in the target attention output result based on the traffic prediction step number of the target scenic spot, and output the global context feature:

[0074]

[0075]

[0076] in, represents the target attention output result, Represents the attention head The output result is, Represents the output linear transformation matrix, which is used to map the concatenated attention output results to the target dimension. represents the global context feature, Represents the last time step in the target attention output The attention output result is Indicates the number of flow prediction steps;

[0077] The BiLSTM decoder is used to perform temporal dependency analysis based on the global context features to obtain the hidden state of each time step:

[0078]

[0079] in, Represents the time step The hidden state of represents the BiLSTM decoder;

[0080] The linear layer is used to integrate the hidden states of each time step into the initial prediction result, perform linear mapping on the initial prediction result, and output the traffic prediction result of the target scenic spot:

[0081]

[0082]

[0083] in, Indicates the traffic prediction result. represents the output linear transformation matrix, represents the bias term, Represents the initial prediction result.

[0084] In addition, to achieve the above-mentioned purpose, the present invention further proposes a device for predicting tourist flow at a scenic spot, which is applied to predict tourist flow at a scenic spot. The device for predicting tourist flow at a scenic spot comprises:

[0085] A data processing module is used to obtain a flow time series from the historical tourist flow data of the target scenic spot, and pre-process the flow time series to generate a data set, wherein the historical tourist flow data includes information on the number of tourists at multiple time nodes;

[0086] A whale optimization module is used to initialize the whale optimization algorithm and solve the initialized whale optimization algorithm based on the data set to obtain algorithm result parameters, which include the number of wavelet decomposition layers, regularization parameters, and prediction model hyperparameters;

[0087] A model construction module, configured to construct a first prediction model based on the prediction model hyperparameters and the regularization parameters, wherein the first prediction model is an informer model;

[0088] A wavelet decomposition module, configured to perform multi-level wavelet decomposition on the data set according to the wavelet decomposition layer number to obtain target high-frequency information and target low-frequency information, wherein the target high-frequency information includes a plurality of high-frequency subsequences and the target low-frequency information includes a plurality of low-frequency subsequences;

[0089] A first prediction module is configured to input the target high-frequency information and the target low-frequency information into the first prediction model for prediction, thereby obtaining a high-frequency prediction feature and a low-frequency prediction feature;

[0090] The second prediction module is used to input the high-frequency prediction features and the low-frequency prediction features into the second prediction model for prediction to obtain the traffic prediction result of the target scenic spot, and the traffic prediction result includes the number of tourists within the prediction time step. The second prediction model is constructed based on the BiLSTM module. The second prediction model is used to perform multi-scale feature fusion on the high-frequency prediction features and the low-frequency prediction features, and perform traffic prediction based on the multi-scale feature fusion result.

[0091] In addition, to achieve the above-mentioned purpose, the present application also proposes a scenic spot traffic prediction device, which includes: a memory, a processor and a scenic spot traffic prediction program stored on the memory, the processor is used to run the scenic spot traffic prediction program, and the computer program is configured to implement the steps of the scenic spot traffic prediction method described above.

[0092] In addition, to achieve the above-mentioned purpose, the present application also proposes a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the scenic spot traffic prediction method as described above are implemented.

[0093] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the steps of the scenic spot traffic prediction method as described above.

[0094] The present invention obtains a flow time series from historical tourist flow data of a target scenic spot, and pre-processes the flow time series to generate a data set, wherein the historical tourist flow data includes information on the number of tourists at multiple time nodes, initializes a whale optimization algorithm, and solves the initialized whale optimization algorithm based on the data set to obtain algorithm result parameters, wherein the algorithm result parameters include the number of wavelet decomposition layers, regularization parameters, and prediction model hyperparameters, constructs a first prediction model based on the prediction model hyperparameters and the regularization parameters, performs multi-level wavelet decomposition on the data set according to the number of wavelet decomposition layers, obtains target high-frequency information and target low-frequency information, wherein the target high-frequency information includes multiple high-frequency subsequences, and the target low-frequency information includes multiple low-frequency subsequences. The target high-frequency information and the target low-frequency information are respectively input into the first prediction model for prediction to obtain high-frequency prediction features and low-frequency prediction features, and the high-frequency prediction features and the low-frequency prediction features are input into the second prediction model for prediction to obtain the flow prediction result of the target scenic spot; because the present invention decomposes the flow time series into multiple frequency bands through multi-level wavelet decomposition, it realizes multi-scale analysis of the flow time series of complex scenic spots, improves the accuracy and efficiency of flow prediction through the frequency division prediction of the first prediction model, realizes accurate analysis of the long-term trend and short-term fluctuation of the flow of scenic spots, and performs multi-scale fusion and prediction through the second prediction model, thereby further extracting context features, effectively optimizing the prediction results, and realizing accurate prediction of the personnel flow of scenic spots. BRIEF DESCRIPTION OF THE DRAWINGS

[0095] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0096] Figure 1 It is a structural diagram of a scenic spot traffic prediction device in a hardware operating environment involved in an embodiment of the present invention;

[0097] Figure 2 This is a flow chart of a first embodiment of a method for predicting flow rates at scenic spots according to the present invention;

[0098] Figure 3 Schematic diagram of the flow of scenic spot traffic prediction in one embodiment of the present invention;

[0099] Figure 4 This is a flow chart of a second embodiment of a method for predicting flow rates at scenic spots according to the present invention;

[0100] Figure 5 This is a structural block diagram of the first embodiment of the scenic spot traffic prediction device of the present invention.

[0101] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0102] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0103] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a scenic spot traffic prediction device in the hardware operating environment involved in an embodiment of the present invention.

[0104] like Figure 1 As shown, the scenic spot traffic prediction device 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 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 a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also be a storage device independent of the processor 1001.

[0105] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the scenic spot traffic prediction device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0106] like Figure 1 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a scenic spot traffic prediction program.

[0107] exist Figure 1In the scenic spot traffic prediction device 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 scenic spot traffic prediction device of the present invention can be set in the scenic spot traffic prediction device, and the scenic spot traffic prediction device calls the scenic spot traffic prediction program stored in the memory 1005 through the processor 1001, and executes the scenic spot traffic prediction method provided by the embodiment of the present invention.

[0108] The embodiment of the present invention provides a method for predicting the flow of scenic spots. Figure 2 , Figure 2 2 is a flow chart of the first embodiment of the method for predicting tourist flow in the present invention.

[0109] In this embodiment, the scenic spot flow prediction method includes the following steps:

[0110] Step S10: Obtain a traffic time series from the historical tourist traffic data of the target scenic spot, and preprocess the traffic time series to generate a data set.

[0111] It should be noted that this embodiment is applied to the prediction of the flow of people in scenic spots or scenic areas, and predicts the flow trend of tourists in scenic areas within a certain period of time in the future, thereby providing a basis for resource scheduling, safety management and service optimization of scenic areas. Since the flow of scenic spots has nonlinear, multi-periodic and multi-scale oscillation characteristics, this embodiment decomposes the time series of scenic spot flow into low-frequency information and high-frequency information through wavelet decomposition, thereby realizing multi-scale analysis, and decomposing the original non-stationary time series from low frequency to high frequency layer, obtaining the trend information and disturbance information corresponding to the time series, and then performing frequency division modeling analysis through the first prediction model. Based on the first prediction model, the low-frequency prediction results and the high-frequency prediction results are multi-scale fused and flow prediction is carried out through the second prediction model, effectively further optimizing the prediction results, thereby realizing accurate prediction of the flow of people in scenic spots.

[0112] It should be understood that the execution subject of this embodiment may be a computing service device with data processing, network communication, and program execution capabilities, such as a tablet computer, personal computer, mobile phone, etc., or a terminal electronic device capable of performing the aforementioned functions. This embodiment and the following embodiments will be described below using a scenic spot traffic prediction device (hereinafter referred to as the prediction device) as an example.

[0113] It should be noted that the historical tourist flow data includes tourist number information at multiple time nodes. For example, the historical tourist flow data may include the number of tourists in different weather conditions (such as rainy days, snowy days, sunny days, cloudy days, etc.), the number of tourists on holidays, the number of tourists during scenic spot activities, etc.

[0114] In some embodiments, preprocessing may include performing data noise reduction processing, missing value filling processing, normalization processing, sliding window division processing, etc. on the traffic time series.

[0115] In some embodiments, the prediction device may extract visitor flow data from a historical monitoring system or ticketing platform of a target attraction, in the form of the number of visitors recorded by timestamp (eg, hourly, daily).

[0116] In some embodiments, the prediction device may divide the preprocessed data into a training set (70%), a validation set (15%), and a test set (15%) in chronological order. For example, the training set includes the time series from January 1, 2023, to June 30, 2023; the validation set includes the time series from July 1, 2023, to August 15, 2023; and the test set includes the time series from August 16, 2023, to September 30, 2023.

[0117] Furthermore, in order to improve traffic prediction efficiency and data quality, the above step S10 may include:

[0118] Step S101: obtaining a flow time series from historical tourist flow data of a target scenic spot, and performing standardization processing on the flow time series.

[0119] It should be noted that the prediction device can use data standardization to eliminate the impact of different features due to dimensional differences. The standardization process refers to the following formula:

[0120]

[0121] in, represents the normalized data points, represents the original data points in the traffic time series, represents the data mean of the traffic time series, Represents the standard deviation of the flow time series data;

[0122] Step S102: determining the total number of windows based on the sequence length of the traffic time series and the prediction time step.

[0123] It should be noted that the total number of windows is calculated according to the following formula:

[0124]

[0125] in, Indicates the total number of windows, represents the sequence length, Indicates the window length, Represents the forecast time step.

[0126] Step S103: Divide the normalized traffic time series into sliding windows according to the total number of windows to obtain multiple continuous subsequences.

[0127] It should be noted that the prediction device divides the sequence data into multiple continuous subsequences through a sliding window. .

[0128] Step S104: performing time feature encoding on each subsequence to generate encoding feature data.

[0129] It is understood that the prediction device can convert time information into features that the model can understand and utilize. Here, periodic features such as hours, days, and months are encoded using sine and cosine. In this embodiment, T can be changed at any time according to the time granularity of the dataset (for hourly level, T = 24, for weekly level, T = 7, for annual level, T = 365), referring to the following formula:

[0130]

[0131]

[0132] Step S105: dividing the coded feature data into a training set, a test set, and a validation set based on the time sequence of the traffic time series.

[0133] It should be noted that the training set is used to train the first prediction model and the second prediction model, the test set is used to test the first prediction model and the second prediction model, and the verification set is used to verify the prediction results of the first prediction model and the second prediction model.

[0134] Step S20: Initialize the whale optimization algorithm, and solve the initialized whale optimization algorithm based on the data set to obtain algorithm result parameters.

[0135] It should be noted that the algorithm result parameters include the number of wavelet decomposition layers, regularization parameters and prediction model hyperparameters.

[0136] It should be noted that the number of wavelet decomposition layers can be used to control the refinement of the decomposition; more layers result in richer high-frequency details. Regularization parameters are used to balance the complexity and generalization capabilities of the first prediction model to prevent overfitting. Prediction model hyperparameters can be informer model hyperparameters, which determine the model's feature extraction capabilities and computational efficiency.

[0137] In some embodiments, the prediction device can set initialization parameters based on the data set. The initialization parameters may include population size parameters, iteration number threshold, fitness function, etc. For example, the population size is set to 50 whale individuals, the iteration number threshold is set to 50 times, and the fitness function uses the prediction error on the validation set (such as mean square error MSE) as the optimization target.

[0138] Furthermore, in order to accurately obtain the algorithm result parameters, the above step S20 may include:

[0139] Step S201: determining initialization parameters based on the predicted time step of the target scenic spot;

[0140] Step S202: Initializing the whale optimization algorithm according to the initialization parameters;

[0141] Step S203: iteratively updating the current position of each individual whale based on the search expansion coefficient;

[0142] Step S204: When the current iterative update number reaches the iteration number threshold, the target individual is screened out from the whale individuals, and the updated current position of the target individual is output as the algorithm result parameter.

[0143] It should be noted that in this embodiment, the whale optimization algorithm is used to jointly optimize the multi-band wavelet decomposition parameters and the informer model hyperparameters in the tourist attraction prediction model. The initialization parameters include the number of whale populations N and the maximum number of iterations T. The individual whale positions are updated according to the following formula:

[0144]

[0145]

[0146]

[0147]

[0148] in, Indicates the position difference, Indicates the current location, Indicates the location of the current optimal solution, represents the coefficient vector for adjusting the search range, Indicates the updated current position, represents the shrinkage and expansion coefficient that controls the search range, represents the control factor, represents a random number, represents the randomly selected individual position, Used to control the shape and size of the spiral trajectory, is a constant used to control the tightness of the spiral trajectory. is a random number used to generate different spiral trajectories. The direction used to generate the spiral trajectory.

[0149] Working principle:

[0150] when When , the whale algorithm tends to shrink to the global optimal position and combines the spiral search term Perform local refined search; when When , the random individual position is used Update to increase population diversity, thereby improving the ability to escape local optimality.

[0151] The technical effects of the whale optimization algorithm used in this embodiment are as follows:

[0152] By embedding the aforementioned whale optimization algorithm into the joint optimization of multi-band wavelet decomposition and the hyperparameters of the informer model, it is possible to simultaneously determine in a single optimization process:

[0153] 1. Number of wavelet decomposition layers, mother wavelet type, and frequency band energy threshold;

[0154] 2. Key structural parameters of the Informer model (such as sequence length, prediction length, embedding dimension, number of attention heads, learning rate, etc.).

[0155] This joint optimization strategy conducts global exploration in the early stage of the search to avoid falling into local optimality, and quickly approaches the optimal solution through spiral search in the later stage of the search, thereby obtaining a model configuration that takes into account both prediction accuracy and computational efficiency in the task of tourist attraction passenger flow prediction, and improving the system's prediction stability and real-time performance during special periods such as holidays.

[0156] It should be noted that the basic parameters required by the whale optimization algorithm mainly include the population size parameter, that is, the number of whale individuals and the maximum number of iterations.

[0157] For example, the number of whales is set to N = the number of whales, which is equal to the maximum number of iterations. In some embodiments, the number of whales can be set to N = 30, which means that 30 different parameter combinations are explored simultaneously, and each parameter set represents a possible prediction model configuration. This is equivalent to 30 parallel models being learned and optimized simultaneously. Maximum number of iterations , which means the algorithm performs the entire parameter optimization process one hundred times. This means the system tries once to find the optimal parameter combination. Indicates how tight the spiral search is. In prediction, it affects how the model searches locally around the current optimal solution. Indicates the range of parameter search. In tourist attraction traffic prediction, this parameter determines the breadth of the model's exploration in parameter space. Larger values ​​allow the model to explore a wider range of parameter combinations.

[0158] It is understandable that this embodiment uses the optimal parameters obtained by searching with the Whale Optimization Algorithm (WOA) to initialize the model structure. The construction content includes:

[0159] The number of decomposition layers of the wavelet decomposition model , regularization ratio As well as multiple hyperparameters of the Informer model, let the hyperparameter combination vector be: ,in, represents the number of prediction steps, Represents the learning rate. Each set of parameter combinations Corresponding to a candidate model structure and training strategy, the initialization of the whale optimization algorithm is input by using the fitting effect (such as MSE) on the training set as the fitness function. For each whale parameter combination, the Informer model is trained on the training set, and the MSE is calculated on the validation set.

[0160] Step S30: Constructing a first prediction model based on the prediction model hyperparameters and the regularization parameters.

[0161] It should be noted that the first prediction model is an Informer model, which may include a self-attention mechanism (Self-Attention) and a probabilistic sparse attention module (ProbSparse Attention).

[0162] It is understandable that this embodiment is based on the prediction model hyperparameters (such as ) Configure the hyperparameters of the Informer model and add an L2 regularization term to the loss function based on the regularization parameter (Dropout ratio).

[0163] Furthermore, in order to accurately capture the trend characteristics of long- and short-term fluctuations in scenic spot traffic data at different scales, in one embodiment, the first prediction model includes a low-frequency prediction model and a high-frequency prediction model, each of which is composed of a multi-layer embedding module, a probabilistic sparse attention module, an encoder, and a decoder;

[0164] The high-frequency prediction model is used to make predictions based on the target high-frequency information and output high-frequency prediction features;

[0165] The low-frequency prediction model is used to make predictions based on target low-frequency information and output low-frequency prediction features;

[0166] The multi-layer embedding module is used to perform linear projection on the target high-frequency information and / or the target low-frequency information, and embed the linear projection result into a vector representation to obtain a target embedding vector;

[0167] The probabilistic sparse attention module is used to linearly transform the target embedding vector into a query vector and calculate the information entropy of each query vector;

[0168] The probabilistic sparse attention module is further configured to screen the query vector based on the information entropy to generate a set of key query vectors, and perform sparse attention analysis based on the set of key query vectors to obtain a sparse attention result;

[0169] The encoder is used to perform feature splicing and linear transformation on the sparse attention results of multiple attention heads in the probabilistic sparse attention module to obtain a multi-head attention output result;

[0170] The decoder is configured to convert the output result of the encoder into a key vector and a value vector, and perform a cross-attention analysis based on the historical traffic time series, the key vector, and the value vector to obtain a cross-attention result;

[0171] The decoder is also used to input the cross-attention result into a feedforward neural network module for nonlinear modeling, and linearly map the output result of the feedforward neural network module to output high-frequency prediction features and / or low-frequency prediction features. The feedforward neural network module includes two linear transformation layers and a nonlinear activation function.

[0172] It should be noted that the prediction device decomposes the high-frequency and low-frequency components based on a multi-level wavelet transform. Therefore, two informer models are constructed: one input takes the high-frequency component to estimate future high-frequency changes, and the other inputs the low-frequency component to predict future low-frequency change trends. The input representation of the first prediction model includes the target low-frequency information and the target high-frequency information.

[0173] It should be noted that the Multi-layer / DataEmbedding module is used to "translate" the original input data into a high-dimensional representation that the model can understand. The input time series undergoes linear projection + time encoding:

[0174]

[0175] in, represents the linear projection vector, Represents a time encoding vector.

[0176] The multi-layer embedding module not only includes temporal embedding, but also positional embedding and value embedding:

[0177]

[0178]

[0179] in, represents a numerical embedding vector, represents the position embedding vector, represents the time embedding vector, represents the target embedding vector.

[0180] It's important to note that tourist flow time series typically include real-valued features (such as historical passenger volume and weather indicators), periodic location information (sequence position), and multi-level time markers (minutes / hours / weeks / holidays, etc.). In order for the Transformer / Informer to simultaneously utilize local time series, global temporal context, and numerical features, a unified input representation (DataEmbedding) is required to map this information from various sources into a vector space of the same dimension (facilitating subsequent addition and attention operations). Informer also adopts a similar approach in Appendix B, combining three types of embeddings: value, position, and temporal as the input representation:

[0181] ValueEmbedding

[0182] For continuous multidimensional numerical features, the most common and stable approach is linear projection (or 1-Dconv):

[0183]

[0184] PositionEmbedding

[0185]

[0186]

[0187] TemporalEmbedding (time stamp embedding / global time feature):

[0188] Use embeddinglookup to map discrete time attributes such as "hour / week / holiday / month / holiday status" into vectors, and then merge them (element-by-element addition or concatenation followed by linear projection). Formalization is based on the following formula:

[0189]

[0190] in, It is a collection of time stamps (such as hour, weekday, month, holiday), Is the timestamp at the time The value of For the corresponding lookup embedding or small network projection (dimension d), Informer explicitly states that these global timestamps are also used as learnable embeddings to enhance the modeling of global context such as long periods / holidays.

[0191] It should be noted that the ProbSpare Attention module selects the most representative top-u query vector:

[0192]

[0193] The scoring function measures the "information entropy" of each query, selecting the ones with higher information entropy, indicating a stronger connection between the query and the key. Key query vectors are then retained and a set of key query vectors is constructed, which contains multiple key query vectors. Finally, sparse attention is calculated only for the key query vector set, reducing computational complexity and focusing only on important query vectors. Information entropy calculation follows the following formula:

[0194]

[0195] in, Represents the query vector The information entropy function, represents the vector dimension, represents the bond matrix, represents transpose, represents the scaling factor, Represents the Kullback-Leibler divergence, which is used to measure The difference between the distribution and the benchmark distribution, As a benchmark distribution, Represents the normalization function, which is used to convert the dot product result Convert to a probability distribution.

[0196] The calculation of sparse attention results refers to the following formula:

[0197]

[0198] in, represents the sparse attention result, represent the query matrix, key matrix and value matrix respectively, represents the key query vector, Represents a set of key query vectors.

[0199] It should be noted that the complexity of standard self-attention is When the input length L is very large (especially when the length is increased after wavelet multi-frequency splicing), computation and memory become bottlenecks. The ProbSparse mechanism proposed by Informer reduces the complexity to nearly .

[0200] 1. Starting from the standard Self-Attention:

[0201] Given a query matrix , bond matrix , value matrix classic

[0202]

[0203] Consider a single query vector (Take the query matrix A row of All scoring vectors .

[0204] 2. Define the "sparsity measurement of the query" and use the KL distance to measure the difference between the attention distribution and the uniform distribution:

[0205] make (This is the probability distribution of attention of the query to all keys), let the uniform distribution .measure The "dissimilarity" from the uniform distribution can be expressed as:

[0206]

[0207] , expand and simplify:

[0208]

[0209] in, ,and that is :

[0210]

[0211] Remove the constant term , you can The sparsity measure is defined as ,when When the value is large, it means The difference from the uniform distribution is large, that is, the Attention is focused on a few (“Information-rich” ).

[0212] Implementation details: Probabilistic sampling + top-u strategy → "ProbSparse";

[0213] For each Randomly sample a small subset (from mid-sampling indivual , ), calculate the dot product of these samples to get the approximate and estimates of indivual Do a dot multiplication.

[0214] With estimated All by size Do Top-u selection (select the one with the largest of The paper suggests that Set to The logarithm of The overall complexity is about

[0215] To the selected Calculate the complete attention (with all Do and softmax); for the unselected Use approximation (such as replacing it with the mean or using a mask to only receive certain summary values). Finally, a sparse attention matrix is ​​obtained, which saves computation and memory.

[0216] It should be noted that the encoder extracts sequence features through multi-head self-attention and feedforward networks. The encoder in the first prediction model first adopts a multi-stack structure and multi-head parallel calculation. The multi-head attention calculation refers to the following formula:

[0217]

[0218] in, Indicates the The sparse attention results of attention heads, represents the linear transformation matrix, Represents the multi-head attention output result.

[0219] Secondly, a nonlinear transformation is performed at each position, using the GELU activation function:

[0220]

[0221] Finally, residual connections are added to each module to prevent gradient explosion and disappearance:

[0222]

[0223] It's important to note that the decoder in the first prediction model can adopt a Transformer-like architecture, consisting of three main modules: Masked Self-Attention, Multi-Head Cross-Attention, and a Feedforward Network. Residual connections and layer normalization are introduced in each sublayer, enhancing the model's expressive power and training stability. At the decoder input, the target sequence (typically a known portion of past predictions) is positionally encoded and feature-embedded to obtain a high-dimensional input representation.

[0224] Decoder input: The decoder receives a partially known target sequence (either past or aligned future labels used in the training phase), which is first mapped into a high-dimensional vector through an embedding layer and positional encoding:

[0225]

[0226] in, represents the input of the decoder, is the embedding matrix, is the position code, is the input sequence (time series segment) of the decoder, The length of the decoder input sequence (number of time steps), Represents the feature dimension at each time step, usually the embedding dimension.

[0227] The Masked Multi-Head Self-Attention module is then used to model the dependencies of the target sequence itself. The first layer implements the Masked Multi-Head Self-Attention mechanism, which only allows access to information at the current position and before, preventing future information leakage. The attention form is as follows:

[0228]

[0229] The derivation process of the mask attention formula is as follows:

[0230] The energy score matrix of general attention is:

[0231]

[0232]

[0233] Scaling is done on this basis to prevent With dimension Increase leads to too large variance, divided by :

[0234]

[0235] Add Mask matrix: The upper triangle (including the diagonal) is filled with 0, and the lower triangle is filled with The purpose of the matrix (or approximation with a large negative number) is to shield future information (to prevent future moments from being seen during prediction).

[0236] Softmax normalization:

[0237]

[0238] The position of the mask is added Then the probability becomes 0 in softmax.

[0239] The weighted summation gives the output:

[0240]

[0241] The masked attention module is similar to the above attention mechanism, except that M (mask matrix - masking the position of future time steps) is added during softmax classification. Taking a sequence of length 4 as an example, the mask matrix M is usually an upper triangular The matrix is ​​as follows:

[0242]

[0243] Finally, we use the multi-head mechanism to improve the representation capability through parallelization:

[0244]

[0245] Subsequently, the Cross-Attention module interacts the current state of the decoder with the encoder output (i.e., the high-level representation of the historical sequence). Using the encoder output as the key and value, combined with the current representation of the decoder, Cross-Attention is calculated to fuse historical input information. This module also utilizes a multi-head attention mechanism, enabling the model to dynamically focus on key time steps in the historical sequence, thereby more accurately generating future predictions. The calculation of the Cross-Attention result is based on the following formula:

[0246]

[0247] in, represents the cross attention result, , and Represent the key vector and value vector converted based on the encoder output results, respectively. represents the query vector based on the transformation of historical traffic time series, Represents the scaling factor.

[0248] The cross-attention query comes from the current decoder state ;Key and Value come from the encoder output ;

[0249] Cross-attention effect: During decoding, the encoder’s global context information (historical temporal features) is used to guide current predictions.

[0250] Significance in tourist attraction prediction: The low-frequency wavelet features of the encoder input retain long-term regularities (seasonality, holiday patterns), while the high-frequency features contain short-term fluctuations (weather, activities).

[0251] The Cross-Attention module allows the decoder to dynamically query the most relevant low-frequency and high-frequency historical patterns when generating predictions, improving prediction targeting.

[0252] Next, the output passes through a standard feedforward neural network (FFN), which consists of two linear transformation layers and a nonlinear activation function. The activation function uses GELU (GaussianErrorLinearUnit), which is smoother than ReLU and helps improve nonlinear modeling capabilities:

[0253]

[0254] GELU = Gaussian error function (erf) approximates the product of Sigmoid and linear function. Unlike ReLU, GELU performs smooth probabilistic gating on the input: small negative values ​​are not completely set to zero, but are scaled by probability.

[0255] Theoretical basis: Maintaining smoothness in gradient propagation is conducive to learning complex patterns in high-dimensional continuous feature spaces.

[0256] Advantages in the "wavelet + informer" model: The features generated by wavelet decomposition may contain small but important fluctuation information (especially high-frequency components). ReLU will lose this subtle information, while GELU retains it, which is conducive to the utilization of high-frequency information.

[0257] Finally, the high-dimensional representation of the decoder's final output is mapped to the target dimension through a linear layer to generate prediction results for future time steps.

[0258] Final Output Mapped to the target dimension through a linear layer , and get the predicted value: ,in is the sequence length of the decoder, is the embedding dimension (feature dimension) of the model. and are the weight matrix and bias term of the output layer.

[0259] Step S40: performing multi-level wavelet decomposition on the data set according to the number of wavelet decomposition layers to obtain target high-frequency information and target low-frequency information.

[0260] It should be noted that the target high-frequency information includes a plurality of high-frequency subsequences, and the target low-frequency information includes a plurality of low-frequency subsequences.

[0261] It should be noted that due to the nonlinear, multi-periodic, and multi-scale oscillation characteristics of scenic area traffic, this embodiment performs wavelet decomposition on the data set to decompose the original time series into multiple subsequences with different frequency characteristics, thereby decomposing the original non-stationary time series from low frequency to high frequency layers. In this order reduction process, the trend information and disturbance information corresponding to the sequence are also obtained.

[0262] It should be noted that this embodiment can perform wavelet decomposition on the dataset from both the high-frequency branch and the low-frequency branch, thereby achieving multi-scale decomposition of the time series. The target high-frequency information can be short-term fluctuations in the corresponding time series (e.g., a sudden event causing a surge in tourist arrivals). The target low-frequency information can be long-term trends in the corresponding time series (e.g., seasonal growth).

[0263] For example, through wavelet decomposition, the prediction equipment can decompose the high-frequency feature sequence of short-term surges in tourist flow caused by severe weather such as heavy rain or scenic area activities from the tourist flow time series; and decompose the low-frequency feature sequence of slowly changing long-term tourist flow trends (such as the summer tourist peak season or seasonality, annual growth, etc.) from the tourist flow time series.

[0264] Step S50: inputting the target high-frequency information and the target low-frequency information into the first prediction model for prediction respectively, to obtain high-frequency prediction features and low-frequency prediction features.

[0265] In some embodiments, the prediction device decomposes high-frequency and low-frequency components based on a multi-level wavelet transform. Consequently, two informer models are constructed: one input for the high-frequency component to estimate future high-frequency changes, and one input for the low-frequency component to predict future low-frequency trends. This frequency-separation modeling improves the sophistication and accuracy of predictions, integrating flexible modeling structures with optimization strategies to ultimately achieve more accurate, stable, and efficient tourist attraction traffic forecasts.

[0266] For example, the original sequence is , perform 3-level wavelet decomposition and get , respectively and Input into two Informer models for low-frequency prediction and high-frequency prediction respectively.

[0267] Step S60: Inputting the high-frequency prediction features and the low-frequency prediction features into a second prediction model for prediction to obtain a flow prediction result of the target scenic spot.

[0268] It should be noted that the traffic prediction result includes the number of tourists within the prediction time step. The second prediction model is constructed based on the BiLSTM module. The second prediction model is used to perform multi-scale feature fusion on the high-frequency prediction features and the low-frequency prediction features, and perform traffic prediction based on the multi-scale feature fusion results.

[0269] It can be understood that this embodiment uses a combination of multi-layer wavelet decomposition and deep time series neural network Informer to improve the accuracy of multi-scale scenic spot traffic time series modeling and prediction, and utilizes the dual-path feature extraction structure and attention mechanism of the network structure to capture the trend characteristics of long- and short-cycle fluctuations in scenic spot passenger flow data. The prediction results are highly accurate and have strong generalization capabilities. The second prediction model performs multi-scale feature fusion of high-frequency prediction features and low-frequency prediction features, and traffic prediction is performed based on the fused features to optimize the Informer prediction results, thereby further extracting contextual features in the time series and realizing accurate prediction of scenic spot personnel flow.

[0270] In some embodiments, reference Figure 3 , Figure 3 This is a flow chart of scenic spot traffic prediction. The prediction device preprocesses the original time series of the target scenic spot, solves the whale optimization algorithm, obtains wavelet decomposition parameters and model hyperparameters, and decomposes the preprocessed original time series into high-frequency components and low-frequency components based on the wavelet decomposition parameters. The low-frequency component and high-frequency component are predicted by the first prediction model as low-frequency branches and high-frequency branches respectively. The prediction results of the first prediction model are then input into the second prediction model for prediction, thereby optimizing the prediction results of the first prediction model and further capturing the contextual information and potential features in the time series, thereby improving the accuracy of scenic spot traffic prediction.

[0271] Furthermore, in order to effectively optimize the prediction results of the first prediction model and thus improve the accuracy of the scenic spot traffic prediction results, in one embodiment, the second prediction model includes a multi-scale feature fusion module, a BiLSTM encoder, a multi-head attention module, a BiLSTM decoder and a linear layer;

[0272] The multi-scale feature fusion module is used to perform multi-scale feature fusion on the high-frequency prediction feature and the low-frequency prediction feature to generate a fused prediction feature;

[0273] The BiLSTM encoder is used to perform bidirectional traversal encoding on the fused prediction features, extract the forward temporal hidden state and the reverse temporal hidden state, and concatenate the forward temporal hidden state and the reverse temporal hidden state of each time step to obtain bidirectional temporal feature information;

[0274] The multi-head attention module is used to perform context modeling on the bidirectional temporal feature information and obtain a multi-head attention output result;

[0275] The multi-head attention module is further used to perform feature splicing on the multi-head attention output results to obtain a target attention output result, copy the attention output result of the last time step in the target attention output result based on the traffic prediction step number of the target scenic spot, and output a global context feature;

[0276] The BiLSTM decoder is used to perform temporal dependency analysis based on the global context features to obtain the hidden state of each time step, and integrate the hidden state of each time step into an initial prediction result;

[0277] The linear layer is used to integrate the hidden states of each time step into an initial prediction result, perform linear mapping on the initial prediction result, and output the traffic prediction result of the target scenic spot.

[0278] It should be noted that this embodiment uses the frequency domain features obtained after multi-level wavelet decomposition to add to the LIGHTTS model, and uses bidirectional LSTM as the model skeleton in the LIGHTTS model to improve the model's ability to model the before and after information of time series. In the LIGHTTS structure, there are mainly the following modules: input layer splicing features, entering the encoder (BiLSTM), multi-head attention mechanism (self-attention), entering the decoder (BiLSTM) and prediction; LIGHTTS can realize multi-scale frequency domain feature fusion.

[0279] The low-frequency and high-frequency predictions are spliced ​​and fused separately:

[0280]

[0281] in, represents the fusion prediction feature, represents low-frequency prediction features, Represents high-frequency prediction features.

[0282] enter To the bidirectional LSTM encoder to obtain the forward and reverse hidden states respectively:

[0283]

[0284]

[0285] Then splice:

[0286]

[0287]

[0288] in, Represents the time step Forward timing hidden state, Represents the time step Reverse timing hidden state, represents the forward LSTM encoding, represents the reverse LSTM encoding, Represents the time step The fusion prediction features of Represents the time step The forward sequential hidden state of Represents the time step The reverse timing hidden state, Represents the time step The bidirectional temporal hidden state of Represents bidirectional time series feature information, represents the hidden state dimension, represents the set of real numbers.

[0289] Feature concatenation:

[0290] Assuming the low frequency component , high frequency component , then after concatenating the corresponding time steps (feature-wiseconcat), we get:

[0291]

[0292] This operation does not perform a learnable transformation, but only expands the channel dimension; subsequent wiring transformations Project the concatenated dimensions to the hidden dimensions required by the model .

[0293] Usage: Splicing preserves the local information of the two frequency bands, making it easier for subsequent networks (such as LSTM / Transformer) to learn cross-band interactions internally.

[0294] The forward LSTM and backward LSTM outputs are:

[0295]

[0296] (Note the reverse order of subscripts and dependency directions) and then concatenate:

[0297]

[0298] Derivation and explanation: The standard LSTM single-step update (forward) has the form:

[0299]

[0300]

[0301]

[0302]

[0303]

[0304]

[0305] Bidirectional LSTM runs LSTM once in both forward and reverse order to obtain two hidden vectors , After splicing, each time step represents the temporal semantics of "from the past" and "from the future" (which is conducive to capturing short-term local patterns and relative position relationships). Usage description: When the input is the spliced ​​low / high frequency wavelet output (or directly the original multi-scale features), BiLSTM can aggregate the multi-scale context of each time point in the time dimension to obtain an enhanced local temporal representation. .

[0306] Secondly, the encoder output is calculated using multi-head attention (ScaledDot-ProductAttention) for context modeling:

[0307]

[0308] in, They represent the query matrix, key matrix and value matrix obtained by linear transformation of bidirectional temporal feature information, represents the transpose of the key matrix, Used for calculation and The similarity matrix of represents the scaling factor, Represents the multi-head attention output result, It is used to normalize the similarity matrix to obtain the attention weight, wherein the normalization includes row normalization.

[0309] Multi-head attention: Divide The model learns different types of correlations (short-term / long-term, periodic / mutation, etc.) in different subspaces by paying attention to the subspaces in parallel and finally concatenating and linearly projecting them.

[0310] In the multi-head attention formula, if The dimension is , then the inner product The variance of Increases linearly (if the components are approximately independent and the variance is constant). This will cause the absolute value of the softmax input value to become larger, making the gradient or output extreme (softmax becomes a very sharp probability distribution), which is not conducive to training. Divided by Scaling can normalize the variance of the inner product to a constant scale, thereby stabilizing training.

[0311] In the multi-head attention formula, softmax is multiplied by Perform linear combination to produce a weighted value for each query. The attention mechanism allows the model to model global dependencies (any steps in the sequence can interact with each other).

[0312] After multi-head splicing, output global context features:

[0313]

[0314] Then copy the last time step of the attention output P times as the decoder input:

[0315]

[0316] in, represents the target attention output result, Represents the attention head The output result is, Represents the output linear transformation matrix, which is used to map the concatenated attention output results to the target dimension. represents the global context feature, Represents the last time step in the target attention output The attention output result is Indicates the number of flow prediction steps.

[0317] Finally input to BILSTM:

[0318]

[0319] in, Represents the time step The hidden state of Represents a BiLSTM decoder.

[0320] The final prediction result is output through a linear mapping layer:

[0321]

[0322]

[0323] in, Indicates the traffic prediction result. represents the output linear transformation matrix, represents the bias term, It is the hidden state sequence output by the BiLSTM decoder, which is used to capture temporal dependencies and generate preliminary prediction results of scenic spot traffic, indicating the initial prediction results.

[0324] This embodiment obtains a flow time series from the historical tourist flow data of the target scenic spot, and pre-processes the flow time series to generate a data set, wherein the historical tourist flow data includes information on the number of tourists at multiple time nodes, initializes the whale optimization algorithm, and solves the initialized whale optimization algorithm based on the data set to obtain algorithm result parameters, wherein the algorithm result parameters include the number of wavelet decomposition layers, regularization parameters and prediction model hyperparameters, constructs a first prediction model based on the prediction model hyperparameters and the regularization parameters, performs multi-level wavelet decomposition on the data set according to the number of wavelet decomposition layers, obtains target high-frequency information and target low-frequency information, wherein the target high-frequency information includes multiple high-frequency subsequences and the target low-frequency information includes multiple low-frequency subsequences. sequence, input the target high-frequency information and the target low-frequency information into the first prediction model for prediction respectively, obtain high-frequency prediction features and low-frequency prediction features, input the high-frequency prediction features and the low-frequency prediction features into the second prediction model for prediction, and obtain the flow prediction result of the target scenic spot; because the present invention decomposes the flow time series into multiple frequency bands through multi-level wavelet decomposition, it realizes multi-scale analysis of the complex scenic spot flow time series, improves the accuracy and efficiency of flow prediction through the frequency division prediction of the first prediction model, realizes accurate analysis of the long-term trend and short-term fluctuation of the scenic spot flow, and performs multi-scale fusion and prediction through the second prediction model, thereby further extracting context features, effectively optimizing the prediction results, and realizing accurate prediction of the scenic spot personnel flow.

[0325] refer to Figure 4 , Figure 4 2 is a flow chart of a second embodiment of a method for predicting flow rates of scenic spots according to the present invention.

[0326] Based on the above embodiment, in this embodiment, step S40 further includes:

[0327] Furthermore, in order to accurately decompose the original time series into multiple subsequences with different frequency characteristics, thereby extracting features of different scales and frequencies, the above step S40 may include:

[0328] Step S401: performing wavelet decomposition on the data set according to the wavelet decomposition layer number to extract original low-frequency information and original high-frequency information.

[0329] It should be noted that for one-dimensional discrete signals, wavelet decomposition uses a low-pass filter, which is a scaling function, and a high-pass filter, which is a wavelet function. Unlike traditional discrete wavelet transforms, in the process of constructing features in this embodiment, a downsampling strategy is not used. Instead, the decomposed frequency components are retained and reconstructed in proportion. The low-frequency branch retains all low-frequency coefficients and weights the high-frequency coefficients of each scale with a weight of 30%. The high-frequency branch retains all high-frequency coefficients and extracts 10% of the features from the low frequency as a supplement. This improves the model's ability to utilize multi-scale information while retaining more time-frequency details. Finally, the approximate coefficients of the previous level are decomposed again with wavelet decomposition to generate new approximate coefficients and detail coefficients. By analogy, the final result is: ,in, Represents low-frequency information, Represents high-frequency information, Indicates the number of wavelet decomposition levels.

[0330] Step S402: extracting high-frequency supplementary features of a high-frequency feature extraction ratio from the original high-frequency information, and concatenating the high-frequency supplementary features with the original low-frequency information to generate target low-frequency information.

[0331] It should be noted that the prediction device retains all the original low-frequency information and extracts 30% of the high-frequency supplementary features from the original high-frequency information obtained by wavelet decomposition. The target low-frequency information is generated based on the low-frequency information and the 30% high-frequency supplementary features, referring to the following formula:

[0332]

[0333] in, Represents the target low-frequency information, Represents the original low-frequency information, represents the original high-frequency information, Indicates the ratio of high-frequency feature extraction.

[0334] It can be understood that this embodiment fuses the original low-frequency information with part of the high-frequency information, thereby retaining the short-term fluctuation details in the target low-frequency information. This is because the high-frequency features contain short-term fluctuations (such as sudden passenger flow), and merging them into the low-frequency information allows the target low-frequency information to contain both long-term trends and retain key details of short-term changes, thereby enhancing the dynamics of the low-frequency information, avoiding the loss of short-term fluctuation information due to excessive smoothing of the target low-frequency information, and improving the model's sensitivity to short-term traffic changes.

[0335] Step S403: extracting low-frequency supplementary features of a low-frequency feature extraction ratio from the original low-frequency information, and concatenating the low-frequency supplementary features with the original high-frequency information to generate target high-frequency information.

[0336] It should be noted that the prediction device retains all original high-frequency information and extracts 10% of the low-frequency supplementary features from the original low-frequency information obtained by wavelet decomposition. The target high-frequency information is generated based on all the original high-frequency information and 10% of the low-frequency supplementary features, referring to the following formula:

[0337]

[0338] in, Represents the target high-frequency information, Indicates the ratio of low-frequency feature extraction.

[0339] It can be understood that this embodiment fuses the original high-frequency information with part of the low-frequency information to supplement the target high-frequency information with long-term trend information: low-frequency features represent long-term trends (such as seasonal passenger flow), and they are merged into the high-frequency information so that the target high-frequency information retains short-term fluctuations while having the guidance of long-term patterns and reducing high-frequency noise interference. This is because by introducing a small amount of low-frequency features, the noise in the high-frequency information can be suppressed and the stability of the high-frequency information can be improved.

[0340] This embodiment extracts high-frequency supplementary features of the high-frequency feature extraction ratio from the original high-frequency information, splices the high-frequency supplementary features with the original low-frequency information to generate target low-frequency information, extracts low-frequency supplementary features of the low-frequency feature extraction ratio from the original low-frequency information, and splices the low-frequency supplementary features with the original high-frequency information to generate target high-frequency information, thereby integrating the target low-frequency information with short-term fluctuation details and the target high-frequency information with long-term trends, ensuring that the prediction model can simultaneously capture short-term changes and long-term rules, accurately supplementing the short-term fluctuations and long-term trends in the scenic spot traffic time series, and effectively reducing noise and overfitting risks. The high-frequency information is combined with the low-frequency features to suppress noise, and the low-frequency information is combined with the high-frequency features to supplement details, thereby achieving the dual effects of denoising and information enhancement.

[0341] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a scenic spot traffic prediction program is stored. When the scenic spot traffic prediction program is executed by a processor, the steps of the scenic spot traffic prediction method described above are implemented.

[0342] The computer-readable storage medium provided herein may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores 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.

[0343] The computer-readable storage medium may be included in the scenic spot flow prediction device; or may exist independently without being incorporated into the scenic spot flow prediction device.

[0344] In addition, an embodiment of the present invention further provides a computer program product, including a scenic spot traffic prediction program, which implements the steps of the scenic spot traffic prediction method described above when executed by a processor.

[0345] The specific implementation of the computer program product of the present invention is basically the same as the embodiments of the above-mentioned scenic spot traffic prediction method, and will not be repeated here.

[0346] Reference Figure 5 , Figure 5 This is a structural block diagram of the first embodiment of the scenic spot traffic prediction device of the present invention.

[0347] like Figure 5 As shown, the scenic spot flow prediction device proposed in the embodiment of the present invention is applied to the scenic spot tourist flow prediction, and the device includes:

[0348] The data processing module 10 is used to obtain a flow time series from the historical tourist flow data of the target scenic spot, and pre-process the flow time series to generate a data set, wherein the historical tourist flow data includes information on the number of tourists at multiple time nodes;

[0349] The whale optimization module 20 is used to initialize the whale optimization algorithm and solve the initialized whale optimization algorithm based on the data set to obtain algorithm result parameters, wherein the algorithm result parameters include the number of wavelet decomposition layers, regularization parameters, and prediction model hyperparameters;

[0350] A model building module 30 is configured to build a first prediction model based on the prediction model hyperparameters and the regularization parameters, wherein the first prediction model is an informer model;

[0351] A wavelet decomposition module 40 is configured to perform multi-level wavelet decomposition on the data set according to the wavelet decomposition layer number to obtain target high-frequency information and target low-frequency information, wherein the target high-frequency information includes a plurality of high-frequency subsequences and the target low-frequency information includes a plurality of low-frequency subsequences;

[0352] A first prediction module 50 is configured to input the target high-frequency information and the target low-frequency information into the first prediction model for prediction, thereby obtaining a high-frequency prediction feature and a low-frequency prediction feature.

[0353] The second prediction module 60 is used to input the high-frequency prediction features and the low-frequency prediction features into the second prediction model for prediction to obtain the traffic prediction result of the target scenic spot, and the traffic prediction result includes the number of tourists within the prediction time step. The second prediction model is constructed based on the BiLSTM module. The second prediction model is used to perform multi-scale feature fusion on the high-frequency prediction features and the low-frequency prediction features, and perform traffic prediction based on the multi-scale feature fusion result.

[0354] This embodiment obtains a flow time series from the historical tourist flow data of the target scenic spot, and pre-processes the flow time series to generate a data set, wherein the historical tourist flow data includes information on the number of tourists at multiple time nodes, initializes the whale optimization algorithm, and solves the initialized whale optimization algorithm based on the data set to obtain algorithm result parameters, wherein the algorithm result parameters include the number of wavelet decomposition layers, regularization parameters and prediction model hyperparameters, constructs a first prediction model based on the prediction model hyperparameters and the regularization parameters, performs multi-level wavelet decomposition on the data set according to the number of wavelet decomposition layers, obtains target high-frequency information and target low-frequency information, wherein the target high-frequency information includes multiple high-frequency subsequences and the target low-frequency information includes multiple low-frequency subsequences. sequence, input the target high-frequency information and the target low-frequency information into the first prediction model for prediction respectively, obtain high-frequency prediction features and low-frequency prediction features, input the high-frequency prediction features and the low-frequency prediction features into the second prediction model for prediction, and obtain the flow prediction result of the target scenic spot; because the present invention decomposes the flow time series into multiple frequency bands through multi-level wavelet decomposition, it realizes multi-scale analysis of the complex scenic spot flow time series, improves the accuracy and efficiency of flow prediction through the frequency division prediction of the first prediction model, realizes accurate analysis of the long-term trend and short-term fluctuation of the scenic spot flow, and performs multi-scale fusion and prediction through the second prediction model, thereby further extracting context features, effectively optimizing the prediction results, and realizing accurate prediction of the scenic spot personnel flow.

[0355] The scenic spot flow prediction device provided in this application utilizes the scenic spot flow prediction method described in the aforementioned embodiments to address the technical challenges of scenic spot flow prediction. Compared to the prior art, the scenic spot flow prediction device provided in this application achieves the same beneficial effects as the scenic spot flow prediction method described in the aforementioned embodiments. Other technical features of the scenic spot flow prediction device are the same as those disclosed in the aforementioned embodiments and are not further elaborated here.

[0356] It should be understood that the above is only an example and does not constitute any limitation to 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 limitation on this.

[0357] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of it according to actual needs to achieve the purpose of the embodiment scheme, and no limitation is made here.

[0358] In addition, for technical details not fully described in this embodiment, please refer to the scenic spot traffic prediction method provided in any embodiment of the present invention, and will not be repeated here.

[0359] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0360] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0361] Through the above description of the embodiments, those skilled in the art will clearly understand that the above-mentioned embodiments and methods can be implemented by means of software plus the necessary general-purpose hardware platform. Of course, hardware can also be used, but in many cases the former is a more preferred embodiment. Based on this understanding, the technical solution of the present invention, or the portion 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, a magnetic disk, or an optical disk) and includes a number of instructions for enabling a terminal device (which can 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.

[0362] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for predicting traffic flow at a scenic spot, characterized in that: The method is applied to tourist flow prediction of scenic spots, and the method for predicting tourist flow of scenic spots includes: Obtaining a traffic time series from historical tourist traffic data of a target attraction, and preprocessing the traffic time series to generate a data set, wherein the historical tourist traffic data includes information on the number of tourists at multiple time nodes; Initializing a whale optimization algorithm, and solving the initialized whale optimization algorithm based on the data set to obtain algorithm result parameters, wherein the algorithm result parameters include the number of wavelet decomposition layers, regularization parameters, and prediction model hyperparameters; Constructing a first prediction model based on the prediction model hyperparameters and the regularization parameters, where the first prediction model is an Informer model; Performing multi-level wavelet decomposition on the data set according to the wavelet decomposition layer number to obtain target high-frequency information and target low-frequency information, wherein the target high-frequency information includes multiple high-frequency subsequences and the target low-frequency information includes multiple low-frequency subsequences; Inputting the target high-frequency information and the target low-frequency information into the first prediction model for prediction respectively to obtain high-frequency prediction features and low-frequency prediction features; Inputting the high-frequency prediction features and the low-frequency prediction features into a second prediction model for prediction to obtain a flow prediction result for the target scenic spot, wherein the flow prediction result includes the number of tourists within a prediction time step, wherein the second prediction model is constructed based on a BiLSTM module, and is used to perform multi-scale feature fusion on the high-frequency prediction features and the low-frequency prediction features, and perform flow prediction based on the multi-scale feature fusion result; The step of performing multi-level wavelet decomposition on the data set according to the wavelet decomposition layer number to obtain target high-frequency information and target low-frequency information includes: Performing wavelet decomposition on the data set according to the wavelet decomposition layer number to extract original low-frequency information and original high-frequency information; Extract high-frequency supplementary features of the high-frequency feature extraction ratio from the original high-frequency information, and concatenate the high-frequency supplementary features with the original low-frequency information to generate target low-frequency information: in, Represents the target low-frequency information, Represents the original low-frequency information, represents the original high-frequency information, Indicates the ratio of high-frequency feature extraction; Extract low-frequency supplementary features of the low-frequency feature extraction ratio from the original low-frequency information, and concatenate the low-frequency supplementary features with the original high-frequency information to generate target high-frequency information: in, Represents the target high-frequency information, Indicates the ratio of low-frequency feature extraction.

2. The method for predicting scenic spot traffic flow according to claim 1, wherein: The data set includes a training set, a test set and a validation set; The method of obtaining a traffic time series from the historical tourist traffic data of the target scenic spot and preprocessing the traffic time series to generate a data set includes: Obtain the traffic time series from the historical tourist traffic data of the target scenic spot and perform normalization on the traffic time series: in, represents the normalized data points, represents the original data points in the traffic time series, represents the data mean of the traffic time series, Represents the standard deviation of the flow time series data; The total number of windows is determined based on the sequence length of the traffic time series and the forecast time step: in, Indicates the total number of windows, represents the sequence length, Indicates the window length, represents the prediction time step; The normalized traffic time series is divided into sliding windows according to the total number of windows to obtain multiple continuous subsequences; Perform time feature encoding on each subsequence to generate encoding feature data; Based on the time order of the traffic time series, the coded feature data is divided into a training set, a test set and a validation set. The training set is used to train the first prediction model and the second prediction model, the test set is used to test the first prediction model and the second prediction model, and the validation set is used to verify the prediction results of the first prediction model and the second prediction model.

3. The method for predicting scenic spot traffic flow according to claim 2, wherein: Initializing the whale optimization algorithm, and solving the initialized whale optimization algorithm based on the data set to obtain algorithm result parameters, including: Determining initialization parameters based on the predicted time step of the target scenic spot, wherein the initialization parameters include the number of whale individuals and the iteration number threshold; Initializing the whale optimization algorithm according to the initialization parameters; Iteratively update the current position of each whale based on the search expansion coefficient: in, Indicates the position difference, Indicates the current location, Indicates the location of the current optimal solution, represents the coefficient vector for adjusting the search range, Indicates the updated current position, represents the shrinkage and expansion coefficient that controls the search range, represents the control factor, represents a random number, represents the randomly selected individual position, Used to control the shape and size of the spiral trajectory, is a constant used to control the tightness of the spiral trajectory. is a random number used to generate different spiral trajectories. Direction used to generate spiral trajectories; When the current iterative update number reaches the iteration number threshold, the target individual is screened out from the whale individuals, and the updated current position of the target individual is output as the algorithm result parameter.

4. The method for predicting scenic spot traffic flow according to claim 3, wherein: The first prediction model includes a low-frequency prediction model and a high-frequency prediction model, each of which is composed of a multi-layer embedding module, a probabilistic sparse attention module, an encoder, and a decoder; The high-frequency prediction model is used to make predictions based on the target high-frequency information and output high-frequency prediction features; The low-frequency prediction model is used to make predictions based on target low-frequency information and output low-frequency prediction features; The multi-layer embedding module is used to perform linear projection on the target high-frequency information and / or the target low-frequency information, and embed the linear projection result into a vector representation to obtain the target embedding vector: in, represents a numerical embedding vector, represents the position embedding vector, represents the time embedding vector, represents the target embedding vector; The probabilistic sparse attention module is used to linearly transform the target embedding vector into a query vector and calculate the information entropy of each query vector: in, Represents the query vector The information entropy function, represents the vector dimension, represents the bond matrix, represents transpose, represents the scaling factor, Represents the Kullback-Leibler divergence, which is used to measure The difference between the distribution and the benchmark distribution, As a benchmark distribution, Represents the normalization function, which is used to convert the dot product result Convert to probability distribution; The probabilistic sparse attention module is further configured to screen the query vector based on the information entropy to generate a key query vector set, and perform sparse attention analysis based on the key query vector set to obtain a sparse attention result. The key query vector set includes multiple key query vectors. The sparse attention result is calculated according to the following formula: in, represents the sparse attention result, represent the query matrix, key matrix and value matrix respectively, represents the key query vector, Represents a set of key query vectors; The encoder is used to perform feature concatenation on the sparse attention results of multiple attention heads in the probabilistic sparse attention module and perform linear transformation to obtain the multi-head attention output result: in, Indicates the The sparse attention results of attention heads, represents the linear transformation matrix, Represents the output of multi-head attention; The decoder is used to convert the output result of the encoder into a key vector and a value vector, and perform cross attention analysis based on the historical traffic time series, the key vector and the value vector to obtain a cross attention result. The cross attention result is calculated according to the following formula: in, represents the cross attention result, and Represent the key vector and value vector converted based on the encoder output results, respectively. represents the query vector based on the transformation of historical traffic time series, represents the scaling factor; The decoder is also used to input the cross-attention result into a feedforward neural network module for nonlinear modeling, and linearly map the output result of the feedforward neural network module to output high-frequency prediction features and / or low-frequency prediction features. The feedforward neural network module includes two linear transformation layers and a nonlinear activation function.

5. The method for predicting scenic spot traffic flow according to claim 4, characterized in that: The second prediction model includes a multi-scale feature fusion module, a BiLSTM encoder, a multi-head attention module, a BiLSTM decoder and a linear layer; The multi-scale feature fusion module is used to perform multi-scale feature fusion on the high-frequency prediction features and the low-frequency prediction features to generate fused prediction features: in, represents the fusion prediction feature, represents low-frequency prediction features, Represents high-frequency prediction features; The BiLSTM encoder is used to perform bidirectional traversal encoding on the fused prediction features, extract the forward temporal hidden state and the reverse temporal hidden state, and concatenate the forward temporal hidden state and the reverse temporal hidden state of each time step to obtain bidirectional temporal feature information: in, Represents the time step Forward timing hidden state, Represents the time step Reverse timing hidden state, represents the forward LSTM encoding, represents the reverse LSTM encoding, Represents the time step The fusion prediction features of Represents the time step The forward sequential hidden state of Represents the time step The reverse timing hidden state, Represents the time step The bidirectional temporal hidden state of Represents bidirectional time series feature information, represents the hidden state dimension, represents the set of real numbers; The multi-head attention module is used to perform context modeling on the bidirectional temporal feature information and obtain the multi-head attention output result: in, They represent the query matrix, key matrix and value matrix obtained by linear transformation of bidirectional temporal feature information, represents the transpose of the key matrix, Used for calculation and The similarity matrix of represents the scaling factor, Represents the multi-head attention output result, Used to normalize the similarity matrix to obtain attention weights, wherein the normalization includes row normalization; The multi-head attention module is further used to perform feature splicing on the multi-head attention output results to obtain a target attention output result, copy the attention output result of the last time step in the target attention output result based on the traffic prediction step number of the target scenic spot, and output the global context feature: in, represents the target attention output result, Represents the attention head The output result is, Represents the output linear transformation matrix, which is used to map the concatenated attention output results to the target dimension. represents the global context feature, Represents the last time step in the target attention output The attention output result is Indicates the number of flow prediction steps; The BiLSTM decoder is used to perform temporal dependency analysis based on the global context features to obtain the hidden state of each time step: in, Represents the time step The hidden state of represents the BiLSTM decoder; The linear layer is used to integrate the hidden states of each time step into the initial prediction result, perform linear mapping on the initial prediction result, and output the traffic prediction result of the target scenic spot: in, Indicates the traffic prediction result. represents the output linear transformation matrix, represents the bias term, Represents the initial prediction result.

6. A device for predicting flow rate at a scenic spot, characterized in that: The device is applied to tourist flow prediction of scenic spots, and the scenic spot flow prediction device comprises: A data processing module is used to obtain a flow time series from the historical tourist flow data of the target scenic spot, and pre-process the flow time series to generate a data set, wherein the historical tourist flow data includes information on the number of tourists at multiple time nodes; A whale optimization module is used to initialize the whale optimization algorithm and solve the initialized whale optimization algorithm based on the data set to obtain algorithm result parameters, which include the number of wavelet decomposition layers, regularization parameters, and prediction model hyperparameters; A model construction module, configured to construct a first prediction model based on the prediction model hyperparameters and the regularization parameters, wherein the first prediction model is an informer model; A wavelet decomposition module, configured to perform multi-level wavelet decomposition on the data set according to the wavelet decomposition layer number to obtain target high-frequency information and target low-frequency information, wherein the target high-frequency information includes a plurality of high-frequency subsequences and the target low-frequency information includes a plurality of low-frequency subsequences; A first prediction module is configured to input the target high-frequency information and the target low-frequency information into the first prediction model for prediction, thereby obtaining a high-frequency prediction feature and a low-frequency prediction feature; a second prediction module, configured to input the high-frequency prediction features and the low-frequency prediction features into a second prediction model for prediction, and obtain a flow prediction result for the target scenic spot, wherein the flow prediction result includes the number of tourists within a prediction time step, and the second prediction model is constructed based on a BiLSTM module. The second prediction model is configured to perform multi-scale feature fusion on the high-frequency prediction features and the low-frequency prediction features, and perform flow prediction based on the multi-scale feature fusion result; The wavelet decomposition module is further configured to perform wavelet decomposition on the data set according to the wavelet decomposition layer number to extract original low-frequency information and original high-frequency information; extract high-frequency supplementary features of a high-frequency feature extraction ratio from the original high-frequency information, and concatenate the high-frequency supplementary features with the original low-frequency information to generate target low-frequency information: in, Represents the target low-frequency information, Represents the original low-frequency information, represents the original high-frequency information, Indicates the ratio of high-frequency feature extraction; Extract low-frequency supplementary features of the low-frequency feature extraction ratio from the original low-frequency information, and concatenate the low-frequency supplementary features with the original high-frequency information to generate target high-frequency information: in, Represents the target high-frequency information, Indicates the ratio of low-frequency feature extraction.

7. A device for predicting traffic flow at a scenic spot, characterized in that: The scenic spot traffic prediction device includes: a memory, a processor, and a scenic spot traffic prediction program stored in the memory, the processor is used to run the scenic spot traffic prediction program, and the scenic spot traffic prediction program is configured to implement the scenic spot traffic prediction method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a scenic spot traffic prediction program, and when the scenic spot traffic prediction program is executed by a processor, the scenic spot traffic prediction method according to any one of claims 1 to 5 is implemented.

9. A computer program product, characterized in that The computer program product includes a scenic spot traffic prediction program, which implements the steps of the scenic spot traffic prediction method according to any one of claims 1 to 5 when executed by a processor.

Citation Information

Patent Citations

  • Transition frame generation method and device, equipment and storage medium

    CN115131475A

  • Equipment operation trend prediction method based on ICEEMDAN secondary decomposition coupling informer model

    CN115438301A

Cited By

  • Scenic spot visitor quantity interval correction, prediction model training, prediction method and system

    CN122472288A