Tourist flow prediction and service optimization method and system for smart tourism
By constructing a hierarchical prediction architecture and dynamically adjusting and optimizing the objective function, the mismatch between tourist flow prediction and service resource allocation in existing technologies is solved, achieving efficient resource allocation and prediction accuracy, and improving the system's adaptability and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-09
- Publication Date
- 2026-03-31
AI Technical Summary
Existing tourist flow prediction methods fail to adapt to the service scheduling needs of different spatial units, resulting in a mismatch between prediction results and actual service demand, low resource allocation efficiency, and failure to effectively distinguish and handle the impact of service intervention measures, thus reducing the prediction accuracy and adaptability of the model.
Based on the scheduling flexibility of scenic area spatial units, a hierarchical prediction architecture is constructed to generate multi-granular tourist flow prediction results. Through uncertainty quantification and hierarchical service resource allocation schemes, the weight coefficients of the objective function are dynamically adjusted and optimized, and the prediction model is monitored and updated online in real time to separate the impact of service intervention events.
This approach achieves a match between the accuracy of tourist flow forecasting and actual demand, avoids resource waste, improves the system's adaptability and robustness, and forms a closed-loop feedback mechanism of forecasting-configuration-monitoring-updating.
Smart Images

Figure CN121480893B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to data processing technology, and more particularly to a method and system for predicting tourist flow and optimizing services for smart cultural tourism. Background Technology
[0002] With the booming development of the smart cultural tourism industry, the prediction of tourist flow and the optimization of service resource allocation in scenic spots have become key links in ensuring tourist experience and improving the operational efficiency of scenic spots.
[0003] Existing tourist flow prediction methods typically employ a uniform prediction granularity, failing to adapt to the service scheduling needs of different spatial units. This results in a mismatch between prediction results and actual service demands, leading to inefficient resource allocation. Furthermore, they fail to effectively distinguish and address the impact of service intervention measures, such as flow control and diversion, on natural tourist flow. Consequently, the prediction model training data is mixed with human intervention factors, reducing the model's prediction accuracy and adaptability, and making it difficult to support precise service optimization in dynamic and complex scenarios. Summary of the Invention
[0004] This invention provides a method and system for predicting tourist flow and optimizing services for smart cultural tourism, which can solve the problems in the prior art.
[0005] A first aspect of this invention provides a method for predicting tourist flow and optimizing services for smart cultural tourism, comprising:
[0006] Based on tourist flow data and service resource scheduling data of scenic area spatial units, the scheduling flexibility is calculated. According to the scheduling flexibility, the prediction granularity requirement of tourist flow for each spatial unit is determined and a hierarchical prediction architecture is constructed to generate multi-granularity tourist flow prediction results. The uncertainty of the prediction results is quantified to obtain the prediction confidence interval and uncertainty index.
[0007] Based on the uncertainty index, each spatial unit is divided into different confidence levels. Based on the prediction confidence interval, the range of tourist flow prediction fluctuation is determined, and the corresponding hierarchical service resource allocation scheme is determined.
[0008] Based on the hierarchical service resource allocation scheme, a service optimization objective function is constructed and optimized. The weight coefficients of the objective function are dynamically adjusted according to the predicted granularity of demand. The constraint conditions are determined by embedding the uncertainty index into the lower bound of the service resource capacity, thus obtaining the optimized scheme.
[0009] During the implementation of the optimized scheme, actual tourist flow is monitored and service intervention events are recorded. The flow data affected by service intervention events are separated from natural flow data and assigned different training weights. The hierarchical prediction architecture is then updated online.
[0010] The steps include: calculating scheduling flexibility based on tourist flow data and service resource scheduling data of scenic area spatial units; determining the prediction granularity requirement of tourist flow for each spatial unit based on the scheduling flexibility and constructing a hierarchical prediction architecture; generating multi-granularity tourist flow prediction results; and quantifying the uncertainty of the prediction results to obtain prediction confidence intervals and uncertainty indicators.
[0011] Based on the service resource scheduling data of scenic area spatial units, the dimensional index values are calculated from resource allocation response time, spatial accessibility and service capacity elasticity, and the scheduling flexibility of each spatial unit is obtained by weighted aggregation.
[0012] Based on the scheduling flexibility, the required granularity of tourist flow prediction for each spatial unit is determined. The prediction error tolerance is determined by establishing a positive correlation between scheduling flexibility and prediction error tolerance. The prediction error tolerance is then mapped to the prediction time granularity and prediction spatial granularity, both of which are positively correlated with the prediction error tolerance.
[0013] Based on the required prediction granularity, the scenic area spatial unit is divided into multiple prediction levels, and the different prediction levels are organized into a hierarchical prediction architecture according to the prediction granularity from coarse to fine.
[0014] The hierarchical prediction architecture is used to perform predictions on spatial units at each prediction level to obtain initial prediction results for each prediction level. Uncertainty quantification and inter-level collaborative optimization are then performed on the initial prediction results to obtain multi-granularity tourist flow prediction results, their prediction confidence intervals, and uncertainty indices.
[0015] The steps for quantifying the uncertainty of the forecast results to obtain the forecast confidence interval and uncertainty index include:
[0016] The initial prediction results are subjected to uncertainty quantification to obtain the initial prediction confidence interval and initial uncertainty index for each spatial unit;
[0017] For sets of coarse-grained and fine-grained spatial units with spatial inclusion relationships between prediction levels, inter-level uncertainty collaborative optimization is performed. The upper and lower bounds of the initial prediction confidence interval of the coarse-grained spatial units are used as the upper and lower bounds of the sum of predicted values of the set of fine-grained spatial units, and the initial prediction confidence interval of the fine-grained spatial units is adjusted accordingly. The aggregate value of the initial uncertainty index of the set of fine-grained spatial units is calculated, and the width of the initial prediction confidence interval of the coarse-grained spatial units is adjusted based on the aggregate value. The adjustment process is iteratively executed until the confidence interval of the adjusted sum of predicted values of the set of fine-grained spatial units intersects with the adjusted prediction confidence interval of the coarse-grained spatial units.
[0018] The uncertainty index of each spatial unit is updated based on the adjusted prediction confidence interval, and the prediction confidence interval and uncertainty index of each spatial unit are output.
[0019] The steps of dividing spatial units into different confidence levels based on the uncertainty index, determining the predicted fluctuation range of tourist flow based on the predicted confidence interval, and determining the corresponding hierarchical service resource allocation scheme include:
[0020] Based on the relationship between the uncertainty index of each spatial unit and the pre-set confidence level classification threshold, each spatial unit is divided into different confidence levels;
[0021] For each spatial unit, the predicted fluctuation range of tourist flow is calculated based on the difference between the upper and lower bounds of the predicted confidence interval.
[0022] The initial resource allocation redundancy coefficient is determined based on the confidence level of each spatial unit; the initial resource allocation redundancy coefficient is adjusted based on the predicted fluctuation range of the spatial unit to obtain the adjusted resource allocation redundancy coefficient.
[0023] The initial resource demand elasticity range is determined based on the predicted fluctuation range, and the initial resource demand elasticity range is corrected based on the confidence level of the spatial unit to obtain the corrected resource demand elasticity range.
[0024] Based on the predicted tourist flow of each spatial unit and the adjusted resource allocation redundancy coefficient, a resource allocation benchmark is obtained; the resource allocation benchmark and the corrected resource demand elasticity range are used to form a hierarchical service resource allocation scheme for each spatial unit.
[0025] Based on the aforementioned hierarchical service resource allocation scheme, a service optimization objective function is constructed and optimized. The weight coefficients of the objective function are dynamically adjusted according to the predicted granularity of demand. The constraints are determined by embedding the uncertainty index into the lower bound of the service resource capacity. The steps to obtain the optimized scheme include:
[0026] Extract the baseline resource allocation and elasticity range of resource demand for each spatial unit in the hierarchical service resource allocation scheme, and construct a service optimization objective function that includes service quality target items and resource cost target items;
[0027] Obtain the predicted granularity requirements of each spatial unit, establish a dynamic mapping rule between the predicted granularity requirements and the weight coefficients of the service optimization objective function, and determine the weight coefficients corresponding to the service quality objective item and the resource cost objective item according to the dynamic mapping rule.
[0028] Uncertainty indices are extracted for each spatial unit. Service resource capacity safety margin is calculated based on the uncertainty indices. The service resource capacity safety margin is superimposed on the resource configuration benchmark of each spatial unit to determine the lower bound of service resource capacity. The lower bound of service resource capacity is used as the lower bound of the constraint condition.
[0029] Substitute the weight coefficients of each item into the service optimization objective function, and optimize the service optimization objective function under the constraints to obtain the optimized scheme for each spatial unit.
[0030] The steps of separating traffic data affected by service intervention events from natural traffic data and assigning them different training weights, and then updating the hierarchical prediction architecture online, include:
[0031] During the implementation of the optimized scheme, actual tourist flow is monitored and service intervention events are recorded; based on the occurrence time and duration of the service intervention events, the actual tourist flow data is divided into flow data affected by service intervention and natural flow data; a mapping relationship between service intervention type and training weight decay factor is established, and based on the mapping relationship, the flow data affected by service intervention is assigned a decay-adjusted training weight, and the natural flow data is assigned a baseline training weight;
[0032] Construct an online training sample set containing the traffic data affected by service intervention and the natural traffic data, input the online training sample set into the hierarchical prediction architecture, and perform weighted gradient updates on the inter-layer collaborative parameters and multi-granularity prediction parameters in the hierarchical prediction architecture according to the training weights carried by each sample;
[0033] Verify the prediction error of the updated hierarchical prediction architecture, and complete the online update when the prediction error meets the convergence condition.
[0034] The steps for calculating the decay-adjusted training weights include:
[0035] The service intervention impact time window is determined based on the occurrence time and duration of the service intervention event. The actual tourist flow data within the impact time window is marked as the flow data affected by the service intervention, and the actual tourist flow data outside the impact time window is marked as the natural flow data.
[0036] Extract the service intervention type corresponding to the traffic data affected by the service intervention, and establish a mapping table between the service intervention type and the intervention type attenuation factor; for the traffic data affected by the service intervention, calculate the time interval between the time of the traffic data and the time of the service intervention, and establish a mapping relationship between the time interval and the weight recovery coefficient.
[0037] The attenuation-adjusted training weights are obtained by multiplying the intervention type attenuation factor, the weight recovery coefficient, and the baseline training weights.
[0038] A second aspect of this invention provides a tourist flow prediction and service optimization system for smart cultural tourism, comprising:
[0039] The prediction granularity adaptive module is used to calculate the scheduling flexibility based on tourist flow data and service resource scheduling data of scenic area spatial units, determine the prediction granularity requirement of tourist flow for each spatial unit according to the scheduling flexibility, construct a hierarchical prediction architecture, generate multi-granularity tourist flow prediction results, and quantify the uncertainty of the prediction results to obtain the prediction confidence interval and uncertainty index;
[0040] The hierarchical resource allocation module is used to divide each spatial unit into different confidence levels according to the uncertainty index, determine the predicted fluctuation range of tourist flow according to the predicted confidence interval, and determine the corresponding hierarchical service resource allocation scheme.
[0041] The service optimization solution module is used to construct a service optimization objective function based on the hierarchical service resource configuration scheme and perform optimization solution. The weight coefficients of the objective function are dynamically adjusted according to the predicted granularity requirements. The constraint conditions embed the uncertainty index into the lower bound of the service resource capacity to determine the optimized scheme.
[0042] The online update module is used to monitor actual tourist flow and record service intervention events during the execution of the optimized scheme, separate the flow data affected by service intervention events from the natural flow data and assign different training weights to them, and update the hierarchical prediction architecture online.
[0043] A third aspect of the present invention provides an electronic device, comprising:
[0044] processor;
[0045] Memory used to store processor-executable instructions;
[0046] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0047] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0048] This invention constructs a hierarchical prediction architecture based on the scheduling flexibility of scenic area spatial units, realizing multi-granularity prediction of tourist flow. This makes the prediction accuracy more aligned with actual needs, avoiding the resource waste or insufficient accuracy problems of traditional single-granularity prediction methods. By monitoring tourist flow in real time and updating it online during the execution of the optimization scheme, a closed-loop feedback mechanism of prediction-configuration-monitoring-update is formed, improving the overall adaptability and robustness. Attached Figure Description
[0049] Figure 1 This is a flowchart illustrating the tourist flow prediction and service optimization method for smart cultural tourism according to an embodiment of the present invention.
[0050] Figure 2 Flowchart of the hierarchical prediction architecture for service intervention data separation and online updates. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0052] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0053] Figure 1 This is a flowchart illustrating the tourist flow prediction and service optimization method for smart cultural tourism according to an embodiment of the present invention. Figure 1 As shown, the method includes:
[0054] Based on tourist flow data and service resource scheduling data of scenic area spatial units, the scheduling flexibility is calculated. According to the scheduling flexibility, the prediction granularity requirement of tourist flow for each spatial unit is determined and a hierarchical prediction architecture is constructed to generate multi-granularity tourist flow prediction results. The uncertainty of the prediction results is quantified to obtain the prediction confidence interval and uncertainty index.
[0055] Based on the uncertainty index, each spatial unit is divided into different confidence levels. Based on the prediction confidence interval, the range of tourist flow prediction fluctuation is determined, and the corresponding hierarchical service resource allocation scheme is determined.
[0056] Based on the hierarchical service resource allocation scheme, a service optimization objective function is constructed and optimized. The weight coefficients of the objective function are dynamically adjusted according to the predicted granularity of demand. The constraint conditions are determined by embedding the uncertainty index into the lower bound of the service resource capacity, thus obtaining the optimized scheme.
[0057] During the implementation of the optimized scheme, actual tourist flow is monitored and service intervention events are recorded. The flow data affected by service intervention events are separated from natural flow data and assigned different training weights. The hierarchical prediction architecture is then updated online.
[0058] In one optional implementation, the steps of calculating scheduling flexibility based on tourist flow data and service resource scheduling data of scenic area spatial units, determining the prediction granularity requirement of tourist flow for each spatial unit based on the scheduling flexibility and constructing a hierarchical prediction architecture, generating multi-granularity tourist flow prediction results, and quantifying the uncertainty of the prediction results to obtain prediction confidence intervals and uncertainty indicators include:
[0059] Based on the service resource scheduling data of scenic area spatial units, the dimensional index values are calculated from resource allocation response time, spatial accessibility and service capacity elasticity, and the scheduling flexibility of each spatial unit is obtained by weighted aggregation.
[0060] Based on the scheduling flexibility, the required granularity of tourist flow prediction for each spatial unit is determined. The prediction error tolerance is determined by establishing a positive correlation between scheduling flexibility and prediction error tolerance. The prediction error tolerance is then mapped to the prediction time granularity and prediction spatial granularity, both of which are positively correlated with the prediction error tolerance.
[0061] Based on the required prediction granularity, the scenic area spatial unit is divided into multiple prediction levels, and the different prediction levels are organized into a hierarchical prediction architecture according to the prediction granularity from coarse to fine.
[0062] The hierarchical prediction architecture is used to perform predictions on spatial units at each prediction level to obtain initial prediction results for each prediction level. Uncertainty quantification and inter-level collaborative optimization are then performed on the initial prediction results to obtain multi-granularity tourist flow prediction results, their prediction confidence intervals, and uncertainty indices.
[0063] For example, the division of scenic area spatial units can be achieved using existing GIS spatial analysis technology. Based on factors such as functional zoning, road network, and distribution of service facilities, the scenic area can be divided into several spatial units. For each spatial unit, the resource allocation response time reflects the time required for service resources within the unit to reach their actual location after a scheduling instruction is issued. This can be calculated using the average response time from historical scheduling records. Spatial accessibility = (road network density × 0.6 + average traffic speed × 0.4) / normalization factor; where road network density is the ratio of the total road length to the unit area, and average traffic speed can be obtained from historical GPS trajectory data. Service capacity elasticity = number of dynamically allocated resources / total number of service resources; for example, mobile food trucks and temporary service personnel are dynamically allocated resources, while fixed facilities such as toilets and fixed ticket booths cannot be dynamically allocated. Scheduling flexibility = w1 × (1 / resource allocation response time) + w2 × spatial accessibility + w3 × service capacity elasticity; where w1, w2, and w3 are weighting coefficients and satisfy w1 + w2 + w3 = 1. The weights can be adjusted according to the characteristics of the scenic area. For example, in large theme parks, more emphasis is placed on the flexibility of service capacity, and w3=0.5, w1=0.3, and w2=0.2 can be set, while in natural scenic areas, more emphasis is placed on spatial accessibility, and w2=0.5, w1=0.3, and w3=0.2 can be set.
[0064] Areas with high scheduling flexibility can respond to emergencies quickly by rapidly allocating resources, even with relatively low prediction accuracy; conversely, areas with low scheduling flexibility require more accurate predictions to avoid resource misallocation. Therefore, a positive correlation mapping function is established between scheduling flexibility and prediction error tolerance: Error Tolerance = α × Scheduling Flexibility + β; where α and β are parameters determined based on the actual conditions of the scenic area. For example, for a theme park, empirically determined α = 0.15 and β = 0.05, then when the scheduling flexibility of a certain area is 0.8, its prediction error tolerance = 0.15 × 0.8 + 0.05 = 0.17, meaning a 17% prediction error is allowed. Then, the prediction error tolerance is further mapped to specific prediction time and spatial granularities, both of which are positively correlated with the error tolerance. For example, for the main entrance area with high scheduling flexibility, a 30-minute time granularity prediction is used; while for the enclosed exhibition hall area with low scheduling flexibility, a more precise 5-minute prediction is required.
[0065] Based on the aforementioned prediction granularity requirements, the scenic area's spatial units are divided into multiple prediction levels. A typical hierarchical structure may include: a coarse-grained level, encompassing the entire scenic area or major functional zones, with a time granularity of hourly; a medium-grained level, including specific groups of attractions, with a time granularity of 30-minute; and a fine-grained level, including individual attractions or key nodes, with a time granularity of 5 to 10 minutes. These levels are organized into a hierarchical prediction architecture according to the prediction granularity from coarse to fine, forming logical connections between the levels.
[0066] When performing forecasts under the hierarchical forecasting architecture, historical tourist flow data is first preprocessed, including data cleaning to remove outliers and missing values; time alignment to unify timestamp formats; and normalization to convert data of different dimensions to the same scale. Then, forecasting methods are established for the spatial units of each forecasting level, and preliminary forecasts are performed.
[0067] For the coarse-grained level, historical tourist flow time-series data is extracted to analyze its periodic characteristics. Specifically, autocorrelation coefficients at different time scales, including daily, weekly, and monthly cycles, are calculated to identify significant periodic patterns. For example, if the flow patterns on weekdays and weekends are significantly different, the data is categorized by weekday and weekend; if there are seasonal differences between different months, monthly features are extracted. Based on the identified periodic characteristics, a time feature vector is constructed, including hour, weekday, month, and whether it is a holiday. The feature vector of historical time points is used as input, and the actual tourist flow at the corresponding time point is used as output to establish an input-output mapping relationship. This mapping relationship can be implemented using regression methods such as linear regression or multinomial regression, or time series methods such as moving average or exponential smoothing. During training, 80% of the historical data is selected as the training set and 20% as the validation set, and parameters are adjusted by minimizing the prediction error. The prediction error can be measured using mean squared error or mean absolute error. After training, for the time point to be predicted, its time feature vector is extracted and input into the established mapping relationship to obtain a preliminary prediction of the tourist flow at that time point.
[0068] For the medium-grained level, in addition to time features, the influence of external factors also needs to be considered. External factors include weather conditions such as temperature, precipitation, and wind speed; holiday types such as national statutory holidays and local festivals; and special events such as performances and celebrations. In practice, historical weather data is obtained from a meteorological data platform and aligned with tourist flow data by timestamp; holiday information is obtained from public calendar services and encoded as binary features (0 for non-holidays, 1 for holidays), or encoded as multi-class features to distinguish different holiday types; special event information is extracted from scenic area activity records and also encoded as feature vectors. Time features, weather features, holiday features, and event features are combined to form a comprehensive feature vector, which serves as input. A mapping relationship between the comprehensive feature vector and tourist flow is established, which can be achieved using methods such as multiple linear regression or neural networks. The training process is similar to that of the coarse-grained level, fitting the relationship between the feature vector and tourist flow using historical data. During prediction, various feature data for the time point to be predicted are obtained, and the established mapping relationship is input to obtain the predicted value.
[0069] For fine-grained predictions, short-term forecasts need to be made using real-time monitoring data. Real-time monitoring data includes actual visitor flow at the current moment and several previous moments, the number of people entering and exiting each entrance of the scenic area, and the number of vehicles in the parking lot. Specifically, a sliding window method is used to extract the visitor flow sequence from the most recent N time steps as the input sequence. The value of N is determined based on the time granularity; for example, for a 5-minute granularity, N can be 12, corresponding to the data from the past hour. A mapping relationship is established between the input sequence and the flow at the next time step. This can be achieved using an autoregressive method, where the current flow equals the weighted sum of the flows from the previous N moments plus an error term; or using a recurrent neural network structure that remembers historical information through hidden states. During training, historical data is divided into multiple sliding window samples, each containing the input sequence and the corresponding output value. Parameters are trained by minimizing the prediction error. During prediction, monitoring data from the most recent N time steps is acquired in real-time, and the established mapping relationship is used to obtain the predicted value for the next time step. Because fine-grained predictions have a short time span, this method can quickly capture short-term fluctuations in flow.
[0070] After the prediction methods for each prediction level are established, predictions are executed for each time point within the prediction period to obtain the initial prediction results for each spatial unit at each prediction level. The initial prediction results are organized in time series form, recording the predicted tourist flow value for each time point.
[0071] After obtaining the initial prediction results at each level, uncertainty quantification and inter-level collaborative optimization are performed. Uncertainty quantification includes: sampling the prediction method multiple times or generating a probability distribution of the predicted values based on the statistical characteristics of the prediction residuals, thereby calculating confidence intervals. For example, a 95% confidence interval means that the predicted value has a 95% probability of falling within that interval. Based on the dispersion of the predicted value distribution, uncertainty indices, such as standard deviation or coefficient of variation, are calculated; the larger the value, the higher the prediction uncertainty.
[0072] Inter-level collaborative optimization ensures consistency in the quantity of prediction results across all levels. Specifically, for sets of coarse-grained and fine-grained units with spatial inclusion relationships, the upper and lower bounds of the initial prediction confidence interval for the coarse-grained units are extracted as constraints, requiring the sum of the predicted values for the fine-grained unit set to fall within these intervals. Simultaneously, the aggregated uncertainty index of the fine-grained unit set is calculated, which can be obtained by weighted averaging of variances or standard deviations. If the aggregated value is significantly greater than the uncertainty index of the coarse-grained units, the confidence interval width of the coarse-grained units is increased; conversely, it is decreased. This process is iteratively adjusted between the prediction confidence intervals of the fine-grained units and the coarse-grained units until the confidence interval of the sum of the fine-grained unit predictions overlaps with that of the coarse-grained units.
[0073] Through the above steps, multi-granularity tourist flow forecasts covering different spatial units and time scales are obtained, along with forecast confidence intervals and uncertainty indicators. These results can be directly used for differentiated management decisions in scenic areas, such as pre-deploying more mobile resources in areas with low scheduling flexibility and high forecast uncertainty, while adopting demand-responsive resource allocation strategies in areas with high scheduling flexibility.
[0074] In one optional implementation, the step of quantifying the uncertainty of the prediction results to obtain the prediction confidence interval and uncertainty index includes:
[0075] The initial prediction results are subjected to uncertainty quantification to obtain the initial prediction confidence interval and initial uncertainty index for each spatial unit;
[0076] For sets of coarse-grained and fine-grained spatial units with spatial inclusion relationships between prediction levels, inter-level uncertainty collaborative optimization is performed. The upper and lower bounds of the initial prediction confidence interval of the coarse-grained spatial units are used as the upper and lower bounds of the sum of predicted values of the set of fine-grained spatial units, and the initial prediction confidence interval of the fine-grained spatial units is adjusted accordingly. The aggregate value of the initial uncertainty index of the set of fine-grained spatial units is calculated, and the width of the initial prediction confidence interval of the coarse-grained spatial units is adjusted based on the aggregate value. The adjustment process is iteratively executed until the confidence interval of the adjusted sum of predicted values of the set of fine-grained spatial units intersects with the adjusted prediction confidence interval of the coarse-grained spatial units.
[0077] The uncertainty index of each spatial unit is updated based on the adjusted prediction confidence interval, and the prediction confidence interval and uncertainty index of each spatial unit are output.
[0078] For example, the initial predicted flow sequence for each spatial unit within the prediction time period is extracted. For the predicted value at each time point, a probability distribution of the predicted value is generated based on the historical error distribution characteristics of the prediction method. Specifically, prediction residual samples of the prediction method are collected on the historical validation set. The residual is defined as the difference between the actual flow value and the predicted flow value. The mean and standard deviation of the residuals are calculated. Assuming that the residuals follow a normal distribution, the probability distribution of the current predicted value can be represented as a normal distribution centered on the predicted value and with the standard deviation of the historical residuals as the dispersion. Based on this probability distribution, a confidence interval with a 95% confidence level is calculated. The upper bound of the confidence interval is the predicted value plus 1.96 times the standard deviation of the historical residuals, and the lower bound is the predicted value minus 1.96 times the standard deviation of the historical residuals. The width of the confidence interval is the difference between the upper and lower bounds, reflecting the degree of uncertainty in the prediction. Dividing the width of the confidence interval by the predicted value yields a relative uncertainty index, which normalizes the degree of uncertainty at different flow levels, facilitating comparisons across spatial units. The above process is repeated for all prediction time points of each spatial unit to obtain the initial prediction confidence interval sequence and the initial uncertainty index sequence for that spatial unit. The initial uncertainty index can be further aggregated into a single value by averaging or taking the maximum value of the uncertainty index at each time point in the sequence.
[0079] This process identifies sets of coarse-grained and fine-grained spatial units that exhibit spatial inclusion relationships between prediction levels. Spatial inclusion refers to a coarse-grained spatial unit completely covering several fine-grained spatial units geographically; for example, a scenic area may cover multiple functional zones, and each functional zone may cover multiple individual attractions. For each coarse-grained unit with an inclusion relationship and its corresponding set of fine-grained units, the upper and lower bounds of the initial prediction confidence interval for the coarse-grained unit at a given time point are extracted. These upper and lower bounds serve as constraints on the sum of the predicted values of the fine-grained unit set at the same time point. The specific adjustment process involves calculating the sum of the initial predicted values of each unit in the fine-grained unit set at that time point. If this sum falls outside the initial prediction confidence interval of the coarse-grained unit, the prediction confidence interval of the fine-grained unit needs to be adjusted. The adjustment strategy employs a proportional allocation method. The proportion of each fine-grained unit's initial predicted value to the total sum is calculated, and the upper bound of the coarse-grained unit's confidence interval is allocated to each fine-grained unit according to this proportion as its adjusted upper bound. The lower bound is allocated similarly. The adjusted fine-grained cell predictions remain unchanged, but the upper and lower bounds of the confidence interval are shrunk or expanded to satisfy the summation constraint.
[0080] Extract the initial uncertainty index of each unit in the set, and obtain the aggregate value through weighted averaging or direct summation. For weighted averaging, the weights can be set as the proportion of each unit's initial predicted value to the total sum; for direct summation, it is assumed that the uncertainties of each unit are independently superimposed. Compare the aggregate value with the initial uncertainty index of the coarse-grained unit. If the aggregate value is significantly greater than the uncertainty index of the coarse-grained unit (e.g., the aggregate value exceeds 1.5 times the coarse-grained uncertainty index), then the overall uncertainty of the fine-grained prediction is considered higher than that of the coarse-grained prediction, and the initial prediction confidence interval width of the coarse-grained unit needs to be expanded. The expansion method is to proportionally increase the upper and lower bounds of the original confidence interval according to the ratio of the aggregate value to the coarse-grained uncertainty index, i.e., new upper bound = predicted value + (original upper bound offset × ratio), new lower bound = predicted value - (original lower bound offset × ratio). Conversely, if the aggregate value is significantly smaller than the coarse-grained uncertainty index (e.g., less than 0.7 times), then the confidence interval width of the coarse-grained unit is reduced, and the reduction ratio is also determined based on the ratio of the aggregate value to the coarse-grained uncertainty index.
[0081] After completing one round of fine-grained unit confidence interval adjustment and coarse-grained unit confidence interval width adjustment, the confidence interval of the sum of the predicted values of the fine-grained unit set is recalculated. The upper bound of the confidence interval of the sum of the predicted values of the fine-grained unit set is the sum of the upper bounds of the adjusted confidence intervals of each fine-grained unit, and the lower bound is the sum of the lower bounds of the adjusted confidence intervals of each fine-grained unit. It is then determined whether the sum confidence interval intersects with the adjusted prediction confidence intervals of the coarse-grained units. The condition for intersection is that the upper bound of the sum confidence interval is greater than or equal to the lower bound of the coarse-grained confidence interval, and the lower bound of the sum confidence interval is less than or equal to the upper bound of the coarse-grained confidence interval. If no intersection exists, the next round of adjustment continues, with the adjustment direction being to further shrink or expand the fine-grained unit confidence interval to approximate the coarse-grained constraints, while simultaneously fine-tuning the width of the coarse-grained unit confidence interval based on the new aggregate value. The iteration process sets a maximum number of iterations, for example, 10. If convergence is not achieved after reaching the maximum, a compromise is adopted, and the union of the confidence interval of the sum of the fine-grained unit set and the confidence interval of the coarse-grained unit set is used as the final adjustment result.
[0082] When updating the uncertainty index of each spatial unit based on the adjusted prediction confidence interval, the width of the adjusted confidence interval is recalculated and divided by the predicted value to obtain the updated relative uncertainty index. For coarse-grained spatial units, the updated uncertainty index reflects the impact of the aggregated uncertainty of the fine-grained units it contains; for fine-grained spatial units, the updated uncertainty index reflects the uncertainty level adjusted by coarse-grained constraints. The updated prediction confidence intervals and uncertainty indices are organized into structured data, with each spatial unit corresponding to a data record containing fields such as spatial unit identifier, prediction time point, predicted value, upper bound of the confidence interval, lower bound of the confidence interval, and uncertainty index.
[0083] This invention realizes the quantification and collaborative optimization of uncertainty in multi-level spatial prediction results, which not only ensures the consistency of prediction results at different levels, but also provides a quantitative measure of prediction uncertainty, providing an effective tool for risk assessment and decision support in spatial prediction applications.
[0084] In one optional implementation, the steps of dividing each spatial unit into different confidence levels according to the uncertainty index, determining the predicted fluctuation range of tourist flow according to the predicted confidence interval, and determining the corresponding hierarchical service resource allocation scheme include:
[0085] Based on the relationship between the uncertainty index of each spatial unit and the pre-set confidence level classification threshold, each spatial unit is divided into different confidence levels;
[0086] For each spatial unit, the predicted fluctuation range of tourist flow is calculated based on the difference between the upper and lower bounds of the predicted confidence interval.
[0087] The initial resource allocation redundancy coefficient is determined based on the confidence level of each spatial unit; the initial resource allocation redundancy coefficient is adjusted based on the predicted fluctuation range of the spatial unit to obtain the adjusted resource allocation redundancy coefficient.
[0088] The initial resource demand elasticity range is determined based on the predicted fluctuation range, and the initial resource demand elasticity range is corrected based on the confidence level of the spatial unit to obtain the corrected resource demand elasticity range.
[0089] Based on the predicted tourist flow of each spatial unit and the adjusted resource allocation redundancy coefficient, a resource allocation benchmark is obtained; the resource allocation benchmark and the corrected resource demand elasticity range are used to form a hierarchical service resource allocation scheme for each spatial unit.
[0090] For example, multiple confidence level thresholds are pre-defined to divide the range of uncertainty indicators into several intervals, each interval corresponding to a confidence level. The number of confidence level thresholds is determined based on the need for refined management. Two thresholds are set to divide spatial units into three levels: high confidence, medium confidence, and low confidence. The specific division rule is as follows: extract the uncertainty indicator value of a spatial unit and compare it with the preset first threshold. If the uncertainty indicator is less than the first threshold, it is classified as a high confidence level; if the uncertainty indicator is greater than or equal to the first threshold and less than the second threshold, it is classified as a medium confidence level; if the uncertainty indicator is greater than or equal to the second threshold, it is classified as a low confidence level. The values of the first and second thresholds are determined based on historical prediction accuracy statistics. For example, the first threshold can be set to 0.15, and the second threshold can be set to 0.30, indicating that spatial units with an uncertainty indicator less than 0.15 have higher prediction reliability, and spatial units with an uncertainty indicator greater than 0.30 have lower prediction reliability. The above comparison and division process is repeated for all spatial units within the scenic area, assigning each spatial unit to the corresponding confidence level and recording its confidence level identifier in the spatial unit attribute data.
[0091] Extract the upper and lower bounds of the prediction confidence interval for each spatial unit at a given prediction time point, and calculate the difference between them as the predicted fluctuation range for that time point. The upper and lower bounds of the prediction confidence interval are derived from the adjusted confidence intervals output by the uncertainty quantification and inter-level collaborative optimization process. The predicted fluctuation range reflects the magnitude of change in tourist traffic for that spatial unit at that time point; a larger value indicates more drastic traffic fluctuations. Repeating the above calculation for all prediction time points for that spatial unit yields a sequence of predicted fluctuation ranges. To facilitate subsequent resource allocation decisions, the maximum or average value of this sequence is typically taken as the representative predicted fluctuation range for that spatial unit. Taking the maximum value covers the most extreme fluctuation scenarios and is suitable for safety-first resource allocation strategies; taking the average value balances the overall level of fluctuation and is suitable for cost-optimized resource allocation strategies.
[0092] The confidence level of spatial units is used to query a preset confidence level and redundancy coefficient mapping table. This mapping table establishes a correspondence between confidence levels and initial resource allocation redundancy coefficients. The lower the confidence level, the higher the initial resource allocation redundancy coefficient, to compensate for the risk of resource demand deviation caused by forecast uncertainty. The mapping relationship is as follows: high confidence level corresponds to an initial resource allocation redundancy coefficient of 1.1, indicating that 10% redundant resources are configured based on the forecast flow; medium confidence level corresponds to an initial resource allocation redundancy coefficient of 1.2; and low confidence level corresponds to an initial resource allocation redundancy coefficient of 1.3. The ratio of the forecast fluctuation range to the forecast value is calculated as a volatility index, which is then compared with a preset volatility threshold. If the volatility index is greater than the volatility threshold, an adjustment amount is added to the initial resource allocation redundancy coefficient. The adjustment amount can be set as the volatility index minus the volatility threshold multiplied by an adjustment sensitivity coefficient. The adjustment sensitivity coefficient reflects the strength of the impact of volatility on redundancy demand, with a typical value range of 0.3 to 0.5. If the volatility index is less than or equal to the volatility threshold, the initial resource allocation redundancy coefficient remains unchanged. The adjusted resource configuration redundancy coefficient is obtained by adding the initial resource configuration redundancy coefficient to the adjustment amount. The upper limit of this coefficient can be set to 1.5 to avoid over-configuration.
[0093] The width of the elasticity interval is calculated based on the predicted fluctuation range of spatial units. The elasticity interval width reflects the reasonable fluctuation range of resource demand around the predicted value, and is calculated by multiplying the predicted fluctuation range by an elasticity coefficient. The elasticity coefficient is set according to the resource type's deployability; for resources that can be quickly deployed, such as temporary personnel, the elasticity coefficient can be set to 0.8, while for resources that are more difficult to deploy, such as fixed facilities, the elasticity coefficient can be set to 0.5. The upper bound of the initial resource demand elasticity interval = predicted value + (elasticity interval width ÷ 2), and the lower bound = predicted value - (elasticity interval width ÷ 2). For spatial units with low confidence levels, the elasticity interval width is expanded to cope with greater prediction deviations. This expansion is achieved by multiplying the initial elasticity interval width by a correction coefficient, which is greater than 1. For example, the correction coefficient is 1.3 for low confidence levels, 1.1 for medium confidence levels, and 1.0 (no correction) for high confidence levels. The upper bound of the corrected resource demand elasticity interval = predicted value + (corrected elasticity interval width ÷ 2), and the lower bound = predicted value - (corrected elasticity interval width ÷ 2).
[0094] The predicted tourist flow for each spatial unit within the predicted time period is extracted. This predicted value originates from the output of the prediction method executed at the prediction level of the spatial unit within the hierarchical prediction architecture; specifically, it is the adjusted predicted value obtained after inter-level collaborative optimization of the initial prediction result. The predicted tourist flow is multiplied by an adjusted resource allocation redundancy coefficient to obtain the resource allocation baseline quantity. The resource allocation baseline quantity represents the quantity of basic service resources that should be allocated at this predicted flow level. The unit is determined according to the resource type; for example, service personnel are measured in person, catering facilities in seats, and sanitation facilities in the number of available seats. The resource allocation baseline quantity is used as the core allocation quantity, and the upper and lower bounds of the adjusted resource demand elasticity interval are used as the allocation fluctuation range. These three together constitute the hierarchical service resource allocation scheme for this spatial unit. The configuration scheme data structure includes fields such as spatial unit identifier, prediction time point, confidence level, resource allocation baseline quantity, upper bound of the resource demand elasticity interval, and lower bound of the resource demand elasticity interval.
[0095] This method enables the rational allocation of tourism service resources based on the uncertainty of tourist flow forecasts, thereby avoiding resource waste, ensuring service quality, and improving the operational efficiency of scenic spots.
[0096] In one optional implementation, the steps of constructing a service optimization objective function based on the hierarchical service resource allocation scheme and optimizing it, wherein the weight coefficients of the objective function are dynamically adjusted according to the predicted granularity of demand, and the constraint conditions embed the uncertainty index into the lower bound of the service resource capacity to obtain the optimized scheme include:
[0097] Extract the baseline resource allocation and elasticity range of resource demand for each spatial unit in the hierarchical service resource allocation scheme, and construct a service optimization objective function that includes service quality target items and resource cost target items;
[0098] Obtain the predicted granularity requirements of each spatial unit, establish a dynamic mapping rule between the predicted granularity requirements and the weight coefficients of the service optimization objective function, and determine the weight coefficients corresponding to the service quality objective item and the resource cost objective item according to the dynamic mapping rule.
[0099] Uncertainty indices are extracted for each spatial unit. Service resource capacity safety margin is calculated based on the uncertainty indices. The service resource capacity safety margin is superimposed on the resource configuration benchmark of each spatial unit to determine the lower bound of service resource capacity. The lower bound of service resource capacity is used as the lower bound of the constraint condition.
[0100] Substitute the weight coefficients of each item into the service optimization objective function, and optimize the service optimization objective function under the constraints to obtain the optimized scheme for each spatial unit.
[0101] For example, the resource allocation baseline represents the quantity of basic resources that should be allocated to the spatial unit, and the upper and lower bounds of the resource demand elasticity interval define the allowable adjustment range of resource allocation. The service optimization objective function consists of two parts: a service quality objective term and a resource cost objective term. The service quality objective term measures the degree to which the service level meets the needs of tourists. It is calculated as the weighted sum of the ratios of the actual resource allocation quantity to the predicted tourist flow value for each spatial unit; a higher ratio indicates better service quality. The resource cost objective term measures the total cost of resource allocation. It is calculated by multiplying the actual resource allocation quantity of each spatial unit by the corresponding unit cost and then summing the results; a lower cost indicates higher resource utilization efficiency. The service optimization objective function consists of two parts: the first part is the service quality objective term multiplied by its weight coefficient, and the second part is the resource cost objective term multiplied by its weight coefficient and then negative. The sum of the two parts constitutes the objective function expression; the objective is to maximize this function, that is, to maximize service quality while controlling costs.
[0102] The forecast granularity requirement data for each spatial unit consists of the time granularity and spatial granularity parameters allocated to each unit. The forecast granularity requirement reflects the level of granularity in the forecast for that spatial unit; finer granularity indicates more accurate forecasting and a higher focus on service quality, while coarser granularity indicates a higher tolerance for forecast uncertainty and a greater emphasis on cost control. A dynamic mapping rule is established between the forecast granularity requirement and the weight coefficients of the service optimization objective function. This mapping rule is based on the time granularity value of the forecast granularity requirement. The time granularity is expressed in minutes; smaller time granularity indicates more refined forecasting. The weight coefficients for the service quality objective item are obtained by adding the base weights and the time granularity adjustment amount. The time granularity adjustment amount is calculated through the following steps: calculating the difference between the preset baseline time granularity and the actual time granularity, dividing the difference by the preset baseline time granularity to obtain a normalized ratio, and then multiplying this ratio by the adjustment amplitude coefficient. The preset baseline time granularity can be set to 30 minutes, and the adjustment amplitude coefficient can be set to 0.3. For example, when the actual time granularity is 10 minutes, the time granularity adjustment is (30-10)÷30×0.3=0.2. If the base weight is 0.5, then the weight coefficient for the service quality objective item is 0.5+0.2=0.7. The weight coefficient for the resource cost objective item is equal to 1 minus the weight coefficient for the service quality objective item, ensuring that the sum of the two weight coefficients is 1. Repeat the above mapping calculation for all spatial units within the scenic area, and the corresponding weight coefficients for the two items.
[0103] The uncertainty index values for each spatial unit are extracted. A higher uncertainty index indicates lower prediction reliability, requiring a larger resource allocation safety margin to mitigate prediction bias risks. The service resource capacity safety margin is calculated by multiplying the uncertainty index by the resource allocation baseline and then by a safety factor. The safety factor is set based on the scenic area's risk appetite: 1.5 for risk-averse scenic areas, 1.0 for risk-neutral scenic areas, and 0.5 for risk-seeking scenic areas. For example, if a spatial unit has an uncertainty index of 0.2, a resource allocation baseline of 610, and a safety factor of 1.0, then the service resource capacity safety margin is 0.2 × 610 × 1.0 = 122. The service resource capacity lower bound is obtained by adding the service resource capacity safety margin to the resource allocation baseline. Using the above data as an example, the service resource capacity lower bound is 610 + 122 = 732. The service resource capacity lower bound represents the minimum allowable amount of resources actually allocated to this spatial unit to ensure service reliability.
[0104] The constraints include a lower bound constraint on service resource capacity, a resource demand elasticity range constraint, and a total resource constraint. The lower bound constraint on service resource capacity requires that the actual resource allocation of each spatial unit must not be lower than its lower bound. The resource demand elasticity range constraint requires that the actual resource allocation of each spatial unit should fall between the lower and upper bounds of its resource demand elasticity range. The total resource constraint requires that the sum of the actual resource allocations of all spatial units must not exceed the upper limit of the total resource allocation available to the scenic area, which is determined based on the scenic area's actual resource reserves and budget. Substituting the weight coefficients into the service optimization objective function forms an objective function expression containing decision variables, where the actual resource allocation of each spatial unit is the decision variable. A constraint optimization algorithm is used to solve the objective function. The constraint optimization algorithm can be linear programming, quadratic programming, or heuristic optimization methods such as genetic algorithms. Linear programming is suitable for scenarios where both the objective function and constraints are linearly related, offering fast solution speed and guaranteeing global optimum. Quadratic programming is suitable for scenarios where the objective function contains quadratic terms, offering higher solution accuracy. Heuristic optimization methods are suitable for large-scale, complex constraint scenarios, offering high solution flexibility but not guaranteeing global optimum. The optimization process iteratively updates the actual resource allocation values for each spatial unit, gradually approaching the maximum value of the objective function while satisfying all constraints. The convergence criterion is that the difference between the objective function values of two adjacent iterations is less than a preset convergence threshold, which can be set to 0.001. After the solution is completed, the optimized solution for the actual resource allocation of each spatial unit is output; this optimized solution is the optimized scheme.
[0105] This embodiment dynamically adjusts the weight coefficients of the objective function to match different prediction granularity requirements, embeds uncertainty indicators into the lower bound constraint of service resource capacity, achieves a balance between service quality and resource cost optimization, and improves the adaptability and robustness of resource allocation schemes to prediction uncertainty.
[0106] In one optional implementation, the step of separating traffic data affected by service intervention events from natural traffic data and assigning different training weights to the hierarchical prediction architecture, and then updating the hierarchical prediction architecture online, includes:
[0107] During the implementation of the optimized scheme, actual tourist flow is monitored and service intervention events are recorded; based on the occurrence time and duration of the service intervention events, the actual tourist flow data is divided into flow data affected by service intervention and natural flow data; a mapping relationship between service intervention type and training weight decay factor is established, and based on the mapping relationship, the flow data affected by service intervention is assigned a decay-adjusted training weight, and the natural flow data is assigned a baseline training weight;
[0108] Construct an online training sample set containing the traffic data affected by service intervention and the natural traffic data, input the online training sample set into the hierarchical prediction architecture, and perform weighted gradient updates on the inter-layer collaborative parameters and multi-granularity prediction parameters in the hierarchical prediction architecture according to the training weights carried by each sample;
[0109] Verify the prediction error of the updated hierarchical prediction architecture, and complete the online update when the prediction error meets the convergence condition.
[0110] Combination Figure 2 The flowchart illustrating the service intervention data separation and online update hierarchical prediction architecture is provided. For example, during the implementation of the optimized plan, visitor flow monitoring equipment deployed in various spatial units of the scenic area collects visitor flow data in real time. The monitoring data is indexed and stored according to timestamps and spatial unit identifiers, forming an actual visitor flow time series. Service intervention events refer to proactive control measures taken by the scenic area management to optimize the visitor experience or respond to emergencies, including flow control measures, diversion measures, temporary closure of facilities, opening of backup channels, and organization of evacuation activities. When implementing intervention measures, operators enter fields such as the type identifier of the intervention event, the time of occurrence, the duration, and the affected spatial unit identifier. The intervention event type identifier uses a predefined code, the time of occurrence is recorded as a timestamp accurate to the minute, and the duration is recorded in minutes.
[0111] The start time of the service intervention impact time window is set to the time when the service intervention event occurs, and the end time is set to the time of occurrence plus the duration plus the delayed impact duration. The delayed impact duration considers the time required for traffic flow to return to its natural state after the intervention stops, and is set according to the type of intervention. For example, the delayed impact duration for flow restriction measures can be set to 50% of the duration, and the delayed impact duration for flow diversion measures can be set to 30% of the duration. Actual tourist traffic data recorded within the impact time window is marked as traffic data affected by the service intervention, and actual tourist traffic data outside the impact time window is marked as natural traffic data. The marking process is achieved by comparing the traffic data timestamp with the start and end times of the impact time window.
[0112] The training weight decay factor reflects the degree to which different intervention types weaken the representativeness of the natural laws of traffic data. The decay factor ranges from 0 to 1, with smaller values indicating a greater degree of distortion in traffic caused by that type of intervention. The mapping relationship is as follows: 0.3 for flow restriction measures, 0.5 for diversion measures, and 0.4 for temporary facility closure. For traffic data affected by service interventions, the corresponding service intervention type identifier is extracted, and the intervention type decay factor is obtained by querying the mapping table. The time interval between the traffic data moment and the service intervention moment is calculated, and a mapping relationship between the time interval and the weight recovery coefficient is established. The weight recovery coefficient reflects the gradual weakening of the intervention's impact over time. The weight recovery coefficient is equal to the time interval divided by the total length of the impact time window. The method for calculating the decay-adjusted training weights is to multiply the intervention type decay factor, the weight recovery coefficient, and the baseline training weight. The baseline training weight is set to 1. For natural traffic data, a baseline training weight of 1 is directly assigned.
[0113] The online training sample set includes traffic data affected by service interventions and natural traffic data. Each sample consists of three parts: an input feature vector, an actual traffic label value, and training weights. The input feature vector extraction method is consistent with the feature extraction method used in each prediction level of the hierarchical prediction architecture. The actual traffic label value is the actual tourist traffic value collected by the monitoring equipment. The training weights are the attenuated training weights or baseline training weights calculated in the previous steps. The online training sample set is organized chronologically, with newly collected monitoring data continuously added to the sample set. The total capacity of the sample set is capped, for example, retaining sample data from the most recent 7 days, and automatically removing historical samples exceeding the time range.
[0114] The online training sample set is input into the hierarchical prediction architecture, and weighted gradient updates are performed on the inter-layer collaborative parameters and multi-granularity prediction parameters. Inter-layer collaborative parameters refer to parameters used to coordinate the consistency of prediction results across different prediction levels, while multi-granularity prediction parameters refer to the parameters of the prediction model within each prediction level. The weighted gradient update method involves calculating the error between the prediction model output value and the actual traffic label value, calculating the parameter gradient based on the error, multiplying the parameter gradient by the training weight of the sample to obtain the weighted gradient, and adjusting the parameter values according to the direction of the weighted gradient. The update process uses a mini-batch gradient descent method, randomly selecting a certain number of samples from the online training sample set each time to form a mini-batch; the batch size can be set to 32 or 64. The learning rate is set to 0.001 to 0.01. The number of update iterations is determined based on the sample set size and update frequency; it can be set to execute one round of updates after accumulating 100 new samples, or to execute one round of updates at a fixed time period, such as every hour.
[0115] A validation set is created from the online training sample set. This validation set contains sample data from the most recent day and does not participate in the parameter update process. The updated hierarchical prediction architecture is used to predict the input feature vectors of each sample in the validation set. The error between the predicted value and the actual traffic label value is calculated, using the mean absolute percentage error (MASE) as the error metric. A convergence condition for the prediction error is set: either the current prediction error is less than a preset threshold, or the change in prediction error between two consecutive updates is less than a preset threshold. The prediction error threshold is set according to the granularity of the prediction level: 15% for coarse-grained levels, 10% for medium-grained levels, and 8% for fine-grained levels. The threshold for the change in prediction error can be set to 1%. When the prediction error meets the convergence condition, the parameter update process stops, and the online update is complete.
[0116] This invention effectively reduces the distortion of predictions caused by human intervention when updating the hierarchical prediction architecture online by distinguishing between traffic data affected by service intervention and natural traffic data and assigning differentiated training weights, thereby improving the ability to learn natural traffic patterns and the accuracy of prediction.
[0117] In one alternative implementation, the step of calculating the decay-adjusted training weights includes:
[0118] The service intervention impact time window is determined based on the occurrence time and duration of the service intervention event. The actual tourist flow data within the impact time window is marked as the flow data affected by the service intervention, and the actual tourist flow data outside the impact time window is marked as the natural flow data.
[0119] Extract the service intervention type corresponding to the traffic data affected by the service intervention, and establish a mapping table between the service intervention type and the intervention type attenuation factor; for the traffic data affected by the service intervention, calculate the time interval between the time of the traffic data and the time of the service intervention, and establish a mapping relationship between the time interval and the weight recovery coefficient.
[0120] The attenuation-adjusted training weights are obtained by multiplying the intervention type attenuation factor, the weight recovery coefficient, and the baseline training weights.
[0121] For example, the impact time window of a service intervention is determined based on the occurrence time and duration of the intervention event. The start time of the impact time window is set to the occurrence time of the service intervention event, and the calculation of the end time requires the introduction of a delay impact duration coefficient parameter. The delay impact duration coefficient represents the ratio of the delay impact duration to the duration, and different intervention types correspond to different delay impact duration coefficient values. A mapping relationship between intervention types and delay impact duration coefficients is established. The delay impact duration coefficient for flow restriction measures can be set to 0.5, for flow diversion measures to 0.3, for temporary facility closure to 0.4, and for evacuation activities to 0.6. The delay impact duration is calculated by multiplying the duration by the delay impact duration coefficient. The method for calculating the end time of the impact time window is to add the duration and the delay impact duration to obtain the total duration, and then add the total duration to the occurrence time to obtain the end time. For example, if a flow control measure occurs at 10:00 AM and lasts for 60 minutes, with a delay impact coefficient of 0.5, then the delay impact duration is 60 × 0.5 = 30 minutes, and the end time of the impact window is 10:00 AM + (60 + 30) = 11:30 AM. The actual tourist flow data within the impact window is marked as flow data affected by service intervention. The specific judgment rule is that the flow data timestamp is greater than or equal to the start time of the impact window and less than or equal to the end time of the impact window. An intervention-affected flag field is added to the flow data record; a field value of 1 indicates intervention impact, and a value of 0 indicates natural flow.
[0122] Extract the service intervention type identifier corresponding to the traffic data affected by service intervention. The service intervention type identifier adopts a predefined coding system. For example, T01 represents flow restriction measures, T02 represents flow diversion measures, T03 represents temporary facility closure, and T04 represents evacuation activities. Establish a mapping table between service intervention types and intervention type attenuation factors. The mapping table uses the service intervention type identifier as the index and the intervention type attenuation factor as the mapping value. The intervention type attenuation factor ranges from 0 to 1, with smaller values indicating a greater degree of distortion in traffic caused by that type of intervention. The mapping table is stored in a structured data format. An example mapping relationship is: flow restriction measure T01 corresponds to an intervention type attenuation factor of 0.3, flow diversion measure T02 corresponds to an intervention type attenuation factor of 0.5, temporary facility closure T03 corresponds to an intervention type attenuation factor of 0.4, and evacuation activities T04 correspond to an intervention type attenuation factor of 0.2. For traffic data affected by service intervention, read its associated service intervention event records, extract the service intervention type identifier, and query the mapping table to obtain the corresponding intervention type attenuation factor. The mapping table supports dynamic expansion. When a new intervention type is added, a new type identifier and decay factor mapping item can be added without modifying the calculation logic code.
[0123] For traffic data affected by service intervention, calculate the time interval between the traffic data time and the time of the service intervention. The time interval is calculated by subtracting the service intervention time from the traffic data timestamp, with the result in minutes. Establish a mapping relationship between the time interval and the weighted recovery coefficient. The weighted recovery coefficient reflects the gradual weakening of the intervention's impact over time, with a value ranging from 0 to 1. The mapping relationship supports various function configurations, including linear growth, exponential growth, and S-curve growth modes. In the linear growth mode, the weighted recovery coefficient is calculated by dividing the time interval by the total length of the impact time window, where the total impact time window equals the sum of the duration and the delayed impact duration. For example, if the total impact time window is 90 minutes and the time interval is 5 minutes, the weighted recovery coefficient is 5 ÷ 90 ≈ 0.056. In exponential growth mode, the calculation of the weighted recovery coefficient involves two steps. First, the time interval is divided by the decay time constant to obtain the exponential term. Second, the weighted recovery coefficient is calculated by negating the exponential term to obtain a negative exponential term. This negative exponential term is then used as a power of the natural constant e. Subtracting the power from 1 gives the weighted recovery coefficient. The decay time constant is set according to the intervention type, ranging from 10 to 50 minutes. In S-curve growth mode, the weighted recovery coefficient is calculated using a logistic function. The function parameters include the midpoint and the kurtosis coefficient. The midpoint is set to half the total length of the influence time window, and the kurtosis coefficient controls the transition speed of the curve from 0 to 1, typically ranging from 0.1 to 0.5. The functional form of the mapping relationship is specified through a configuration file, with linear growth mode used by default. When the time interval is equal to or exceeds the total length of the influence time window, the weighted recovery coefficient is set to 1 regardless of the function form used.
[0124] The baseline training weight is set to 1, representing the standard weight for natural traffic data. The training weight after decay adjustment is calculated by multiplying the intervention type decay factor by the weight recovery coefficient by the baseline training weight. The calculation result is retained to three decimal places, ensuring the accuracy meets the training weight configuration requirements. The decay-adjusted training weights are stored in the training weight field of the traffic data record for subsequent online training. For natural traffic data, the training weight field is directly set to the baseline training weight of 1, without the need for decay adjustment calculation. The training weight ranges from 0 to 1. Due to the decay adjustment, the training weights of traffic data affected by service interventions are generally smaller than those of natural traffic data, thus reducing the impact of intervention-affected traffic data on model parameters during subsequent weighted gradient updates.
[0125] This invention quantifies the duration of the impact of different intervention types by introducing a delay impact duration coefficient, thereby enabling fine-grained adjustment of the training weights for traffic data affected by service interventions and improving the accuracy of learning natural traffic patterns.
[0126] A second aspect of this invention provides a tourist flow prediction and service optimization system for smart cultural tourism, comprising:
[0127] The prediction granularity adaptive module is used to calculate the scheduling flexibility based on tourist flow data and service resource scheduling data of scenic area spatial units, determine the prediction granularity requirement of tourist flow for each spatial unit according to the scheduling flexibility, construct a hierarchical prediction architecture, generate multi-granularity tourist flow prediction results, and quantify the uncertainty of the prediction results to obtain the prediction confidence interval and uncertainty index;
[0128] The hierarchical resource allocation module is used to divide each spatial unit into different confidence levels according to the uncertainty index, determine the predicted fluctuation range of tourist flow according to the predicted confidence interval, and determine the corresponding hierarchical service resource allocation scheme.
[0129] The service optimization solution module is used to construct a service optimization objective function based on the hierarchical service resource configuration scheme and perform optimization solution. The weight coefficients of the objective function are dynamically adjusted according to the predicted granularity requirements. The constraint conditions embed the uncertainty index into the lower bound of the service resource capacity to determine the optimized scheme.
[0130] The online update module is used to monitor actual tourist flow and record service intervention events during the execution of the optimized scheme, separate the flow data affected by service intervention events from the natural flow data and assign different training weights to them, and update the hierarchical prediction architecture online.
[0131] A third aspect of the present invention provides an electronic device, comprising:
[0132] processor;
[0133] Memory used to store processor-executable instructions;
[0134] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0135] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0136] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.
[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for tourist flow prediction and service optimization for smart tourism, characterized in that, The method comprises the following steps: calculating scheduling flexibility based on tourist flow data and service resource scheduling data of scenic spot space units, determining the prediction granularity requirement of tourist flow of each space unit according to the scheduling flexibility, and constructing a hierarchical prediction architecture to generate multi-granularity tourist flow prediction results, and quantifying the uncertainty of the prediction results to obtain prediction confidence intervals and uncertainty indicators; dividing each space unit into different confidence levels according to the uncertainty indicators, determining the tourist flow prediction fluctuation range according to the prediction confidence intervals, and determining the corresponding hierarchical service resource configuration scheme; constructing a service optimization objective function based on the hierarchical service resource configuration scheme and performing optimization solution, the weight coefficient of the objective function is dynamically adjusted according to the prediction granularity requirement, the uncertainty indicators are embedded into the lower bound of service resource capacity to determine the constraint condition, and the optimized scheme is obtained; monitoring the actual tourist flow and recording the service intervention events during the execution of the optimized scheme, separating the flow data affected by the service intervention events from the natural flow data and assigning different training weights, and performing online update on the hierarchical prediction architecture.
2. The method of claim 1, wherein, The steps of calculating scheduling flexibility based on tourist flow data and service resource scheduling data of scenic spot space units, determining the prediction granularity requirement of tourist flow of each space unit according to the scheduling flexibility, and constructing a hierarchical prediction architecture to generate multi-granularity tourist flow prediction results, and quantifying the uncertainty of the prediction results to obtain prediction confidence intervals and uncertainty indicators comprise: Based on the service resource scheduling data of the scenic spot space units, the dimension indicator values are calculated from the resource allocation response time, the spatial accessibility and the service capacity elasticity, and the scheduling flexibility of each space unit is obtained by weighted aggregation; determining the prediction granularity requirement of tourist flow of each space unit according to the scheduling flexibility, determining the prediction error tolerance by establishing a positive correlation between scheduling flexibility and prediction error tolerance, and mapping the prediction error tolerance to the prediction time granularity and the prediction space granularity, which are positively correlated with the prediction error tolerance; dividing the scenic spot space units into multiple prediction levels based on the prediction granularity requirement, and organizing the hierarchical prediction architecture from coarse to fine according to the prediction granularity of different prediction levels; performing prediction on the space units of each prediction level through the hierarchical prediction architecture to obtain the initial prediction results of each prediction level; and quantifying the uncertainty of the initial prediction results and optimizing them between levels to obtain multi-granularity tourist flow prediction results, prediction confidence intervals and uncertainty indicators.
3. The method of claim 2, wherein, The steps of quantifying the uncertainty of the prediction results to obtain prediction confidence intervals and uncertainty indicators comprise: quantifying the uncertainty of the initial prediction results to obtain the initial prediction confidence intervals and the initial uncertainty indicators of each space unit; The initial prediction confidence interval of the coarse-grained spatial unit is adjusted as the upper and lower bounds of the sum of the prediction values of the set of fine-grained spatial units, and the initial prediction confidence interval of the fine-grained spatial unit is adjusted; the aggregated value of the initial uncertainty index of the set of fine-grained spatial units is calculated, and the initial prediction confidence interval width of the coarse-grained spatial unit is adjusted according to the aggregated value; the adjustment process is iteratively performed until the adjusted prediction value sum of the set of fine-grained spatial units and the adjusted prediction confidence interval of the coarse-grained spatial unit have an intersection; The uncertainty index of each spatial unit is updated based on the adjusted prediction confidence interval, and the prediction confidence interval and the uncertainty index of each spatial unit are output.
4. The method of claim 1, wherein, According to the uncertainty index, the spatial units are divided into different confidence levels, and the prediction fluctuation range of the tourist flow is determined according to the prediction confidence interval, and the steps of determining the hierarchical service resource allocation scheme include: According to the size relationship between the uncertainty index of each spatial unit and the preset confidence level division threshold, the spatial units are divided into different confidence levels; For each spatial unit, the prediction fluctuation range of the tourist flow is calculated based on the difference between the upper bound and the lower bound of the prediction confidence interval; According to the confidence level of each spatial unit, an initial resource allocation redundancy coefficient is determined; and the initial resource allocation redundancy coefficient is adjusted to obtain an adjusted resource allocation redundancy coefficient according to the prediction fluctuation range of the spatial unit; According to the prediction fluctuation range, an initial resource demand elasticity interval is determined, and the initial resource demand elasticity interval is corrected to obtain a corrected resource demand elasticity interval according to the confidence level of the spatial unit; Based on the tourist flow prediction value of each spatial unit and the adjusted resource allocation redundancy coefficient, a resource allocation reference amount is obtained; the resource allocation reference amount and the corrected resource demand elasticity interval form a hierarchical service resource allocation scheme for each spatial unit.
5. The method of claim 1, wherein, Based on the hierarchical service resource allocation scheme, a service optimization objective function is constructed and optimized, the weight coefficient of the objective function is dynamically adjusted according to the prediction granularity demand, the uncertainty index is embedded into the lower bound of the service resource capacity to determine the constraint condition, and the steps of obtaining the optimized scheme include: The resource allocation reference amount and the resource demand elasticity interval of each spatial unit in the hierarchical service resource allocation scheme are extracted, and a service optimization objective function including a service quality target item and a resource cost target item is constructed; The prediction granularity demand of each spatial unit is obtained, a dynamic mapping rule between the prediction granularity demand and the weight coefficient of the service optimization objective function is established, and the weight coefficients corresponding to the service quality target item and the resource cost target item are determined according to the dynamic mapping rule; extracting an uncertainty index of each spatial unit, calculating a service resource capacity safety margin according to the uncertainty index, superimposing the service resource capacity safety margin to a resource configuration benchmark quantity of each spatial unit to determine a lower bound of service resource capacity, and taking the lower bound of service resource capacity as a lower bound limit of the constraint condition; putting the weight coefficients of each item into the service optimization objective function, and optimizing and solving the service optimization objective function under the constraint of the constraint condition to obtain an optimized scheme of each spatial unit.
6. The method of claim 1, wherein, The step of separating the traffic data affected by the service intervention event from the natural traffic data and assigning different training weights to the hierarchical prediction architecture includes: monitoring actual tourist traffic and recording service intervention events during the execution of the optimized scheme, dividing the actual tourist traffic data into traffic data affected by service intervention and natural traffic data according to the time and duration of the service intervention event, establishing a mapping relationship between service intervention types and training weight decay factors, and assigning the traffic data affected by service intervention to an adjusted training weight according to the mapping relationship, and assigning the natural traffic data to a baseline training weight; constructing an online training sample set containing the traffic data affected by service intervention and the natural traffic data, inputting the online training sample set into the hierarchical prediction architecture, and performing weighted gradient update on the inter-layer coordination parameters and multi-granularity prediction parameters in the hierarchical prediction architecture according to the training weights carried by each sample; verifying the prediction error of the updated hierarchical prediction architecture, and completing online update when the prediction error meets the convergence condition.
7. The method of claim 6, wherein, The step of calculating the adjusted training weight includes: determining a service intervention impact time window according to the time and duration of the service intervention event, marking the actual tourist traffic data within the impact time window as traffic data affected by service intervention, and marking the actual tourist traffic data outside the impact time window as natural traffic data; extracting the service intervention type corresponding to the traffic data affected by service intervention, establishing a mapping table of service intervention types and intervention type decay factors, and calculating the time interval from the time of the traffic data affected by service intervention to the time of the service intervention for the traffic data affected by service intervention, and establishing a mapping relationship between the time interval and the weight recovery coefficient; multiplying the intervention type decay factor, the weight recovery coefficient and the baseline training weight to obtain the adjusted training weight.
8. A tourist flow prediction and service optimization system for smart tourism, for implementing the method of any one of the preceding claims 1-7, characterized in that, It includes: a prediction granularity adaptive module for calculating scheduling flexibility based on tourist traffic data and service resource scheduling data of a scenic spot spatial unit, determining the prediction granularity demand of tourist traffic of each spatial unit according to the scheduling flexibility, constructing a hierarchical prediction architecture, generating a multi-granularity tourist traffic prediction result, and quantifying the prediction result to obtain a prediction confidence interval and an uncertainty index; a hierarchical resource configuration module for dividing each spatial unit into different confidence levels according to the uncertainty index, determining a tourist traffic prediction fluctuation range according to the prediction confidence interval, and determining a corresponding hierarchical service resource configuration scheme. a service optimization solving module, configured to construct a service optimization objective function based on the hierarchical service resource configuration scheme and perform optimization solving, wherein a weight coefficient of the objective function is dynamically adjusted according to the predicted granularity demand, and a constraint condition embeds the uncertainty index into a service resource capacity lower bound determination to obtain an optimized scheme; an online updating module, configured to monitor actual tourist flow and record service intervention events in the execution of the optimized scheme, separate flow data affected by the service intervention events from natural flow data and assign different training weights, and perform online updating on the hierarchical prediction architecture.
9. An electronic device, comprising: comprise: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to execute the method of any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon computer program instructions, wherein, The computer program instructions, when executed by the processor, implement the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Dynamic resource allocation system and method for smart text travel
CN120355005A
Tourism resource scheduling method and device based on multi-modal data, equipment and storage medium
CN121212742A