A bus route design method, device, and terminal device based on big data
Using big data and ant colony algorithm to optimize bus route design solves the problems of low manual planning efficiency and lack of satisfaction, realizes automated design and efficient passenger flow attraction, and is suitable for a variety of scenarios.
Patent Information
- Application Number
- CN202010939988.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-09
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-09-09
AI Technical Summary
Existing bus line design mainly relies on manual planning, which has problems such as experience dependence, lack of clear indicator standards, difficulty in meeting various needs, and unreasonable station spacing, resulting in low design efficiency and insufficient passenger satisfaction.
Adopting a bus route design method based on big data, through objective functions and pheromone update rules, combined with ant colony algorithm and genetic algorithm, it can automatically find the optimal bus route, optimize route design, reduce design time and workload, and improve passenger flow attraction.
It realizes the automation of bus line design, saves time and cost, and improves passenger travel satisfaction. It is suitable for new lines, extended lines and various scenarios.
Smart Images

Figure BDA0002673304030000041 
Figure BDA0002673304030000101 
Figure FDA0004929327380000011
Abstract
Description
Technical Field
[0001] The present invention relates to the research field of intelligent transportation big data, and in particular to a bus route design method, device, and terminal equipment based on big data. Background Art
[0002] As my country's cities expand and the population increases, the daily travel needs of residents undertaken by public transportation are becoming increasingly important. However, due to the influence of route planning methods, road conditions, and insufficient intelligence of planning methods, bus routes often have many problems: it is difficult to meet the travel needs of most people, detours delay passengers' time, and high operating costs. With the accumulation of bus data and the development of passenger flow collection technology, bus companies and research institutions have begun to try to plan bus routes through computer intelligence and carry out network optimization. In the process of realizing the present invention, the inventor found that there are at least the following problems in the prior art: my country's current bus route design mainly relies on manual planning, but manual planning has obvious defects: it relies on the experience and ability of designers, the design results have no clear indicators and standards, the number of bus community stations is large and the workload is large, the line design is difficult to meet the actual needs of many aspects, and the bus line station spacing is unreasonable. Summary of the invention
[0003] In order to overcome the shortcomings of the prior art, the disclosed embodiments provide a bus route design method, device, and terminal device based on big data. The method can continuously tend to the optimal bus route through the pheromone update rule based on the objective function and the contribution of the station to the objective function. This enables the computer to automatically find a suitable bus route, greatly saving the time and workload of bus route design, increasing the number of passengers that can be attracted by the bus route, saving residents' travel time by bus, reducing costs and increasing efficiency for bus companies, and improving public travel satisfaction. In addition, the technical solution has high applicability and is well applicable to various scenarios such as newly opened routes, extended routes, and given must-pass stations.
[0004] The technical solution is as follows:
[0005] A bus route design method based on big data is provided, which includes the following steps:
[0006] Step 1: Get basic data
[0007] The existing bus stops in the area are collected and marked with serial numbers in sequence. The total number of stops is recorded as SN. Basic data such as the time, mileage, and cost required to travel between two stops by bus, walking, or driving are obtained.
[0008] Step 2: Process the basic data
[0009] Based on the basic data, we obtain the distance matrix D between each station and the time consumption matrix T between each station using different transportation modes, obtain the number of people who need public transportation between each station, and form the average daily number of people who need travel between each station O. The elements of the mth row and nth column of the matrices D, T, and O represent the distance, time consumption, and number of people who need travel from the mth station to the nth station, respectively.
[0010] Select a pre-designed bus route W(i 1 ,i 2 ,i 3 ,……i n ): that is, randomly select several sites in the area to form an ordered site sequence to form an ordered path, where i 1 ,i 2 ,i 3 ,……i n For a pre-designed arrangement of bus routes, the number of passengers required to travel between any two stations in the route can be obtained based on the travel demand matrix O: the number of passengers required to travel between station i and station j in the bus route is recorded as O(i,j).
[0011] Define the impedance function v(i,j,vehicle):
[0012] v(i,j,vehicle) = travel cost of vehicle + corresponding time cost
[0013] v(i,j,vehicle) represents the travel impedance from station i to station j when vehicle is chosen as the transportation mode.
[0014] Calculate the probability of passengers choosing each mode based on the impedance function:
[0015] k is all available transportation modes,
[0016] That is, the probability of traveling on the pre-designed bus route is obtained Prob(i, j, pre-designed bus route);
[0017] Predict the total passenger flow total_od of the pre-designed bus route: According to the O(i,j) point multiplication probability Prob(i,j,pre-designed bus route), we get the predicted number of travelers between station i and station j after the actual construction of the pre-designed bus route, and then sum the predicted number of travelers between each station to get the total passenger flow total_od.
[0018] Step 3: Design the ant colony algorithm model
[0019] The objective function f(W) of the line is defined as:
[0020] f(W) = fare P * total passenger flow total_od - unit time cost * total travel time total_time
[0021] The total travel time total_time is the total travel time total_time of the passenger flow traveling through the designed bus route, obtained based on the predicted number of travelers between each station and the time consumption between each station in the time consumption matrix T.
[0022] Design ant colony algorithm model: max{f(W)}, W is a bus route design scheme
[0023] The ant colony algorithm model is initialized and iterated in sequence until the total number of iterations N is reached. The maximum objective function value max(f)n=1,2,…N of these N iterations is selected, and the corresponding optimal path is the bus route to be designed.
[0024] Preferably, step 3 initializes the ant colony algorithm model, first of all, the parameters of the ant colony algorithm model are initialized, specifically: set parameters: information matrix, heuristic function matrix, total number of ants K, each ant will find a path, passing through several stations, each ant's path represents a bus route plan, total number of algorithm iterations N, information heuristic factor α, expected heuristic factor β, pheromone volatilization speed ρ, genetic algorithm layer iteration number AN, genetic algorithm layer mutation probability AP; initialize the optimal path L to be solved to be empty, and the optimal objective function is MAX=0; initialize the information matrix, initialize each element of the information matrix to 1, that is, the initialized information on each path is 1, and the elements of the mth row and nth column of the information matrix represent the information on the path from the mth station to the nth station; wherein the elements of the mth row and nth column of the heuristic function matrix are equal to the inverse of the distance from the mth station to the nth station; after initialization, in subsequent iterations, the information matrix is iteratively updated and the state transfer matrix S is calculated.
[0025] Furthermore, after initializing the parameters of the ant colony algorithm model, the ant colony algorithm layer is iterated, and the ant colony algorithm model is initialized by an improved path initialization method, specifically:
[0026] (1) According to the total number of sites SN in the area, K ants are randomly divided into three equal parts. In the first part, each ant generates a random number between 0 and SN / 3 as the total number of path sites. In the second part, each ant generates a random number between SN / 3 and SN*2 / 3 as the total number of path sites. In the third part, each ant generates a random number between SN*2 / 3 and SN as the total number of path sites.
[0027] (2) Divide the area into three sub-areas. For each part of ants in step (1), divide it into three sub-parts, representing the three sub-areas. The initial sites of the ants in each sub-part are generated from the corresponding sub-areas.
[0028] Preferably, after the ant colony algorithm model is initialized, the subsequent iteration process of the ant colony algorithm is performed, that is, each station path of the bus line to be designed is generated, specifically: the state transition probability from station i to the next station j is calculated according to the state transition matrix S combined with the logit algorithm
[0029] j,k∈Unvisit set
[0030] After obtaining the state transition probability, the next site j of the path is generated through the roulette algorithm, thereby generating the path of this ant in turn and calculating the objective function of this path.
[0031] Similarly, obtain the K route paths and corresponding objective functions produced by all K ants in the nth iteration, store the path route1 with the largest objective function among these K paths and its objective function object1, and iterate in sequence until the total number of iterations N is reached.
[0032] Furthermore, when generating the path of each station of the bus route to be designed, it also includes: setting a set of stations that each station will not pass through, that is, a dynamic Unvisit set. In the process of each ant looking for stations to form a bus path, only stations outside the Unvisit set are considered. The dynamic Unvisit set includes stations that have been selected in the process of forming the bus path, and also includes stations whose distance to the selected station is less than the specified minimum station distance or greater than the maximum station distance.
[0033] Preferably, in the subsequent iteration process, the information amount matrix is iteratively updated in sequence and the state transfer matrix S is calculated, specifically,
[0034] When n=1, the information matrix is the initialized information matrix; otherwise, the information matrix is updated according to the pheromone increment matrix, and the state transfer matrix S is obtained by performing matrix dot multiplication operation on the information matrix and the heuristic function matrix.
[0035] According to the objective function of each path, the pheromone increment matrix is obtained, that is, the pheromone increment of the adjacent sites on the path of the kth ant. For the path of the kth ant, the number of travelers between sites i and j can be predicted first, and the pheromone increment of the adjacent sites k1 and k2 in the path of the kth ant can be calculated as follows:
[0036]
[0037] Then, the element in the m-th row and n-th column of the pheromone increment matrix is the sum of the information increments passing through stations m and n in all line paths, and stations m and n are adjacent stations. Adding the pheromone increment matrix to the information matrix gives the updated information matrix.
[0038] Preferably, when the number of iterations reaches the total number of iterations N, for the last iteration, that is, the K paths generated in the N-th iteration, genetic algorithm layer operations are performed. Each operation in the genetic algorithm layer includes a selection operation and a mutation operation.
[0039] The selection operation is as follows: The selection probability of each path is obtained through the softmax function according to the objective function of each path, and a new set of K preferred paths is selected from the K paths through the roulette wheel algorithm.
[0040] The mutation operation is as follows: The mutation operation is performed on each path after the selection operation. For each path i, a random number ri between [0, 1] is randomly generated. If this random number ri < the mutation probability AP, the mutation operation will be performed: If the random number ri < AP / 3, the order of two randomly selected stations in the path is exchanged; if AP / 3 < the random number ri < AP*2 / 3, a station randomly selected from the remaining stations not passed by the path is randomly inserted into one of the positions of the existing stations in the path; if AP*2 / 3 < the random number ri < AP, if the number of stations in the path itself >= 3, a station in the path is randomly selected and deleted.
[0041] Record the maximum value AM of the objective function and the corresponding path scheme among the K paths generated by each genetic algorithm operation. If the maximum value of the objective function generated by the next genetic algorithm iteration is larger than the existing AM value, update the AM value and the corresponding path scheme. Thus, after AN genetic algorithm iterations, the maximum objective function value object2 of the genetic algorithm layer and the corresponding optimal path scheme route2 are selected.
[0042] Compare object1 and object2, and take the larger value and the corresponding route1 / route2 as the optimal path MAX_n and the optimal objective function L_n of the n-th time of this technical algorithm.
[0043] Compared with the prior art, one of the above technical solutions has the following beneficial effects: the possibility of residents choosing different modes of transportation is calculated by the designed impedance function rule, so that the bus route designed in the end is more in line with the actual situation; the ant colony algorithm model is initialized by the improved path initialization method to find the optimal bus route, ensuring the diversification of the bus path length and the area in which it is located during initialization, thereby avoiding the local optimal problem that the traditional algorithm may cause due to initialization. Further optimization is performed by the genetic algorithm to avoid falling into the local optimal solution. Taking the number of people and travel time as the comprehensive goal, the role function of public transportation is fully utilized. When generating the path, the set of prohibited sites Unvisit set designed by the station spacing is used to avoid the unreasonable station spacing problem that often exists in the actual bus route. The pheromone update rule based on the objective function and the contribution of the station to the objective function enables the method to continuously tend to the optimal bus route. Thus, the computer automatically finds the appropriate bus route, which greatly saves the time and workload of bus route design, increases the number of passengers that the bus route can attract, saves the travel time of residents through the bus, reduces costs and increases efficiency for bus companies, and improves public travel satisfaction. In addition, this technical solution has high applicability and is well applicable to various scenarios such as newly opened lines, extended lines, and given must-pass stations. DETAILED DESCRIPTION
[0044] In order to illustrate the technical solution and working principle of the present invention, the embodiments of the present invention will be described in further detail below. All the above optional technical solutions can be combined in any way to form optional embodiments of the present invention, which will not be described one by one here.
[0045] The terms "step 1", "step 2", "step 3" or "(1)", "(2)" and the like in the specification and claims of the present application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application described herein can, for example, be implemented in an order other than those described herein.
[0046] In this embodiment, the bus route design method can also be used in the fields of corporate shuttle buses, light rails, subways, etc. that adopt a similar operation mode as buses.
[0047] First aspect: The embodiment of the present disclosure provides a bus route design method based on big data: the method mainly includes the following steps:
[0048] Step 1: Get basic data
[0049] Collect the existing bus stops in the area and mark them with serial numbers in sequence. The total number of stops is recorded as SN. Obtain basic data such as the time, mileage, and cost required to travel between any two stops by bus, walking, or driving. The cost of the bus refers to the designed fare P, the walking cost is recorded as 0, and the driving cost is mileage*unit mileage cost.
[0050] Step 2: Process the basic data
[0051] Based on the basic data, we obtain the distance matrix D between each station and the time matrix T between each station using different transportation modes. We investigate or obtain the number of people who need to travel by bus between each station to form the average daily number of people who need to travel between each station. The elements of the mth row and nth column of the matrices D, T, and O represent the distance, time consumption, and number of people who need to travel from the mth station to the nth station, respectively.
[0052] Select a pre-designed bus route W(i 1 ,i 2 ,i 3 ,……i n ): that is, randomly select several sites in the area to form an ordered site sequence to form an ordered path, where i 1 ,i 2 ,i 3 ,……i n For a pre-designed arrangement of bus routes, the number of passengers required to travel between any two stations in the route can be obtained based on the travel demand matrix O: the number of passengers required to travel between station i and station j in the bus route is recorded as O(i,j).
[0053] Define the impedance function v(i,j,vehicle):
[0054] v(i,j,vehicle) = travel cost of vehicle + corresponding time cost
[0055] v(i,j,vehicle) represents the travel impedance from station i to station j when vehicle is chosen as the transportation mode.
[0056] Preferably, the corresponding time cost = the time required to travel by vehicle * unit time cost,
[0057] The unit time cost is: the local average monthly wage income is obtained through the statistics bureau data, and the unit time cost of the region is calculated by average monthly wage income / (20 working days*8 hours).
[0058] The transportation modes from station i to station j include: pre-designed bus routes, driving, walking, and existing direct bus routes; various modes that residents may choose from station i to station j are counted. In addition to the bus routes, driving, and walking designed in this plan, existing bus routes will also be optional options. Considering the sensitivity of residents to the number of bus transfers, only the bus routes that can directly reach station i from station j in the existing bus routes are added to the optional modes.
[0059] In real life, different passengers will choose different modes of transportation from their departure point to their destination. For example, there is a certain number of travelers between a residential area and an office building. However, even if there is a direct bus line between the residential area and the office building, a certain proportion of these travelers will consider time, cost and other factors and choose other modes of travel. If this difference in choice is not taken into account when designing bus routes, it will be difficult to accurately measure the number of people traveling through the designed bus routes in real life, which will result in the designed bus routes being unable to meet actual needs.
[0060] Calculate the probability of passengers choosing each mode based on the impedance function:
[0061] k is all available transportation modes,
[0062] That is, the probability of traveling on the pre-designed bus route is obtained Prob(i, j, pre-designed bus route);
[0063] Predict the total passenger flow total_od of the pre-designed bus route:
[0064] According to the O(i,j) point multiplication probability Prob(i,j, pre-designed bus route), the predicted number of travelers between station i and station j after the actual construction of the pre-designed bus route is obtained, and then the predicted number of travelers between each station is summed up to obtain the total passenger flow total_od.
[0065] Step 3: Design the ant colony algorithm model
[0066] The objective function f(W) of the line is defined as:
[0067] f(W) = fare P * total passenger flow total_od - unit time cost * total travel time total_time
[0068] The total travel time total_time is the total travel time total_time of the passenger flow (i.e. the total_od part of people) traveling through the designed bus line, obtained based on the predicted number of travelers between each station and the time consumption between each station in the time consumption matrix T.
[0069] Design an ant colony algorithm model: max{f(W)}, where W is a bus route design scheme
[0070] Initialize the ant colony algorithm model and iterate in sequence until the total number of iterations N is reached. Select the maximum objective function value max(f)n=1,2,…N of these N iterations, and the corresponding optimal path is the bus route to be designed. Each iteration generates the next iteration path based on the route path result generated by the previous iteration. Through this continuous iterative process, the result continues to tend towards the optimal path.
[0071] Preferably, the ant colony algorithm model is initialized, and the parameters of the ant colony algorithm model are initialized first, specifically: setting parameters: information matrix, heuristic function matrix, total number of ants K (each ant will find a path, passing through several stations, and the path of each ant represents a bus route plan), total number of algorithm iterations N, information heuristic factor α, expected heuristic factor β, pheromone volatilization speed ρ, genetic algorithm layer iteration number AN, genetic algorithm layer mutation probability AP; initialize the optimal path L to be solved to be empty, and the optimal objective function is MAX=0; initialize the information matrix, initialize each element of the information matrix to 1, that is, the initialized information on each path is 1, and the elements of the mth row and nth column of the information matrix represent the information on the path from the mth station to the nth station; wherein the elements of the mth row and nth column of the heuristic function matrix are equal to the inverse of the distance from the mth station to the nth station (that is, the inverse of the elements in the corresponding distance matrix D); after initialization, in subsequent iterations, the information matrix is iteratively updated in turn and the state transfer matrix S is calculated.
[0072] Furthermore, after initializing the parameters of the ant colony algorithm model, the ant colony algorithm layer is iterated, and the ant colony algorithm model is initialized by an improved path initialization method, specifically:
[0073] (1) According to the total number of stations SN in the area, K ants are randomly divided into three parts. In the first part, each ant generates a random number between 0 and SN / 3 as the total number of path stations; in the second part, each ant generates a random number between SN / 3 and SN*2 / 3 as the total number of path stations; in the third part, each ant generates a random number between SN*2 / 3 and SN as the total number of path stations; so that the initial path length is as diversified as possible when the algorithm is solved. In fact, in the traditional ant colony algorithm, it is assumed that each path passes through all stations, which is obviously not in line with the actual bus route design scenario. When designing bus routes, only some stations in the area will be selected as passing stations. In addition, the subsequent iterations of the ant colony algorithm will largely depend on the initialization results. If only a completely randomized method is used, there is a possibility that the ant paths are generally too long / too short in the initialization, which will make the paths of each ant too long / too short in each subsequent iteration. Therefore, the "optimal solution" generated after a limited number of iterations is only the "optimal solution" in the long / short bus routes, and is not the true global optimal solution of the model. In step (1), the path lengths are made as diverse as possible during initialization, so that there are long / medium / short bus route paths in the initialization scheme, which can make the result closer to the global optimal solution of the model.
[0074] (2) Divide the area into three sub-areas. For each part of ants in step (1), they are further divided into three sub-parts, representing three sub-areas. The initial stations of the ants in each sub-part are generated from the corresponding sub-areas respectively; thus, the diversity of the area is ensured during initialization. If the traditional completely randomized method is used, there is a situation where the initial stations are generally concentrated in a certain sub-area. At this time, the bus route paths of subsequent iterations will actually be more concentrated in this sub-area, and other stations cannot be found. Some stations with large passenger flow demand may be omitted. At this time, the optimal solution obtained after iteration is only the optimal bus route of this sub-area. This step (2) makes the initial stations dispersed in different areas as much as possible, so that the bus routes in subsequent iterations will pass through various sub-areas of the area as much as possible. In this way, the optimal solution generated after comparison is closer to the optimal solution of the entire area.
[0075] After the path is initialized, the subsequent iteration process of the ant colony algorithm is carried out to generate the path of each station of the bus route to be designed.
[0076] Specifically: According to the state transfer matrix S combined with the logit algorithm, the state transfer probability from site i to the next site j is calculated
[0077] j,k∈Unvisit set
[0078] After obtaining the state transition probability, the next site j of the path is generated through the roulette algorithm (the site with a greater probability is more likely to be selected as the next site), and site j is added to the Unvisit set, thereby generating the path of this ant in turn and calculating the objective function of this path.
[0079] Similarly, obtain the K route paths and corresponding objective functions produced by all K ants in the nth iteration, store the path route1 with the largest objective function among these K paths and its objective function object1, and iterate in sequence until the total number of iterations N is reached.
[0080] Preferably, generating each station path of the bus route to be designed also includes: setting a station set that each station will not pass through, that is, a dynamic Unvisit set, and each ant only considers stations outside the Unvisit set in the process of searching for stations to form a bus path. The dynamic Unvisit set includes stations that have been selected in the process of forming the bus path, and also includes stations whose distance to the selected station is less than the specified shortest station distance or greater than the maximum station distance.
[0081] The process of each ant generating a path is a process of continuously iterating and adding new sites. After the starting site is determined, the next site will be selected iteratively in turn. Considering that in actual bus routes, a route generally does not pass through the same site repeatedly, and there are minimum / maximum station distances between two adjacent sites, in the process of each ant looking for sites to form a bus path, the Unvisit collection is set to indicate that the passed sites will not be considered. Therefore, for each ant's process of iteratively adding new sites, the existing sites are added to the Unvisit collection of the ant's no longer visited sites; in addition, the remaining sites whose distance from the existing sites is less than the specified shortest station distance or greater than the maximum station distance are selected and added to the Unvisit collection. Therefore, when the ant continues to select the next site, it will directly exclude the sites in the Unvisit collection.
[0082] Preferably, in the subsequent iteration process, the information amount matrix is iteratively updated in sequence and the state transfer matrix S is calculated, specifically,
[0083] When n=1, the information matrix is the initialized information matrix; otherwise, the information matrix is updated according to the pheromone increment matrix, and the state transfer matrix S is obtained by performing matrix dot multiplication operation on the information matrix and the heuristic function matrix.
[0084] According to the objective function of each path, the pheromone increment matrix is obtained, that is, the pheromone increment of the adjacent sites on the path of the kth ant. For the path of the kth ant, the number of travelers between sites i and j can be predicted first, and the pheromone increment of the adjacent sites k1 and k2 in the path of the kth ant can be calculated as follows:
[0085]
[0086] In this improved pheromone increment calculation method, the pheromone increment of adjacent stations with more cross-sectional passenger flow on the path with a larger objective function is greater. In the traditional ant colony algorithm, only the objective function of the path is considered, and the pheromone increment of adjacent stations in the line with a higher path is higher and the increment is the same. The problem that will arise is that in a bus line, the passenger flow of some sections is extremely high, while the passenger flow of other sections is very low. When calculating the pheromone increment, the increment of each section is the same, and the difference cannot be reflected. This method measures the contribution degree of adjacent stations to the overall line passenger flow through the cross-sectional passenger flow of adjacent stations, so that the pheromone increment of the section with a larger cross-sectional passenger flow is greater.
[0087] Through the above calculation method, more information increments will be generated in the high-passenger-flow sections on the better path. The element in the m-th row and n-th column of the pheromone increment matrix is the sum of the information increments of all line paths passing through stations m and n, and stations m and n are adjacent stations. Adding the information amount matrix and the pheromone increment matrix gives the updated information amount matrix.
[0088] Furthermore, when the number of iterations reaches the total number of iterations N, for the last iteration, that is, the K paths generated in the N-th iteration, genetic algorithm layer operations are performed. Each operation in the genetic algorithm layer includes a selection operation and a mutation operation.
[0089] The selection operation is as follows: The selection probability of each path is obtained through the softmax function according to the objective function of each path, and new K preferred paths are selected from the K paths through the roulette wheel algorithm (the greater the objective function of the path, the greater the probability of being selected).
[0090] The mutation operation is as follows: The mutation operation is performed on each path after the selection operation in turn. For each path i, a random number ri between [0,1] is randomly generated. If this random number ri < the mutation probability AP, the mutation operation will be performed. Specifically, if the random number ri < AP / 3, the order of two randomly selected stations in the path is exchanged; if AP / 3 < random number ri < AP*2 / 3, a station randomly selected from the remaining stations not passed by the path is randomly inserted into one of the existing stations in the path. If AP*2 / 3 < random number ri < AP and the number of stations in the path itself >= 3, a station in the path is randomly selected and deleted.
[0091] Record the maximum objective function value AM and the corresponding path plan among the K paths generated by each genetic algorithm operation. If the maximum objective function value generated by the next genetic algorithm iteration is larger than the existing AM value, update the AM value and the corresponding path plan. After AN genetic algorithm iterations, select the maximum objective function value object2 at the genetic algorithm layer and the corresponding optimal path plan route2.
[0092] Compare object1 and object2, take the larger value and the corresponding route1 / route2 as the optimal path MAX_n and the optimal objective function L_n of the nth time of this technical algorithm.
[0093] In a second aspect, the embodiment of the present disclosure provides a bus route design device based on big data. Based on the same technical concept, the device includes an acquisition module, a processing module, and a calculation module.
[0094] The acquisition module is used to execute step 1 of a bus route design method based on big data in any one of all possible implementation methods.
[0095] The processing module is used to execute step 2 of a bus route design method based on big data in any one of all possible implementation methods.
[0096] The calculation module is used to execute step 3 of a bus route design method based on big data in any one of all possible implementation methods.
[0097] It should be noted that the bus route design device based on big data provided in the above embodiment only uses the division of the above functional modules as an example when executing a bus route design method based on big data. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the bus route design device based on big data provided in the above embodiment and the bus route design method based on big data are of the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0098] In a third aspect, an embodiment of the present disclosure provides a terminal device, which includes a bus route design device based on big data as described in any one of all possible implementation methods.
[0099] The above is an exemplary description of the present invention. Obviously, the specific implementation of the present invention is not limited to the above-mentioned method. All non-substantial improvements made by adopting the method concept and technical solution of the present invention; or directly applying the above-mentioned concept and technical solution of the present invention to other occasions without improvement or equivalent replacement, are within the protection scope of the present invention.
Claims
1. A bus route design method based on big data, It is characterized in that The method comprises the following steps: Step 1: Get basic data Collect the existing bus stops in the area and mark them with serial numbers. The total number of stops is recorded as SN. Obtain the time, mileage, and cost-based data required to travel between two stops by bus, walking, or driving. Step 2: Process the basic data Based on the basic data, we obtain the distance matrix D between each station and the time matrix T between each station using different transportation modes, obtain the number of people who need to travel by public transportation between each station, and form the average daily number of people who need to travel between each station O. The mth row and nth column elements of the matrices D, T, and O represent the distance, time, and number of people who need to travel from the mth station to the nth station, respectively. Select a pre-designed bus route W(i 1 ,i 2 ,i 3 ,……i n ): that is, randomly select several sites in the area to form an ordered site sequence to form an ordered path, where i 1 ,i 2 ,i 3 ,……i n For a pre-designed bus route arrangement, the number of passengers required to travel between two stations in the route can be obtained according to the travel demand matrix O: the number of passengers required to travel between station i and station j in the bus route is recorded as O(i,j), Define the impedance function v(i,j,vehicle): v(i,j,vehicle) = travel cost of vehicle + corresponding time cost v(i,j,vehicle) represents the travel impedance from station i to station j when the vehicle is chosen as the transportation mode; Calculate the probability of passengers choosing each mode based on the impedance function: k is all available transportation modes, That is, the probability Prob of traveling on the pre-designed bus route is obtained; Predict the total passenger flow total_od of the pre-designed bus route: According to the O(i,j) point multiplication probability Prob, the predicted number of travelers between station i and station j after the actual construction of the pre-designed bus route is obtained, and then the predicted number of travelers between two stations is summed to obtain the total passenger flow total_od; Step 3: Design the ant colony algorithm model The objective function f(W) of the line is defined as: f(W) = fare P * total passenger flow total_od - unit time cost * total travel time total_time The total travel time total_time is the total travel time total_time of the passenger flow traveling through the designed bus route, obtained based on the predicted number of travelers between two stations and the time consumption between two stations in the time consumption matrix T; Design ant colony algorithm model: max{f(W)}, W is a bus route design scheme The ant colony algorithm model is initialized and iterated in sequence until the total number of iterations N is reached. The maximum objective function value max(f)n=1,2,…N of these N iterations is selected, and the corresponding optimal path is the bus route to be designed.
2. According to the bus route design method based on big data as described in claim 1, It is characterized in that Step 3 initializes the ant colony algorithm model. First, the parameters of the ant colony algorithm model are initialized, specifically: set parameters: information matrix, heuristic function matrix, total number of ants K, each ant will find a path, passing through several stations, each ant's path represents a bus route plan, total number of algorithm iterations N, information heuristic factor α, expected heuristic factor β, pheromone volatilization speed ρ, genetic algorithm layer iteration number AN, genetic algorithm layer mutation probability AP; initialize the optimal path L to be solved to be empty, and the optimal objective function is MAX=0; initialize the information matrix, initialize each element of the information matrix to 1, that is, the initialization information on each path is 1, and the elements in the mth row and nth column of the information matrix represent the information on the path from the mth station to the nth station; The elements of the mth row and nth column of the heuristic function matrix are equal to the inverse of the distance from the mth site to the nth site. After initialization, the information matrix is iteratively updated in the subsequent iteration process and the state transfer matrix S is calculated.
3. According to the bus route design method based on big data as described in claim 2, It is characterized in that After initializing the parameters of the ant colony algorithm model, the ant colony algorithm layer is iterated, and the ant colony algorithm model is initialized by the improved path initialization method, specifically: (1) According to the total number of sites SN in the area, K ants are randomly divided into three equal parts. In the first part, each ant generates a random number between 0 and SN / 3 as the total number of sites on the path; in the second part, each ant generates a random number between SN / 3 and SN*2 / 3 as the total number of sites on the path; in the third part, each ant generates a random number between SN*2 / 3 and SN as the total number of sites on the path; (2) Divide the area into three sub-areas. For each part of ants in step (1), divide it into three sub-parts, representing the three sub-areas. The initial sites of the ants in each sub-part are generated from the corresponding sub-areas.
4. A bus route design method based on big data according to any one of claims 1 to 3, It is characterized in that After initializing the ant colony algorithm model, the subsequent iteration process of the ant colony algorithm is carried out, that is, each station path of the bus line to be designed is generated. Specifically, the state transition probability from station i to the next station j is calculated based on the state transition matrix S combined with the logit algorithm. After obtaining the state transition probability, the next site j of the path is generated through the roulette algorithm, thereby generating the path of this ant in turn and calculating the objective function of this path; Similarly, obtain the K route paths and corresponding objective functions produced by all K ants in the nth iteration, store the path route1 with the largest objective function among these K paths and its objective function object1, and iterate in sequence until the total number of iterations N is reached.
5. According to the bus route design method based on big data as described in claim 4, It is characterized in that When generating the path of each stop for the bus line to be designed, it also includes: setting a set of stops that each stop will not pass through, that is, the dynamic Unvisit set. During the process of each ant finding stops to form a bus path, only the stops outside the Unvisit set are considered. The dynamic Unvisit set includes the stops that have been selected during the process of forming the bus path, and also includes the stops whose distance from the selected stops is less than the specified minimum stop distance or greater than the maximum stop distance.
6. A bus line design method based on big data according to claim 2, characterized in that in the subsequent iterative process, the information matrix is iteratively updated in sequence and the state transition matrix S is calculated. Specifically, when n = 1, the information matrix is the initialized information matrix; otherwise, the information matrix is updated according to the pheromone increment matrix, and the information matrix and the heuristic function matrix are subjected to matrix dot multiplication operation to obtain the state transition matrix S; The pheromone increment matrix is obtained according to the objective function of each path, that is, the pheromone increment of adjacent stops on the path of the k-th ant. For the path of the k-th ant, first, the predicted number of passengers between stop i and stop j can be calculated, and the pheromone increment of adjacent stops k1 and k2 in the path of the k-th ant can be obtained as: Then the element in the m-th row and n-th column of the pheromone increment matrix is the sum of the information increments of all line paths passing through stops m and n, and stops m and n are adjacent stops. Adding the pheromone increment matrix to the information matrix gives the updated information matrix.
7. A bus line design method based on big data according to any one of claims 1-3 or 5-6, characterized in that when the number of iterations reaches the total number of iterations N, for the last iteration, that is, the K paths generated in the N-th iteration, genetic algorithm layer operations are performed. Each operation of the genetic algorithm layer includes a selection operation and a mutation operation; The selection operation is: obtaining the selection probability of each path through the softmax function according to the objective function of each path, and selecting new K preferred paths from the K paths through the roulette wheel algorithm; The mutation operation is: performing mutation operations on each path after the selection operation in sequence. For each path i, a random number ri between [0,1] is randomly generated. If this random number ri < mutation probability AP, a mutation operation will be performed: if the random number ri < AP / 3, the order of two randomly selected stops in the path will be exchanged; if AP / 3 < random number ri < AP*2 / 3, a stop randomly selected from the remaining stops not passed by the path will be randomly inserted into one of the existing stops in the path; if AP*2 / 3 < random number ri < AP, if the number of stops in the path itself >= 3, a stop in the path will be randomly selected and deleted; Record the maximum value AM of the objective function and the corresponding path plan among the K paths generated by each genetic algorithm operation. If the maximum value of the objective function generated by the next genetic algorithm iteration is greater than the existing AM value, update the AM value and the corresponding path plan. After AN genetic algorithm iterations, select the maximum objective function value object2 at the genetic algorithm layer and the corresponding optimal path plan route2. Compare object1 and object2, take the larger value and the corresponding route1 / route2 as the optimal path MAX_n and the optimal objective function L_n of the nth time of this technical algorithm.
8. A bus route design method based on big data according to claim 2, It is characterized in that The corresponding time cost in step 2 = the time required for traveling by vehicle transportation mode * unit time cost, and the transportation modes include: pre-designed bus routes, driving, walking, and existing direct bus routes.
9. A bus route design device based on big data, It is characterized in that The device includes an acquisition module, a processing module, and a calculation module. The acquisition module is used to execute step 1 of the bus route design method based on big data according to any one of claims 1 to 8; The processing module is used to execute step 2 of the bus route design method based on big data according to any one of claims 1 to 8; The calculation module is used to execute step 3 of the bus route design method based on big data described in any one of claims 1-8.
10. A terminal device, It is characterized in that The terminal device includes a bus route design device based on big data as described in claim 9.
Citation Information
Patent Citations
GIS-based bus route planning method
CN108647221A
Medium and small city bus line network design method based on whole-process travel perception time
CN109753694A
Bus adaptive scheduling method based on station optimization and ant tracing
CN110084402A
Optimization method for vehicle path planning of assembly type construction site
CN111079983A
Moving route optimizing method for marker
JP2012066350A
