A scenic spot recommendation method based on a time convolution network

CN123012276APending Publication Date: 2026-10-30CHINA TELECOM DIGITAL INTELLIGENCE TECHNOLOGY (ANHUI) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202611344227.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-01
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0003]但是,现有技术在实际旅游推荐业务中仍存在不足:游客本次行程可能因临时绕行、景点关闭、停留时间变化或旅游目的改变而偏离历史习惯,若直接融合长期偏好与短期行为,长期偏好容易抑制当前行程变化,而短期行为权重过高又容易受定位漂移和偶发停留影响;同时,现有时空推荐通常对空间邻近性和时间适配性进行整体融合,当候选景点仅满足空间或时间中的一项条件时,较高的单侧匹配结果可能补偿另一侧偏离,使空间迁移方向与预计到达时间不一致的景点仍获得较高推荐概率,难以兼顾当前行程动态性、历史偏好稳定性及候选景点时空一致性

Benefits of technology

[0063]本发明通过用户位置活动轨迹构建、游客停留点识别、异常位置剔除及旅游行程切分形成可靠的游客景点游览序列,并结合行为嵌入、膨胀卷积、多尺度卷积、残差连接和自注意力提取游客短期出行特征,再依据不同历史旅游行程之间的相似度及注意力权重生成游客长期偏好特征。该技术链能够同时保留当前旅游行程的局部变化和历史旅游行为的稳定规律,避免传统长短期特征直接融合时长期偏好抑制当前行程变化或短期异常行为过度影响推荐结果,从而提高游客行为表征对真实出行状态的适应性和下一景点推荐依据的可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012276A_ABST
    Figure CN123012276A_ABST
Patent Text Reader

Abstract

The application discloses a scenic spot recommendation method based on a time convolution network, and relates to the technical field of intelligent tourism recommendation, and comprises the following steps: collecting user position data and scenic spot information data, generating user position activity tracks and scenic spot geographic ranges; extracting user stay points and matching the scenic spot geographic ranges, eliminating long-term stay users, and generating tourist scenic spot tour sequences; eliminating abnormal position records, cutting tourism itineraries and filtering short sequences, and generating tour sequence data sets; generating tourist short-term travel features through a time convolution network; generating tourist long-term preference features according to the similarity of different tourism itinerary features; generating candidate scenic spot space-time correction weights through a personalized space-time clustering model; calculating candidate scenic spot visit probabilities according to the short-term travel features, the long-term preference features and the space-time correction weights, and generating scenic spot recommendation results. The application improves the adaptability of scenic spot recommendation to the dynamic travel state and long-term preference of tourists, and improves the accuracy of scenic spot recommendation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent tourism recommendation technology, and in particular to a method for recommending tourist attractions based on temporal convolutional networks. Background Technology

[0002] With the development of location services, mobile signaling big data, and smart tourism platforms, attraction identification and next attraction recommendation based on tourist trajectories have become important directions in existing technologies. For example, CN112800348A has disclosed the use of long-term mobile signaling trajectories, dwelling behavior, and habitual behavior to identify tourist behavior; CN112182398A has disclosed the extraction of long-term preferences through an attention mechanism, the extraction of short-term preferences through BiLSTM, and the fusion calculation of the probability of visiting the next attraction; CN113158038A further discloses embedding points of interest into sequences and inputting them into a TCN, and combining spatiotemporal self-attention to obtain global spatiotemporal correlation for point of interest recommendation. It is evident that there are already publicly available practical cases for mobile signaling trajectory analysis, long-term and short-term preference modeling, and TCN time-series recommendation.

[0003] However, existing technologies still have shortcomings in practical tourism recommendation services: tourists' current trips may deviate from historical habits due to temporary detours, attraction closures, changes in stay time, or changes in travel purpose. If long-term preferences and short-term behaviors are directly integrated, long-term preferences may easily suppress changes in the current itinerary, while excessive weighting of short-term behaviors may be affected by location drift and occasional stops. At the same time, existing spatiotemporal recommendations usually integrate spatial proximity and temporal adaptability as a whole. When a candidate attraction only meets one of the spatial or temporal conditions, a higher one-sided matching result may compensate for the deviation on the other side, so that attractions whose spatial migration direction is inconsistent with the expected arrival time still receive a higher recommendation probability. It is difficult to take into account the dynamism of the current itinerary, the stability of historical preferences, and the spatiotemporal consistency of candidate attractions.

[0004] Therefore, how to provide a scenic spot recommendation method based on temporal convolutional networks is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] One objective of this invention is to propose a scenic spot recommendation method based on temporal convolutional networks. This invention fully utilizes behavioral embedding, temporal convolutional networks, attention mechanisms, and personalized spatiotemporal clustering techniques to model the long-term and short-term preferences of tourists' historical travel behavior. It also combines spatial and temporal support to correct candidate scenic spots and generate scenic spot recommendation results. This method has the advantages of accurate tourist preference characterization, strong spatiotemporal adaptability, and high accuracy in scenic spot recommendation.

[0006] A scenic spot recommendation method based on a temporal convolutional network according to an embodiment of the present invention includes the following steps:

[0007] Step 1: Collect user location data and scenic spot information data, and generate user location activity trajectories and scenic spot geographic ranges;

[0008] Step 2: Extract user stay points and match them with the geographic ranges of scenic spots, exclude residents near scenic spots and scenic area staff according to the number of stay days, and generate tourist scenic spot tour sequences;

[0009] Step 3: Eliminate abnormal location records, segment travel itineraries and filter short sequences to generate a tour sequence dataset;

[0010] Step 4: Perform behavior embedding on the tourist scenic spot tour sequences, generate tourist scenic spot visit embedding sequences and input them into a temporal convolutional network, and generate short-term travel features of tourists through dilated convolution, multi-scale convolution, residual connection and self-attention processing;

[0011] Step 5: Calculate the similarity of different travel itinerary features, and generate long-term preference features of tourists through attention weighted aggregation;

[0012] Step 6: Input the tourist historical tour data and the long and short-term features into a personalized spatio-temporal clustering model, generate the spatio-temporal clustering migration amount according to the short-term travel features, limit the migration range with the long-term preferences, generate a spatial support set and a temporal support set respectively and perform consistency confirmation, and generate spatio-temporal correction weights for candidate scenic spots according to the states of consistent support, unilateral conflict and no support;

[0013] Step 7: Calculate the access probability of candidate scenic spots according to the short-term travel features, the long-term preference features and the spatio-temporal correction weights of the candidate scenic spots, and generate scenic spot recommendation results.

[0014] Optionally, the user location data includes anonymized user identifiers, location record timestamps, longitude and latitude, and the scenic spot information data includes scenic spot identifiers, scenic spot boundary coordinates and affiliated tourist areas;

[0015] Write the user location data and the scenic spot information data into HDFS, perform parallel trajectory processing by Spark according to the anonymized user identifiers, and assign corresponding data processing tasks by Yarn;

[0016] Group the location records according to the anonymized user identifiers, convert the location records to a unified time reference and sort them in ascending order of timestamp, and delete duplicate location records under the same timestamp; when there are multiple different coordinates at the same timestamp, retain the coordinate with the minimum surface distance from the previous valid location record, and organize the valid location records in chronological order to generate the user location activity trajectories;

[0017] Convert the scenic spot boundary coordinates to the same geographic coordinate system as the user location data, construct a closed area according to the connection relationship of the scenic spot boundary vertices, bind the corresponding closed area with the scenic spot identifier, and generate the geographic range of the scenic spot.

[0018] Optionally, step two specifically includes:

[0019] Calculate the time interval between consecutive location records in the user's location activity trajectory, divide the trajectory into segments according to the record interval threshold, count the duration of the trajectory segments and the spatial distribution of location records, filter the dwell segments according to the segment duration and the proportion of location records within a preset spatial radius, and generate user dwell points based on the valid location records within the dwell segments;

[0020] Perform a spatial inclusion determination between the user's stop point and the geographical range of the scenic spot to generate a scenic spot tour record; when the user's stop point is located within the geographical range of multiple scenic spots at the same time, calculate the distance between the stop point and the geometric center of the geographical range of each scenic spot, and write the scenic spot with the smallest distance into the scenic spot tour record.

[0021] The number of independent stay dates of users in the corresponding tourist area is counted according to the preset statistical period. Users who reach the stay date threshold are regarded as long-term users and their scenic spot visit records are deleted.

[0022] The remaining scenic spot visit records are arranged according to arrival time. The time interval between consecutive visit records of the same scenic spot is compared with the consecutive visit interval threshold. Records with time intervals not exceeding the consecutive visit interval threshold are merged and organized into a tourist scenic spot visit sequence according to time order.

[0023] Optionally, step three specifically includes:

[0024] The ground movement distance is calculated based on the latitude and longitude of adjacent locations in the tourist attraction tour sequence. The ground movement distance is divided by the corresponding time difference to generate the average movement speed. Locations that exceed the upper limit of movement speed are written into the record to be verified.

[0025] Calculate the stopping path distance from the previous valid position to the next valid position via the position to be verified, and the direct distance from the previous valid position to the next valid position. When the ratio of the stopping path distance to the direct distance reaches the abnormal distance ratio threshold, delete the record of the position to be verified.

[0026] Calculate the time interval between the departure time of the previous attraction and the arrival time of the next attraction between adjacent attraction visit records, divide the adjacent attraction visit records that reach the maximum interval time window into different travel itineraries, and filter short sequences according to the number of valid attraction visit records included in the travel itinerary;

[0027] Min-Max normalization is performed on latitude and longitude and length of stay. The visit time is converted into weekday identifier and intraday time slot. Discrete index encoding is performed on anonymized user identifier, attraction identifier, intraday time slot and itinerary identifier. Hierarchical units are established according to the travel itinerary length range, intraday time slot and attraction visit frequency. Training set and test set are divided in each hierarchical unit to generate tour sequence dataset.

[0028] Optionally, step four specifically includes:

[0029] Time categories are generated based on weekday identifiers and intraday time slots; location categories are generated based on Geohash encoding of location latitude and longitude; a behavioral vocabulary is constructed based on anonymized user identifiers, attraction identifiers, time categories, and location categories, and each is mapped to a unique integer index.

[0030] The Skip-Gram structure of Word2Vec is used to build a sliding window according to the order of attraction visits. The currently visited attraction is used as the center word, and the previous and subsequent visited attractions, time category, and location category are used as context words. Continuous embedding vectors are obtained by training with positive sample context words and negative sample words.

[0031] Based on the attraction identifier, anonymized user identifier, time category, and location category, attraction embedding, tourist embedding, time embedding, and location embedding are generated respectively. They are then concatenated with the normalized dwell time and processed by fully connected projection, GELU activation, and LayerNorm to generate attraction visit behavior embedding. Finally, they are arranged according to the actual visit order within the travel itinerary to generate a tourist attraction visit embedding sequence.

[0032] Tourist attraction visits are embedded into a temporal convolutional network. After dilated convolution, multi-scale convolution, residual connections, and self-attention processing, temporal convolutional features and global visit association features are generated. The temporal convolutional features and global visit association features are then weighted and fused to generate short-term travel features for tourists.

[0033] Optionally, the temporal convolutional network includes multiple sequentially connected temporal convolutional blocks and a self-attention layer. Each temporal convolutional block includes multiple parallel dilated convolutional branches, a feature splicing layer, a feature projection layer, a residual connection layer, and a LayerNorm layer.

[0034] Different temporal convolutional blocks use an increasing dilation rate, and each parallel dilated convolutional branch uses a one-dimensional causal convolutional kernel of different size. The outputs of each parallel dilated convolutional branch are concatenated for features, and after feature projection, they are added to the input of the corresponding temporal convolutional block to generate temporal convolutional features.

[0035] The output of the last temporal convolutional block is input into the attention layer. Query features, key features, and value features are generated through query projection, key projection, and value projection. SoftMax normalization is performed on the scaled dot product result of the query features and key features. The value features are then weighted and aggregated based on the normalization result to generate global access association features.

[0036] Trainable fusion weights are used to weight the temporal convolutional features corresponding to the last valid visit location in the current travel itinerary, and the global visit association features are weighted by subtracting the trainable fusion weights from one. The two weighted results are summed and LayerNorm is applied to generate short-term travel features of tourists.

[0037] The actual next-visit destination is used as the supervision label, and the cross-entropy between the predicted next-visit destination and the actual next-visit destination is used as the training loss to train the temporal convolutional network.

[0038] Optionally, step five specifically includes:

[0039] A temporal convolutional network is used to process each historical travel itinerary before the current travel itinerary, generating short-term travel features of tourists corresponding to each historical travel itinerary, and using the short-term travel features of tourists corresponding to each historical travel itinerary as features of different travel itineraries.

[0040] Calculate the cosine similarity between any two different tourism itinerary features, and construct a tourism itinerary similarity matrix according to the historical tourism itinerary arrangement order;

[0041] SoftMax normalization is performed on each row of the travel itinerary similarity matrix to generate normalized similar responses. The normalized similar responses are multiplied by the corresponding original similarity and then summed to generate the attention responses for each historical travel itinerary.

[0042] SoftMax normalization is performed on the attention response of all historical travel itineraries to generate historical travel itinerary attention weights, and the corresponding short-term travel features of tourists are weighted and aggregated according to the historical travel itinerary attention weights to generate long-term tourist preference features.

[0043] Bind the attention weight of historical travel itineraries to the corresponding itinerary identifiers.

[0044] Optionally, step six specifically includes:

[0045] A personalized spatiotemporal clustering model is constructed, which includes a spatiotemporal clustering module, a migration constraint module, a dual support generation module, and a support correction module connected in sequence.

[0046] The spatiotemporal clustering module converts the latitude and longitude of attractions in the historical visit data of tourists into local planar coordinates of the tourist area, performs spatial clustering to generate spatial clusters, spatial cluster centers and spatial support radii, and statistically analyzes the distribution of attraction visits according to continuous time slices. It also performs temporal clustering based on the Jensen-Shannon divergence of adjacent time slices to generate time clusters, time cluster centers and time support radii.

[0047] The migration constraint module generates basic spatial migration and basic temporal migration based on the spatial displacement and temporal progression deviation of attractions in the current travel itinerary. It adjusts the basic spatial migration and basic temporal migration based on the short-term travel characteristics of tourists, generates spatial clustering migration and temporal clustering migration, and uses the historical travel itinerary attention weight obtained when generating long-term tourist preference characteristics to generate the tourist spatial stability range and tourist temporal stability range. It compresses the migration part that exceeds the corresponding stability range and generates the current itinerary spatial center and current itinerary temporal center.

[0048] The dual support generation module generates a spatial support set based on the spatial distance between candidate attractions and the current travel space center, generates the expected arrival time of candidate attractions based on the departure time of the current attractions and the transfer time of historical attractions, and generates a time support set based on the circumferential time distance between the expected arrival time and the current travel time center. The spatial support set generation process does not use the time support results, and the time support set generation process does not use the spatial support results.

[0049] The support correction module performs consistency verification on the spatial support set and the temporal support set, divides the candidate attractions into consistent support, temporal one-sided conflict, spatial one-sided conflict and no support states, and generates the spatiotemporal correction weights of the candidate attractions according to the corresponding states.

[0050] Optionally, the migration constraint module specifically includes:

[0051] Based on the displacement between the most recently visited attractions in the current travel itinerary, a spatial displacement vector is generated. Then, exponential decay and normalization are performed according to the time interval between the time of each displacement and the current time of visit to generate a normalized time weight. The cosine similarity between each spatial displacement vector and the most recent spatial displacement vector is calculated. Negative values ​​are assigned to zero to generate a direction consistency weight. The spatial displacement vector, normalized time weight, and direction consistency weight are weighted and aggregated to generate the basic spatial migration amount.

[0052] Calculate the time deviation between the actual stay duration and the median historical stay duration of the corresponding attraction, and the time deviation between the actual transfer time and the median historical transfer time of the corresponding attraction combination. Add the two types of deviations and perform weighted aggregation using normalized time weights to generate the basic time migration quantity. Input the short-term travel characteristics of tourists into the spatial migration adjustment branch and the temporal migration adjustment branch respectively to adjust the basic spatial migration quantity and the basic temporal migration quantity, and generate the spatial clustering migration quantity and the temporal clustering migration quantity.

[0053] The attention weights of historical tourist trips are allocated according to the number of valid migration records of the corresponding trips. The samples are sorted and accumulated according to the absolute value of historical spatial migration distance and historical time offset. Based on the spatial migration distance and time offset corresponding to the stable coverage ratio of the accumulated sample weights, the stable spatial range and stable temporal range of tourists are generated.

[0054] Spatial and temporal cluster migration amounts are fully preserved when they are within their respective stable ranges. When they exceed their respective stable ranges, the migration portion within the stable range is preserved, and the out-of-bounds migration portion is preserved according to a preset compression ratio, generating restricted spatial and temporal migration amounts. The restricted spatial migration amount is superimposed on the center of the current spatial cluster, and the restricted temporal migration amount is superimposed on the center of the current temporal cluster, generating the current travel spatial center and the current travel temporal center.

[0055] Optionally, step seven specifically includes:

[0056] By combining tourists' short-term travel characteristics and long-term preference characteristics, a comprehensive tourist recommendation feature is generated.

[0057] The comprehensive tourist recommendation features are input into the fully connected recommendation network. Feature mapping is performed through the first fully connected layer and the GELU activation layer. The basic visit score corresponding to each candidate attraction is generated through the candidate attraction output layer.

[0058] After adding a preset positive number to the spatiotemporal correction weight of the candidate attractions, a natural logarithm mapping is performed. The mapping result is multiplied by the correction intensity coefficient and then added to the basic visit score of the corresponding candidate attraction to generate a corrected visit score.

[0059] Perform SoftMax normalization on the corrected visit scores of all candidate attractions to generate visit probabilities for each candidate attraction;

[0060] The actual next-visited attractions are used as supervision labels, and the cross-entropy between the visit probability of candidate attractions and the actual next-visited attractions is used as the recommendation loss. A fully connected recommendation network is trained, and after the phased training is completed, joint fine-tuning is performed on the trainable structures in the temporal convolutional network, the personalized spatiotemporal clustering model and the fully connected recommendation network.

[0061] Candidate attractions are ranked from highest to lowest based on their visit probability, and attraction recommendations are generated based on a preset number of recommendations.

[0062] The beneficial effects of this invention are:

[0063] This invention constructs reliable visitor attraction sequences by constructing user location activity trajectories, identifying tourist stop points, removing abnormal locations, and segmenting travel itineraries. It then extracts short-term travel features by combining behavioral embedding, dilated convolution, multi-scale convolution, residual connections, and self-attention. Finally, it generates long-term tourist preference features based on the similarity and attention weights between different historical travel itineraries. This technology chain can simultaneously preserve the local variations of the current travel itinerary and the stable patterns of historical travel behavior. It avoids the situation where traditional direct fusion of long-term and short-term features results in where long-term preferences suppress current itinerary changes or short-term abnormal behaviors excessively influence recommendation results. This improves the adaptability of tourist behavior representation to real travel conditions and the reliability of next attraction recommendations.

[0064] Furthermore, this invention generates basic spatial and temporal migration quantities based on the current travel itinerary using a personalized spatiotemporal clustering model. It adjusts the migration response based on short-term travel characteristics and utilizes historical travel itinerary attention weights to form spatial and temporal stable ranges, compressing only out-of-bounds migration portions. On this basis, it independently generates spatial and temporal support sets, and generates spatiotemporal correction weights for candidate attractions based on consistent support, temporal one-sided conflict, spatial one-sided conflict, and no-support states. This suppresses excessive migration caused by location drift, temporary detours, and abnormal stops, while avoiding erroneous compensation for deviations on one side by a single spatial proximity or temporal match. The recommendation results simultaneously satisfy the dynamism of the current itinerary, the stability of historical preferences, and spatiotemporal consistency, providing a more stable and scenario-adaptable technical path for real-time attraction recommendations based on location services. Attached Figure Description

[0065] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0066] Figure 1 This is a flowchart of a scenic spot recommendation method based on a temporal convolutional network proposed in this invention;

[0067] Figure 2 This is a schematic diagram of a scenic spot recommendation method based on a temporal convolutional network proposed in this invention;

[0068] Figure 3 This is a framework diagram of the personalized spatiotemporal clustering model in the scenic spot recommendation method based on temporal convolutional networks proposed in this invention. Detailed Implementation

[0069] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are all simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, so they only show the components related to the present invention.

[0070] reference to Figures 1-3 , a scenic spot recommendation method based on a temporal convolutional network comprises the following steps:

[0071] Step 1: Collect user location data and scenic spot information data, and generate user location activity trajectories and scenic spot geographic ranges.

[0072] Step 2: Extract user stay points and match them with the geographic ranges of the scenic spots, exclude residents near the scenic spots and scenic area staff according to the number of stay days, and generate tourist scenic spot visit sequences.

[0073] Step 3: Eliminate abnormal location records, segment travel itineraries and filter short sequences, and generate a visit sequence dataset.

[0074] Step 4: Perform behavior embedding on the tourist scenic spot visit sequences, generate tourist scenic spot access embedding sequences and input them into the temporal convolutional network, and generate tourist short-term travel features through dilated convolution, multi-scale convolution, residual connection and self-attention processing.

[0075] Step 5: Calculate the similarity of different travel itinerary features, and generate tourist long-term preference features through attention weighted aggregation.

[0076] Step 6: Input the tourist historical visit data and the long and short-term features into a personalized spatio-temporal clustering model, generate a spatio-temporal clustering migration amount according to the short-term travel features, limit the migration range with the long-term preferences, generate a spatial support set and a temporal support set respectively, perform consistency verification on the two support sets, and generate candidate scenic spot spatio-temporal correction weights according to the states of consistent support, unilateral conflict and no support.

[0077] Step 7: Calculate the access probability of candidate scenic spots according to the short-term travel features, the long-term preference features and the candidate scenic spot spatio-temporal correction weights, and generate a scenic spot recommendation result.

[0078] In this embodiment, step 1 specifically comprises:

[0079] Collect user location data and scenic spot information data through direct collection from database tables and data interface invocation; the user location data is obtained from operator mobile phone signaling data, including anonymized user identifiers, location record timestamps, longitudes and latitudes; the scenic spot information data is obtained from public scenic area data of authoritative institutions and map service interfaces, including scenic spot identifiers, scenic spot names, scenic spot boundary coordinates and affiliated tourism regions.

[0080] A Hadoop data processing cluster is built with HDFS as the storage base, Spark as the computing engine, and Yarn as the resource scheduling component. User location data and scenic spot information data are written to HDFS, Spark performs parallel trajectory processing according to the anonymized user identifier, and Yarn allocates the corresponding data processing tasks.

[0081] Location records are grouped according to the anonymized user identifier, and each location record is converted to a unified time base and sorted in ascending order of timestamp; duplicate location records with the same coordinates for the same anonymized user at the same timestamp are deleted; when there are multiple different coordinates for the same timestamp, the ground distance between each coordinate and the previous valid location record of the anonymized user is calculated, and the coordinate with the smallest ground distance is retained.

[0082] Organize the valid location records of the same anonymized user in chronological order, bind the anonymized user identifier, location coordinates and timestamp in sequence to generate the user's location activity trajectory, and bind and retain the corresponding original location record index with the location record in the user's location activity trajectory;

[0083] The coordinates of the scenic spot boundary are transformed to a geographic coordinate system consistent with the user's location data, and a closed region is constructed according to the connection relationship of the scenic spot boundary vertices. When the same scenic spot contains multiple discontinuous regions, the corresponding closed regions are bound to the same scenic spot identifier to generate the geographical range of the scenic spot.

[0084] In this embodiment, step two specifically includes:

[0085] The time interval between consecutive location records in the user's location activity trajectory is calculated in chronological order. The next location record that exceeds the record interval threshold is taken as the candidate dwell boundary, and the trajectory is divided into segments according to the adjacent candidate dwell boundaries.

[0086] The duration and spatial distribution of position records for each trajectory segment are statistically analyzed. The median of the longitude and latitude of the effective position records within the trajectory segment is used to generate the position center of the segment. The number of position records falling within the preset spatial radius of the position center of the segment is counted, and the proportion of the number of position records to the total number of effective position records within the trajectory segment is calculated.

[0087] Match corresponding attractions based on the spatial inclusion relationship between the location center of the segment and the geographical range of the attraction, and generate a dwell duration threshold using the historical valid visit duration of the corresponding attraction; filter dwell segments based on the duration of the trajectory segment, the dwell duration threshold, and the proportion of location records within a preset spatial radius, and generate user dwell points using the location center of the dwell segment;

[0088] Specifically, the recording interval threshold is set to 30 minutes, and the preset spatial radius is set to 300 meters. The dwell time threshold is taken as 30% of the median of the effective historical visit duration of the corresponding scenic spot in the previous 30 days, and the resulting threshold is limited to the range of 20 minutes to 60 minutes. When there are no effective historical visit records in the previous 30 days for the corresponding scenic spot, the dwell time threshold is set to 20 minutes. When the duration of the trajectory segment reaches the dwell time threshold and no less than 80% of the location records are within the 300-meter radius, the trajectory segment is written into the dwell segment.

[0089] Perform a spatial inclusion determination between the user's stop point and the geographical range of the scenic spot generated in step one; if the user's stop point is within the geographical range of a single scenic spot, write the corresponding scenic spot identifier into the scenic area visit record; if the user's stop point is within the geographical range of multiple overlapping scenic spots, calculate the distance between the user's stop point and the geometric center of each scenic spot's geographical range, and write the identifier of the scenic spot with the smallest distance into the scenic area visit record.

[0090] The number of unique stay dates for each user in the corresponding tourist area is counted according to the preset statistical period, and long-term stay users are filtered based on the number of stay dates.

[0091] Specifically, the preset statistical period is set to 30 consecutive days. When a user has no less than 15 independent stay dates in the corresponding tourist area within 30 consecutive days, the user is regarded as a long-term resident user and the corresponding user's scenic spot visit records are deleted to exclude residents near the scenic spot and scenic spot staff.

[0092] The remaining scenic spot visit records are sorted in ascending order according to arrival time. The time interval between consecutive visit records of the same scenic spot is compared with the consecutive visit interval threshold. When the time interval between two consecutive visit records does not exceed 60 minutes, the corresponding records are merged, and the merged scenic spot visit records are updated with the arrival time of the first record, the departure time of the last record, and the corresponding cumulative stay time.

[0093] The processed scenic area visit records are organized into a tourist attraction visit sequence according to time. Each scenic area visit record includes an anonymized user identifier, timestamp, attraction identifier, latitude and longitude, arrival time, departure time, and duration of stay.

[0094] In this embodiment, step three specifically includes:

[0095] The ground movement distance is calculated based on the latitude and longitude of adjacent locations recorded in the tourist attraction tour sequence. The ground movement distance is divided by the corresponding record time difference to generate the average movement speed. Anomaly location records are then filtered based on the average movement speed.

[0096] When the average speed of adjacent position records exceeds the upper limit of the speed limit, the next position record is written into the record to be verified. The stopping path distance from the previous valid position to the next valid position via the position to be verified and the direct distance from the previous valid position to the next valid position are calculated respectively. The ratio of the stopping path distance to the direct distance is compared with the abnormal distance ratio threshold. When the abnormal distance ratio threshold is reached, the record to be verified is deleted.

[0097] Specifically, the upper limit of the movement speed is set to 160km / h, and the threshold for abnormal distance ratio is set to 3;

[0098] After removing abnormal location records, calculate the time interval between adjacent attraction visit records from the departure time of the previous attraction to the arrival time of the next attraction, and divide the adjacent attraction visit records that reach the maximum interval time window into different tour itineraries;

[0099] Specifically, the maximum interval time window is set to 24 hours, so that different tour itineraries are entered when the time interval between adjacent tour records reaches 24 hours.

[0100] Configure itinerary identifiers for each tour itinerary, count the number of valid attraction visit records included in each tour itinerary, and filter short sequences based on the minimum sequence length;

[0101] Specifically, the minimum sequence length is set to 3 valid attraction visit records, and travel itineraries with fewer than 3 valid attraction visit records are deleted;

[0102] Min-Max normalization is performed on latitude and longitude and length of stay. The visit time is converted into weekday identifier and intraday time slot. Discrete index encoding is performed on anonymized user identifier, attraction identifier, intraday time slot and itinerary identifier, while retaining the original timestamp.

[0103] Stratified units are established based on the length range of the travel itinerary, the time slot within a day and the frequency of visit to attractions. The travel itineraries within each stratified unit are randomly divided so that the same stratified unit has both training samples and test samples.

[0104] Specifically, 70% of the valid travel itineraries within each stratified unit are written into the training set, and the remaining 30% are written into the test set;

[0105] The anonymized user identifier, attraction identifier, timestamp, attraction visit order, latitude and longitude, stay duration, itinerary identifier, and training and testing labels are bound together to generate a tour sequence dataset. The training set is used for subsequent model training, and the test set is used for model validation. The tourist attraction tour sequences in the tour sequence dataset are processed in step four, while historical tourist itinerary data are processed in steps five and six.

[0106] In this embodiment, step four specifically includes:

[0107] Time categories are generated based on weekday identifiers and intraday time slots; location categories are generated based on Geohash encoding of location latitude and longitude; a behavioral vocabulary is constructed based on anonymized user identifiers, attraction identifiers, time categories, and location categories, and each is mapped to a unique integer index.

[0108] The behavior embedding training is performed using the Skip-Gram structure of Word2Vec. A fixed-size sliding window is established according to the order of attractions visited in each travel itinerary. The current attraction at the center of the window is used as the center word, and the attractions before and after the center, the corresponding time category, and the location category are used as context words to form a center word-context word training sample.

[0109] The training samples are input into Word2Vec. Positive sample context words are predicted using the center word, and negative sample words are extracted from the behavior vocabulary. The embedding parameters are updated based on the prediction loss of positive and negative samples, reducing the representation distance between the center word and the positive sample context words in the embedding space and increasing the representation distance between the center word and the negative sample words. After training, continuous embedding vectors corresponding to attractions, time categories, and location categories are generated. Tourist embeddings can be trained based on anonymized user identifiers and jointly updated during the next attraction prediction training process.

[0110] Specifically, the sliding window covers three access points before and after the central attraction, the attraction embedding dimension is set to 128, the number of negative samples is set to 5, the training batch size is set to 256, the initial learning rate is set to 0.025, and the training is conducted for 20 rounds.

[0111] Based on the attraction identifier, anonymized user identifier, time category, and location category, attraction embedding, tourist embedding, time embedding, and location embedding are generated respectively, and concatenated with normalized dwell time. After processing with fully connected projection, GELU activation, and LayerNorm, a 128-dimensional attraction visit behavior embedding is generated. The attraction visit behavior embeddings are arranged according to the actual visit order in the tourist itinerary to generate a tourist attraction visit embedding sequence.

[0112] For adjacent attractions and attractions with multiple visit locations in the same travel itinerary, no target attraction or transit attraction classification labels are set in advance. Instead, they are written into the tourist attraction visit embedding sequence according to the actual visit order. Local adjacent visit relationships and itinerary context relationships across visit locations are extracted through subsequent temporal convolution of different receptive fields.

[0113] The tourist attraction visit embedding sequence is input into a temporal convolutional network. The temporal convolutional network includes three sequentially connected temporal convolutional blocks and a self-attention layer. Each temporal convolutional block includes three parallel dilated convolutional branches, a feature splicing layer, a feature projection layer, a residual connection layer, and a LayerNorm layer.

[0114] Dilated convolutions are performed on the embedded sequences of tourist attraction visits, and the receptive field is expanded by increasing the dilation rate in different temporal convolutional blocks. The three parallel dilated convolutional branches in each temporal convolutional block use one-dimensional causal convolutional kernels of different sizes, and the convolutional outputs of the three scales are concatenated to extract the contextual relationships of attractions within different visit spans.

[0115] Specifically, the dilation rates of the three temporal convolutional blocks are set to 1, 2 and 4 respectively, and the kernel sizes of the three parallel dilated convolutional branches are set to 3, 5 and 7 respectively.

[0116] The multi-scale convolution results are mapped to 128 dimensions through feature projection, and then the residuals are added to the corresponding temporal convolution block input. After GELU activation, Dropout and LayerNorm processing, temporal convolution features are generated.

[0117] The output of the last temporal convolutional block is input into the attention layer, and query features, key features, and value features are generated by query projection, key projection, and value projection, respectively. The dot product between the query features and key features is calculated, and the dot product result is divided by the square root of the dimension of a single attention head feature and then SoftMax normalization is performed. The value features are then weighted and aggregated based on the normalization result to generate global access association features.

[0118] A trainable scalar is converted into a trainable fusion weight between 0 and 1 using a Sigmoid function. The trainable fusion weight is used to weight the temporal convolutional features corresponding to the last valid visit location in the current travel itinerary. The result of subtracting the trainable fusion weight from 1 is used to weight the global visit association features. The two weighted results are summed and LayerNorm is executed to generate short-term travel features for tourists.

[0119] The temporal convolutional network is trained using the next attraction prediction task. The embedded sequence of tourist attractions visited up to the current visit location is used as the training input, the actual next attraction is used as the supervision label, and the cross-entropy between the next attraction prediction result and the actual next attraction is used as the training loss. The AdamW optimizer is used to update the parameters of the embedding layer, the three temporal convolutional blocks and the self-attention layer.

[0120] Specifically, the attention layer is set with 4 attention heads, the training batch size is set to 128, the initial learning rate is set to 0.001, the maximum training is 50 rounds, and training is stopped when the validation loss does not decrease for 5 consecutive rounds. The network parameters corresponding to the round with the lowest validation loss are used.

[0121] The trained temporal convolutional network is used to process the current travel itinerary and the historical travel itineraries before the current travel itinerary, generating short-term travel features of tourists corresponding to the current travel itinerary and the short-term travel features of tourists corresponding to each historical travel itinerary. The short-term travel features of tourists corresponding to each historical travel itinerary are then input into step five as different travel itinerary features.

[0122] In this embodiment, step five specifically includes:

[0123] Obtain the short-term travel characteristics of the same tourist for each historical travel itinerary formed before the current travel itinerary and for each historical travel itinerary generated in step four.

[0124] Calculate the cosine similarity for any two different travel itinerary features, and write all pairwise similarities into the travel itinerary similarity matrix according to the order of historical travel itineraries;

[0125] SoftMax normalization is performed on each row of the travel itinerary similarity matrix to convert the similarity between the same historical travel itinerary and other historical travel itineraries into a normalized similarity response. For each historical travel itinerary, the normalized similarity response is multiplied by the corresponding original similarity and summed to generate the attention response for the corresponding historical travel itinerary.

[0126] SoftMax normalization is performed again on the attention responses of all historical travel itineraries to generate historical travel itinerary attention weights; the short-term travel characteristics of the corresponding tourists are weighted and summed according to the historical travel itinerary attention weights to generate long-term tourist preference characteristics.

[0127] The attention weights of historical tourist trips are bound to the corresponding trip identifiers and retained. The attention weights of historical tourist trips are then input into step six to generate the spatial stability range and temporal stability range of tourists.

[0128] When a tourist has only one historical travel itinerary, the short-term travel characteristics of the tourist corresponding to that historical travel itinerary are taken as the tourist's long-term preference characteristics, and the attention weight of the corresponding historical travel itinerary is assigned a value of 1.

[0129] In this embodiment, step six specifically includes:

[0130] A personalized spatiotemporal clustering model is constructed, comprising a spatiotemporal clustering module, a migration constraint module, a dual support generation module, and a support correction module connected in sequence. The spatiotemporal clustering module processes historical visitor data, the migration constraint module processes short-term travel characteristics, long-term preference characteristics, and historical travel itinerary attention weights, the dual support generation module receives the current itinerary spatial center, current itinerary temporal center, spatial support radius, and temporal support radius, and the support correction module outputs the spatiotemporal correction weights for candidate attractions.

[0131] The spatiotemporal clustering module converts the latitude and longitude of attractions in the historical visit data of tourists into local planar coordinates of the tourist area. It uses K-means to perform spatial clustering to form spatial clusters, generates the center of the spatial cluster by the mean of the coordinates of the attractions within the cluster, and uses the 90th percentile of the distance from the attractions within the cluster to the center of the spatial cluster as the spatial support radius.

[0132] A day is divided into 72 consecutive 20-minute time slices. The distribution of attraction visits in each time slice is statistically analyzed. The Jensen-Shannon divergence is used to compare adjacent time slices. When the Jensen-Shannon divergence of adjacent time slices is not higher than 0.12, they are merged. The center of the time cluster is generated by the circumferential mean of the visit times in the merged time cluster, and the 90th percentile of the circumferential distance from the visit time to the center of the time cluster is used as the time support radius.

[0133] The current spatial cluster is generated based on the spatial cluster of the location of the last valid visited attraction in the current travel itinerary, and the current time cluster is generated based on the time cluster of the current visit time. The center of the corresponding spatial cluster and the center of the time cluster are used as the reference center for subsequent restricted migration and overlay.

[0134] The migration constraint module uses the four most recently visited attractions in the current travel itinerary to calculate the spatial displacement vectors between adjacent attractions. It then performs exponential decay based on the time interval between the time of each spatial displacement vector's visit and the current time of visit, dividing each decay result by the sum of all decay results to generate a normalized time weight. Next, it calculates the cosine similarity between each spatial displacement vector and the most recent spatial displacement vector, assigning negative values ​​to 0 and using the remaining results as direction consistency weights. Finally, it performs weighted aggregation of the spatial displacement vectors, normalized time weights, and direction consistency weights to generate the basic spatial migration amount.

[0135] Specifically, the exponential decay coefficient is set to 0.7;

[0136] Calculate the dwell time deviation between the actual dwell time of the most recently visited attractions and the median historical dwell time of the corresponding attractions, and the transfer time deviation between the actual transfer time of adjacent attractions and the median historical transfer time of the corresponding attraction combination; add the dwell time deviation and transfer time deviation together, and use the same normalized time weight as spatial migration for weighted aggregation to generate the basic time migration amount;

[0137] Tourists' short-term travel characteristics are input into the spatial migration adjustment branch and the temporal migration adjustment branch, respectively. The spatial migration adjustment branch consists of a 128-dimensional input layer, a 64-dimensional hidden layer, a migration gain output layer, and a direction correction output layer. The temporal migration adjustment branch consists of a 128-dimensional input layer, a 64-dimensional hidden layer, and a migration gain output layer. The length and direction of the basic spatial migration quantity are adjusted according to the output of the spatial migration adjustment branch, and the magnitude of the basic temporal migration quantity is adjusted according to the output of the temporal migration adjustment branch, thereby generating spatial clustering migration quantity and temporal clustering migration quantity.

[0138] Specifically, the migration gain is limited to 0.75 to 1.25, and the spatial orientation correction angle is limited to -15° to 15°;

[0139] Divide the attention weight of each historical travel itinerary generated in step five by the number of valid migration records contained in the corresponding itinerary to generate the sample weight of the corresponding historical migration record; sort the corresponding historical migration records in ascending order of the absolute value of historical spatial migration distance and historical time offset and accumulate the sample weights; take the spatial migration distance and time offset corresponding to the first time the accumulated sample weight reaches 90% as the tourist spatial stability range and tourist time stability range, respectively.

[0140] Spatial and temporal cluster migration amounts are fully preserved when they are within their respective stable ranges; when they exceed their respective stable ranges, the migration portion within the stable range is fully preserved, and 25% of the out-of-bounds migration portion is preserved, generating restricted spatial and restricted temporal migration amounts respectively; the restricted spatial migration amount is superimposed on the center of the current spatial cluster, and the restricted temporal migration amount is superimposed on the center of the current temporal cluster, generating the current travel spatial center and the current travel temporal center;

[0141] For attractions recommended for the next attraction, they are considered as candidate attractions. The dual support generation module calculates the spatial distance from each candidate attraction to the current trip's spatial center and adds candidate attractions whose spatial distance does not exceed the spatial support radius to the spatial support set. The estimated arrival time of each candidate attraction is generated by adding the current attraction's departure time to the median historical attraction transfer time of the corresponding candidate attraction. The circumferential time distance between the estimated arrival time of each candidate attraction and the current trip's time center is calculated, and candidate attractions whose circumferential time distance does not exceed the time support radius are added to the time support set. The spatial support set generation process does not use the time support results, and the time support set generation process does not use the spatial support results.

[0142] The support correction module performs consistency verification on the spatial support set and the temporal support set, writes the candidate attractions that belong to both the spatial support set and the temporal support set into the consistent support state, writes the candidate attractions that belong only to the spatial support set into the temporal one-sided conflict state, writes the candidate attractions that belong only to the temporal support set into the spatial one-sided conflict state, and writes the candidate attractions that do not belong to either the spatial support set or the temporal support set into the no support state.

[0143] The spatial normalized deviation is generated by dividing the spatial distance from the candidate attraction to the current travel time center by the spatial support radius; the time normalized deviation is generated by dividing the circumferential time distance between the expected arrival time of the candidate attraction and the current travel time center by the time support radius; the spatiotemporal correction weight of the candidate attraction in the consistent support state is assigned a value of 1; in the time-unilateral conflict state, the time normalized deviation is subtracted by 1, the natural exponent of the negative number is taken, and then multiplied by 0.70 to generate the spatiotemporal correction weight of the candidate attraction; the same processing is performed on the spatial normalized deviation in the spatial-unilateral conflict state; in the no-support state, the spatial normalized deviation and the time normalized deviation are subtracted by 1 respectively, summed, the natural exponent of the negative number of the sum is taken, and multiplied by 0.20 to generate the spatiotemporal correction weight of the candidate attraction.

[0144] The actual next site spatial change and the actual next visit time change in the training samples are used as spatial migration supervision labels and temporal migration supervision labels, respectively. The Huber loss is used to train the spatial migration adjustment branch and the temporal migration adjustment branch, and the AdamW optimizer is used to update the corresponding trainable parameters.

[0145] Specifically, the learning rate is set to 0.0005, the training batch size is set to 128, the training is conducted for 30 rounds, and after training is completed, the spatiotemporal correction weights of each candidate scenic spot are output.

[0146] In this embodiment, step seven specifically includes:

[0147] Obtain the short-term travel features of tourists generated in step four, the long-term preference features of tourists generated in step five, and the spatiotemporal correction weights of candidate attractions generated in step six. Then, concatenate the short-term travel features of tourists and the long-term preference features of tourists to generate comprehensive tourist recommendation features.

[0148] The comprehensive tourist recommendation features are input into a fully connected recommendation network, which includes a first fully connected layer, a GELU activation layer, and a candidate attraction output layer. The first fully connected layer performs feature mapping on the comprehensive tourist recommendation features, and the output dimension of the candidate attraction output layer is consistent with the current number of candidate attractions, and generates the basic visit score corresponding to each candidate attraction.

[0149] After increasing the spatiotemporal correction weight of each candidate attraction by one millionth, a natural logarithm mapping is performed. The mapping result is multiplied by the correction intensity coefficient and added to the basic visit score of the corresponding candidate attraction to generate the corrected visit score.

[0150] Specifically, the correction intensity coefficient is set to 0.5; the spatiotemporal correction weight of the candidate attractions corresponding to the consistent support state is 1, and no negative correction is generated for the corresponding basic access score; the access scores of the corresponding candidate attractions are reduced according to the spatiotemporal correction weight of the candidate attractions generated in step six for the time-side conflict state, the spatial-side conflict state, and the no-support state.

[0151] SoftMax normalization is performed on the corrected visit scores of all candidate attractions to generate the visit probability of each candidate attraction;

[0152] The training set uses the access sequence up to the current access position as input, the actual next access point as supervision label, and the cross-entropy between the access probability of candidate points and the actual next access point as recommendation loss. The AdamW optimizer is used to train a fully connected recommendation network.

[0153] Specifically, the training learning rate of the fully connected recommendation network was set to 0.0005, the batch size was set to 128, and the training lasted for 30 epochs.

[0154] After completing the phased training of the temporal convolutional network, the spatial transfer adjustment branch and the temporal transfer adjustment branch in the personalized spatiotemporal clustering model, and the fully connected recommendation network, joint fine-tuning is performed. In the joint fine-tuning stage, the spatial cluster and temporal cluster generated in step six are fixed, and the last temporal convolutional block, self-attention layer, spatial transfer adjustment branch, temporal transfer adjustment branch, and fully connected recommendation network are updated. The cross-entropy of the next spot prediction is used as the main loss, and the spatial transfer Huber loss and the temporal transfer Huber loss are multiplied by 0.2 and added to the main loss to generate the joint training loss.

[0155] Specifically, the joint fine-tuning uses the AdamW optimizer with a learning rate of 0.0001 and is trained for 10 epochs.

[0156] In the inference phase, based on the tourist's completed attraction visit records, short-term travel characteristics are generated in step four, long-term preference characteristics are generated based on the tourist's historical travel itinerary before the current travel itinerary in step five, and spatiotemporal correction weights for candidate attractions are generated in step six. Then, the corrected visit scores for each candidate attraction are generated through a fully connected recommendation network, and SoftMax normalization is performed on the corrected visit scores to generate the visit probabilities of candidate attractions.

[0157] Candidate attractions are ranked from highest to lowest based on their access probability. Starting from the first ranked attraction, a preset number of candidate attractions are selected sequentially. The corresponding candidate attraction identifier, access probability, spatial support status, temporal support status, conflict type, and spatiotemporal correction weight are then bound together to generate attraction recommendation results.

[0158] Specifically, the preset number of recommendations is set to 5.

[0159] Example 1: To verify the feasibility of this invention in practice, it was applied to a next attraction recommendation scenario in a tourist area of ​​a city. Location service data for three consecutive months was collected. The original data covered approximately 21,000 anonymized users and 132 attractions. After removing long-term resident users, deleting abnormal location records, segmenting travel itineraries, and filtering short sequences, approximately 18,600 valid tourists and 159,000 valid travel itineraries were obtained. Users may temporarily change their travel direction, extend their stay at attractions, or detour to other areas during their travels. Therefore, this scenario can simultaneously test the regular recommendation capability, the adaptability when the current travel itinerary deviates, and the spatiotemporal consistency of candidate attractions.

[0160] During implementation, the recording interval threshold was set to 30 minutes, the preset spatial radius was set to 300 meters, and the stay duration threshold was set to 30% of the median of the effective historical visit duration of the corresponding scenic spot in the previous 30 days, limited to 20-60 minutes. Users with no fewer than 15 independent stay dates in the corresponding tourist area within 30 consecutive days were considered long-term resident users. The upper limit of movement speed was set to 160 km / h, the abnormal distance ratio threshold was set to 3, the maximum interval time window was set to 24 hours, each tourist itinerary contained at least 3 effective scenic spot visit records, and the training set and test set were divided at 70% and 30% respectively.

[0161] Behavioral embedding is performed on the tourist attraction visit sequence, with the attraction embedding dimension set to 128. The temporal convolutional network uses three sequentially connected temporal convolutional blocks with dilation rates of 1, 2, and 4 respectively. The kernel sizes of the parallel dilated convolutional branches are 3, 5, and 7 respectively, and four attention heads are set in the self-attention layer. The similarity matrix of tourist itineraries is calculated based on the short-term travel characteristics of tourists corresponding to each historical tourist itinerary. The attention weights of historical tourist itineraries are obtained through two-stage SoftMax processing and weighted aggregation to generate long-term tourist preference features.

[0162] The personalized spatiotemporal clustering model divides a day into 72 consecutive 20-minute time slices. Merging is performed when the Jensen-Shannon divergence between adjacent time slices is no higher than 0.12. The spatial and temporal support radii are calculated using the 90th percentile of their respective distance distributions. The migration constraint module generates basic spatial and temporal migration values ​​using the four most recently visited attractions in the current travel itinerary. The exponential decay coefficient is set to 0.7, the migration gain is limited to 0.75–1.25, and the spatial orientation correction angle is limited to -15°–15°. When the cumulative sample weight reaches 90%, a stable spatial and temporal range for tourists is generated. 25% of the migration exceeding the stable range is retained. Spatial and temporal support sets are generated independently. The spatiotemporal correction weight for candidate attractions with consistent support is set to 1. Temporal and spatial one-sided conflicts use 0.70 as the initial correction coefficient, while unsupported states use 0.20.

[0163] To verify the performance of different technical structures, comparison method A uses LSTM combined with an attention mechanism to predict the next attraction based on the continuous attraction visit sequence, and its characteristic is that it has good modeling of local visit order relationships; comparison method B uses a temporal convolutional network and self-attention without the improvement of this invention, and its characteristic is that it can quickly respond to changes in the current travel itinerary through different receptive fields; comparison method C, based on comparison method B, integrates long-term tourist preference features and uses conventional spatiotemporal clustering, and its characteristic is that the recommendation ranking is more stable and it can exclude some candidate attractions with obviously unreasonable spatiotemporal locations. The test results are shown in Table 1 below:

[0164] Table 1. Comprehensive Test Results of Different Tourist Attraction Recommendation Methods

[0165] Comparison Method A 69.4 53.1 46.8 54.7 14.2 Comparison Method B 72.8 54.0 45.9 60.8 13.5 Comparison Method C 74.1 57.2 48.3 58.6 9.4 This invention 78.3 60.6 51.7 68.9 5.9

[0166] As shown in Table 1, Comparison Method A achieves an MRR of 46.8%, higher than Comparison Method B, indicating that the cyclic structure has a certain advantage in the order of visiting adjacent attractions. However, the Hit@5 of the itinerary deviation scenario is only 54.7%, showing limited adaptability to changes in the current itinerary. Comparison Method B achieves a Hit@5 of 72.8% and a Hit@5 of the itinerary deviation scenario of 60.8%, indicating that dilated convolution, multi-scale convolution, and self-attention can expand the receptive field of the visit sequence and respond quickly to short-term changes. However, its misrecommendation rate due to spatiotemporal conflict still reaches 13.5%. Comparison Method C, by introducing long-term tourist preference features and conventional spatiotemporal clustering, increases NDCG@5 to 57.2% and MRR to 48.3%, while reducing the misrecommendation rate due to spatiotemporal conflict to 9.4%, demonstrating good ranking stability. However, since long-term preferences directly participate in the current recommendation, its Hit@5 of the itinerary deviation scenario is actually lower than that of Comparison Method B, indicating that stable historical preferences may limit recommendation adjustments when the current travel itinerary changes significantly.

[0167] The Hit@5, NDCG@5, and MRR of this invention reached 78.3%, 60.6%, and 51.7%, respectively, all of which are the best results among the tested methods. In particular, in the test samples where the current travel itinerary deviates from historical patterns, Hit@5 reached 68.9%, which is 8.1 percentage points higher than the comparative method B, which performed better in this scenario. At the same time, it reduced the false recommendation rate due to spatiotemporal conflict from 9.4% in the comparative method C to 5.9%. The reason for this is that this invention forms the basic migration amount based on the current actual spatial displacement and temporal deviation of attractions, adjusts the migration response using the short-term travel characteristics of tourists, and forms the tourist spatial stability range and tourist temporal stability range through the attention weight of historical travel itineraries. Only the migration part exceeding the stability range is compressed. Therefore, it can maintain the responsiveness to changes in the current travel itinerary and the stability constraint of long-term preferences at the same time. Furthermore, by generating spatial support sets and temporal support sets independently, confirming consistency, and correcting one-sided conflicts, it reduces the situation where candidate attractions with spatial matching but unreasonable time or temporal matching but abnormal spatial migration have a high access probability, thereby improving the accuracy, ranking quality, and spatiotemporal consistency of the next attraction recommendation.

[0168] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A scenic spot recommendation method based on temporal convolutional networks, characterized in that, comprising the following steps: Step 1: Collect user location data and scenic spot information data, and generate user location activity trajectories and scenic spot geographic ranges; Step 2: Extract user stay points and match them with the geographic ranges of scenic spots, exclude residents near scenic spots and scenic area staff according to the number of stay days, and generate tourist scenic spot tour sequences; Step 3: Eliminate abnormal location records, segment travel itineraries and filter short sequences to generate a tour sequence dataset; Step 4: Perform behavior embedding on the tourist scenic spot tour sequences, generate tourist scenic spot visit embedding sequences and input them into a temporal convolutional network, and generate tourist short-term travel features through dilated convolution, multi-scale convolution, residual connection and self-attention processing; Step 5: Calculate the similarity of different travel itinerary features, and generate tourist long-term preference features through attention-weighted aggregation; Step 6: Input the tourist historical tour data and the long and short-term features into a personalized spatio-temporal clustering model, generate the spatio-temporal clustering migration amount according to the short-term travel features, limit the migration range with the long-term preference, respectively generate a spatial support set and a temporal support set and perform consistency confirmation, and generate the spatio-temporal correction weights of candidate scenic spots according to the states of consistent support, one-side conflict and no support; Step 7: Calculate the access probability of candidate scenic spots according to the short-term travel features, long-term preference features and the spatio-temporal correction weights of candidate scenic spots, and generate scenic spot recommendation results.

2. The scenic spot recommendation method based on temporal convolutional networks according to claim 1, characterized in that, The user location data includes anonymized user identifiers, location record timestamps, longitude and latitude, and the scenic spot information data includes scenic spot identifiers, scenic spot boundary coordinates and affiliated tourist areas; Write the user location data and scenic spot information data into HDFS, Spark performs parallel trajectory processing according to the anonymized user identifiers, and Yarn allocates corresponding data processing tasks; Group the location records according to the anonymized user identifiers, convert the location records to a unified time reference and sort them in ascending order of timestamps, and delete duplicate location records under the same timestamp; When there are multiple different coordinates for the same timestamp, retain the coordinate with the minimum surface distance from the last valid location record, and organize the valid location records in chronological order to generate the user location activity trajectory; Convert the scenic spot boundary coordinates to the same geographic coordinate system as the user location data, construct a closed area according to the connection relationship of the scenic spot boundary vertices, bind the corresponding closed area with the scenic spot identifier, and generate the geographic range of the scenic spot.

3. The scenic spot recommendation method based on temporal convolutional networks according to claim 1, characterized in that, The step 2 specifically includes: Calculate the time interval between consecutive location records in the user location activity trajectory, divide trajectory segments according to the record interval threshold, count the duration of the trajectory segments and the spatial distribution of location records, screen stay segments according to the segment duration and the proportion of location records within a preset spatial radius, and generate user stay points according to the valid location records in the stay segments; Perform spatial inclusion judgment on the user stay points and the geographic ranges of scenic spots to generate scenic area tour records; when a user stay point is located within the geographic ranges of multiple scenic spots at the same time, respectively calculate the distance between the stay point and the geometric center of the geographic range of each scenic spot, and write the scenic spot identifier with the smallest distance into the scenic area tour record; The number of independent stay dates of users in the corresponding tourist area is counted according to the preset statistical period. Users who reach the stay date threshold are regarded as long-term users and their scenic spot visit records are deleted. The remaining scenic spot visit records are arranged according to arrival time. The time interval between consecutive visit records of the same scenic spot is compared with the consecutive visit interval threshold. Records with time intervals not exceeding the consecutive visit interval threshold are merged and organized into a tourist scenic spot visit sequence according to time order.

4. The scenic spot recommendation method based on temporal convolutional networks according to claim 1, characterized in that, Step three specifically includes: The ground movement distance is calculated based on the latitude and longitude of adjacent locations in the tourist attraction tour sequence. The ground movement distance is divided by the corresponding time difference to generate the average movement speed. Locations that exceed the upper limit of movement speed are written into the record to be verified. Calculate the stopping path distance from the previous valid position to the next valid position via the position to be verified, and the direct distance from the previous valid position to the next valid position. When the ratio of the stopping path distance to the direct distance reaches the abnormal distance ratio threshold, delete the record of the position to be verified. Calculate the time interval between the departure time of the previous attraction and the arrival time of the next attraction between adjacent attraction visit records, divide the adjacent attraction visit records that reach the maximum interval time window into different travel itineraries, and filter short sequences according to the number of valid attraction visit records included in the travel itinerary; Min-Max normalization is performed on latitude and longitude and length of stay. The visit time is converted into weekday identifier and intraday time slot. Discrete index encoding is performed on anonymized user identifier, attraction identifier, intraday time slot and itinerary identifier. Hierarchical units are established according to the travel itinerary length range, intraday time slot and attraction visit frequency. Training set and test set are divided in each hierarchical unit to generate tour sequence dataset.

5. The scenic spot recommendation method based on temporal convolutional networks according to claim 1, characterized in that, Step four specifically includes: Time categories are generated based on weekday identifiers and intraday time slots; location categories are generated based on Geohash encoding of location latitude and longitude; a behavioral vocabulary is constructed based on anonymized user identifiers, attraction identifiers, time categories, and location categories, and each is mapped to a unique integer index. The Skip-Gram structure of Word2Vec is used to build a sliding window according to the order of attraction visits. The currently visited attraction is used as the center word, and the previous and subsequent visited attractions, time category, and location category are used as context words. Continuous embedding vectors are obtained by training with positive sample context words and negative sample words. Based on the attraction identifier, anonymized user identifier, time category, and location category, attraction embedding, tourist embedding, time embedding, and location embedding are generated respectively. They are then concatenated with the normalized dwell time and processed by fully connected projection, GELU activation, and LayerNorm to generate attraction visit behavior embedding. Finally, they are arranged according to the actual visit order within the travel itinerary to generate a tourist attraction visit embedding sequence. Tourist attraction visits are embedded into a temporal convolutional network. After dilated convolution, multi-scale convolution, residual connections, and self-attention processing, temporal convolutional features and global visit association features are generated. The temporal convolutional features and global visit association features are then weighted and fused to generate short-term travel features for tourists.

6. The scenic spot recommendation method based on temporal convolutional networks according to claim 5, characterized in that, The temporal convolutional network includes multiple sequentially connected temporal convolutional blocks and a self-attention layer. Each temporal convolutional block includes multiple parallel dilated convolutional branches, a feature splicing layer, a feature projection layer, a residual connection layer, and a LayerNorm layer. Different temporal convolutional blocks use an increasing dilation rate, and each parallel dilated convolutional branch uses a one-dimensional causal convolutional kernel of different size. The outputs of each parallel dilated convolutional branch are concatenated for features, and after feature projection, they are added to the input of the corresponding temporal convolutional block to generate temporal convolutional features. The output of the last temporal convolutional block is input into the attention layer. Query features, key features, and value features are generated through query projection, key projection, and value projection. SoftMax normalization is performed on the scaled dot product result of the query features and key features. The value features are then weighted and aggregated based on the normalization result to generate global access association features. Trainable fusion weights are used to weight the temporal convolutional features corresponding to the last valid visit location in the current travel itinerary, and the global visit association features are weighted by subtracting the trainable fusion weights from one. The two weighted results are summed and LayerNorm is applied to generate short-term travel features of tourists. The actual next-visit destination is used as the supervision label, and the cross-entropy between the predicted next-visit destination and the actual next-visit destination is used as the training loss to train the temporal convolutional network.

7. The scenic spot recommendation method based on temporal convolutional networks according to claim 1, characterized in that, Step five specifically includes: A temporal convolutional network is used to process each historical travel itinerary before the current travel itinerary, generating short-term travel features of tourists corresponding to each historical travel itinerary, and using the short-term travel features of tourists corresponding to each historical travel itinerary as features of different travel itineraries. Calculate the cosine similarity between any two different tourism itinerary features, and construct a tourism itinerary similarity matrix according to the historical tourism itinerary arrangement order; SoftMax normalization is performed on each row of the travel itinerary similarity matrix to generate normalized similar responses. The normalized similar responses are multiplied by the corresponding original similarity and then summed to generate the attention responses for each historical travel itinerary. SoftMax normalization is performed on the attention response of all historical travel itineraries to generate historical travel itinerary attention weights, and the corresponding short-term travel features of tourists are weighted and aggregated according to the historical travel itinerary attention weights to generate long-term tourist preference features. Bind the attention weight of historical travel itineraries to the corresponding itinerary identifiers.

8. The scenic spot recommendation method based on temporal convolutional networks according to claim 1, characterized in that, Step six specifically includes: A personalized spatiotemporal clustering model is constructed, which includes a spatiotemporal clustering module, a migration constraint module, a dual support generation module, and a support correction module connected in sequence. The spatiotemporal clustering module converts the latitude and longitude of attractions in the historical visit data of tourists into local planar coordinates of the tourist area, performs spatial clustering to generate spatial clusters, spatial cluster centers and spatial support radii, and statistically analyzes the distribution of attraction visits according to continuous time slices. It also performs temporal clustering based on the Jensen-Shannon divergence of adjacent time slices to generate time clusters, time cluster centers and time support radii. The migration constraint module generates basic spatial migration and basic temporal migration based on the spatial displacement and temporal progression deviation of attractions in the current travel itinerary. It adjusts the basic spatial migration and basic temporal migration based on the short-term travel characteristics of tourists, generates spatial clustering migration and temporal clustering migration, and uses the historical travel itinerary attention weight obtained when generating long-term tourist preference characteristics to generate the tourist spatial stability range and tourist temporal stability range. It compresses the migration part that exceeds the corresponding stability range and generates the current itinerary spatial center and current itinerary temporal center. The dual support generation module generates a spatial support set based on the spatial distance between candidate attractions and the current travel space center, generates the expected arrival time of candidate attractions based on the departure time of the current attractions and the transfer time of historical attractions, and generates a time support set based on the circumferential time distance between the expected arrival time and the current travel time center. The spatial support set generation process does not use the time support results, and the time support set generation process does not use the spatial support results. The support correction module performs consistency verification on the spatial support set and the temporal support set, divides the candidate attractions into consistent support, temporal one-sided conflict, spatial one-sided conflict and no support states, and generates the spatiotemporal correction weights of the candidate attractions according to the corresponding states.

9. A scenic spot recommendation method based on a temporal convolutional network according to claim 8, characterized in that, The migration constraint module specifically includes: Based on the displacement between the most recently visited attractions in the current travel itinerary, a spatial displacement vector is generated. Then, exponential decay and normalization are performed according to the time interval between the time of each displacement and the current time of visit to generate a normalized time weight. The cosine similarity between each spatial displacement vector and the most recent spatial displacement vector is calculated. Negative values ​​are assigned to zero to generate a direction consistency weight. The spatial displacement vector, normalized time weight, and direction consistency weight are weighted and aggregated to generate the basic spatial migration amount. Calculate the time deviation between the actual stay duration and the median historical stay duration of the corresponding attraction, and the time deviation between the actual transfer time and the median historical transfer time of the corresponding attraction combination. Add the two types of deviations and perform weighted aggregation using normalized time weights to generate the basic time migration quantity. Input the short-term travel characteristics of tourists into the spatial migration adjustment branch and the temporal migration adjustment branch respectively to adjust the basic spatial migration quantity and the basic temporal migration quantity, and generate the spatial clustering migration quantity and the temporal clustering migration quantity. The attention weights of historical tourist trips are allocated according to the number of valid migration records of the corresponding trips. The samples are sorted and accumulated according to the absolute value of historical spatial migration distance and historical time offset. Based on the spatial migration distance and time offset corresponding to the stable coverage ratio of the accumulated sample weights, the stable spatial range and stable temporal range of tourists are generated. Spatial and temporal cluster migration amounts are fully preserved when they are within their respective stable ranges. When they exceed their respective stable ranges, the migration portion within the stable range is preserved, and the out-of-bounds migration portion is preserved according to a preset compression ratio, generating restricted spatial and temporal migration amounts. The restricted spatial migration amount is superimposed on the center of the current spatial cluster, and the restricted temporal migration amount is superimposed on the center of the current temporal cluster, generating the current travel spatial center and the current travel temporal center.

10. The scenic spot recommendation method based on temporal convolutional networks according to claim 1, characterized in that, Step seven specifically includes: By combining tourists' short-term travel characteristics and long-term preference characteristics, a comprehensive tourist recommendation feature is generated. The comprehensive tourist recommendation features are input into the fully connected recommendation network. Feature mapping is performed through the first fully connected layer and the GELU activation layer. The basic visit score corresponding to each candidate attraction is generated through the candidate attraction output layer. After adding a preset positive number to the spatiotemporal correction weight of the candidate attractions, a natural logarithm mapping is performed. The mapping result is multiplied by the correction intensity coefficient and then added to the basic visit score of the corresponding candidate attraction to generate a corrected visit score. Perform SoftMax normalization on the corrected visit scores of all candidate attractions to generate visit probabilities for each candidate attraction; The actual next-visited attractions are used as supervision labels, and the cross-entropy between the visit probability of candidate attractions and the actual next-visited attractions is used as the recommendation loss. A fully connected recommendation network is trained, and after the phased training is completed, joint fine-tuning is performed on the trainable structures in the temporal convolutional network, the personalized spatiotemporal clustering model and the fully connected recommendation network. Candidate attractions are ranked from highest to lowest based on their visit probability, and attraction recommendations are generated based on a preset number of recommendations.

Citation Information

Patent Citations

  • Scenic spot recommendation method and system considering long-term preferences and short-term preferences of users

    CN112182398A

  • Travel behavior identification method based on mobile big data

    CN112800348A

  • Interest point recommendation method and system based on STA-TCN neural network framework

    CN113158038A