Method, device, equipment and medium for generating tourist routes based on enhanced whale optimization algorithm
Through the enhanced whale optimization algorithm combined with data analysis and sentiment analysis, the tourism route planning is optimized, and the problems of insufficient data sparsity and search capabilities are solved, and personalized and efficient travel route recommendations are achieved.
Patent Information
- Application Number
- CN202510861238.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-06-25
AI Technical Summary
The existing tourism route planning technology has problems such as data sparsity and insufficient search capabilities of intelligent optimization algorithms in both global and local areas, resulting in low accuracy and personalization of recommended attractions.
The enhanced whale optimization algorithm (EWOA) is used, combined with tourist feature data and scenic spot feature data, and the tourist interest and satisfaction model is constructed, and the data is analyzed using the BERT-BiGRU sentiment analysis network, nonlinear convergence factors and adaptive weight strategies are introduced, and tourism routes are optimized by combining pooling mechanisms and Cauchy distribution search strategy.
It improves the accuracy and personalization of travel route planning, provides efficient and economical travel solutions that meet user interests and needs, and improves user experience and satisfaction.
Smart Images

Figure CN120373601B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of tourism management, and in particular to a method, device, equipment and medium for generating a tourism route based on an enhanced whale optimization algorithm. Background Art
[0002] With the widespread adoption of the internet and mobile devices, the tourism industry has ushered in new opportunities for digital transformation. Tourists generate massive amounts of data as they book trips, browse travel information, and review attractions online. This data not only records visitor behavior and preferences but also provides travel service providers with the opportunity to gain a deeper understanding of their needs. Leveraging technologies such as big data analytics, machine learning and artificial intelligence, cloud computing, location-based services (LBS), mobile internet, and social networks, the tourism industry can gain a more precise understanding of tourists' interests and preferences, thereby improving the quality and efficiency of tourism services and providing travelers with more comfortable and personalized travel recommendations and experiences.
[0003] In the field of travel route planning, current technologies have made considerable progress. For example, intelligent optimization algorithms (such as genetic algorithms and ant colony algorithms) are widely used to solve complex route planning problems, effectively optimizing travel time and cost. Furthermore, neural networks and personalized recommendation technologies are being applied to provide customized recommendations tailored to user interests. Furthermore, augmented reality and virtual reality technologies enhance the user's immersive experience, while location-based services and smart guide systems improve travel convenience through real-time navigation and personalized recommendations. Cloud computing and big data analytics support large-scale data processing, ensuring rapid response and efficient service. Social network analysis further optimizes itinerary planning by mining user-generated content.
[0004] Although existing technologies have achieved certain results in tourist route planning, some challenges still exist in practical applications. First, the sparsity of tourism data is a prominent issue. Since tourists travel infrequently and their preferences may vary greatly from trip to trip, the interaction data between users and tourist attractions is very limited. This makes it difficult for the system to accumulate sufficient data to accurately analyze and predict users' travel preferences, which affects the accuracy and personalization of recommended attractions. Second, traditional intelligent optimization algorithms have shortcomings in global and local search capabilities, low population diversity, and are prone to falling into local optimal solutions, resulting in poor solution results. Therefore, there is an urgent need for a more accurate and personalized tourist route planning method to improve user experience and satisfaction. Summary of the Invention
[0005] The main purpose of this application is to provide a method, device, equipment and medium for generating a tourist route based on an enhanced whale optimization algorithm, aiming to solve the technical problem of how to improve the accuracy and personalization of tourist route planning.
[0006] To achieve the above objectives, the present application proposes a method for generating a travel route based on an enhanced whale optimization algorithm, the method comprising:
[0007] Obtaining tourist characteristic data and scenic spot characteristic data;
[0008] Input the tourist characteristic data and the scenic spot characteristic data into a preset multi-objective tourist route planning model to obtain a tourist route;
[0009] Optimize the tourist route using an enhanced whale optimization algorithm model to obtain a target tourist route;
[0010] Before the step of inputting the tourist characteristic data and the scenic spot characteristic data into a preset multi-objective tourist route planning model to obtain a tourist route, the method further includes:
[0011] Analyzing the visitor characteristic data and the scenic spot characteristic data to construct a scenic spot interest model;
[0012] Analyze the scenic spot feature data through the BERT-BiGRU sentiment analysis network to obtain sentiment analysis results;
[0013] Constructing a scenic spot satisfaction model based on the sentiment analysis results;
[0014] A preset multi-objective tourism route planning model is constructed based on the attraction interest model and the attraction satisfaction model.
[0015] In one embodiment, before the step of optimizing the tourist route using the enhanced whale optimization algorithm model to obtain the target tourist route, the following steps are included:
[0016] Generate an initial population, set the whale population size and the maximum number of iterations;
[0017] Calculating individuals in the whale population according to a multi-objective function to obtain the fitness of the individuals and the optimal position of the population;
[0018] By introducing a nonlinear convergence factor and an adaptive weight strategy, the search range of the whale population is obtained;
[0019] Based on the search range, solutions around the optimal position of the population are mixed through a pooling mechanism to obtain multiple whale populations and corresponding individual fitness;
[0020] Comparing the fitness of a plurality of individuals using a Cauchy distribution search strategy to obtain a global optimal solution for the whale population;
[0021] updating the positions of individuals in the whale population according to the population best position and the global optimal solution;
[0022] If the number of iterations is reached, the preset whale individual corresponding to the final individual position is output;
[0023] An enhanced whale optimization algorithm model is constructed based on the preset whale individuals to predict the target travel route.
[0024] In one embodiment, the step of analyzing the visitor characteristic data and the scenic spot characteristic data to construct a scenic spot interest model includes:
[0025] Performing statistical analysis on the tourist characteristic data to obtain tourist preference characteristics, wherein the tourist characteristic data includes gender, age, preferred time of visit, and budget constraints;
[0026] Analyzing the scenic spot characteristic data to obtain scenic spot cost parameters, wherein the scenic spot characteristic data includes scenic spot ticket price, transportation cost, opening hours and geographical correlation with other scenic spots;
[0027] A scenic spot interest model is constructed according to the passenger preference characteristics and the scenic spot cost parameters.
[0028] In one embodiment, the step of constructing a scenic spot interest model based on the passenger preference characteristics and the scenic spot cost parameters includes:
[0029] A rating matrix of tourists and attractions is constructed based on the passenger preference characteristics and the attraction cost parameters using a collaborative filtering method. The rating matrix is expressed as:
[0030]
[0031] The scoring matrix , each element Indicates tourists Attractions 's rating;
[0032] The Pearson correlation coefficient is used to calculate the similarity between tourists based on the rating matrix. The specific formula is:
[0033]
[0034] in Indicates tourists and tourists There are a collection of rated attractions. and Tourists and tourists The average rating of Indicates tourists Attractions Rating, Indicates tourists Attractions 's rating;
[0035] Filter out the preset groups with high similarity to the target tourists as the neighbor set. The specific formula is:
[0036]
[0037] in, Gathering for tourists, To preset the quantity, Indicates tourists and tourists similarity between
[0038] The interest score of the target tourist's unvisited attractions is predicted by the neighbor set to obtain the interest intensity. The specific formula is:
[0039]
[0040]
[0041] in, Indicates target tourists For unvisited attractions The intensity of interest, Indicates target tourists For unvisited attractions The prediction score of Indicates tourists Attractions The lowest rating, Indicates tourists Attractions The highest rating, Neighbors and tourists For unvisited attractions The actual rating, represents a set of neighbors;
[0042] A scenic spot interest model is constructed according to the interest intensity.
[0043] In one embodiment, the step of analyzing the scenic spot feature data using a BERT-BiGRU sentiment analysis network to obtain a sentiment analysis result includes:
[0044] Preprocessing the comment data in the scenic spot feature data to obtain scenic spot text data;
[0045] The scenic spot text data is vectorized using the Glove method to obtain a text feature vector;
[0046] Inputting the text feature vector into a BERT-BiGRU sentiment analysis network to obtain the comment type, wherein the BERT-BiGRU sentiment analysis network includes an input layer, a fully connected layer, and an output layer;
[0047] The comment type is taken as the sentiment analysis result.
[0048] In one embodiment, the step of inputting the text feature vector into the BERT-BiGRU sentiment analysis network to obtain the comment type includes:
[0049] Input the text feature vector into the input layer of the BERT-BiGRU sentiment analysis network for encoding to obtain the contextual relationship and semantic features of the text;
[0050] According to the contextual relationship and semantic features of the text, the text is input into the fully connected layer for sentiment task classification to obtain an output value;
[0051] The output value is input into the output layer and compared with the preset threshold to obtain the comment type.
[0052] In one embodiment, the step of constructing a preset multi-objective tourism route planning model based on the attraction interest model and the attraction satisfaction model includes:
[0053] The attraction degree of the scenic spot is obtained by the scenic spot interest model, and the satisfaction degree of the scenic spot is obtained by the scenic spot satisfaction model;
[0054] Constructing a scenic spot attraction objective function according to the attraction degree of the scenic spot and the satisfaction degree of the scenic spot;
[0055] A multi-objective tourism route planning model is constructed based on the attraction function of the scenic spots.
[0056] In addition, the present application also proposes a travel route generation device based on an enhanced whale optimization algorithm, the device comprising:
[0057] An acquisition module is used to obtain tourist characteristic data and scenic spot characteristic data;
[0058] A processing module, configured to input the tourist characteristic data and the scenic spot characteristic data into a preset multi-objective tourist route planning model to obtain a tourist route;
[0059] An optimization module, configured to optimize the tourist route using an enhanced whale optimization algorithm model to obtain a target tourist route;
[0060] A construction module is used to analyze the tourist feature data and the scenic spot feature data to construct a scenic spot interest model; analyze the scenic spot feature data through the BERT-BiGRU sentiment analysis network to obtain sentiment analysis results; construct a scenic spot satisfaction model based on the sentiment analysis results; and construct a preset multi-objective tourism route planning model based on the scenic spot interest model and the scenic spot satisfaction model.
[0061] In addition, to achieve the above-mentioned purpose, the present application also proposes a medium, which is a computer-readable medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the travel route generation method based on the enhanced whale optimization algorithm as described above are implemented.
[0062] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the steps of the travel route generation method based on the enhanced whale optimization algorithm as described above.
[0063] This application obtains tourist feature data and scenic spot feature data, inputs the tourist feature data and scenic spot feature data into a preset multi-objective tourist route planning model to obtain a tourist route, and optimizes the tourist route using an enhanced whale optimization algorithm model to obtain a target tourist route. By obtaining tourist feature data and scenic spot feature data, inputting the preset multi-objective tourist route planning model to generate a tourist route, and optimizing it using the enhanced whale optimization algorithm, the target tourist route is finally obtained. This effectively solves the problems of data sparsity and insufficient optimization algorithms, and improves the personalization and optimization effects of tourist routes. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0065] Figure 1 This is a flow chart of the first embodiment of the method for generating a travel route based on the enhanced whale optimization algorithm of this application;
[0066] Figure 2 This is a flow chart of the second embodiment of the travel route generation method based on the enhanced whale optimization algorithm of this application;
[0067] Figure 3 This is a flow chart of the third embodiment of the method for generating a travel route based on the enhanced whale optimization algorithm of this application;
[0068] Figure 4 This is a schematic diagram of the module structure of a tourist route generation device based on an enhanced whale optimization algorithm according to the first embodiment of the tourist route generation method based on the enhanced whale optimization algorithm of the present application;
[0069] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the travel route generation method based on the enhanced whale optimization algorithm in the embodiment of the present application.
[0070] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0071] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.
[0072] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0073] With the rapid development of information technology, the widespread use of the internet and mobile devices is profoundly changing the way people travel. Modern tourists increasingly rely on online platforms to obtain information, book services, and share experiences when planning their trips. This trend generates massive amounts of data, including but not limited to user preferences, reviews, and ratings, laying the foundation for the development of personalized tourism services. At the same time, tourists' expectations for travel experiences are also increasing. They are not only concerned with the appeal of the attractions themselves, but also expect the entire journey to be optimized in terms of time management, budget control, and personal interest matching. Traditional travel route planning methods often struggle to meet this requirement because they generally fail to fully account for tourists' diverse needs and personal preferences.
[0074] Therefore, this application proposes a method for improving the accuracy and personalization of travel route planning. The main solution of the embodiment of this application is to obtain tourist characteristic data and scenic spot characteristic data, input the tourist characteristic data and scenic spot characteristic data into a preset multi-objective travel route planning model to obtain a travel route, and optimize the travel route using an enhanced whale optimization algorithm model to obtain a target travel route.
[0075] Based on the above, the embodiment of the present application also provides a method for generating a travel route based on an enhanced whale optimization algorithm, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the travel route generation method based on the enhanced whale optimization algorithm of this application.
[0076] In this embodiment, the travel route generation method based on the enhanced whale optimization algorithm includes steps S10 to S30:
[0077] Step S10: Acquire tourist characteristic data and scenic spot characteristic data.
[0078] It's important to note that visitor demographic data includes basic information such as gender, age, preferred time of day, and budget constraints. This data can help us understand the preferences and needs of different tourist groups. For example, young tourists may prefer adventurous activities and cultural experiences, while families may prioritize safety and child-friendly amenities. Furthermore, understanding tourists' travel modes (e.g., driving, public transportation, or walking) is crucial for optimizing transportation arrangements.
[0079] Attraction feature data, on the other hand, includes multi-dimensional information such as ticket prices, transportation costs, opening hours, and geographic connections with other attractions. By analyzing this data, we can assess the appeal of each attraction and its value to different visitor groups. For example, some attractions may be favored by older visitors for their historical value, while others attract younger visitors for their unique natural scenery or interactive experiences. It is also worth noting that real-time reviews and ratings of attractions are also important considerations. They reflect the true feelings of current visitors and help identify potential problems or hot trends.
[0080] To collect this data, web crawlers are often used to extract relevant information from major travel websites, social media platforms, and user comment sections. This is combined with questionnaires and user registration information to obtain firsthand information directly from tourists. After data collection, rigorous preprocessing steps are required, including data cleaning, deduplication, and outlier processing, to ensure data quality and reliability. Machine learning algorithms and big data analysis tools can then be used to deeply explore the potential connections between tourists and attractions, providing solid data support for the subsequent construction of accurate travel route planning models. This process not only enhances the intelligence level of tourism services but also provides tourists with a more personalized and satisfying travel experience.
[0081] Step S20: inputting the tourist characteristic data and the scenic spot characteristic data into a preset multi-objective tourist route planning model to obtain a tourist route.
[0082] It should be noted that the purpose of the pre-set multi-objective tourism route planning model is to balance multiple conflicting objectives, such as minimizing travel time and cost while maximizing tourist satisfaction with attractions. First, a preliminary tourist group optimization objective function is constructed based on basic information of tourists (such as gender, age, travel preferences, etc.) and attraction cost parameters. This process fully considers the differences in interest in attractions among tourists of different age groups and genders, as well as their preferences for different types of activities. Specifically, represents a collection of scenic spot features, Represents the number of scenic spots, and contains vector information , Ticket prices for attractions, and Represents the longitude and latitude information of the scenic spot respectively. Then get the ticket cost of each scenic spot along the route selected during the trip:
[0083] ,
[0084] Then we get the time cost of the route selected during the trip. The specific formula is:
[0085]
[0086]
[0087] in, Indicates the mode of travel, such as driving, cycling, public transportation, and sightseeing bus. is the time spent choosing the mode of travel between two tourist attractions, To select the speed of travel mode, is the distance between any two scenic spots. In this embodiment, taking taxi, bus and subway as the travel mode, the cost of the travel mode can be expressed as:
[0088]
[0089] in, is the number of times of the corresponding riding mode, is the total travel cost, For the cost of taking a taxi, is the number of times you take the bus, The cost of a bus ride. The cost of each subway ride.
[0090] Next, the BERT-BiGRU network was used to perform sentiment analysis on attraction reviews to distinguish positive from negative reviews. This analysis was then used to construct an attraction satisfaction optimization model. This method allows for a more accurate assessment of each attraction's actual appeal and visitor satisfaction, providing a basis for selecting tour routes. Furthermore, the cost-benefit ratio of each potential route was further optimized by incorporating factors such as attraction location and ticket price. Combining these analysis results, the final multi-objective tour route planning optimization model was constructed. This model not only takes into account tourists' interests and preferences, but also accounts for the time and cost issues that may arise during the actual tour.
[0091] Step S30: Optimize the tourist route using the enhanced whale optimization algorithm model to obtain a target tourist route.
[0092] It's important to note that to further optimize this route to meet the diverse needs of tourists, deep optimization using the Enhanced Whale Optimization Algorithm (EWOA) is crucial. EWOA is an intelligent optimization algorithm inspired by the natural hunting behavior of humpback whales. It simulates whales' behaviors, such as surrounding prey, attacking with bubble nets, and performing random searches, to explore the solution space and find the optimal solution. For tour route planning, this means not only finding an optimal route that covers all selected attractions, but also minimizing travel time and cost while maximizing tourist satisfaction.
[0093] First, when applying EWOA, a nonlinear convergence factor is introduced. This factor exhibits a nonlinear decreasing trend with increasing iterations, gradually narrowing the search range and helping the algorithm shift from global search to local fine-tuning, ensuring the accuracy of the final solution. Furthermore, to prevent the algorithm from falling into local optimal solutions, an exponentially changing adaptive weighting strategy is adopted. This dynamically adjusts the weight distribution during the search process, improving population diversity and strengthening global search capabilities.
[0094] Secondly, a pooling mechanism is used to mix poor solutions with those near the optimal solution, increasing the diversity of the population and helping to escape local minima and find better solutions. At the end of each iteration, the pool members are updated, and newly discovered better solutions are added to the next iteration, continuously improving the quality of the solution. For the search process under specific conditions, a Cauchy distribution priority search strategy is also adopted, enhancing the algorithm's exploration capabilities and enabling it to search for possible optimal solutions over a wider area.
[0095] Finally, through this series of optimization measures, EWOA was able to effectively refine the initial itinerary and output a final itinerary that met the needs of the target group. This optimized itinerary not only took into account tourists' time and budget constraints but also fully reflected their preferences for different attractions, ensuring efficient and satisfying journeys and providing tourists with a memorable and personalized travel experience. This approach demonstrates the enormous potential of modern technology to improve the quality of tourism services.
[0096] This embodiment obtains tourist and scenic spot feature data, inputs the data into a preset multi-objective tourism route planning model, and generates a tourism route. The enhanced whale optimization algorithm is then used to optimize the tourism route to obtain a target tourism route. By obtaining tourist and scenic spot feature data, inputting the data into a preset multi-objective tourism route planning model to generate a tourism route, and optimizing it using the enhanced whale optimization algorithm, the target tourism route is ultimately obtained. This effectively addresses the issues of data sparsity and inadequate optimization algorithms, and improves the personalization and optimization of tourism routes.
[0097] Based on this, the embodiment of the present application provides a method for generating a travel route based on an enhanced whale optimization algorithm. Figure 2 , Figure 2 This is a flow chart of the second embodiment of the travel route generation method based on the enhanced whale optimization algorithm of this application.
[0098] In this embodiment, the method for generating a travel route based on the enhanced whale optimization algorithm includes steps S201 to S208:
[0099] Step S201: Generate an initial population, set the whale population size and the maximum number of iterations.
[0100] It should be noted that the size of the initial population directly affects the algorithm's exploration ability and computational efficiency. Generally, a larger population can provide a wider coverage of the search space, which helps to find the global optimal solution, but it also increases the computational burden. Therefore, in practical applications, it is necessary to reasonably set the population size based on the complexity of the specific problem and the computational resources. For multi-objective optimization problems such as tourist route planning, a reasonable initial population size may be between 50 and 100, expressed as ,in In addition, the number of iterations determines the length of time the algorithm runs and the level of sophistication of the search process. Too few iterations may result in the algorithm not being able to fully converge to the optimal solution, while too many iterations may cause unnecessary computational overhead. In general, the maximum number of iterations can be adjusted based on preliminary experimental results. For the travel route optimization problem, this value can be obtained from The algorithm starts with 100 attempts and gradually adjusts based on actual conditions. During initialization, each individual whale represents a potential itinerary, and its position vector indicates the order in which attractions are visited within that itinerary. In this way, EWOA continuously explores and optimizes these options while simulating whale feeding behavior, aiming to find the optimal itinerary that meets tourist needs. This process not only minimizes time and cost, but also maximizes tourist satisfaction with the travel experience.
[0101] Step S202: Calculate the fitness of individuals in the whale population according to the multi-objective function to obtain the fitness of the individuals and the optimal position of the population.
[0102] It should be noted that each whale individual represents a potential travel route plan, and its position vector indicates the order of visiting each attraction in the plan. By evaluating these individuals through a multi-objective function, the quality of each travel route can be quantified.
[0103] First, for each individual whale, a multi-objective function is calculated based on tourist characteristic data and attraction characteristic data, combined with multiple dimensions such as time, cost, and satisfaction. For example, a typical multi-objective function may include minimizing the total travel time, minimizing the total consumption cost, and maximizing the attraction of attractions and tourist satisfaction. Specifically, the attraction of attractions can be measured by calculating the sum of the scores of each attraction in each route; and tourist satisfaction can be determined based on the sentiment analysis results of the attraction reviews. After calculating the above multi-objective function, the fitness value of each individual can be obtained. This value reflects the degree of advantage of the travel route plan over other plans. Then, in the entire whale population, the individual with the highest fitness is selected as the current best position This process not only helps identify optimal or near-optimal travel routes but also provides guidance for subsequent iterations. As the number of iterations increases, the algorithm gradually approaches the global optimal solution by continuously updating individual positions and exploring new solution spaces, ensuring that the final output travel routes not only meet user needs but are also efficient and economical.
[0104] Step S203: Obtain the search range of the whale population by introducing a nonlinear convergence factor and an adaptive weight strategy.
[0105] It should be noted that the nonlinear convergence factor is mainly used to control the balance between exploration and exploitation during the search process. The nonlinear convergence factor is specifically expressed as:
[0106]
[0107] in, is the maximum number of iterations, is the phase offset. As the number of iterations increases, this factor exhibits a nonlinear decreasing trend, gradually narrowing the search range. This helps the algorithm shift from extensive exploration in the early stages to detailed development of potential optimal solutions in the later stages, thereby improving convergence speed and accuracy.
[0108] At the same time, an adaptive weighting strategy is used to further optimize the search process. This strategy enhances the algorithm's ability to escape local optimality by dynamically adjusting the weight of each whale during position updates. The specific formula is:
[0109]
[0110] in, represents the learning factor, Indicates the current iteration number, Represents the maximum number of iterations. Specifically, during each iteration, the weight value is automatically adjusted based on the quality of the current solution: when approaching the optimal solution, the weight tends to stabilize to allow for a detailed search; when moving away from the optimal solution, the weight is increased to expand the search range and avoid falling into a local minimum. In the position update function, the weight is adjusted based on the current and maximum number of iterations to achieve a smooth transition from exploration to development. The update function is:
[0111]
[0112]
[0113] Where, When the whales surround their prey, When searching for prey for whales, When the whale is attacked by a spiral bubble net, is the number of iterations, For the In the iteration The position vector of the head whale, and is the coefficient vector, For the The position vector of a random whale in the iteration, is the current best position, 、 and is the distance vector between the whale and its prey, is the shape parameter of the logarithmic spiral, which is the key parameter used to describe the shape of the moving path of the whale when performing spiral bubble net attack behavior. The range is A random number, These strategies work together to not only effectively reduce the reliance on the search range of the whale population, but also improve the overall performance of the algorithm, especially when solving complex multi-objective travel route planning problems.
[0114] Step S204: Based on the search range, the solutions around the optimal position of the population are mixed through a pooling mechanism to obtain multiple whale populations and corresponding individual fitness.
[0115] It's important to note that to increase population diversity and prevent the algorithm from getting stuck in a local optimum, a pooling mechanism is employed to mix solutions around the optimal position. This mechanism generates new whale individuals by combining poor solutions from the current population with high-quality solutions near the optimal position, thereby forming multiple whale populations. Specifically, the pooling operation selects a portion of poorly performing solutions and mixes them with solutions near the currently found optimal position. This not only introduces new solution space but also helps explore a wider range of possible solutions.
[0116] During this process, each newly generated whale has its fitness recalculated based on a multi-objective function. This value reflects the degree of superiority of a travel route plan relative to other options. For example, when calculating fitness, multiple factors such as travel time, consumption cost, attraction appeal, and visitor satisfaction may be considered. In this way, the algorithm is able to maintain high-quality solutions while exploring new solutions that may have been overlooked but have potential. The specific formula is:
[0117]
[0118] In the above formula, is a binary random vector, yes The inverse vector of is the solution in the current generation that is worse than the previous generation, The optimal solution Nearby solutions, and are the upper and lower bounds of the optimal solution.
[0119] This strategy significantly improves the global search capability of the algorithm, enabling EWOA to not only effectively discover the optimal solution within the existing solution space, but also to explore new areas of the solution space and find potentially better solutions.
[0120] Step S205: Compare the fitness of multiple individuals using the Cauchy distribution search strategy to obtain the global optimal solution for the whale population.
[0121] It should be noted that to improve global search capabilities and avoid falling into local optimal solutions, a Cauchy distribution search strategy is used to compare the fitness of multiple individuals to discover and update the global optimal solution for the whale population. The Cauchy distribution is a probability distribution with a heavy tail. Its characteristic is that it can generate random numbers within a large range, which is very beneficial for escaping local minima and exploring a wider solution space.
[0122] Specifically, during each iteration, a set of random numbers is generated through the Cauchy distribution, and these random numbers are used to adjust the positions of some individual whales. The specific formula is:
[0123]
[0124] in, is the Cauchy distribution, Represents a coefficient vector, usually randomly generated from the interval [0, 1], and Random selection is made from the matrix pool in t iterations. This process allows the algorithm to explore underexplored areas based on the current population, thereby increasing the likelihood of finding a more optimal solution. For each whale individual whose position has been adjusted using the Cauchy distribution, its fitness is recalculated according to the multi-objective function and compared with the best individual in the current population. If the fitness corresponding to the new position is higher, the individual is updated as the new global optimal solution.
[0125] This search strategy based on Cauchy distribution not only enhances the algorithm's exploration capability but also promotes the maintenance of population diversity, ensuring that the algorithm can effectively balance global search and local fine search when solving complex multi-objective travel route planning problems.
[0126] Step S206: updating the positions of individuals in the whale population based on the population's best position and the global optimal solution.
[0127] It should be noted that this process is primarily based on the current population's best position and information about the global optimal solution. Specifically, each individual whale uses a specific search strategy to adjust its position based on the distance between its current position and the global optimal solution.
[0128] First, the optimal position and global optimal solution within the population are determined. This information provides the direction and goal for individual exploration. Next, various mathematical models are used to simulate whale hunting behaviors, such as encircling prey and attacking with a bubble net, to guide individual position updates. For example, nonlinear convergence factors and adaptive weighting strategies may be employed during position updates to dynamically adjust the search range and direction, ensuring both efficient exploration of new areas and careful exploration of potential near known high-quality solutions.
[0129] For each individual whale, a new position is calculated using the updated formula, and its fitness is evaluated using a multi-objective function. If the new position results in higher fitness, the individual's position and fitness value are updated. This approach not only improves the quality of each individual whale but also helps the entire population converge towards a global optimal solution, ultimately providing an efficient and personalized solution to the travel route planning problem. This process demonstrates the importance of the algorithm's balance between exploration and exploitation, ensuring continuous optimization.
[0130] Step S207: If the number of iterations is reached, the preset whale individual corresponding to the final individual position is output.
[0131] It's important to note that at the end of each iteration, the algorithm first determines the global optimal solution within the current population. This optimal solution corresponds to the individual whale with the highest fitness value at the corresponding individual location. This optimal solution not only represents the most optimized travel route but also embodies key parameters and strategies within the solution, such as attraction appeal, visitor satisfaction, travel time, and cost.
[0132] Step S208: constructing an enhanced whale optimization algorithm model based on the preset whale individuals and then predicting the target travel route.
[0133] It should be noted that the EWOA model is initialized using the location information of the optimal whales, including but not limited to the sequence of attractions along the optimal route, the optimal transportation methods and time schedules between attractions. Next, model parameters are adjusted based on the specific needs of tourists (such as preferences and budget constraints) to ensure personalized service. EWOA-specific mechanisms, such as nonlinear convergence factors, adaptive weight adjustment, and pooling, are then employed to fine-tune the model to more accurately simulate travel route planning problems under different scenarios. This foundation allows the EWOA model to be used for predictions under new datasets or changing conditions. For example, if a tourist's points of interest change or new attractions are added, the algorithm can quickly respond and recalculate the optimal route. By inputting different scenario assumptions, such as weather changes and updated traffic conditions, the model outputs a series of alternative travel routes, each optimized to meet the optimal experience and efficiency requirements under specific conditions. Ultimately, these predictions not only provide tourists with diverse options but also demonstrate how advanced intelligent optimization algorithms can dynamically respond to complex real-world changes, improving the overall quality and personalization of the travel experience.
[0134] This example optimizes the whale population search process by generating an initial population and combining a nonlinear convergence factor, an adaptive weighting strategy, a pooling mechanism, and a Cauchy distribution search strategy. After reaching the maximum number of iterations, the optimal individual is output. Based on this, an enhanced whale optimization algorithm model is constructed to predict travel routes. This improves the efficiency and accuracy of solving multi-objective travel route planning problems, provides more personalized, cost-effective travel solutions, and enhances user experience and satisfaction.
[0135] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction and will not be described in detail later. Figure 3 The method for generating a travel route based on the enhanced whale optimization algorithm further includes steps S301 to S304 before step S20:
[0136] Step S301: Analyze the tourist feature data and the scenic spot feature data to construct a scenic spot interest model.
[0137] It is important to note that we collect and process visitor profile data, including gender, age, travel mode, preferences, and other characteristics, as well as visitor characteristics such as location, ticket price, reviews, and ratings. After cleaning, standardization, and necessary preprocessing, this data provides high-quality input for subsequent analysis. Based on this visitor profile data, we can use collaborative filtering to characterize the interest distribution of different visitor groups. We can also calculate the Pearson correlation coefficient to measure similarities between visitors and use this to predict individual interest ratings for unvisited attractions.
[0138] Specifically, we statistically analyze visitor characteristic data to obtain traveler preference characteristics. These characteristics include gender, age, preferred time of visit, and budget constraints. We also analyze attraction characteristic data to obtain attraction cost parameters. These characteristics include attraction ticket prices, transportation costs, opening hours, and geographical connections with other attractions. Based on these characteristics, we construct an attraction interest model. Furthermore, we use collaborative filtering to construct a rating matrix for both visitors and attractions based on these characteristics. The rating matrix is expressed as:
[0139]
[0140] The scoring matrix , each element Indicates tourists Attractions 's rating;
[0141] The Pearson correlation coefficient is used to calculate the similarity between tourists based on the rating matrix. The specific formula is:
[0142]
[0143] in Indicates tourists and tourists There are a collection of rated attractions. and Tourists and tourists The average rating of Indicates tourists Attractions Rating, Indicates tourists Attractions 's rating;
[0144] Filter out the preset groups with high similarity to the target tourists as the neighbor set. The specific formula is:
[0145]
[0146] in, Gathering for tourists, To preset the quantity, Indicates tourists and tourists similarity between
[0147] The interest score of the target tourists’ unvisited attractions is predicted through the neighbor set to obtain the interest intensity. The specific formula is:
[0148]
[0149]
[0150] in, Indicates target tourists For unvisited attractions The intensity of interest, Indicates target tourists For unvisited attractions The prediction score of Indicates tourists Attractions The lowest rating, Indicates tourists Attractions The highest rating, Neighbors and tourists For unvisited attractions The actual rating, represents a set of neighbors;
[0151] The attraction interest model is constructed based on the interest intensity. The specific formula is:
[0152]
[0153] in, is the number of scenic spots, is the decision variable, indicating whether to choose a scenic spot.
[0154] Step S302: Analyze the scenic spot feature data using the BERT-BiGRU sentiment analysis network to obtain sentiment analysis results.
[0155] It should be noted that the scenic spot feature data undergoes a series of preprocessing operations, including outlier removal, data normalization, duplicate text filtering, word segmentation, and stop word removal, to ensure data accuracy and consistency. Subsequently, the text is vectorized using the Glove method, converting it into a numerical form that the model can process. Next, the BERT pre-trained model is used to capture the contextual relationships and complex semantic patterns in the review text. At its core, BERT is a multi-layer Transformer encoder. Through a multi-head attention mechanism and a feedforward network, it fully understands the relationships and semantic nuances between words in the text. Building on this foundation, the BiGRU module further extracts long-term dependencies in the text and maintains a stable gradient flow during deep network training, thereby more comprehensively understanding the sentiment of the reviews. Finally, the output of the BERT-BiGRU sentiment analysis network is input into a fully connected layer for sentiment classification. Using activation functions and thresholds, the positive or negative sentiment of the review is determined.
[0156] Specifically, the review data within the scenic spot feature data is preprocessed to generate scenic spot text data. The Glove method is used to vectorize the scenic spot text data to generate text feature vectors. These text feature vectors are then fed into a BERT-BiGRU sentiment analysis network to determine the review type. The BERT-BiGRU sentiment analysis network consists of an input layer, a fully connected layer, and an output layer. Furthermore, the text feature vectors are fed into the input layer of the BERT-BiGRU sentiment analysis network for encoding, which extracts the contextual relationships and semantic features of the text. These contextual relationships and semantic features are then fed into the fully connected layer for sentiment classification, resulting in an output value. The output value is then fed into the output layer and compared with a preset threshold to determine the review type. Specifically, after preprocessing the original review text (such as removing stop words and performing word segmentation), the Glove method is used to convert it into vector form. These vectors are then fed into a pretrained BERT model for encoding, which captures the contextual relationships and complex semantic patterns within the text. The core of BERT lies in its use of a Transformer encoder, using a multi-head attention mechanism and a feedforward network to model the relationships between words at different positions. Next, the encoded features are passed to the BiGRU module to further extract long-term dependencies. BiGRU consists of two GRUs, forward and reverse, which process sequence data from the forward and backward directions respectively and concatenate the results to obtain a more comprehensive hidden state representation. The specific processing process is as follows: first update the gate, ,in is the weight matrix, is the Sigmoid activation function, and then reset the gate, ,in is the weight matrix, and then the candidate hidden state is obtained according to the following formula, ,in represents element-wise multiplication, is the weight matrix, and then obtain the final hidden state. The formula is: , through the forward GRU, the forward state of each time step is calculated in turn. The specific formula is: , and then through the reverse GRU, the reverse hidden state of each time step is calculated in reverse order. The formula is: Finally, concatenate the forward hidden state and the reverse hidden state to get the final hidden representation This process not only helps capture the temporal dynamics within the sequence, but also effectively maintains the stable flow of gradients, which is particularly important for long sequences. Subsequently, the context and semantic features obtained through BERT-BiGRU processing are fed into the fully connected layer to perform the final sentiment classification task. The fully connected layer calculates the output value through a series of weights, representing the probability that the comment belongs to a certain sentiment category. The specific formula is:
[0157]
[0158]
[0159] in, is the output of the fully connected layer, is the activation function, is the vector composed of weights in the fully connected layer, is the eigenvector, is the bias. If the output value exceeds the preset threshold, the review is considered positive, indicating that the visitor has a positive attitude and a satisfactory experience with the attraction. Otherwise, it is considered negative, indicating that the visitor may be dissatisfied with the attraction or have made criticisms. Finally, the review type is used as the sentiment analysis result.
[0160] Step S303: constructing a scenic spot satisfaction model based on the sentiment analysis results.
[0161] It's important to note that the BERT-BiGRU network was used to perform deep sentiment analysis on tourist reviews of tourist attractions, distinguishing between positive and negative reviews. This process not only relies on the choice of words in the text but also considers sentence structure and contextual information to more accurately capture tourists' true feelings.
[0162] Based on these sentiment analysis results, a tourist attraction satisfaction model can be constructed. This model comprehensively considers multiple dimensions, including but not limited to the sentiment of reviews, ratings, and specific visitor feedback. Specifically, for each tourist attraction, all relevant reviews are collected and, using a sentiment analysis algorithm, the ratio of positive to negative reviews is calculated to derive an overall tourist attraction satisfaction index. Furthermore, rating data can be combined and assigned different weights to more comprehensively reflect the attraction's actual popularity and service quality. When constructing the model, a weighted average or other appropriate statistical method is used to integrate these multi-source data to produce a quantitative satisfaction score. For example, if a tourist attraction receives a large number of highly rated reviews, with the majority of reviews being positive, its satisfaction index will be high. Conversely, if a large proportion of negative reviews are present, even if the rating is acceptable, its satisfaction index will be lowered accordingly. If a visitor rating on the website is not a perfect score (out of 5) and the sentiment analysis result is a negative example, the review is considered negative and the visitor score is assigned a -1 point. If the visitor rating is between 3 and 5, the sentiment analysis result is a positive example, the review is considered positive and the visitor score is assigned a +1 point. Ultimately, this attraction satisfaction model not only helps potential tourists make more informed choices but also provides a valuable reference for itinerary planning, ensuring that every recommended route includes highly satisfying attractions, thereby improving the overall quality of the travel experience and user satisfaction. It also helps attraction managers identify service shortcomings and implement targeted improvements.
[0163] Step S304: constructing a preset multi-objective tourism route planning model based on the scenic spot interest model and the scenic spot satisfaction model.
[0164] It's important to note that the attraction interest model analyzes visitor characteristics (such as gender, age, and preferences) and attraction features (such as location, ticket price, and reviews) to identify the most attractive attractions for a specific group of tourists. Furthermore, the attraction satisfaction model uses sentiment analysis and ratings to assess the service quality and visitor satisfaction of each attraction, ensuring that recommended attractions not only meet tourists' interests but also provide a high-quality experience. When constructing the multi-objective travel route planning model, multiple optimization objectives were comprehensively considered, including attraction attractiveness, visitor satisfaction, and travel costs (including time and expenses).
[0165] Furthermore, step S304 includes: obtaining the attraction's attractiveness using the attraction interest model, and obtaining attraction satisfaction using the attraction satisfaction model; and constructing an attraction attraction objective function based on the attraction's attractiveness and attraction satisfaction. Specifically, the attraction interest model quantifies the attraction's appeal to specific tourist groups. This model uses collaborative filtering and sentiment analysis techniques to assess the compatibility between attractions and tourist interests based on basic tourist information (such as age, gender, and travel preferences) and attraction characteristics (such as location, ticket price, and review content). Simultaneously, the attraction satisfaction model uses a BERT-BiGRU network to perform sentiment analysis based on visitor reviews and ratings, calculating the satisfaction rating for each attraction and reflecting the visitor's actual experience. Based on the results of these two models, an attraction attraction objective function can be constructed, comprehensively considering both attraction attractiveness and satisfaction. Specifically, the attraction attraction objective function can be defined as the weighted sum of the attraction's attractiveness score and satisfaction score, where the weights can be adjusted to emphasize the importance of specific factors based on the actual application scenario. The formula is:
[0166]
[0167]
[0168]
[0169] in, The number of people who received the score, Indicates the attraction score of attractions to genders. represents the attractiveness score for age, Indicates satisfaction with the attractions. Indicates the lowest satisfaction level of the attraction. represents the highest satisfaction level at a tourist attraction. For example, in certain scenarios, if we want to focus more on tourists' interests and preferences, we can appropriately increase the weight of the attractiveness score; conversely, if we pay more attention to service quality, we can increase the weight of the satisfaction score. A multi-objective tourism route planning model is then constructed based on the attraction attraction function. When constructing the target tourism route planning model, the primary goal is to maximize the total attractiveness score of all selected attractions throughout the itinerary. This means not only selecting highly attractive attractions, but also arranging their visit order in a reasonable manner to enhance the overall experience. Furthermore, the model needs to minimize travel time and cost, which involves optimizing the choice of transportation mode and route planning to ensure the most efficient itinerary within the budget.
[0170] This example analyzes visitor and attraction data and uses the BERT-BiGRU network to build attraction interest and satisfaction models. Based on these two models, an enhanced whale optimization algorithm is employed to construct a multi-objective tour route planning model. This improves the accuracy of personalized recommendations, optimizes the travel experience, and ensures that recommended routes are both relevant to visitor interests and highly satisfying, while also balancing cost and time efficiency.
[0171] Based on the first embodiment of the present application, the present application also provides a travel route generation device based on the enhanced whale optimization algorithm, please refer to Figure 4 , the device comprises:
[0172] An acquisition module 10 is used to acquire tourist characteristic data and scenic spot characteristic data;
[0173] Processing module 20, for inputting a preset multi-objective tourism route planning model according to tourist characteristic data and scenic spot characteristic data to obtain a tourism route;
[0174] An optimization module 30 is used to optimize the tourist route using an enhanced whale optimization algorithm model to obtain a target tourist route;
[0175] Construction module 40 is used to analyze tourist feature data and scenic spot feature data to construct a scenic spot interest model; analyze the scenic spot feature data through the BERT-BiGRU sentiment analysis network to obtain sentiment analysis results; construct a scenic spot satisfaction model based on the sentiment analysis results; and construct a preset multi-objective tourism route planning model based on the scenic spot interest model and the scenic spot satisfaction model.
[0176] The device for generating tourist routes based on the enhanced whale optimization algorithm provided in this application, which employs the method for generating tourist routes based on the enhanced whale optimization algorithm in the above-mentioned embodiments, can solve the technical problem of how to improve the accuracy and personalization of tourist route planning. Compared with the prior art, the beneficial effects of the device for generating tourist routes based on the enhanced whale optimization algorithm provided in this application are the same as those of the method for generating tourist routes based on the enhanced whale optimization algorithm provided in the above-mentioned embodiments. The other technical features of the device for generating tourist routes based on the enhanced whale optimization algorithm are the same as those disclosed in the above-mentioned embodiments and are not further described here.
[0177] In one embodiment, the optimization module 30 is also used to generate an initialization population, set the size of the whale population and the maximum number of iterations; calculate the individuals in the whale population according to the multi-objective function to obtain the individual fitness and the optimal position of the population; obtain the search range of the whale population by introducing a nonlinear convergence factor and an adaptive weight strategy; based on the search range, the solutions around the optimal position of the population are mixed through a pooling mechanism to obtain multiple whale populations and corresponding individual fitness; compare the fitness of multiple individuals through a Cauchy distribution search strategy to obtain the global optimal solution of the whale population; update the position of the individuals in the whale population according to the optimal position of the population and the global optimal solution; if the number of iterations is reached, output the preset whale individual corresponding to the final individual position; construct an enhanced whale optimization algorithm model based on the preset whale individuals and then predict the target travel route.
[0178] In one embodiment, the construction module 40 is further used to perform statistical analysis on tourist characteristic data to obtain tourist preference characteristics, where the tourist characteristic data includes gender, age, appearance time preference, and budget limit; analyze scenic spot characteristic data to obtain scenic spot cost parameters, where the scenic spot characteristic data includes scenic spot ticket price, transportation fee, opening hours, and geographical correlation with other scenic spots; and construct a scenic spot interest model based on the tourist preference characteristics and scenic spot cost parameters.
[0179] In one embodiment, the construction module 40 is further used to construct a rating matrix of tourists and attractions based on the tourist preference characteristics and the attraction cost parameters through a collaborative filtering method; use the Pearson correlation coefficient to calculate based on the rating matrix to obtain the similarity between tourists; screen out preset groups with high similarity to the target tourists as a neighbor set; predict the interest score of the target tourists' unvisited attractions through the neighbor set to obtain the interest intensity; and construct an attraction interest model based on the interest intensity.
[0180] In one embodiment, the construction module 40 is also used to preprocess the comment data in the scenic spot feature data to obtain scenic spot text data; use the Glove method to vectorize the scenic spot text data to obtain a text feature vector; input the text feature vector into the BERT-BiGRU sentiment analysis network to obtain the comment type, the BERT-BiGRU sentiment analysis network includes an input layer, a fully connected layer and an output layer; and use the comment type as the sentiment analysis result.
[0181] In one embodiment, the construction module 40 is also used to input the text feature vector into the input layer of the BERT-BiGRU sentiment analysis network for encoding to obtain the contextual relationship and semantic features of the text; input the text into the fully connected layer according to the contextual relationship and semantic features of the text to perform sentiment task classification to obtain an output value; and input the output value into the output layer for comparison with a preset threshold to obtain the comment type.
[0182] In one embodiment, the construction module 40 is also used to obtain the attraction level of the scenic spot through the attraction interest model, and obtain the attraction satisfaction through the attraction satisfaction model; construct a scenic spot attraction objective function based on the attraction level of the scenic spot and the attraction satisfaction; and construct a multi-objective tourism route planning model based on the scenic spot attraction function.
[0183] The present application provides a travel route generation device based on an enhanced whale optimization algorithm. The travel route generation device based on the enhanced whale optimization algorithm includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the travel route generation method based on the enhanced whale optimization algorithm in the above-mentioned embodiment one.
[0184] Reference below Figure 5 , which shows a schematic diagram of the structure of a travel route generation device based on the enhanced whale optimization algorithm suitable for implementing the embodiments of the present application. The travel route generation device based on the enhanced whale optimization algorithm in the embodiments of the present application can include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The travel route generation device based on the enhanced whale optimization algorithm shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0185] like Figure 5As shown, a travel route generation device based on the enhanced whale optimization algorithm may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for the operation of the travel route generation device based on the enhanced whale optimization algorithm. Processing device 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication devices 1009 can allow the travel route generation device based on the enhanced whale optimization algorithm to communicate with other devices wirelessly or wired to exchange data. While the diagram illustrates a travel route generation device based on the enhanced whale optimization algorithm with various systems, it should be understood that implementation or presence of all illustrated systems is not required. More or fewer systems may alternatively be implemented or present.
[0186] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0187] The device for generating tourist routes based on the enhanced whale optimization algorithm provided in this application, which employs the method for generating tourist routes based on the enhanced whale optimization algorithm in the above-mentioned embodiment, can solve the technical problem of how to improve the accuracy and personalization of tourist route planning. Compared with the prior art, the beneficial effects of the device for generating tourist routes based on the enhanced whale optimization algorithm provided in this application are the same as those of the method for generating tourist routes based on the enhanced whale optimization algorithm provided in the above-mentioned embodiment. The other technical features of the device for generating tourist routes based on the enhanced whale optimization algorithm are the same as those disclosed in the method of the above-mentioned embodiment, and are not further described here.
[0188] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0189] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0190] The present application provides a computer-readable medium having computer-readable program instructions (i.e., a computer program) stored thereon, and the computer-readable program instructions are used to execute the travel route generation method based on the enhanced whale optimization algorithm in the above embodiment.
[0191] The computer-readable medium provided in this application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination thereof. More specific examples of computer-readable media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0192] The computer-readable medium may be included in the travel route generation device based on the enhanced whale optimization algorithm; or it may exist independently without being assembled into the travel route generation device based on the enhanced whale optimization algorithm.
[0193] The computer-readable medium carries one or more programs that, when executed by a travel route generation device based on the enhanced whale optimization algorithm, enable the travel route generation device based on the enhanced whale optimization algorithm to write computer program code for performing the operations of the present application in one or more programming languages, or a combination thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0194] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0195] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.
[0196] The computer-readable medium provided in this application stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned method for generating tourist routes based on the enhanced whale optimization algorithm. This computer-readable medium addresses the technical problem of improving the accuracy and personalization of tourist route planning. Compared to the prior art, the beneficial effects of the computer-readable medium provided in this application are similar to those of the method for generating tourist routes based on the enhanced whale optimization algorithm provided in the aforementioned embodiments, and are not further elaborated here.
[0197] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned method for generating a travel route based on the enhanced whale optimization algorithm.
[0198] The computer program product provided in this application can solve the technical problem of improving the accuracy and personalization of travel route planning. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the travel route generation method based on the enhanced whale optimization algorithm provided in the above embodiment, and will not be further elaborated here.
[0199] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A tourist route generation method based on an enhanced whale optimization algorithm, characterized in that: The method comprises: Obtaining tourist characteristic data and scenic spot characteristic data; Input the tourist characteristic data and the scenic spot characteristic data into a preset multi-objective tourist route planning model to obtain a tourist route; Optimize the tourist route using an enhanced whale optimization algorithm model to obtain a target tourist route; Before the step of inputting the tourist characteristic data and the scenic spot characteristic data into a preset multi-objective tourist route planning model to obtain a tourist route, the method further includes: Analyzing the visitor characteristic data and the scenic spot characteristic data to construct a scenic spot interest model; Analyze the scenic spot feature data through the BERT-BiGRU sentiment analysis network to obtain sentiment analysis results; Constructing a scenic spot satisfaction model based on the sentiment analysis results; Constructing a preset multi-objective tourism route planning model based on the attraction interest model and the attraction satisfaction model; The step of analyzing the tourist characteristic data and the scenic spot characteristic data to construct a scenic spot interest model includes: Performing statistical analysis on the tourist characteristic data to obtain tourist preference characteristics, wherein the tourist characteristic data includes gender, age, preferred time of visit, and budget constraints; Analyzing the scenic spot characteristic data to obtain scenic spot cost parameters, wherein the scenic spot characteristic data includes scenic spot ticket price, transportation cost, opening hours and geographical correlation with other scenic spots; Constructing a scenic spot interest model based on the passenger preference characteristics and the scenic spot cost parameters; The step of constructing a scenic spot interest model based on the passenger preference characteristics and the scenic spot cost parameters includes: A rating matrix of tourists and attractions is constructed based on the passenger preference characteristics and the attraction cost parameters using a collaborative filtering method. The rating matrix is expressed as: The scoring matrix , each element Indicates tourists Attractions 's rating; The Pearson correlation coefficient is used to calculate the similarity between tourists based on the rating matrix. The specific formula is: in Indicates tourists and tourists There are a collection of rated attractions. and Tourists and tourists The average rating of Indicates tourists Attractions Rating, Indicates tourists Attractions 's rating; Filter out the preset groups with high similarity to the target tourists as the neighbor set. The specific formula is: in, Gathering for tourists, To preset the quantity, Indicates tourists and tourists similarity between The interest score of the target tourist's unvisited attractions is predicted by the neighbor set to obtain the interest intensity. The specific formula is: in, Indicates target tourists For unvisited attractions The intensity of interest, Indicates target tourists For unvisited attractions The prediction score of Indicates tourists Attractions The lowest rating, Indicates tourists Attractions The highest rating, Neighbors and tourists For unvisited attractions The actual rating, represents a set of neighbors; A scenic spot interest model is constructed according to the interest intensity.
2. The method according to claim 1, wherein Before the step of optimizing the tourist route by using the enhanced whale optimization algorithm model to obtain the target tourist route, the method includes: Generate an initial population, set the whale population size and the maximum number of iterations; Calculating individuals in the whale population according to a multi-objective function to obtain the fitness of the individuals and the optimal position of the population; By introducing a nonlinear convergence factor and an adaptive weight strategy, the search range of the whale population is obtained; Based on the search range, solutions around the optimal position of the population are mixed through a pooling mechanism to obtain multiple whale populations and corresponding individual fitness; Comparing the fitness of a plurality of individuals using a Cauchy distribution search strategy to obtain a global optimal solution for the whale population; updating the positions of individuals in the whale population according to the population best position and the global optimal solution; If the number of iterations is reached, the preset whale individual corresponding to the final individual position is output; An enhanced whale optimization algorithm model is constructed based on the preset whale individuals to predict the target travel route.
3. The method according to claim 1, wherein The step of analyzing the scenic spot feature data using a BERT-BiGRU sentiment analysis network to obtain a sentiment analysis result includes: Preprocessing the comment data in the scenic spot feature data to obtain scenic spot text data; The scenic spot text data is vectorized using the Glove method to obtain a text feature vector; Inputting the text feature vector into a BERT-BiGRU sentiment analysis network to obtain the comment type, wherein the BERT-BiGRU sentiment analysis network includes an input layer, a fully connected layer, and an output layer; The comment type is taken as the sentiment analysis result.
4. The method according to claim 3, wherein The step of inputting the text feature vector into the BERT-BiGRU sentiment analysis network to obtain the comment type includes: Input the text feature vector into the input layer of the BERT-BiGRU sentiment analysis network for encoding to obtain the contextual relationship and semantic features of the text; According to the contextual relationship and semantic features of the text, the text is input into the fully connected layer for sentiment task classification to obtain an output value; The output value is input into the output layer and compared with the preset threshold to obtain the comment type.
5. The method according to claim 1, wherein The step of constructing a preset multi-objective tourism route planning model based on the scenic spot interest model and the scenic spot satisfaction model includes: The attraction degree of the scenic spot is obtained by the scenic spot interest model, and the satisfaction degree of the scenic spot is obtained by the scenic spot satisfaction model; Constructing a scenic spot attraction objective function according to the attraction degree of the scenic spot and the satisfaction degree of the scenic spot; A multi-objective tourism route planning model is constructed based on the attraction function of the scenic spots.
6. A travel route generation device based on an enhanced whale optimization algorithm, characterized in that: The device comprises: An acquisition module is used to obtain tourist characteristic data and scenic spot characteristic data; A processing module, configured to input the tourist characteristic data and the scenic spot characteristic data into a preset multi-objective tourist route planning model to obtain a tourist route; An optimization module, configured to optimize the tourist route using an enhanced whale optimization algorithm model to obtain a target tourist route; A construction module is used to analyze the tourist feature data and the scenic spot feature data to construct a scenic spot interest model; analyze the scenic spot feature data using a BERT-BiGRU sentiment analysis network to obtain sentiment analysis results; construct a scenic spot satisfaction model based on the sentiment analysis results; and construct a preset multi-objective travel route planning model based on the scenic spot interest model and the scenic spot satisfaction model; further used to perform statistical analysis on the tourist feature data to obtain tourist preference characteristics, wherein the tourist feature data includes gender, age, appearance time preference, and budget limit; analyze the scenic spot feature data to obtain scenic spot cost parameters, wherein the scenic spot feature data includes scenic spot ticket price, transportation fee, opening hours, and geographical correlation with other scenic spots; construct a scenic spot interest model based on the tourist preference characteristics and the scenic spot cost parameters; and further used to construct a tourist and scenic spot scoring matrix based on the tourist preference characteristics and the scenic spot cost parameters using a collaborative filtering method, wherein the scoring matrix is expressed as: The scoring matrix , each element Indicates tourists Attractions 's rating; The Pearson correlation coefficient is used to calculate the similarity between tourists based on the rating matrix. The specific formula is: in Indicates tourists and tourists There are a collection of rated attractions. and Tourists and tourists The average rating of Indicates tourists Attractions Rating, Indicates tourists Attractions 's rating; Filter out the preset groups with high similarity to the target tourists as the neighbor set. The specific formula is: in, Gathering for tourists, To preset the quantity, Indicates tourists and tourists similarity between The interest score of the target tourist's unvisited attractions is predicted by the neighbor set to obtain the interest intensity. The specific formula is: in, Indicates target tourists For unvisited attractions The intensity of interest, Indicates target tourists For unvisited attractions The prediction score of Indicates tourists Attractions The lowest rating, Indicates tourists Attractions The highest rating, Neighbors and tourists For unvisited attractions The actual rating, represents a neighbor set; and constructs a scenic spot interest model according to the interest intensity.
7. A travel route generation device based on an enhanced whale optimization algorithm, characterized in that: The device includes: a memory, a processor, and a tourist route generation program based on an enhanced whale optimization algorithm stored in the memory and running on the processor. The tourist route generation program based on the enhanced whale optimization algorithm is configured to implement the steps of the tourist route generation method based on the enhanced whale optimization algorithm as described in any one of claims 1 to 5.
8. A medium, characterized in that The medium stores a tourist route generation program based on the enhanced whale optimization algorithm. When the tourist route generation program based on the enhanced whale optimization algorithm is executed by the processor, the steps of the tourist route generation method based on the enhanced whale optimization algorithm as described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Line customization method and line customization system based on travel planning
CN106096785A
Genetic algorithm-based travel itinerary planning system
CN119359494A