A multi-mode travel route recommendation method and device
The random forest model and Double Q-learning algorithm are used to optimize travel routes in the multi-modal traffic super network graph, which solves the problems of low accuracy and personalization of route recommendations in the existing technology, and improves the user experience and traffic congestion solutions. effectiveness.
Patent Information
- Application Number
- CN202410895338.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-05
AI Technical Summary
Existing travel recommendation algorithms cannot effectively meet the diverse needs of users in multi-modal transportation, and are prone to falling into local optimal solutions, resulting in low accuracy and low personalization of route recommendations.
The random forest model is used to determine the proportion of user travel preferences, combined with the Double Q-learning algorithm for multi-objective optimization, a multi-modal transportation super network graph is constructed, and paths are iteratively planned to meet the user's travel time, cost and transfer cost objectives.
It improves the accuracy and personalization of route recommendations, improves user experience, and can more effectively solve traffic congestion problems.
Smart Images

Figure CN118427448B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of traffic dispatching, and in particular to a method and device for recommending a multi-mode travel route. Background Art
[0002] With the continuous acceleration of the construction of modern cities, the traffic congestion caused by the corresponding population density problem is becoming increasingly serious. With the promotion of the new generation of information technology, there are currently a variety of public transportation systems (such as buses or rail transit). Although these transportation systems are large in scale and constantly improving, they have never been able to effectively solve this problem, and travel recommendation algorithms have emerged.
[0003] Most of the current travel recommendation algorithms provide route planning solutions under a single standard, which cannot meet the diversified travel needs of modern citizens. In multi-modal transportation applications, most of them recommend routes based on the optimal situation of a single goal or set the weight of multiple goals for route recommendation. They lack judgment and understanding of the actual needs of users, and the user experience satisfaction has not been improved.
[0004] In addition, traditional genetic algorithms or heuristic algorithms need to rely on prior modeling or manually designed heuristic rules. Although they can search for the optimal solution within an acceptable computational cost, they are prone to fall into local optimality in global path planning problems and cannot guarantee that the feasible solution obtained is the optimal solution. Not only is the scope of application limited, but it also increases the processing cost. Summary of the invention
[0005] The embodiment of the present application solves the problems of low accuracy of path recommendation and low personalization of recommended paths in the path recommendation algorithm in the prior art by providing a multi-mode travel path recommendation method and device. The preference ratio is obtained by using the random forest model, and a multi-objective optimization function is designed. The goal of minimizing the user's travel time cost, travel cost, and travel transfer cost is achieved with the user's preference ratio as the guide. The Double Q-learning algorithm improved by reinforcement learning is applied to solve the problem, so as to obtain the optimal travel plan that adapts to different users, improve the user's travel experience, and effectively solve the problem of traffic congestion.
[0006] In a first aspect, an embodiment of the present application provides a method for recommending a multimodal travel path, comprising: obtaining a user's historical travel data and public transportation site data; wherein the historical travel data includes travel trajectory, travel expenses, travel time and travel mode; the public transportation site data includes bus sites, subway stations and shared car sites; constructing a multimodal transportation super network diagram based on the public transportation site data; wherein the multimodal transportation super network diagram includes a bus transportation subnetwork, a rail transportation subnetwork and a shared car subnetwork; defining the user's travel preference index based on the historical travel data, and using a random forest model to determine the preference ratio of the travel preference index, thereby constructing a multi-objective optimization function; wherein the travel preference index includes travel time, travel expenses and transfer costs; based on the multimodal transportation super network diagram, using a Double Q-learning algorithm to iteratively plan a path until a preset number of iterations is met, and using the multi-objective optimization function as a reward function of the Double Q-learning algorithm to evaluate each iteration; wherein the reward function includes a travel time cost function, a travel expense cost function and a transfer cost function; and using the obtained path planning result as the user's recommended path.
[0007] In a possible implementation, before using the random forest model to determine the preference ratio of the travel preference index, the method further includes: filtering the historical travel data to remove redundant data, duplicate data and abnormal data.
[0008] In one possible implementation, the use of a random forest model to determine the preference ratio of the travel preference index includes: determining multiple training subsets in the historical travel data, and inputting them and the travel preference index into the random forest model to obtain a classification result; and determining the preference ratio of each travel preference index based on the classification result.
[0009] In a possible implementation, the travel time cost function is as follows:
[0010] ;
[0011] in,
[0012] ;
[0013] ,
[0014] ;
[0015] ,
[0016] ,
[0017] ;
[0018] ;
[0019] In the formula, It represents the total time spent by the user on the trip. Indicates the user's unit time value, Indicates the time it takes to transfer at the same station. Indicates the time spent on transfers at different stations. Indicates the time spent on public transportation during the trip. IC represents the average annual income, T represents the average annual working hours, represents the unit time value correction index, Indicates the public transportation mode, Indicates the subway traffic mode, represents the shared car transportation mode, i represents the current station i where the user is, and i+1 represents the next station after the i-station that the user is expected to go to. Indicates the time when the user arrives at the i site. Indicates the time when the user leaves the i site. Indicates whether to transfer at the same station as i. It indicates the inter-station transfer time from station i to station i+1. Indicates whether the train from station i to station i+1 is transferring to another station. Indicates transfer between bus and subway. Indicates transfers between different stations within the public transportation mode. Indicates transfers between different stations within the subway transportation mode. Indicates transfers between public transportation and shared cars. Indicates transfer between subway and shared car. represents the distance between site i and site i+1, represents the average walking speed, Indicates the bus speed. Indicates the subway speed, Indicates the speed of shared cars.
[0020] In a possible implementation, the travel cost function is as follows:
[0021] ;
[0022] In the formula, represents the total travel cost, Indicates the public transportation mode, Indicates the subway traffic mode, represents the shared car transportation mode, i represents the current station i where the user is, and i+1 represents the next station after the i-station that the user is expected to go to. represents the distance between site i and site i+1, Indicates the bus price. Indicates the subway unit price, Indicates the unit price of shared cars.
[0023] In a possible implementation, the transfer cost function is as follows:
[0024] ;
[0025] In the formula, represents the transfer cost, represents the statistics of the number of transfers, Indicates the penalty time for a single transfer. Indicates the user's unit time value.
[0026] In a possible implementation, the Double Q-learning algorithm further includes: optimizing -greedy strategy, as follows: Initialization , set an initial Value: Wherein, the initial The value is greater than the median of the interval; the attenuation function is used to control the initial Value decay updated value to reduce the randomness of the Double Q-learning algorithm; when the update When the value drops to the preset boundary value, the update value until the upper limit is reached.
[0027] In a possible implementation, the reward function includes: the negative value of the sum of the time cost, the fare cost and the transfer cost during the user's travel.
[0028] In a second aspect, an embodiment of the present application provides a multi-modal travel path recommendation device, comprising: a data storage module, used to obtain a user's historical travel data and public transportation station data; wherein the historical travel data includes travel trajectory, travel expenses, travel time and travel mode; the public transportation station data includes bus stations, subway stations and shared car stations; a construction module, used to construct a multi-modal transportation super network diagram according to the public transportation station data; wherein the multi-modal transportation super network diagram includes a bus transportation sub-network, a rail transportation sub-network and a shared car sub-network; a training model module, used to define the user's travel preference index based on the historical travel data, and use a random forest model to determine the preference ratio of the travel preference index, so as to construct a multi-objective optimization function; wherein the travel preference index includes travel time, travel expenses and transfer cost; an iteration module, used to iteratively perform path planning in the multi-modal transportation super network diagram using a Double Q-learning algorithm until a preset number of iterations is met, and use the multi-objective optimization function as a Double The reward function of the Q-learning algorithm evaluates each iteration; wherein the reward function includes a travel time cost function, a travel fee cost function and a transfer cost function; and a path recommendation module is used to use the obtained path planning result as a user recommended path.
[0029] In a third aspect, an embodiment of the present application provides a device for a multi-modal travel route recommendation method, the device comprising: a processor; a memory for storing processor executable instructions; when the processor executes the executable instructions, it implements the method described in the first aspect or any possible implementation method of the first aspect.
[0030] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0031] The embodiment of the present application adopts a multi-modal travel route recommendation method and device, and by constructing a multi-modal traffic super network diagram, it can fully consider different public transportation travel modes. The proportion of user travel preferences is obtained through the random forest model, and the influencing factors of user travel choices can be considered from many aspects. The Double Q-learning algorithm is used to iteratively plan the path, and the target optimization function is used as the reward function of the Double Q-learning algorithm, which can improve the accuracy of path recommendation and the relevance of user personalized needs. It effectively solves the problems of low path recommendation accuracy and low degree of personalization of recommended paths in the path recommendation algorithm in the prior art. It can recommend personalized travel plans for users based on the influencing factors of user travel choices, improve the user experience, and comprehensively consider a variety of public travel modes to help users reasonably plan travel routes and improve the accuracy of path recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0033] Figure 1 A flowchart of a multi-mode travel route recommendation method provided in an embodiment of the present application;
[0034] Figure 2 A flow chart of determining the preference ratio of travel preference indicators using a random forest model provided in an embodiment of the present application;
[0035] Figure 3 A schematic diagram of the structure of a multi-modal transportation super network diagram provided in an embodiment of the present application;
[0036] Figure 4 A flowchart illustrating the steps of the Double Q-learning algorithm provided in an embodiment of the present application;
[0037] Figure 5 A flowchart of the Double Q-learning algorithm provided in the embodiment of the present application;
[0038] Figure 6 A schematic diagram of the structure of a multi-modal travel route recommendation device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0040] The following describes some of the techniques involved in the embodiments of the present application to facilitate understanding, and they should be considered as merely exemplary. Therefore, it should be appreciated by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, some descriptions of well-known functions and structures are omitted in the following description.
[0041] The embodiment of the present application proposes a method for recommending a multi-modal travel route. By acquiring the public transportation station data, various urban transportation sub-networks are constructed, and a multi-modal transportation super-network diagram is constructed by integrating various transportation sub-networks. Python is used as the language for simulation construction, and travel preference indicators are defined based on the acquired historical travel data. The random forest model is used to obtain the user's preference ratio for travel time, travel expenses and transfer costs during the travel process, and a multi-objective optimization function is constructed based on this. The Double Q-learning algorithm is then used to iterate the algorithm in the multi-modal transportation super-network diagram to perform path planning until the preset number of iterations is met, and a multi-modal personalized travel route recommendation model is trained.
[0042] Figure 1 It is a flowchart of a multi-modal travel route recommendation method provided in an embodiment of the present application, including steps 101 to 105. Figure 1 This is only an execution order shown in the embodiment of the present application, and does not represent the only execution order of the multi-mode personalized path recommendation method. If the final result can be achieved, Figure 1 The steps shown may be performed in parallel or in reverse, as follows.
[0043] Step 101: Obtain the user's historical travel data and public transportation station data. In an embodiment of the present application, the historical travel data includes travel trajectory, travel expenses, travel time and travel mode. Public transportation station data includes bus stops, subway stations and shared car stops. Specifically, collect the user's historical travel data, and process the user's historical travel data into trajectory segment data at intervals of 20 minutes, including the longitude and latitude of the starting point, the longitude and latitude of the end point, the time spent on this section of the journey, the cost and the number of transfers. After cleaning and denoising these data, they are organized into historical travel data in units of single users. In addition, a database can also be used for storage, in which case the data is stored with the user (or user ID) as the primary key. In addition, a new column can be added to indicate the user's satisfaction with the current travel plan.
[0044] Step 102: Construct a multi-modal transportation super network diagram based on public transportation station data. Figure 3As shown, the present application constructs a multi-modal transportation super-network diagram that integrates the bus transportation sub-network, the rail transportation sub-network and the shared car sub-network by crawling the public transportation station data of the third-party website. Those skilled in the art can also obtain transportation network data from the transportation management department. The undirected edge in the figure represents the way to reach the next station by walking, realizing the fusion connection of the three transportation sub-networks. The bus transportation sub-network has fixed routes and fixed stations. The time of transfer at the bus station is used as the node of the bus transportation sub-network. Considering that the same station in the bus line has two directions back and forth, and the transfer station has different routes, the two directions of the line and the station information are stored in the two sub-nodes of the vertex respectively, which is convenient for obtaining the transfer method and transfer time. Similarly, in the rail transportation sub-network, the transfer time at the transfer station is stored in the vertex, and the two directions of the line and the station information are stored in the two sub-nodes of the vertex respectively. The shared car sub-network stores the rental point in the vertex, and adds this mode of transportation to the multi-modal transportation super-network diagram, providing users with more travel options.
[0045] Step 103: Define the user's travel preference index based on historical travel data, and use the random forest model to determine the preference ratio of the travel preference index, so as to construct a multi-objective optimization function. The travel preference index includes travel time, travel cost and transfer cost. The flowchart of using the random forest model to determine the preference ratio of travel preference index is as follows: Figure 2 As shown, the details are as follows.
[0046] Step 201: Define preference index. In the embodiment of the present application, the user's travel time, travel expenses and transfer costs are defined as the user's travel preference index, a training subset is determined in the historical travel data, and the historical travel data set is divided into a training subset and a test subset, with a ratio of 80% and 20% respectively.
[0047] Step 202: Data preprocessing. The user's travel preference index data is cleaned and processed, i.e., data filtering. Specifically, redundant data, duplicate data, and abnormal data in the travel preference index data are removed, and then the information gain feature selection method is used to select features that are helpful for model prediction to ensure the quality of the data.
[0048] Step 203: training the model. The processed travel preference index data and the training subset data are used as input features of the model to train the random forest model. The parameters of the random forest model are defined. For example, the number of trees and the random state are defined as 100 and 42, respectively.
[0049] Step 204: Output. An important advantage of the random forest model is that it can provide an intuitive understanding of the importance of features, that is, the key factors that affect users' travel choices, travel time, travel expenses and transfer costs. By selecting features, analyzing the importance of features, and reducing the number of features, the generalization ability of the random forest model is stronger, overfitting is avoided, and the preference ratio of each feature in the user's travel preference can be obtained.
[0050] Step 104: Based on the multimodal traffic hypernetwork graph, the Double Q-Learning algorithm is used to iteratively plan the path until a preset number of iterations is met, and the multi-objective optimization function is used as a reward function of the Double Q-Learning algorithm to evaluate each iteration.
[0051] In the embodiments of the present application, a flowchart showing the steps of the Double Q-learning algorithm is also provided. Figure 4 As shown. Reinforcement learning learns the optimal action selection strategy to obtain the maximum overall reward by observing the changes in each state in the environment and obtaining action feedback from the environment. Specifically, when designing the state, the state can be defined as the starting position, the end position and the state of each station of the user in the environment at the current moment, and the number of states is the number of traffic stations. The action space set of the traditional Q-learning algorithm is fixed, and the action space set of the Double Q-learning algorithm in the embodiment of the present application is constantly changing according to different states. Action design is to use the multi-modal traffic super network diagram as the environment for algorithm learning in each iteration of the Double Q-learning algorithm, and the user is represented as an intelligent agent. Before selecting an action, first obtain the spatial set of actions, that is, the set of actions that can be taken in each state is to obtain the travel mode of the next station that can be reached at the position in the state, as well as the specific travel route of each mode. The reward is the feedback given by the environment after the agent takes a certain action in the state, that is, the negative value of the sum of the time cost, cost cost and transfer cost of the agent from the state to the next moment state. The reward function is expressed as: , the size of the reward is positively correlated with the degree to which the agent is encouraged to approach the end point. In the above formula, represents the reward function, represents the weight corresponding to the time cost feature vector, It represents the total time spent by the user on the trip. represents the weight corresponding to the cost feature vector, represents the total travel cost, represents the weight corresponding to the transfer cost feature vector, represents the transfer cost.
[0052] Among them, the time cost reflects the value of the time consumed to achieve the user's travel purpose. In the embodiment of this application, the unit time value is measured by the income method. The total time spent refers to the total time spent by the user from the starting point to the end point, including transfer time and driving time, where transfer is divided into transfer at the same station and transfer at different stations, as follows:
[0053] ;
[0054] ;
[0055] In the formula, It represents the total time spent by the user on the trip. Indicates the user's unit time value, Indicates the time it takes to transfer at the same station. Indicates the time spent on transfers at different stations. Indicates the time spent on public transportation during the trip. IC represents the average annual income, T represents the average annual working hours, Represents the unit time value correction index.
[0056] Transferring at the same station only occurs in the same transportation mode. The total time cost required for transferring at the same station in bus and subway travel modes is:
[0057] ,
[0058] ;
[0059] In the formula, Indicates the time it takes to transfer at the same station. Indicates the public transportation mode, Indicates the subway traffic mode, Indicates the time when the user arrives at the i site. Indicates the time when the user leaves the i site. Indicates whether the transfer is at the same station as i, and i indicates the i station where the user is currently located.
[0060] Among them, inter-station transfers only occur between different modes of bus and subway, between the same mode of bus, between the same mode of subway, between different modes of bus and shared car, and between different modes of subway and shared car, so the total time required for inter-station transfers can be expressed as:
[0061] ,
[0062] ,
[0063] ;
[0064] In the formula, Indicates the time spent on transfers at different stations. It indicates the transfer time from station i to station i+1. Indicates whether the user transfers from station i to station i+1. i indicates the current station i where the user is, and i+1 indicates the next station that the user plans to go to after station i. Indicates transfer between bus and subway. Indicates transfers between different stations within the bus mode. Indicates transfers between different stations within the subway mode. Indicates transfers between public transportation and shared cars. Indicates transfer between subway and shared car. represents the distance between site i and site i+1, represents the average walking speed of the user. As the user changes the mode of transportation during the trip, the number of stations i increases. , , It limits users to only one mode of travel at the current moment.
[0065] Since all transfers are made by walking, the average walking speed is used to calculate the transfer time between stations. The time spent by users on public transportation is expressed as:
[0066] ;
[0067] In the formula, It indicates the time spent on public transportation during the trip, i indicates the current station i where the user is, and i+1 indicates the next station after the i-station that the user is expected to go to. Represents the distance between two stations, calculated using the spherical distance formula, represents the distance between site i and site i+1, Indicates the bus speed. Indicates the subway speed, Indicates the speed of shared cars.
[0068] Travel expenses are composed of three parts, including bus travel expenses, rail transit travel expenses and shared car travel expenses. The total travel cost can be expressed as:
[0069] ;
[0070] In the formula, represents the total travel cost, Indicates the public transportation mode, Indicates the subway traffic mode, represents the shared car transportation mode, i represents the current station i where the user is, and i+1 represents the next station after the i-station that the user is expected to go to. represents the distance between site i and site i+1, Indicates the bus price (¥ / km), Indicates the subway unit price (¥ / km), Indicates the unit price of shared cars (¥ / km).
[0071] The transfer cost is expressed as:
[0072] ;
[0073] In the formula, represents the transfer cost, represents the statistics of the number of transfers, Indicates the penalty time for a single transfer. Represents the user's unit time value. Among them, the transfer cost is expressed as the psychological burden penalty incurred by the user during the travel process. The number of transfers is constrained in the route recommendation process. Since the most intuitive influencing factor of transfer is the change of time, the transfer penalty cost is converted into the transfer penalty time for time cost conversion. Specifically, the internationally recognized value is used as the transfer penalty time, that is, the value of the single transfer penalty time. The psychological burden penalty and the time cost are converted into the same unit, and the transfer time penalty cost is calculated once for each transfer, and then linearly added to obtain the generalized transfer cost function.
[0074] The Double Q-learning algorithm provided in the embodiment of the present application is divided into a training process and a testing process. Figure 5 As shown, the next state is actually estimated by a dual estimator. The specific steps are as follows:
[0075] Step 501: Create tables Q1 and Q2, where rows in the two tables represent states and columns represent actions.
[0076] The training process is as follows Figure 5 As shown in steps 502 to 510 in .
[0077] Step 502: Initialize the state set. Specifically, initialize the current state as the starting state, and all initial Q values are set to 0. Set the learning rate of the Double Q-learning algorithm and discount factor , and set the number of training times and the maximum number of training steps.
[0078] Step 503: Determine whether the random number is less than the changed exploration rate. Specifically, determine the current state, and determine the next step to be executed based on the result of whether the random number is less than the changed exploration rate, where the changed exploration rate refers to the feedback obtained by changing in the multi-modal transportation network through state design, and after comparing with the random number, the Q table can start learning.
[0079] Step 504: Q1 table, select random action. Specifically, Q2 table is used to determine the action at each step, that is, the next travel mode to be selected, and Q1 table is used to evaluate the action of the next state each time.
[0080] Step 505: Select a random action, execute the selected action, and calculate the new state and immediate reward.
[0081] Step 506: Update the state and set the new state as the current state.
[0082] Step 507: Double Q-learning update algorithm, update the new Q value into the Q table, and set the new state as the current state. The Double Q-learning algorithm update formula after using the Q1 table and the Q2 table is as follows:
[0083] ;
[0084] In the formula, is Table Status Take action The long-term return is an estimate value, is in state Next execution The rewards you get, is the target value, The goal you want to approach; is the learning rate, is the discount factor, The corresponding action is not necessarily the actual action that will be performed in the next step, so an improved optimization is introduced -greedy strategy selection actions are as follows.
[0085] initialization Set an initial Value. Among them, the initial The value is greater than the median of the interval. In the embodiment of the present application, the median of the interval is exemplarily set to 0.5, and the initial The value can even approach 1 so that There is a large initial value to ensure that the agent can fully explore the environment in the early stage of training. Use the decay function to control the initial Value decay updated value to reduce the randomness of the Double Q-learning algorithm. Here you can use exponential decay or linear decay to control the initial Value decay can quickly reduce the randomness of the algorithm and allow the agent to start taking advantage of the knowledge it has learned.
[0086] The exponential decay is as follows: ; In the formula, Indicates update value, Indicates initial value, represents the current number of training steps, represents the decay rate, and . For example, Approaching 1, let
[0087] Set to 0.99 to ensure The decrease is gradual.
[0088] The linear decay is as follows: ; In the formula, Indicates update value, Indicates initial value, express The minimum value of is close to 0. represents the current number of training steps, Represents the total number of training steps. For example, The value is 0.01. Decided The decay rate is exemplarily set to 1000.
[0089] The above method can maintain a high exploration rate in the early stage of training to fully explore the environment, and gradually reduce the exploration rate in the later stage of training to make more use of the learned knowledge. When the value drops to the preset boundary value, it increases and updates value until the upper limit is reached.
[0090] The formula for this step is as follows:
[0091] ; In the formula, Indicates the update after enlargement value, Indicates the current update value, represents the growth rate, and Approaching 0. In the embodiment of the present application, Exemplarily, it is set to 0.0001. Slowly increase at a rate of 0.0001, but never exceed 1 (i.e. completely random selection) to ensure The growth of is slow and will not have a negative impact on the performance of the agent. For example, the upper limit value is set to 0.9999. In the embodiment of the present application, the upper limit value is infinitely close to 1, indicating that It can only approach 1, but cannot be equal to 1.
[0092] Step 508: Update to Q2 table, and assign Q1 table to Q2 table after a period of time.
[0093] Step 509: Calculate the maximum number of states in the current Q table.
[0094] Step 510: Determine whether to end.
[0095] The test process is shown in steps 502 to 511. According to the learned Q1 table and Q2 table, the action with the maximum Q value is selected as the decision. Steps 502 to 510 are repeated until the terminal state is reached, and the recommended path model is generated. Based on the trained Q table, the action with the maximum Q value is selected as the next travel mode and travel path. The user's travel path generated based on the selected action includes each station, as well as the transportation and specific routes used between stations.
[0096] Step 105: The obtained path planning result is used as the user recommended path. Specifically, the recommended path is determined by calculating the travel cost, including the sum of time cost, cost and transfer cost, so as to meet the personalized needs of different users.
[0097] Although the present application provides method operation steps such as embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in this embodiment is only one way of executing the order of many steps and does not represent the only execution order. When the actual device or client product is executed, it can be executed in the order of the method shown in this embodiment or the accompanying drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment).
[0098] like Figure 6 As shown, the embodiment of the present application also provides a multi-mode travel route recommendation device 600. The device includes: a data storage module 601, a construction module 602, a training model module 603, an iteration module 604, and a route recommendation module 605, which are specifically as follows.
[0099] The data storage module 601 is used to obtain the user's historical travel data and public transportation station data; the historical travel data includes travel trajectory, travel expenses, travel time and travel mode; the public transportation station data includes bus stations, subway stations and shared car stations;
[0100] A construction module 602 is used to construct a multi-modal transportation super-network diagram based on the public transportation station data; wherein the multi-modal transportation super-network diagram includes a public transportation sub-network, a rail transportation sub-network and a shared car sub-network;
[0101] The training model module 603 is used to define the user's travel preference index based on the historical travel data, and use the random forest model to determine the preference ratio of the travel preference index, so as to construct a multi-objective optimization function; wherein the travel preference index includes travel time, travel cost and transfer cost;
[0102] The iteration module 604 is used to iteratively plan the path in the multimodal traffic hypernetwork diagram using the Double Q-learning algorithm until a preset number of iterations is met, and evaluate each iteration using the multi-objective optimization function as the reward function of the Double Q-learning algorithm; wherein the reward function includes a travel time cost function, a travel fare cost function, and a transfer cost function.
[0103] The route recommendation module 605 is used to use the obtained route planning result as a user recommended route.
[0104] The devices or modules described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above devices are described in various modules according to their functions. When implementing this application, the functions of each module can be implemented in the same or multiple software and / or hardware. Of course, the module that implements a certain function can also be implemented by combining multiple sub-modules or sub-units.
[0105] The method, device or module in the present application can be implemented in the form of a computer-readable program code. The controller can be implemented in any appropriate manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (English: Application Specific Integrated Circuit; Abbreviation: ASIC), a programmable logic controller and an embedded microcontroller. Examples of controllers include but are not limited to the following microcontrollers: ARC 625D, AtmelAT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included in it for implementing various functions can also be regarded as structures within the hardware component. Or even, the means for realizing various functions may be regarded as both a software module for realizing the method and a structure within a hardware component.
[0106] An embodiment of the present application also provides a device for a multi-mode path recommendation method, the device comprising: a processor; a memory for storing processor executable instructions; when the processor executes the executable instructions, the method of the embodiment of the present application is implemented.
[0107] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist independently, or two or more modules may be integrated into one module.
[0108] It can be known from the description of the above implementation mode that those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary hardware. Based on such an understanding, the technical solution of the present application can be essentially or partly reflected in the prior art in the form of a software product, or it can be reflected in the implementation process of data migration. The computer software product can be stored in a storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods of each embodiment of the present application or some parts of the embodiments.
[0109] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. All or part of this application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, mobile communication terminals, multi-processor systems, microprocessor-based systems, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.
[0110] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit the present application. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features thereof may be replaced by 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 present application.
Claims
1. A multi-modal travel route recommendation method, characterized in that: include: Obtain the user's historical travel data and public transportation station data; wherein the historical travel data includes travel trajectory, travel expenses, travel time and travel mode; the public transportation station data includes bus stations, subway stations and shared car stations; Constructing a multimodal transportation supernetwork diagram according to the public transportation station data; wherein the multimodal transportation supernetwork diagram includes a bus transportation subnetwork, a rail transportation subnetwork and a shared car subnetwork; Defining the user's travel preference index based on the historical travel data, and using the random forest model to determine the preference ratio of the travel preference index, thereby constructing a multi-objective optimization function; wherein the travel preference index includes travel time, travel cost and transfer cost; Based on the multimodal traffic hypernetwork graph, the Double Q-learning algorithm is used to iteratively plan the path until a preset number of iterations is met, and the multi-objective optimization function is used as the reward function of the Double Q-learning algorithm to evaluate each iteration; wherein the reward function includes a travel time cost function, a travel fee cost function and a transfer cost function; the travel time cost function includes: ;in, ; , ; , , ; ; In the formula, Indicates the total time spent by the user on the trip. Indicates the user's unit time value, Indicates the time it takes to transfer at the same station. Indicates the time spent on transfers at different stations. Indicates the time spent on public transportation during the trip. IC represents the average annual income, T represents the average annual working hours, represents the unit time value correction index, Indicates the public transportation mode, Indicates the subway traffic mode, represents the shared car transportation mode, i Indicates the user's current location i Site, Indicates the destination the user is expected to visit i The next station of the station, Indicates that the user has arrived i The time of the site, Indicates that the user has left i The time of the site, Indicates whether i Transfer at the same station. express i Stand The transfer time between stations. express i arrive Whether the station is a transfer station, Indicates transfer between bus and subway. Indicates transfers between different stations within the public transportation mode. Indicates transfers between different stations within the subway transportation mode. Indicates transfers between public transportation and shared cars. Indicates transfer between subway and shared car. Indicates the site i To site The distance between represents the average walking speed, Indicates the bus speed. Indicates the subway speed, Indicates the speed of shared cars; The travel cost function includes: ; In the formula, represents the total travel cost, Indicates the public transportation mode, Indicates the subway traffic mode, represents the shared car transportation mode, Indicates the site To site The distance between Indicates the bus price. Indicates the subway unit price, Indicates the unit price of shared cars; The transfer cost function includes: ; In the formula, represents the transfer cost, represents the statistics of the number of transfers, Indicates the penalty time for a single transfer. Indicates the user's unit time value; The obtained path planning result is used as the user recommended path.
2. The method according to claim 1, characterized in that Before determining the preference proportion of the travel preference index by using the random forest model, the method further includes: The historical travel data is filtered to remove redundant data, duplicate data and abnormal data.
3. The method according to claim 1, characterized in that The method of using the random forest model to determine the preference ratio of the travel preference index includes: Determine a plurality of training subsets in the historical travel data, and input the subsets and the travel preference index into a random forest model to obtain a classification result; The preference proportion of each of the travel preference indicators is determined based on the classification result.
4. The method according to claim 1, characterized in that: The Double Q-learning algorithm also includes: optimization -greedy strategy, as follows: initialization , set an initial Value; wherein the initial The value is greater than the median of the interval; The initial Value decay updated value to reduce the randomness of the Double Q-learning algorithm; When the update When the value drops to the preset boundary value, increase the update value until the upper limit is reached.
5. The method according to claim 1, characterized in that The reward function includes: the negative value of the sum of the time cost, the expenditure cost and the transfer cost during the user's travel.
6. A multi-mode travel route recommendation device, characterized in that: include: A data storage module is used to obtain the user's historical travel data and public transportation station data; wherein the historical travel data includes travel trajectory, travel expenses, travel time and travel mode; the public transportation station data includes bus stations, subway stations and shared car stations; A construction module, used to construct a multi-modal transportation super-network diagram according to the public transportation station data; wherein the multi-modal transportation super-network diagram includes a bus transportation sub-network, a rail transportation sub-network and a shared car sub-network; A training model module is used to define the user's travel preference index based on the historical travel data, and use a random forest model to determine the preference ratio of the travel preference index, so as to construct a multi-objective optimization function; wherein the travel preference index includes travel time, travel cost and transfer cost; An iteration module is used to iteratively perform path planning in the multimodal transportation hypernetwork diagram using the Double Q-learning algorithm until a preset number of iterations is met, and to evaluate each iteration using the multi-objective optimization function as a reward function of the Double Q-learning algorithm; wherein the reward function includes a travel time cost function, a travel fare cost function, and a transfer cost function; the travel time cost function includes: ;in, ; , ; , , ; ; In the formula, Indicates the total time spent by the user on the trip. Indicates the user's unit time value, Indicates the time it takes to transfer at the same station. Indicates the time spent on transfers at different stations. Indicates the time spent on public transportation during the trip. IC represents the average annual income, T represents the average annual working hours, represents the unit time value correction index, Indicates the public transportation mode, Indicates the subway traffic mode, represents the shared car transportation mode, i Indicates the user's current location i Site, Indicates the user's expected destination i The next station of the station, Indicates that the user has arrived i The time of the site, Indicates that the user has left i The time of the site, Indicates whether i Transfer at the same station. express i Stand The transfer time between stations. express i arrive Whether the station is a transfer station, Indicates transfer between bus and subway. Indicates transfers between different stations within the public transportation mode. Indicates transfers between different stations within the subway transportation mode. Indicates transfers between public transportation and shared cars. Indicates transfer between subway and shared car. Indicates the site i To site The distance between represents the average walking speed, Indicates the bus speed. Indicates the subway speed, Indicates the speed of shared cars; The travel cost function includes: ; In the formula, represents the total travel cost, Indicates the public transportation mode, Indicates the subway traffic mode, represents the shared car transportation mode, Indicates the site To site The distance between Indicates the bus price. Indicates the subway unit price, Indicates the unit price of shared cars; The transfer cost function includes: ; In the formula, represents the transfer cost, represents the statistics of the number of transfers, Indicates the penalty time for a single transfer. Indicates the user's unit time value; The path recommendation module is used to use the obtained path planning results as user recommended paths.
7. A device for a multi-mode travel route recommendation method, characterized in that: include: processor; a memory for storing processor-executable instructions; When the processor executes the executable instructions, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Multi-mode bus travel path planning method
CN115497326A
Urban public transport passenger travel trajectory estimation method and system, terminal, and storage medium
WO2021243516A1
Cited By
Multi-modal travel path recommendation system for passengers based on knowledge graph and machine learning
CN122288052A
