Route recommendation method and system in smart scenic area based on user portrait

By constructing heterogeneous graphs and using deep learning models, combined with user portraits and scenic spot information, personalized scenic tour routes are generated, which solves the problem that route recommendations in the existing technology cannot meet personalized needs, and achieves a more efficient tourist experience improvement. .

CN118656547BActive Publication Date: 2024-10-25西安衍舆航天科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411142532.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-10-25
Estimated Expiration
2044-08-20

AI Technical Summary

Technical Problem

Existing tour route recommendations in scenic spots mainly rely on manual design, which cannot meet the personalized needs of tourists, cannot fully integrate multi-modal data, and ignore user preferences and scenic spot status.

Method used

A route recommendation method in smart scenic spots based on user portraits is adopted. By obtaining tourists' personal information and scenic spot POI information, a heterogeneous graph is constructed and a graph neural network and a two-way long short-term memory network are used to generate a fused POI and tourist embedding representation and calculate the interest score. , and combined with the route generation model to generate personalized routes, taking into account user preferences, scenic spot status and multi-source heterogeneous information.

Benefits of technology

It realizes personalized tour route recommendation, improves tourist experience, and can generate the most appropriate tour route based on user characteristics and scenic spot information to meet the diverse needs of tourists.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656547B_ABST
    Figure CN118656547B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for recommending routes in a smart scenic spot based on user portraits, which relates to the technical field of route planning, including obtaining personal information data of tourists in the scenic spot and preprocessing it, constructing a multi-dimensional tourist portrait based on the preprocessed data, and constructing a scenic spot POI information model at the same time; constructing a heterogeneous graph including tourist nodes and POI nodes based on the scenic spot POI information model, using a graph neural network to train the heterogeneous graph, obtaining a POI embedding representation that integrates scenic spot information and the multi-dimensional tourist portrait, and using a bidirectional long short-term memory network to extract features from tourists' historical behavior trajectory data to obtain a tourist behavior embedding representation; matching the POI embedding representation with the tourist behavior embedding representation, calculating the interest score of tourists for each POI node in the scenic spot, inputting the obtained interest score of each POI node into a pre-constructed route generation model, and generating a personalized recommended tour route.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to route planning technology, and in particular to a method and system for recommending routes in a smart scenic area based on user portraits. Background Art

[0002] With the rapid development of smart tourism, providing personalized tourism services to tourists has become the key to improving tourist satisfaction and travel experience. POI is the abbreviation of Point of Interest in English, which is translated into Chinese as points of interest or places of interest. In the fields of map navigation, travel and so on, POI usually refers to a geographical entity with certain attraction and visiting value. POI usually contains attribute information such as geographic location coordinates, address, type, description, etc. In modern navigation systems and map applications, POI is a very important data component, which is used to identify and query places of interest and provide location services for users. In the context of smart scenic spots, various attractions, service facilities, etc. in the scenic area can be regarded as POI. Through the modeling, analysis and reasoning of POI, personalized tour routes can be recommended to tourists, intelligent scene services can be provided, etc., which greatly improves the tourist experience.

[0003] At present, the recommendation of tour routes in scenic spots mainly relies on manual design and experience summary. The traditional route recommendation method of scenic spots is often based on fixed route templates and cannot meet the personalized needs of tourists. User portrait technology is a technology that builds a comprehensive user portrait by analyzing and mining multidimensional data such as user historical behavior data, personal information, and social attributes. It can comprehensively portray the user's interests, hobbies, demographic attributes, lifestyle and other characteristics, providing an important basis for personalized recommendations. Personalized route recommendation requires calculating the user's interest score for each scenic spot, and generating the optimal route based on this score combined with the path planning algorithm. This requires that the scoring method and the planning algorithm can fully integrate multimodal data and take into account constraints such as user preferences and scenic spot status. Therefore, the present invention proposes a route recommendation strategy method for smart scenic spots based on user portraits, which aims to recommend the most suitable tour route for tourists based on their personal characteristics, preferences and behavior data. Summary of the invention

[0004] The embodiments of the present invention provide a method and system for recommending routes in a smart scenic spot based on user portraits, which can solve the problems in the prior art.

[0005] According to a first aspect of the embodiments of the present invention,

[0006] A method for recommending routes in a smart scenic spot based on user portraits is provided, comprising:

[0007] Obtain and preprocess the personal information data of tourists in the scenic area, build a multi-dimensional tourist portrait based on the preprocessed data, and build a scenic area POI information model that includes scenic area information and tourist visit behavior weights;

[0008] Based on the scenic spot POI information model, a heterogeneous graph including tourist nodes and POI nodes is constructed, wherein the edges between tourist nodes and POI nodes in the heterogeneous graph represent the tourist's POI visit behavior, and the edges between POI nodes represent the POI spatial adjacency relationship. A graph neural network is used to train the heterogeneous graph to obtain a POI embedding representation that integrates scenic spot information and multi-dimensional tourist portraits, and a bidirectional long short-term memory network is used to extract features from tourists' historical behavior trajectory data to obtain a tourist behavior embedding representation;

[0009] The POI embedding representation is matched with the tourist behavior embedding representation, and the tourist interest score for each POI node in the scenic area is calculated. The obtained interest score of each POI node is input into a pre-built route generation model to generate a personalized recommended tour route.

[0010] In an optional embodiment,

[0011] The heterogeneous graph is trained using a graph neural network to obtain a POI embedding representation that integrates scenic spot information and multi-dimensional tourist portraits. At the same time, a bidirectional long short-term memory network is used to extract features from tourists' historical behavior trajectory data to obtain a tourist behavior embedding representation including:

[0012] A heterogeneous graph neural network is used to model the POI heterogeneous graph and construct a heterogeneous graph tower. Through recursive neighbor aggregation and feature propagation, the scenic spot information and multi-dimensional tourist portraits are integrated to generate the initial POI embedding representation.

[0013] A bidirectional long short-term memory network based on the attention mechanism is used to model the tourist behavior sequence, construct a sequence tower, and incorporate spatiotemporal features to encode the spatiotemporal dependency of tourist behavior to generate an initial tourist behavior embedding representation.

[0014] The obtained initial POI embedding representation and the initial tourist behavior embedding representation are feature fused to obtain a fused feature representation. Based on the fused feature representation, a multi-task network model including the POI embedding representation learning task and the tourist behavior prediction task is constructed, and a joint multi-task loss function is constructed by combining the POI embedding representation learning task loss and the tourist behavior prediction loss. The gradient descent optimization algorithm is used to update the multi-task network model parameters, and the iteration is repeated until the preset termination condition is met to obtain a trained multi-task network model.

[0015] The obtained initial POI embedding representation and initial tourist behavior embedding representation are input into the trained multi-task network model to obtain the final POI embedding representation and tourist behavior embedding representation.

[0016] In an optional embodiment,

[0017] The calculation formula for constructing a joint multi-task loss function by combining the POI embedding representation learning task loss and the tourist behavior prediction loss is as follows:

[0018] ;

[0019] Where L represents the joint loss function, α represents the weight of the POI embedding representation learning task loss, G represents the POI node set, and d represents the dimension of the embedding representation. represents the v-th dimension embedding representation of POI node p, represents the updated v-th dimension embedding representation of POI node p, β represents the weight coefficient of tourist behavior prediction loss, Q represents the sample set, N represents the number of behavior categories, and y q,i represents the true label of the i-th behavior category of sample q, represents the predicted label of the i-th behavior category of sample q, ε represents the smoothing term.

[0020] In an optional embodiment,

[0021] The POI embedding representation is matched with the tourist behavior embedding representation, the tourist interest score for each POI node in the scenic area is calculated, and the obtained interest score of each POI node is input into the pre-built route generation model to generate a personalized recommended tour route, including:

[0022] Obtain the tourist behavior sequence and POI information in the scenic area, use the bidirectional long short-term memory network to model the tourist behavior sequence, obtain the tourist behavior embedding representation, use the graph neural network to learn the representation of POI in the scenic area, obtain the POI embedding representation, match the tourist behavior embedding representation with the POI embedding representation, and obtain the tourist interest score for the embedded representation of each POI in the scenic area;

[0023] According to the tourists’ interest scores on the embedded representations of each POI in the scenic area, the preference distribution of tourists on the embedded representations of each POI in the scenic area is generated. At the same time, the tourists’ historical trajectories and candidate POI nodes and the corresponding historical trajectory embedded representations and candidate POI node embedded representations are obtained as input sequences and input into the pre-trained route generation model.

[0024] In the route generation model, the encoder is used to encode the historical trajectory of tourists to obtain the hidden state representation of the trajectory, and the decoder is used to splice the tourist portrait and the tourist's current location coordinates with the candidate POI node embedding representation, and the attention distribution is calculated based on the current hidden state representation and the input sequence;

[0025] The next POI node to be visited is selected based on the obtained attention distribution. The POI nodes and visit order in the recommended tour route are constrained according to the tourists' available tour time, their physical level and the expected tour duration of the POI nodes. At the same time, a personalized recommended tour route is generated based on the opening hours of the scenic spot and the real-time passenger flow.

[0026] In an optional embodiment,

[0027] The tourist's historical trajectory and candidate POI nodes and the corresponding historical trajectory embedding representation and candidate POI node embedding representation are obtained as input sequences, and before being input into the pre-trained route generation model, the following is also included:

[0028] Obtain the historical trajectory and real tour trajectory of tourists, and map the POI nodes passed in the historical trajectory and the real tour trajectory into corresponding POI position sequences, respectively, to obtain the historical trajectory sequence and the real tour trajectory sequence;

[0029] The encoder and decoder structures in the route generation model are constructed using a bidirectional long short-term memory network, wherein the encoder converts the input POI position sequence into a corresponding context vector, and the decoder generates a recommended POI position sequence according to the obtained context vector;

[0030] A random number generator is used to generate a random number, and the input of the encoder is selected according to the comparison result between the random number and the preset probability threshold. If the random number is less than the preset probability threshold, the first POI node in the actual tour trajectory is used as the input of the decoder. Otherwise, the first POI node in the POI position sequence recommended by the route generation model is used as the input of the decoder.

[0031] The final decoder input is passed to the constructed route generation model for forward calculation, and the historical trajectory sequence is converted into a historical trajectory sequence context vector through the encoder. Based on the obtained historical trajectory sequence context vector, a recommended POI position sequence is generated;

[0032] By minimizing the difference between the recommended POI location sequence and the actual tour trajectory sequence, the back propagation algorithm is used to update the parameters of the route generation model. The iteration is repeated until the predetermined number of iterations is reached to obtain the final trained route generation model.

[0033] In an optional embodiment,

[0034] After inputting the obtained interest scores of each POI node into a pre-built route generation model to generate a personalized recommended tour route, the method further includes:

[0035] A Markov decision process is constructed, and the route generation model is used as an intelligent agent. The current location, time and preference of tourists are used as the state space of the Markov decision process, and the set of POI nodes in the scenic area is used as the action space of the intelligent agent. A composite reward function is designed, which comprehensively considers tourist satisfaction, coverage of popular attractions, rationality of travel time and route diversity.

[0036] A deep neural network is used to construct a policy network and a value network. The policy network generates a probability distribution over the set of POI nodes in the scenic area according to the current state, and the value network takes the current state of the tourist as input and outputs the expected cumulative reward under the current state.

[0037] Construct a policy gradient algorithm to collect a series of state, action, and reward trajectory data through the interaction between the agent and the environment, calculate the cumulative reward of each state through the temporal difference algorithm, and use it as the objective function;

[0038] Minimize the objective function and use the gradient ascent algorithm to update the parameters of the policy network so that the recommended route generated by it can obtain a higher expected cumulative reward. At the same time, use the temporal difference algorithm to update the parameters of the value network. Repeat the iteration until the model converges to obtain the optimized route generation model. Use the optimized route generation model to dynamically adjust the recommended route according to the real-time location and preferences of tourists to obtain the optimal tour route.

[0039] In an optional embodiment,

[0040] Construct a policy gradient algorithm, collect a series of state, action and reward trajectory data through the interaction between the agent and the environment, calculate the cumulative reward of each state through the temporal difference algorithm, and use it as the calculation formula of the objective function as follows:

[0041] ;

[0042] Among them, J(θ) represents the objective function, θ represents the parameters of the current policy network, According to the strategy π θ The generated trajectory τ performs the desired operation, π θ (a t |s t ) means that in a given state s t In this case, the policy network outputs action a according to the parameter θ t The probability of Indicates that in a given state st Next, the old policy network is based on the parameter θ old Output action a t The probability of, T represents the maximum time steps of the trajectory, t represents the time step, γ represents the discount factor, R(s t ,a t ) means in state s t Execute action a t The immediate reward obtained after t ) represents the benchmark function.

[0043] According to a second aspect of the embodiments of the present invention,

[0044] Provided is a route recommendation system for a smart scenic spot based on user portraits, including:

[0045] The first unit is used to obtain and pre-process the personal information data of tourists in the scenic area, build a multi-dimensional tourist portrait based on the pre-processed data, and build a scenic area POI information model containing scenic area information and tourist visit behavior weights;

[0046] The second unit is used to construct a heterogeneous graph including tourist nodes and POI nodes based on the scenic spot POI information model, wherein the edges between the tourist nodes and the POI nodes in the heterogeneous graph represent the tourist's POI visit behavior, and the edges between the POI nodes represent the POI spatial adjacency relationship, and the heterogeneous graph is trained using a graph neural network to obtain a POI embedding representation that integrates scenic spot information and multi-dimensional tourist portraits, and a bidirectional long short-term memory network is used to extract features from the historical behavior trajectory data of tourists to obtain an embedded representation of tourist behavior;

[0047] The third unit is used to match the POI embedding representation with the tourist behavior embedding representation, calculate the tourist's interest score for each POI node in the scenic area, input the obtained interest score of each POI node into a pre-built route generation model, and generate a personalized recommended tour route.

[0048] According to a third aspect of the embodiments of the present invention,

[0049] An electronic device is provided, comprising:

[0050] processor;

[0051] a memory for storing processor-executable instructions;

[0052] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.

[0053] According to a fourth aspect of the embodiments of the present invention,

[0054] A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.

[0055] In this embodiment, by preprocessing the personal information data of tourists, a multi-dimensional tourist portrait can be constructed to fully understand the interests, hobbies, demographic characteristics, etc. of tourists, laying the foundation for personalized recommendations. The scenic spot information and the weight of tourist access behavior are integrated to construct a rich POI information model, which can well characterize the attributes and relationships of various scenic spots in the scenic spot. Tourists and POIs are modeled as heterogeneous networks, and graph neural networks are used for representation learning, which can automatically capture complex topological structure information such as tourists-POI and POI-POI. The bidirectional long short-term memory network is used to perform time series modeling on the historical behavior trajectory of tourists, which can well characterize the dynamic behavior preferences of tourists. Combining the embedded representation of scenic spot POI and the embedded representation of tourist behavior, the multimodal fusion of tourist portraits, scenic spot information and behavior sequences is realized, providing rich semantic features for personalized recommendations. By inputting the interest score into the route generation model, a tour route that meets personalized needs can be generated according to tourist preferences and scenic spot status. Multi-source heterogeneous information is integrated, and tourist portraits, scenic spot knowledge and behavior patterns are automatically mined through a deep learning model, so as to better understand tourist needs and provide high-quality and personalized tour route recommendation services for scenic spot tourists. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 A schematic diagram of a process of a method for recommending routes in a smart scenic spot based on user portraits according to an embodiment of the present invention;

[0057] Figure 2 The figure is a schematic diagram of the structure of a route recommendation system in a smart scenic spot based on user portraits according to an embodiment of the present invention. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0059] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0060] Figure 1FIG. 1 is a flow chart of a method for recommending routes in a smart scenic spot based on user portraits according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0061] S101. Obtain and preprocess the personal information data of tourists in the scenic area, build a multi-dimensional tourist portrait based on the preprocessed data, and at the same time build a scenic area POI information model that includes scenic area information and tourist visit behavior weights.

[0062] For example, data collection in smart scenic spots mainly relies on two channels: IoT devices and mobile applications. IoT devices such as sensors and cameras can collect environmental data (such as temperature, humidity, and traffic flow) and tourist behavior data (such as tourist movement trajectory, length of stay, etc.) in the scenic area in real time. Mobile applications are mainly used to collect data actively provided by tourists, such as personal information, preference settings, comments and feedback, etc. The collected raw data is cleaned and preprocessed to remove missing values, outliers, and redundant data, and format conversion and standardization are performed.

[0063] On the basis of data preprocessing, combined with the business needs of scenic spots, a multi-dimensional tourist user portrait is constructed. The construction of user portraits can adopt the method of user attribute labeling to map various types of tourist information into a series of labels. In terms of basic information, the tourist's age, gender, family structure, occupation, income level and other labels can be extracted; in terms of preferences, according to the tourist's historical behavior and feedback data, their preference labels for different types of attractions (such as natural scenery, humanities and history, theme parks, etc.), activities (such as hiking, photography, entertainment, etc.), and services (such as catering, shopping, accommodation, etc.) can be extracted; in terms of behavioral patterns, the tourist's travel time, length of stay, movement trajectory, etc. can be analyzed to extract their travel frequency, activity, travel radius and other behavioral feature labels.

[0064] At the same time, it is also necessary to model the information of POIs in the scenic area. On the one hand, the static attributes of POIs are encoded, such as converting information such as attraction type, level, location, opening hours, etc. into corresponding feature vectors; on the other hand, technologies such as knowledge graphs are introduced to mine the semantic associations between POIs, such as belonging to the same scenic area, having similar themes, and having similar facilities. The results of POI information modeling can be used in subsequent recommendation algorithms as an important input for calculating the tourist-attraction matching degree.

[0065] In this embodiment,

[0066] S102. A heterogeneous graph including tourist nodes and POI nodes is constructed based on the scenic spot POI information model. The edges between the tourist nodes and the POI nodes in the heterogeneous graph represent the tourist's POI visit behavior, and the edges between the POI nodes represent the POI spatial adjacency relationship. A graph neural network is used to train the heterogeneous graph to obtain a POI embedding representation that integrates scenic spot information and multi-dimensional tourist portraits. At the same time, a bidirectional long short-term memory network is used to extract features from the historical behavior trajectory data of tourists to obtain an embedded representation of tourist behavior.

[0067] Among them, to construct a heterogeneous graph containing tourist nodes and POI nodes, it is first necessary to define two types of nodes, namely tourist nodes and POI nodes. Tourist nodes represent individual tourists, while POI nodes represent various points of interest or locations in the scenic area. According to the actual situation and needs of the scenic area, tourist nodes and POI nodes are constructed. Tourist nodes can be named according to the unique identifier of tourists, and POI nodes can be named according to the name of the point of interest or other identifiers. In the heterogeneous graph, two types of edges need to be defined. One is the edge between tourist nodes and POI nodes, which represents the behavior of tourists visiting POIs. The other is the edge between POI nodes, which represents the spatial adjacency relationship between POIs. According to the visit behavior of tourists and the spatial relationship between POIs, corresponding edges are added to the heterogeneous graph. For example, when a tourist visits a POI, an edge between a tourist node and the corresponding POI node can be added. When there is a spatial adjacency relationship between two POIs, an edge between two POI nodes can be added. Define corresponding features for each node. The features of tourist nodes can include personal information, historical behavior trajectories, etc. of tourists. The features of POI nodes can include the location, category, and rating of points of interest, etc. Based on the defined nodes and edges, as well as node features, a heterogeneous graph is constructed. A heterogeneous graph consists of a collection of nodes and edges and can be represented using a graph data structure.

[0068] Exemplarily, a multi-layer graph neural network is used to train the heterogeneous graph. Specifically, each layer in the multi-layer graph neural network includes two steps: feature transformation and neighbor aggregation. The feature transformation step performs a nonlinear transformation on the node representation of the previous layer to extract higher-level features; the neighbor aggregation step uses the attention mechanism to perform weighted summation on the representations of neighbor nodes to obtain a new representation of the current node. Among them, the calculation of the attention weight takes into account the similarity between nodes and the importance of neighbor nodes. The similarity can be measured based on the inner product or cosine similarity of the node feature vector, and the importance is related to the degree or centrality of the neighbor nodes. By introducing the attention mechanism at each layer, POIs related to tourists' preferences can be highlighted, improving the effectiveness of representation learning. After completing the training of the multi-layer GNN, an embedded representation containing POI semantic information and structural information can be obtained.

[0069] In an optional embodiment,

[0070] The heterogeneous graph is trained using a graph neural network to obtain a POI embedding representation that integrates scenic spot information and multi-dimensional tourist portraits. At the same time, a bidirectional long short-term memory network is used to extract features from tourists' historical behavior trajectory data to obtain a tourist behavior embedding representation including:

[0071] A heterogeneous graph neural network is used to model the POI heterogeneous graph and construct a heterogeneous graph tower. Through recursive neighbor aggregation and feature propagation, the scenic spot information and multi-dimensional tourist portraits are integrated to generate the initial POI embedding representation.

[0072] A bidirectional long short-term memory network based on the attention mechanism is used to model the tourist behavior sequence, construct a sequence tower, and incorporate spatiotemporal features to encode the spatiotemporal dependency of tourist behavior to generate an initial tourist behavior embedding representation.

[0073] The obtained initial POI embedding representation and the initial tourist behavior embedding representation are feature fused to obtain a fused feature representation. Based on the fused feature representation, a multi-task network model including the POI embedding representation learning task and the tourist behavior prediction task is constructed, and a joint multi-task loss function is constructed by combining the POI embedding representation learning task loss and the tourist behavior prediction loss. The gradient descent optimization algorithm is used to update the multi-task network model parameters, and the iteration is repeated until the preset termination condition is met to obtain a trained multi-task network model.

[0074] The obtained initial POI embedding representation and initial tourist behavior embedding representation are input into the trained multi-task network model to obtain the final POI embedding representation and tourist behavior embedding representation.

[0075] For example, a symmetrical dual-tower multi-task learning framework is first used to construct a heterogeneous graph tower and a sequence tower, respectively, to optimize the POI embedding representation learning task and the tourist behavior prediction task. The two tasks share the underlying embedding layer, independently build high-level feature extraction and task output modules, and realize feature exchange and fusion between tasks through the interaction mechanism of the middle layer. Finally, a weighted joint loss function is used to balance the optimization process of different tasks. Among them, feature fusion can adopt different feature fusion methods, such as splicing, weighted summation, multiplication, etc.

[0076] Specifically, a type-aware attention mechanism is first used to assign different weights to the aggregation process of different types of neighbors, highlighting neighbor information that is more relevant to the type of the central node. At the same time, the multimodal attribute features of POI nodes, such as text descriptions, images, etc., are integrated into the aggregation function to enrich the semantic representation of POI nodes through multimodal feature interaction. After iterative updates of multi-layer heterogeneous graph neural networks, the initial POI embedding representation that integrates heterogeneous topological structures and multimodal attribute information is finally obtained. Optionally, a sampling mechanism is introduced in the aggregation process. The number of neighbor samples is adaptively adjusted according to the degree of the central node, and the neighbors with higher correlation with the central node are preferentially selected through the importance sampling strategy, so as to retain key structural information as much as possible while reducing computational overhead.

[0077] A bidirectional long short-term memory network is used to model the tourist behavior sequence. The forward and backward dependencies of the behavior sequence are captured through a bidirectional loop structure, generating a hidden state sequence that integrates bidirectional semantic information. At the same time, an attention mechanism is introduced to calculate the attention weight according to the current hidden state and the historical hidden state, giving different importance to behaviors at different moments. The attention weight is weighted and summed with the corresponding historical hidden state to obtain the aggregated context vector as the behavior embedding representation of the current moment. The attention mechanism can adaptively adjust the influence weight of different historical behaviors on the current decision, highlight the role of key behaviors, and capture the dynamic change trend in the tourist behavior sequence. Furthermore, a spatiotemporal attention mechanism is introduced to model the spatiotemporal dependency of behaviors. Specifically, the timestamp and POI geographic coordinates of each behavior are encoded as spatiotemporal features, which are spliced ​​with the semantic embedding representation of the behavior to form a spatiotemporal enhanced behavior representation. In the process of attention calculation, not only the semantic relevance of the current behavior and the historical behavior is considered, but also their proximity in time and space is integrated, and finally the initial tourist behavior embedding representation that integrates temporal dependency, semantic information and spatiotemporal influence is obtained.

[0078] Based on the obtained initial POI embedding representation and initial tourist behavior embedding representation, a cross-modal attention mechanism is introduced to model the correlation between POI and behavior. For each tourist behavior, the POI node embedding corresponding to the behavior is retrieved from the heterogeneous graph tower, and the attention weight between it and the behavior embedding is calculated to obtain the semantically related POI context vector. Similarly, for each POI node, its corresponding tourist behavior embedding is also retrieved, and the behavior-aware POI context vector is obtained through attention weighting.

[0079] The POI node embedding and the corresponding behavior context vector are input into the gating unit to adaptively control the fusion ratio of the two features. The gating unit can adjust the contribution of graph features and sequence features to the final representation, highlighting more relevant and important information. The fused POI representation contains both the original heterogeneous graph structure and attribute information, and incorporates the dynamic characteristics of tourist behavior feedback. Similarly, the behavior embedding and the POI context vector are fused through the gating unit to obtain an enhanced behavior representation. Finally, task-specific output layers are built on the fused POI embedding representation and tourist behavior embedding representation, corresponding to the POI representation learning task and tourist behavior prediction task. For the former, the reconstruction loss function is used to learn a more accurate POI semantic representation by optimizing the reconstruction ability of the POI embedding on the original heterogeneous graph; for the latter, the classification loss function is used to improve the accuracy of behavior prediction by optimizing the prediction probability of the next moment behavior, thereby obtaining a trained multi-task network model.

[0080] The obtained initial POI embedding representation and initial tourist behavior embedding representation are input into the trained multi-task network model to obtain the final POI embedding representation and tourist behavior embedding representation.

[0081] In an optional embodiment,

[0082] The calculation formula for constructing a joint multi-task loss function by combining the POI embedding representation learning task loss and the tourist behavior prediction loss is as follows:

[0083] ;

[0084] Where L represents the joint loss function, α represents the weight of the POI embedding representation learning task loss, G represents the POI node set, and d represents the dimension of the embedding representation. represents the v-th dimension embedding representation of POI node p, represents the updated v-th dimension embedding representation of POI node p, β represents the weight coefficient of tourist behavior prediction loss, Q represents the sample set, N represents the number of behavior categories, and y q,i represents the true label of the i-th behavior category of sample q, represents the predicted label of the i-th behavior category of sample q, ε represents the smoothing term.

[0085] In this embodiment, by constructing a heterogeneous graph tower and a sequence tower, the POI heterogeneous graph and the tourist behavior sequence are effectively modeled respectively, which can capture heterogeneous topological structure information and temporal behavior patterns. The use of attention-based bidirectional LSTM to encode the tourist behavior sequence can automatically learn the key dependencies in the behavior sequence, improving the modeling ability of complex sequence patterns. Integrating spatiotemporal features into the sequence tower can effectively encode the spatiotemporal dependencies of tourist behavior and better characterize the dynamic behavior preferences of tourists. The POI embedding and tourist behavior embedding are fused through the feature fusion module to achieve a multimodal fusion representation of scenic spot information, tourist portraits and behavior patterns.

[0086] A multi-task network model including POI embedding representation learning and tourist behavior prediction is constructed. By jointly optimizing the multi-task loss function, mutual promotion between different tasks is achieved, and a more generalized representation capability is obtained, providing strong semantic support for downstream personalized route recommendations.

[0087] S103. Match the POI embedding representation and the tourist behavior embedding representation, calculate the tourist's interest score for each POI node in the scenic area, input the obtained interest score of each POI node into a pre-built route generation model, and generate a personalized recommended tour route.

[0088] Among them, the embedded representation of tourist behavior is matched with the embedded representation of each POI node, and the interest score of tourists for each POI node in the scenic area is calculated. A commonly used calculation method is to evaluate the degree of interest matching by calculating the similarity or distance between two vectors. Common similarity measurement methods include cosine similarity, Euclidean distance, Manhattan distance, etc.

[0089] In an optional embodiment,

[0090] The POI embedding representation is matched with the tourist behavior embedding representation, the tourist interest score for each POI node in the scenic area is calculated, and the obtained interest score of each POI node is input into the pre-built route generation model to generate a personalized recommended tour route, including:

[0091] Obtain the tourist behavior sequence and POI information in the scenic area, use the bidirectional long short-term memory network to model the tourist behavior sequence, obtain the tourist behavior embedding representation, use the graph neural network to learn the representation of POI in the scenic area, obtain the POI embedding representation, match the tourist behavior embedding representation with the POI embedding representation, and obtain the tourist interest score for the embedded representation of each POI in the scenic area;

[0092] According to the tourists’ interest scores on the embedded representations of each POI in the scenic area, the preference distribution of tourists on the embedded representations of each POI in the scenic area is generated. At the same time, the tourists’ historical trajectories and candidate POI nodes and the corresponding historical trajectory embedded representations and candidate POI node embedded representations are obtained as input sequences and input into the pre-trained route generation model.

[0093] In the route generation model, the encoder is used to encode the historical trajectory of tourists to obtain the hidden state representation of the trajectory, and the decoder is used to splice the tourist portrait and the tourist's current location coordinates with the candidate POI node embedding representation, and the attention distribution is calculated based on the current hidden state representation and the input sequence;

[0094] The next POI node to be visited is selected based on the obtained attention distribution. The POI nodes and visit order in the recommended tour route are constrained according to the tourists' available tour time, their physical level and the expected tour duration of the POI nodes. At the same time, a personalized recommended tour route is generated based on the opening hours of the scenic spot and the real-time passenger flow.

[0095] For example, the tourist behavior embedding is first matched with the POI embedding, and the tourist interest score for each POI is calculated using a matching function. Common similarity metrics such as dot product and cosine similarity can be used to finally obtain the preference distribution of tourists for each POI in the scenic area.

[0096] After obtaining the POI interest distribution of tourists, we further use the route generation model to generate personalized recommended tour routes. The route generation model can adopt a sequence generation model based on the attention mechanism, which can dynamically select elements from the input sequence according to the current hidden state and generate a variable length output sequence. The route generation problem is modeled as a sequence prediction task. The input includes the historical trajectory of tourists, the candidate POI set and their embedded representations, and the output is a recommended tour route.

[0097] The route generation model consists of two parts: an encoder and a decoder. The encoder uses a bidirectional LSTM to encode the historical trajectory of tourists and obtain the hidden state representation of the trajectory. The decoder also uses the LSTM structure to calculate the attention distribution based on the current hidden state and input sequence at each time step to obtain the probability distribution of the next POI visited.

[0098] When calculating the attention weight, we not only consider the semantic relevance of POIs, but also incorporate contextual information such as tourist portrait features and the current location of tourists. Specifically, the tourist portrait features and location coordinates are concatenated with the embedding vector of the candidate POI to obtain an enhanced POI representation, and a distance metric function is introduced to calculate the geographical distance between the current location of the tourist and the POI. Furthermore, the attention weight distribution is obtained through the attention calculation function. According to the attention weight distribution, the points of interest with the highest probability are sampled or selected as the next visited node. The attention distribution can guide the model to pay attention to the degree of interest of tourists in each POI node, so as to select the most attractive next POI node. When selecting the next POI node to visit, the tourists' available time and physical strength level are considered. According to the tourists' expected stay time and the expected total duration of the trip, the POI nodes that meet the needs of tourists are selected. According to the expected visit duration of each POI node, the visit order of each POI node in the recommended tour route is constrained. Ensure that the time tourists stay at each POI node does not exceed their expected visit duration. Combined with the opening hours of the scenic spot and the real-time passenger flow information, the visit order of each POI node in the recommended tour route is adjusted. Avoid choosing busy POI nodes during peak hours to enhance the tour experience. Furthermore, in combination with the above considerations, generate personalized recommended tour routes. Provide tourists with the most suitable tour routes based on their interests, time and physical strength, as well as the actual conditions of the scenic spot, so that they can experience the essence of the scenic spot as much as possible within a limited time. In the process of generating recommended tour routes, select a suitable combination of points of interest based on the tourists' available time and the estimated duration of the points of interest to avoid an itinerary that is too compact or loose; arrange the order of visiting points of interest reasonably according to the tourists' physical strength and the terrain characteristics of the scenic spot; consider factors such as the opening hours of the scenic spot and real-time passenger flow, and dynamically adjust the recommended routes.

[0099] In this embodiment, by taking the tourists' interest preferences for various attractions as prior knowledge input, the generated route can meet the personalized needs of tourists to the greatest extent. The problem is converted into a sequence generation problem, and the encoder-decoder framework is used to model the tourists' historical trajectory and predict the next visit to the attraction, which can effectively capture the dynamic behavior pattern of tourists. The multi-source semantic information such as tourist portraits, locations and candidate attractions is integrated into the decoder through the attention mechanism, which improves the modeling ability of the model for complex conditions. A variety of practical constraints are considered, including tour time, physical strength level, scenic spot attributes, scenic spot status, etc., so that the recommended route is more in line with the actual situation. In the process of route generation, multiple goals such as tourist preference satisfaction, route rationality, scenic spot comfort, etc. are optimized at the same time, providing a global optimal comprehensive route plan. Real-time route adjustment based on the real-time passenger flow and open status of the scenic spot can timely avoid problems such as crowd congestion and enhance the tour experience.

[0100] In an optional embodiment,

[0101] The tourist's historical trajectory and candidate POI nodes and the corresponding historical trajectory embedding representation and candidate POI node embedding representation are obtained as input sequences, and before being input into the pre-trained route generation model, the following is also included:

[0102] Obtain the historical trajectory and real tour trajectory of tourists, and map the POI nodes passed in the historical trajectory and the real tour trajectory into corresponding POI position sequences, respectively, to obtain the historical trajectory sequence and the real tour trajectory sequence;

[0103] The encoder and decoder structures in the route generation model are constructed using a bidirectional long short-term memory network, wherein the encoder converts the input POI position sequence into a corresponding context vector, and the decoder generates a recommended POI position sequence according to the obtained context vector;

[0104] A random number generator is used to generate a random number, and the input of the encoder is selected according to the comparison result between the random number and the preset probability threshold. If the random number is less than the preset probability threshold, the first POI node in the actual tour trajectory is used as the input of the decoder. Otherwise, the first POI node in the POI position sequence recommended by the route generation model is used as the input of the decoder.

[0105] The final decoder input is passed to the constructed route generation model for forward calculation, and the historical trajectory sequence is converted into a historical trajectory sequence context vector through the encoder. Based on the obtained historical trajectory sequence context vector, a recommended POI position sequence is generated;

[0106] By minimizing the difference between the recommended POI location sequence and the actual tour trajectory sequence, the back propagation algorithm is used to update the parameters of the route generation model. The iteration is repeated until the predetermined number of iterations is reached to obtain the final trained route generation model.

[0107] Exemplarily, the historical trajectory and the real tour trajectory of the tourists are converted into corresponding digital sequences. First, all points of interest are numbered to obtain the ID sequence of the points of interest. Then, the historical trajectory and the real tour trajectory of the tourists are converted into the corresponding ID sequence of the points of interest. For example, the historical trajectory sequence of the tourists [POI1, POI2, POI3] is converted into [1, 2, 3], and the real tour trajectory sequence [POI1, POI4, POI5] is converted into [1, 4, 5].

[0108] Define the encoder and decoder structures of the pointer network model. The commonly used pointer network model is based on the recurrent neural network (RNN), and the bidirectional long short-term memory network (BiLSTM) can be used as the basic model of the encoder and decoder. The encoder converts the input POI ID sequence into the corresponding context vector representation, and the decoder generates a recommended POI sequence based on the context vector and attention mechanism.

[0109] The real tour trajectory is used as the supervision signal, and the cross entropy loss function is used as the optimization target of the model. During the training process, the previous interest point of the real tour trajectory sequence is used as the input of the decoder, and the current interest point of the real tour trajectory sequence is used as the target output of the decoder. For example, for the real tour trajectory sequence [1, 4, 5], 1 is used as the input of the decoder and 4 is used as the target output of the decoder. The input and target output of the decoder are passed to the model for forward calculation. The encoder converts the historical trajectory sequence into a context vector representation, and the decoder generates a recommended interest point sequence based on the context vector and the attention mechanism.

[0110] Calculate the loss function of the model. The cross entropy loss function can be used to measure the difference between the POI sequence generated by the model and the real tour trajectory. Compare the output of the decoder with the target output of the real tour trajectory and calculate the loss value. Use the back propagation algorithm to update the parameters of the model, and minimize the loss function through an optimization algorithm (such as stochastic gradient descent or Adam optimizer). Calculate the gradient based on the loss value and update the parameters of the model using gradient descent. Use a random number generator to generate a random number, and select the input of the encoder based on the comparison result between the random number and the preset probability threshold. If the random number is less than the preset probability threshold, the first POI node in the real tour trajectory is used as the input of the decoder. Otherwise, the first POI node in the POI location sequence recommended by the route generation model is used as the input of the decoder. Pass the final decoder input to the constructed route generation model for forward calculation. The historical trajectory sequence is converted into a historical trajectory sequence context vector through the encoder, and the recommended POI location sequence is generated based on the obtained historical trajectory sequence context vector. The parameters of the route generation model are updated using the back propagation algorithm by minimizing the difference between the recommended POI location sequence and the real tour trajectory sequence. The iteration is repeated until the predetermined number of iterations is reached to obtain the final trained route generation model.

[0111] At the same time, in order to avoid generating repeated sequences of interest points, an attention coverage mechanism is introduced. In each decoding step, the attention weight of each interest point is recorded, and then the entropy of the entire attention distribution is calculated and added to the loss function. This can encourage the model to distribute attention more evenly during the decoding process and avoid generating repeated interest points. In addition, in order to improve the generation quality, multiple high-probability candidate paths can be retained at each time step of the decoder, and the most likely path can be selected as the output according to the probability sorting.

[0112] In this embodiment, by discretizing POI nodes and tour trajectories into position sequences, the complex route recommendation problem can be transformed into a standard sequence generation problem, and a mature sequence model can be directly used for modeling. The encoder-decoder structure is adopted, the encoder encodes the historical tour trajectory, and the decoder generates a new route sequence based on the historical encoding information, capturing the long-term dependency of tourists' behaviors. By setting a random sampling mechanism, the exploration and utilization strategies are introduced in the training process to avoid the model from over-converging to the training set data distribution, thereby improving the generalization ability. The sequence difference between the recommended route and the real tour trajectory is used as the loss function minimization target for back propagation training, ensuring that the generated route can fit the real human behavior to the maximum extent. By introducing exploration behavior, the model can see more samples during training and cover a wider range of data distribution. Through the fusion of sequence modeling and reinforcement learning strategies, the efficient training and generalization ability of the route generation model are enhanced, which can provide tourists with more personalized and reasonable tour route recommendations and meet the robustness and reliability requirements of practical applications.

[0113] In an optional embodiment,

[0114] After inputting the obtained interest scores of each POI node into a pre-built route generation model to generate a personalized recommended tour route, the method further includes:

[0115] A Markov decision process is constructed, and the route generation model is used as an intelligent agent. The current location, time and preference of tourists are used as the state space of the Markov decision process, and the set of POI nodes in the scenic area is used as the action space of the intelligent agent. A composite reward function is designed, which comprehensively considers tourist satisfaction, coverage of popular attractions, rationality of travel time and route diversity.

[0116] A deep neural network is used to construct a policy network and a value network. The policy network generates a probability distribution over the set of POI nodes in the scenic area according to the current state, and the value network takes the current state of the tourist as input and outputs the expected cumulative reward under the current state.

[0117] Construct a policy gradient algorithm to collect a series of state, action, and reward trajectory data through the interaction between the agent and the environment, calculate the cumulative reward of each state through the temporal difference algorithm, and use it as the objective function;

[0118] Minimize the objective function and use the gradient ascent algorithm to update the parameters of the policy network so that the recommended route generated by it can obtain a higher expected cumulative reward. At the same time, use the temporal difference algorithm to update the parameters of the value network. Repeat the iteration until the model converges to obtain the optimized route generation model. Use the optimized route generation model to dynamically adjust the recommended route according to the real-time location and preferences of tourists to obtain the optimal tour route.

[0119] Exemplarily, a Markov decision model is first constructed, and the current location, time and preference of tourists are used as the state space of the Markov decision process. Among them, the current location of tourists is represented by longitude and latitude coordinates, or the scenic area is divided into grids, and the grid number is used to represent the area where the tourists are located. The time is represented by continuous time steps, and each time step represents a fixed duration, such as 10 minutes. Tourists make decisions at each time step and choose the next scenic spot to visit; tourist preferences are learned from the historical behavior data of tourists and represented as a vector of fixed length. This vector can be generated by collaborative filtering, matrix decomposition and other technologies to reflect the degree of preference of tourists for different types of attractions. The POI (Point of Interest) set in the scenic area is used as the action space of the intelligent agent. Among them, POI information is obtained by collecting the attribute information of each POI in the scenic area, such as name, location coordinates, category, historical visits, etc.; POI embedding uses word embedding technology, such as Word2Vec or BERT, to map the attribute information of POI to a fixed-length vector representation; action selection At each decision time step, the intelligent agent selects the next scenic spot to be visited from the POI set as an action according to the current state.

[0120] Taking multiple factors into consideration, a composite reward function is designed. These include tourist satisfaction, which estimates the tourist satisfaction with the recommended routes by analyzing tourist feedback, ratings and other data. Routes with high satisfaction receive positive rewards, and routes with low satisfaction receive negative rewards; Popular attractions coverage: Count the number of popular attractions included in the recommended routes, and routes with high coverage receive additional rewards. Popular attractions can be determined based on historical visit volume, user ratings and other indicators; Travel time rationality, evaluate whether the overall time arrangement of the recommended route is reasonable, neither too tight nor too loose. A reasonable time range can be set, and routes that fall within the range can be rewarded; Route diversity, encourages the generation of diverse recommended routes, and avoids routes that are too similar. The similarity between the current route and the historically generated routes can be calculated, and additional rewards can be given to routes with low similarity.

[0121] A deep neural network is used as the policy network. The input is the current state of the tourist, and the output is the probability distribution over the POI set. The structure of the policy network can be designed using technologies such as attention mechanism and graph neural network. Another deep neural network is used as the value network to estimate the value function of the state. The input of the value network is the current state of the tourist, and the output is the expected cumulative reward under this state.

[0122] By interacting with the environment, a batch of trajectory data is collected. Each trajectory contains a series of states, actions, and rewards. The Monte Carlo method or the temporal difference method is used to calculate the cumulative reward of each state, and this is used as the objective function to update the parameters of the policy network through the gradient ascent algorithm. At the same time, the temporal difference learning algorithm is used to update the parameters of the value network. The trained recommended tour route generation model is deployed to the actual system and continuously optimized. The recommended route is dynamically adjusted according to the real-time location and preferences of tourists using a rolling update method. When tourists arrive at a certain attraction, the state is re-evaluated and the subsequent recommended route is generated.

[0123] In an optional embodiment,

[0124] Construct a policy gradient algorithm, collect a series of state, action and reward trajectory data through the interaction between the agent and the environment, calculate the cumulative reward of each state through the temporal difference algorithm, and use it as the calculation formula of the objective function as follows:

[0125] ;

[0126] Among them, J(θ) represents the objective function, θ represents the parameters of the current policy network, According to the strategy π θ The generated trajectory τ performs the desired operation, π θ (a t |s t ) means that in a given state s t In this case, the policy network outputs action a according to the parameter θ t The probability of Indicates that in a given state s t Next, the old policy network is based on the parameter θ old Output action a t The probability of, T represents the maximum time steps of the trajectory, t represents the time step, γ represents the discount factor, R(s t ,a t ) means in state s t Execute action a t The immediate reward obtained after t ) represents the benchmark function.

[0127] In this embodiment, by converting the route recommendation problem into a Markov decision process, the dynamic relationship between tourist status, scenic spot selection behavior and potential rewards can be effectively captured, so as to make refined online decisions. The reward function takes into account multiple objectives, including tourist satisfaction, scenic spot coverage, time rationality and route diversity, so that the generated route can better balance various needs. The policy gradient algorithm is used to optimize the policy network, so that it can generate the optimal scenic spot visit distribution according to the current state, and make full use of the advantages of reinforcement learning for policy learning. The value network is introduced to estimate the expected cumulative reward of the state, which provides a strong supervision signal for policy optimization and improves the training efficiency and convergence speed. It can optimize various complex needs in a more reasonable and flexible way, generate personalized, efficient and diverse tour route recommendation plans, and comprehensively improve the tourists' tour experience and the operating efficiency of the scenic spot.

[0128] Figure 2 FIG. 1 is a schematic diagram of the structure of a route recommendation system in a smart scenic spot based on user portraits according to an embodiment of the present invention. Figure 2 As shown, the system comprises:

[0129] The first unit is used to obtain and pre-process the personal information data of tourists in the scenic area, build a multi-dimensional tourist portrait based on the pre-processed data, and build a scenic area POI information model containing scenic area information and tourist visit behavior weights;

[0130] The second unit is used to construct a heterogeneous graph including tourist nodes and POI nodes based on the scenic spot POI information model, wherein the edges between the tourist nodes and the POI nodes in the heterogeneous graph represent the tourist's POI visit behavior, and the edges between the POI nodes represent the POI spatial adjacency relationship, and the heterogeneous graph is trained using a graph neural network to obtain a POI embedding representation that integrates scenic spot information and multi-dimensional tourist portraits, and a bidirectional long short-term memory network is used to extract features from the historical behavior trajectory data of tourists to obtain an embedded representation of tourist behavior;

[0131] The third unit is used to match the POI embedding representation with the tourist behavior embedding representation, calculate the tourist's interest score for each POI node in the scenic area, input the obtained interest score of each POI node into a pre-built route generation model, and generate a personalized recommended tour route.

[0132] According to a third aspect of the embodiments of the present invention,

[0133] An electronic device is provided, comprising:

[0134] processor;

[0135] a memory for storing processor-executable instructions;

[0136] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.

[0137] According to a fourth aspect of the embodiments of the present invention,

[0138] A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.

[0139] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.

[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for recommending routes in a smart scenic spot based on user portraits, characterized in that: include: Obtain and preprocess the personal information data of tourists in the scenic area, build a multi-dimensional tourist portrait based on the preprocessed data, and build a scenic area POI information model that includes scenic area information and tourist visit behavior weights; Based on the scenic spot POI information model, a heterogeneous graph including tourist nodes and POI nodes is constructed, wherein the edges between tourist nodes and POI nodes in the heterogeneous graph represent the tourist's POI visit behavior, and the edges between POI nodes represent the POI spatial adjacency relationship. A graph neural network is used to train the heterogeneous graph to obtain a POI embedding representation that integrates scenic spot information and multi-dimensional tourist portraits, and a bidirectional long short-term memory network is used to extract features from tourists' historical behavior trajectory data to obtain a tourist behavior embedding representation; Matching the POI embedding representation with the tourist behavior embedding representation, calculating the tourist's interest score for each POI node in the scenic area, inputting the obtained interest score of each POI node into a pre-built route generation model, and generating a personalized recommended tour route; The heterogeneous graph is trained using a graph neural network to obtain a POI embedding representation that integrates scenic spot information and multi-dimensional tourist portraits. At the same time, a bidirectional long short-term memory network is used to extract features from tourists' historical behavior trajectory data to obtain a tourist behavior embedding representation including: A heterogeneous graph neural network is used to model the POI heterogeneous graph and construct a heterogeneous graph tower. Through recursive neighbor aggregation and feature propagation, the scenic spot information and multi-dimensional tourist portraits are integrated to generate the initial POI embedding representation. A bidirectional long short-term memory network based on the attention mechanism is used to model the tourist behavior sequence, construct a sequence tower, and incorporate spatiotemporal features to encode the spatiotemporal dependency of tourist behavior to generate an initial tourist behavior embedding representation. The obtained initial POI embedding representation and the initial tourist behavior embedding representation are feature fused to obtain a fused feature representation. Based on the fused feature representation, a multi-task network model including the POI embedding representation learning task and the tourist behavior prediction task is constructed, and a joint multi-task loss function is constructed by combining the POI embedding representation learning task loss and the tourist behavior prediction loss. The gradient descent optimization algorithm is used to update the multi-task network model parameters, and the iteration is repeated until the preset termination condition is met to obtain a trained multi-task network model. Input the obtained initial POI embedding representation and initial tourist behavior embedding representation into the trained multi-task network model to obtain the final POI embedding representation and tourist behavior embedding representation; The POI embedding representation is matched with the tourist behavior embedding representation, the tourist interest score for each POI node in the scenic area is calculated, and the obtained interest score of each POI node is input into the pre-built route generation model to generate a personalized recommended tour route, including: Obtain the tourist behavior sequence and POI information in the scenic area, use the bidirectional long short-term memory network to model the tourist behavior sequence, obtain the tourist behavior embedding representation, use the graph neural network to learn the representation of POI in the scenic area, obtain the POI embedding representation, match the tourist behavior embedding representation with the POI embedding representation, and obtain the tourist interest score for the embedded representation of each POI in the scenic area; According to the tourists’ interest scores on the embedded representations of each POI in the scenic area, the preference distribution of tourists on the embedded representations of each POI in the scenic area is generated. At the same time, the tourists’ historical trajectories and candidate POI nodes and the corresponding historical trajectory embedded representations and candidate POI node embedded representations are obtained as input sequences and input into the pre-trained route generation model. In the route generation model, the encoder is used to encode the historical trajectory of tourists to obtain the hidden state representation of the trajectory, and the decoder is used to splice the tourist portrait and the tourist's current location coordinates with the candidate POI node embedding representation, and the attention distribution is calculated based on the current hidden state representation and the input sequence; The next POI node to be visited is selected based on the obtained attention distribution. The POI nodes and the visiting order in the recommended tour route are constrained according to the tourists' available tour time, their physical strength level, and the estimated tour duration of the POI nodes. At the same time, a personalized recommended tour route is generated based on the scenic spot's opening hours and real-time passenger flow. After inputting the obtained interest scores of each POI node into a pre-built route generation model to generate a personalized recommended tour route, the method further includes: A Markov decision process is constructed, and the route generation model is used as an intelligent agent. The current location, time and preference of tourists are used as the state space of the Markov decision process, and the set of POI nodes in the scenic area is used as the action space of the intelligent agent. A composite reward function is designed, which comprehensively considers tourist satisfaction, coverage of popular attractions, rationality of travel time and route diversity. A deep neural network is used to construct a policy network and a value network. The policy network generates a probability distribution over the set of POI nodes in the scenic area according to the current state, and the value network takes the current state of the tourist as input and outputs the expected cumulative reward under the current state. Construct a policy gradient algorithm to collect a series of state, action, and reward trajectory data through the interaction between the agent and the environment, calculate the cumulative reward of each state through the temporal difference algorithm, and use it as the objective function; Minimize the objective function and use the gradient ascent algorithm to update the parameters of the policy network so that the recommended route generated by it can obtain a higher expected cumulative reward. At the same time, use the temporal difference algorithm to update the parameters of the value network. Repeat the iteration until the model converges to obtain the optimized route generation model. Use the optimized route generation model to dynamically adjust the recommended route according to the real-time location and preferences of tourists to obtain the optimal tour route.

2. The method according to claim 1, characterized in that The calculation formula for constructing a joint multi-task loss function by combining the POI embedding representation learning task loss and the tourist behavior prediction loss is as follows: ; Where L represents the joint loss function, α represents the weight of the POI embedding representation learning task loss, G represents the POI node set, and d represents the dimension of the embedding representation. represents the v-th dimension embedding representation of POI node p, represents the updated v-th dimension embedding representation of POI node p, β represents the weight coefficient of tourist behavior prediction loss, Q represents the sample set, N represents the number of behavior categories, and y q,i represents the true label of the i-th behavior category of sample q, represents the predicted label of the i-th behavior category of sample q, ε represents the smoothing term.

3. The method according to claim 1, characterized in that The tourist's historical trajectory and candidate POI nodes and the corresponding historical trajectory embedding representation and candidate POI node embedding representation are obtained as input sequences, and before being input into the pre-trained route generation model, the following is also included: Obtain the historical trajectory and real tour trajectory of tourists, and map the POI nodes passed in the historical trajectory and the real tour trajectory into corresponding POI position sequences, respectively, to obtain the historical trajectory sequence and the real tour trajectory sequence; The encoder and decoder structures in the route generation model are constructed using a bidirectional long short-term memory network, wherein the encoder converts the input POI position sequence into a corresponding context vector, and the decoder generates a recommended POI position sequence according to the obtained context vector; A random number generator is used to generate a random number, and the input of the encoder is selected according to the comparison result between the random number and the preset probability threshold. If the random number is less than the preset probability threshold, the first POI node in the actual tour trajectory is used as the input of the decoder. Otherwise, the first POI node in the POI position sequence recommended by the route generation model is used as the input of the decoder. The final decoder input is passed to the constructed route generation model for forward calculation, and the historical trajectory sequence is converted into a historical trajectory sequence context vector through the encoder. Based on the obtained historical trajectory sequence context vector, a recommended POI position sequence is generated; By minimizing the difference between the recommended POI location sequence and the actual tour trajectory sequence, the back propagation algorithm is used to update the parameters of the route generation model. The iteration is repeated until the predetermined number of iterations is reached to obtain the final trained route generation model.

4. The method according to claim 1, characterized in that: Construct a policy gradient algorithm, collect a series of state, action and reward trajectory data through the interaction between the agent and the environment, calculate the cumulative reward of each state through the temporal difference algorithm, and use it as the calculation formula of the objective function as follows: ; Among them, J(θ) represents the objective function, θ represents the parameters of the current policy network, According to the strategy π θ The generated trajectory τ performs the desired operation, π θ (a t |s t ) means that in a given state s t In this case, the policy network outputs action a according to the parameter θ t The probability of In a given state s t Next, the old policy network is based on the parameter θ old Output action a t The probability of, T represents the maximum time steps of the trajectory, t represents the time step, γ represents the discount factor, R(s t ,a t ) means in state s t Execute action a t The immediate reward obtained after t ) represents the benchmark function.

5. A route recommendation system for a smart scenic spot based on user portraits, used to implement the method described in any one of claims 1 to 4, characterized in that: include: The first unit is used to obtain and pre-process the personal information data of tourists in the scenic area, build a multi-dimensional tourist portrait based on the pre-processed data, and build a scenic area POI information model containing scenic area information and tourist visit behavior weights; The second unit is used to construct a heterogeneous graph including tourist nodes and POI nodes based on the scenic spot POI information model, wherein the edges between the tourist nodes and the POI nodes in the heterogeneous graph represent the tourist's POI visit behavior, and the edges between the POI nodes represent the POI spatial adjacency relationship, and the heterogeneous graph is trained using a graph neural network to obtain a POI embedding representation that integrates scenic spot information and multi-dimensional tourist portraits, and a bidirectional long short-term memory network is used to extract features from the historical behavior trajectory data of tourists to obtain a tourist behavior embedding representation; The third unit is used to match the POI embedding representation with the tourist behavior embedding representation, calculate the tourist's interest score for each POI node in the scenic area, input the obtained interest score of each POI node into a pre-built route generation model, and generate a personalized recommended tour route.

6. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method described in any one of claims 1 to 4.

7. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 4 is implemented.