Route generation method, apparatus and electronic equipment
By using elliptic filtering and aggregation differentiation techniques in bus route planning, the problem of unreasonable bus route planning was solved, and more accurate and efficient bus route generation was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies are flawed in bus route planning, leading to discrepancies between planning results and actual conditions.
By obtaining the target OD data set based on the target start and end points, and using ellipse filtering and centroid distance thresholds and centrifugal distance thresholds for aggregation and differentiation, bus routes are generated.
This improves the accuracy and efficiency of bus route planning, ensuring it meets actual passenger flow needs and avoids resource waste and unreasonable station allocation.
Smart Images

Figure CN116067388B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to a route generation method, apparatus, and electronic device in technologies such as autonomous driving and intelligent transportation. Background Technology
[0002] In related technologies, the common method for planning bus routes is to generate routes manually or semi-automatically based on factors considered in the route planning process, such as bus distance, bus running time, and bus passenger capacity. However, this method of generating bus routes often fails to reflect the actual situation of buses, resulting in unreasonable bus route planning. Summary of the Invention
[0003] This disclosure provides a route generation method, apparatus, electronic device, a non-transitory computer-readable storage medium storing computer instructions, and a computer program product.
[0004] According to one aspect of this disclosure, a route generation method is provided, comprising: obtaining a target start-end data set based on a target start point and a target end point, wherein the target start-end data set includes multiple target start-end data; obtaining a point set corresponding to the multiple target start-end data, wherein the points included in the point set are the start points and end points corresponding to the multiple target start-end data; aggregating and differentiating the points in the point set based on a centroid distance threshold and an eccentric distance threshold to obtain multiple target sets; and generating a target bus route from the target start point to the target end point based on the multiple target sets.
[0005] According to another aspect of this disclosure, a route generation apparatus is provided, comprising: a first acquisition module, configured to acquire a target start-end data set based on a target start point and a target end point, wherein the target start-end data set includes multiple target start-end data; a second acquisition module, configured to acquire a point set corresponding to the multiple target start-end data, wherein the points included in the point set are the start points and end points corresponding to the multiple target start-end data; a processing module, configured to aggregate and differentiate the points in the point set based on a centroid distance threshold and an eccentric distance threshold to obtain multiple target sets; and a generation module, configured to generate a target bus route from the target start point to the target end point based on the multiple target sets.
[0006] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described in any of the preceding claims.
[0007] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are configured to cause the computer to perform the method according to any one of the preceding claims.
[0008] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method according to any of the preceding claims.
[0009] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0010] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0011] Figure 1 This is a flowchart of a route generation method provided according to an embodiment of the present disclosure;
[0012] Figure 2 This is a schematic diagram of a bus route planning simulation method provided according to an embodiment of the present disclosure;
[0013] Figure 3 This is a schematic diagram of an elliptical filter box provided according to an embodiment of the present disclosure;
[0014] Figure 4 This is a structural block diagram of a route generation device provided according to an embodiment of the present disclosure;
[0015] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation
[0016] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0017] First, some nouns or terms that appear in the description of the embodiments of this disclosure shall be interpreted as follows:
[0018] OD data, or origin-destination data, is a pair of points. "O" stands for ORIGIN, indicating the origin of the trip, and "D" stands for DESTINATION, indicating the destination. In this embodiment, the OD data can refer to points formed by any mode of transportation. For example, it can be a pair of points consisting of a bus boarding point and a bus alighting point, a taxi boarding point and a taxi alighting point, a subway boarding point and a subway alighting point, or any other pair of points forming the origin and destination of a trip.
[0019] A bus route is the path a bus travels from one origin to one destination, and this route includes multiple stops, the planning of which must comply with certain planning requirements.
[0020] According to embodiments of this disclosure, this disclosure provides a route generation method. Figure 1 This is a flowchart of a route generation method provided according to an embodiment of this disclosure, such as... Figure 1 As shown, the process includes the following steps:
[0021] Step S102: Based on the target start point and target end point, obtain the target OD data set, wherein the target OD data set includes multiple target OD data;
[0022] As an optional embodiment, the method disclosed herein can be applied to any scenario requiring bus route planning, such as on a terminal or server. For example, when applied to a terminal used for bus route planning, the terminal may have bus route planning software installed, enabling bus route planning. When applied to a terminal, it can easily and simply handle timely planning needs. Alternatively, when applied to a server for bus route planning, the server may have a bus route planning platform deployed, which calls various data (such as detailed map data) to achieve bus route planning. Therefore, when applied to a server, the data called can be more comprehensive and accurate, thus enabling comprehensive and accurate implementation of detailed bus planning needs.
[0023] It should be noted that the types of terminals mentioned above can be various, such as mobile terminals or fixed computer devices. Mobile terminals can include mobile phones, iPads, laptops, etc. Similarly, the types of servers mentioned above can also be various, such as local servers or virtual cloud servers. Servers, based on computing power, can be single computer devices or computer clusters integrating multiple computer devices.
[0024] As an optional embodiment, the aforementioned target start point and target end point can be the start and end points of the planned bus route. For example, the target start point and target end point can be existing bus stops or planned bus stops that have not yet appeared. The selection of the target start point and target end point is related to the needs of the bus route to be generated, and this disclosure does not limit this selection.
[0025] As an optional implementation, when obtaining the target origin-destination OD data set based on the target origin and destination, it can be directly obtained from available resource data, such as travel data available in a map. For example, travel data that can be collected from map software can be directly used as the target OD data set, which includes multiple target OD data. Each target OD data includes one origin and one destination, and can also be considered as an OD pair.
[0026] As an optional implementation, to make the subsequently planned bus routes more accurate and efficient, data with high relevance to the target origin and destination can be filtered from the large amount of travel data in the map software, while some data with no impact can be directly deleted. For example, to obtain the target origin-destination OD data set based on the target origin and destination, the following method can be used: obtain an initial OD data set, which includes multiple initial OD data; based on the target origin and destination, filter multiple target OD data from the multiple initial OD data to obtain the target OD data set. When filtering multiple target OD data from multiple initial OD data based on the target origin and destination, different processing procedures can be used depending on the filtering conditions and methods. Using the above filtering method can avoid processing a large amount of meaningless travel data, making the aggregated and differentiated target OD data more targeted, and effectively improving the efficiency of generating bus routes.
[0027] As an optional implementation, when selecting multiple target OD data from multiple initial OD data based on target origin and destination, different selection methods will have a certain impact on the rationality and efficiency of the selection results. From the essential needs of bus route planning, from the perspective of buses, it is necessary to minimize operating costs; from the perspective of passengers, it is ideal to minimize detours to reach the destination. Considering these multiple needs, using an ellipse to define the range when specifying bus routes can more reasonably meet these requirements. For example, when passengers choose a detour, the generally acceptable detour distance is the range covered by the ellipse. Therefore, using an ellipse for selection better meets the needs of bus route selection.
[0028] Therefore, as an alternative approach, an ellipse-based method is provided to filter target data that meets the above requirements from a large amount of initial data. For example, to obtain a target OD data set by filtering multiple initial OD data based on the target start and end points, the following processing method can be used: construct a target ellipse with the target start and end points as foci and the ellipse parameters used to determine the coverage area; based on the target ellipse, filter multiple target OD data from multiple initial OD data to obtain the target OD data set. It should be noted that the ellipse parameters used to determine the coverage area can simply be the eccentricity of the ellipse, with a value between 0 and 1.
[0029] As an optional implementation, after constructing the target ellipse, data filtering based on this ellipse can intuitively and quickly identify the data that meets the requirements. For example, based on a predetermined coordinate system (which can be a two-dimensional plane coordinate system), the position coordinates of the target's starting point and the position coordinates of the target's ending point are marked in this predetermined coordinate system, and the range covered by the target ellipse in this coordinate system is determined with the target's starting point and ending point as foci and a predetermined eccentricity. It should be noted that this can be set according to the user's needs. For example, when the user needs more data for planning bus routes, and wants the planned bus routes to be more accurate, the eccentricity can be set larger, making the target range drawn by the ellipse larger; otherwise, the opposite operation can be performed.
[0030] Furthermore, after determining the coverage area of the target ellipse, it is necessary to determine whether multiple initial OD data points fall within this coverage area. For example, this determination can be made based on the position coordinates of each initial OD data point. Since each initial OD data point represents a pair of point coordinates, the determination can be based on the point pairs included in the initial OD data. For instance, if the position coordinates of both points included in the initial OD data point are within the coverage area of the ellipse, then the initial OD data is determined to be within the coverage area of the ellipse and belongs to the target OD data. If one of the two points included in the initial OD data point is within the coverage area of the ellipse and the other is outside the coverage area, then the initial OD data is determined to be outside the coverage area of the ellipse and does not belong to the target OD data. If the position coordinates of both points included in the initial OD data point are outside the coverage area of the ellipse, then the initial OD data can be considered to be outside the coverage area of the ellipse. It should be noted that the determination of whether both position coordinates of the initial OD data point are simultaneously within or outside the coverage area of the ellipse is relatively clear at this stage. When two points in the initial OD data are located, one within the ellipse's coverage area and the other outside, they are directly determined to be outside the ellipse's coverage area in the above judgment process. However, depending on the specific situation, the judgment result can be modified, meaning that they can be considered to be within the ellipse's coverage area to a certain extent. For example, when the position coordinates of two points in the initial OD data are one within the ellipse's coverage area and the other outside, the centroid of these two points can be determined. If the centroid is within the ellipse's coverage area, the initial OD data is considered to be within the ellipse's coverage area. If the centroid is on the edge of the ellipse or outside the ellipse's coverage area, the initial OD data is considered to be outside the ellipse's coverage area and does not belong to the target OD data.
[0031] Step S104: Obtain the point set corresponding to multiple target OD data, wherein the points included in the point set are the start and end points corresponding to multiple target OD data;
[0032] As an optional embodiment, after obtaining the target OD dataset, since the multiple target OD data included in the dataset may overlap or partially overlap, some target OD data can be aggregated to simplify repetitive calculations during subsequent path planning. Aggregation is performed based on certain aggregation conditions; for example, aggregation must satisfy the degree of overlap between the data. The degree of overlap can be represented in various ways; in this embodiment, for example, the centroid distance is used for aggregation.
[0033] As an optional embodiment, in this embodiment of the disclosure, the aggregation is not performed on OD pairs, but rather by separating the O points (starting point) and D points (ending point) included in the OD data, and performing the aggregation operation based on the set formed by the separated points.
[0034] It should be noted that during the process of splitting the selected target OD data pairs into multiple O-point and D-point data, the weight of the target OD data may be greater than 1. During the splitting process, O and D data with weights greater than 1 are randomly distributed using a Gaussian distribution, following the pattern x ~ N((lng,lat),1). When splitting the target OD data with weights greater than 1, multiple identical O or D data are randomly distributed using a Gaussian distribution to form multiple actual datasets.
[0035] When applying Gaussian randomization to O and D data with weights greater than 1, the following method can be used: A circular region is formed with the coordinates of the unsplit O and D data as the center and a predetermined distance as the radius. Multiple data sets obtained from the splitting are then randomly distributed within this circular region. Applying Gaussian randomization to O and D data with weights greater than 1 introduces slight fluctuations to the multiple identical data sets obtained from the splitting. Compared to directly aggregating an identical data set, which results in a smaller weight for that identical data set (i.e., smaller corresponding stations but larger passenger flow), this increases the robustness of the route generation method and makes the subsequently generated target bus routes more stable.
[0036] Aggregation using the point set obtained after splitting is more refined and better reflects the characteristics of traffic flow compared to aggregation using OD data pairs. Therefore, the planning results obtained from subsequent bus route planning based on this are more accurate.
[0037] Step S106: Based on the centroid distance threshold and the centrifugal distance threshold, the points in the point set are aggregated and differentiated to obtain multiple target sets;
[0038] As an optional implementation, when aggregating and differentiating points in a point set based on a centroid distance threshold and an eccentric distance threshold to obtain multiple target sets, the centroid distance threshold is used to perform the aggregation operation, while the eccentric distance threshold is used to determine whether to perform a differentiation operation on the aggregated points, i.e., cancel the aggregation operation. Aggregation based on centroid distance and differentiation based on eccentric distance are more consistent with biological characteristics and therefore better meet the requirements of rational planning for bus route stops.
[0039] For example, when performing aggregation and differentiation operations, the following approach can be used: Based on the centroid distance threshold, aggregate the points in the point set to obtain an aggregate set; based on the centrifugal distance threshold, determine whether to differentiate the points in the aggregate set that are targeted by the aggregation operation; if the determination result is that the points in the aggregate set targeted by the aggregation operation should not be differentiated, continue to perform aggregation operations based on the centroid distance threshold until the points corresponding to the aggregation operation are differentiated based on the centrifugal distance threshold, resulting in multiple target sets. Based on the above centroid distance threshold and centrifugal distance threshold, continue to perform aggregation and differentiation operations on the points in the point set until the aggregation no longer meets the centrifugal distance threshold requirement, resulting in the final multiple target sets.
[0040] As an optional embodiment, when performing aggregation operations on points in a point set, the number of aggregated points in the aggregation set will increase. Therefore, when there are multiple points in the aggregation set, the distance between the aggregation set and other points that need to be aggregated can be determined based on the centroid of the points included in the aggregation set. For example, during the process of continuing aggregation operations based on the centroid distance threshold, when the number of aggregated points in the aggregation set is multiple, the distance between the aggregation set and other unaggregated points in the point set is determined based on the aggregation centroid of the multiple points included in the aggregation set. After aggregation, the aggregation set, in subsequent aggregation processes, can make the aggregation and differentiation operations more accurate by using the centroid of the aggregation set as a benchmark.
[0041] It should be noted that when aggregating points in a point set, a certain aggregation order can be followed, which can be determined based on the characteristics of the data. For example, when most of the O or D data (i.e., the points included in the aforementioned point set) in the acquired target OD data are concentrated within a certain range, points within that range can be aggregated first; when the points included in the point set do not possess the aforementioned characteristics, they can be aggregated directly in an equal manner.
[0042] When aggregating points in a point set using an equal approach—that is, based on a centroid distance threshold—the aggregation operation is performed on the points in the set to obtain an aggregate set. Initially, aggregation can be performed using the two points closest to each other in the set. Subsequently, each aggregation is performed using the two points with the shortest distance. Aggregating based on the shortest distance each time ensures more accurate aggregation and differentiation operations, reducing the likelihood of data omission.
[0043] For example, when performing an aggregation operation, the distance between any two points in the point set can be obtained; the two points with the shortest distance can be selected, and it can be determined whether the shortest distance is less than the centroid distance threshold; if the result is that the shortest distance is less than the centroid distance threshold, the two points with the shortest distance can be merged to obtain the aggregate set.
[0044] Subsequently, when determining whether to differentiate the points in the aggregation set that are targeted by the aggregation operation based on the centrifugal distance threshold, the aggregation centroid of the aggregation set can be determined first, and the centrifugal distance of the aggregation set can be determined based on the aggregation centroid. It is then determined whether the centrifugal distance is greater than the centrifugal distance threshold. If the result is that the centrifugal distance is not greater than the centrifugal distance threshold, it is determined that the points in the aggregation set targeted by the aggregation operation will not be differentiated, that is, the aggregation set obtained after this aggregation operation is retained, and this aggregation operation is not canceled. Then, the aggregation set is treated as a single point, and aggregation and differentiation with other unaggregated points continues until the centrifugal distance of the final aggregation set is greater than the centrifugal distance threshold, resulting in multiple target sets.
[0045] The above aggregation and differentiation operation process is illustrated in this disclosure. When the target OD dataset includes 10 target OD data points, these 10 target OD data points can be split into a point set consisting of 20 O points and D points. Each point in this point set has corresponding position coordinates. Taking the aggregation of points in the point set in an equal manner as an example, firstly, the distance between every two points in the point set is determined, and the two points with the shortest distance are identified. This shortest distance is the centroid distance between these two points. The centroid distance is compared to whether it is less than the centroid distance threshold. If the comparison result is that the obtained centroid distance is less than the centroid distance threshold, the two points are aggregated to obtain an aggregate set containing the two points. Then, the centroid of this aggregate set is calculated. For example, the center of the two points can be simply determined as the centroid. Based on the centroid, the distance between the centroid and the two points is determined. Based on the obtained distance between the centroid and the two points, the eccentric distance of the aggregate set is obtained (the method of obtaining the eccentric distance is described in detail below). The eccentric distance is compared with the eccentric distance threshold. If the comparison result is that the eccentric distance is greater than the eccentric distance threshold, the aggregation of the two points is canceled, and the aggregation and differentiation operation ends. When the centrifugal distance is less than the centrifugal distance threshold, it indicates that the aggregation is reasonable. That is, the aggregation set consisting of these two points is treated as a single point and the above-mentioned aggregation and differentiation operation is continued with other points until the centrifugal distance corresponding to the aggregation and differentiation operation is greater than the above-mentioned centrifugal distance threshold.
[0046] In the example of the 20 O and D points mentioned above, the concept of OD data no longer applies; each point is independent. After obtaining the distance between any two points, if the distance between the first and second points is the smallest and this minimum distance is less than the centroid distance threshold, the first and second points are merged to obtain an aggregate set including the first and second points. Next, the centroid of the first and second points is calculated, and the distances between the first and second points and the centroid are obtained. If there are only two points, the centroid can be simply considered to be the center of these two points; if there are more points, the calculation needs to be performed using the coordinates of each point. Based on the distances between the first and second points and the centroid, the eccentricity of this aggregate set is determined. If the eccentricity is greater than the eccentricity threshold, the aggregation of these two points is canceled; if the eccentricity is less than the threshold, subsequent aggregation operations continue.
[0047] It should be noted that when calculating the centroid of the first and second points, besides using the simple centering method described above, different weights can be assigned to the first and second points based on their characteristics. For example, if there are multiple OD data points obtained from the first point (e.g., n identical OD data points), then the weight of the first point can be n times. Therefore, when calculating the centroid of the first and second points, each point can be assigned a corresponding weight, and the aggregation centroid of the entire aggregation set can be determined based on these weights. Using weights to determine the aggregation centroid of the aggregation set more reasonably reflects the actual situation of travel data, making the aggregation and differentiation operations of points in the point set more reasonable.
[0048] As an optional embodiment, various methods can be used to determine the centrifugal distance of an aggregate set based on its centroid. For example, the distances between the points included in the aggregate set and the centroid can be obtained first, and then the obtained distances can be sorted to obtain a sorting result. The distance corresponding to a predetermined sorting position in the sorting result is then determined as the centrifugal distance. Through the above processing, a relatively accurate method for determining the centrifugal distance is provided. Moreover, since the sorting position can be flexibly selected by the user based on their own needs, it provides the user with a certain degree of flexibility.
[0049] Specifically, when determining the distance corresponding to a predetermined sorting position in the sorting results as the centrifugal distance, this can be achieved when the sorting is in ascending order and the predetermined sorting position is a predetermined percentage position within the sorting sequence. The predetermined percentage position can be flexibly set based on user needs; for example, it can be set between 30% and 80%. Furthermore, determining the position based on a percentage is simpler and more direct, improving the operability of the solution.
[0050] Step S108: Based on multiple target sets, generate target bus routes from the target origin to the target destination.
[0051] As an optional implementation, when generating a target bus route from the target origin to the target destination based on multiple target sets, the target centroids of the multiple target sets can be obtained first. Then, the target bus route from the target origin to the target destination can be generated based on the target centroids of the multiple target sets. Generating the target bus route based on the target centroids, rather than based on points in a specific point set (i.e., actual stops), allows the planned points in the bus route to better meet the actual passenger flow needs.
[0052] As an optional implementation, when generating a target bus route from the target origin to the target destination based on the target centroids of multiple target sets, multiple candidate bus routes from the target origin to the target destination can be generated first based on the target centroids of multiple target sets; indicator parameters for selecting the bus route can be determined; then, based on the indicator parameters, the target bus route can be selected from the multiple candidate bus routes. It should be noted that the aforementioned indicator parameters for selecting the bus route can be various, such as route distance, route travel time, coverage area, average passenger flow, number of stops, etc. The selected indicator parameters can be one or a combination of multiple parameters. Selecting the target bus route from multiple candidate bus routes based on the user's specific needs indicators, that is, selecting the target bus route that matches the user's attention, realizes the user's personalized needs, can meet different public transportation planning requirements, and satisfy the user's personalized experience.
[0053] Through the above embodiments, firstly, the initial OD data is filtered using ellipses to select target OD data that meets travel needs; secondly, the O and D points included in the target OD data are aggregated and differentiated. During the aggregation and differentiation process, biological aggregation and differentiation characteristics are used (for example, determining whether to aggregate by using a centroid distance threshold and whether to differentiate by using an eccentric distance threshold) to obtain a set of aggregated and differentiated results. Since this set of results is more consistent with the biological characteristics corresponding to bus routes, the bus routes generated based on this set of results are more reasonable, effectively solving the problem of unreasonable bus route planning in related technologies.
[0054] Based on the above-disclosed embodiments and optional embodiments, an optional implementation method is provided.
[0055] This optional implementation effectively avoids the situation in related technologies where the planning of bus routes is too subjective and lacks objectivity, making it impossible to accurately predict the actual situation. The optional implementation is described below.
[0056] Figure 2This is a schematic diagram of a bus route planning simulation method provided according to an embodiment of this disclosure, such as... Figure 2 As shown, the method includes the following processing:
[0057] 1. Input parameters for route planning:
[0058] 1) The starting and ending points of the planned route (corresponding to the target locations and target endpoints mentioned above);
[0059] 2) Actual passenger OD data (corresponding to the initial OD data mentioned above, which includes multiple initial OD data);
[0060] 3) The eccentricity e of the ellipse (0-1);
[0061] 4) OD polymerization centrifugation rate (0-1);
[0062] 5) OD polymerization centroid distance threshold D1, centrifugal distance D2;
[0063] 6) Station-to-station distance: (d1, d2), where d1 is the lower limit of the distance and d2 is the upper limit of the distance.
[0064] 2. Ellipse data filtering
[0065] 1) Based on the start and end points and e (the closer e is to 0, the larger the ellipse), construct OD data and filter the ellipse. Figure 3 This is a schematic diagram of an elliptical filter box provided according to an embodiment of this disclosure, as shown below. Figure 3 As shown, the ellipse has the target start point and target end point as its foci, and the eccentricity is obtained from user input.
[0066] 2) Input all initial OD data;
[0067] 3) Output the target OD data that meets the conditions: P(lng, lat, n), where lng is longitude, lat is latitude, and n is weight.
[0068] 3. OD data aggregation and differentiation
[0069] 0) Split the selected OD data. For example, split each OD data into O data (e.g., corresponding to a point set) and D data (corresponding to another point set). For O and D data with a weight greater than 1, perform a Gaussian distribution randomization, and the process follows x~N((lng,lat),1).
[0070] Specifically, for data with weights greater than 1 in O and D, a Gaussian distribution is used for randomization to form multiple actual datasets. For example, for OD data (O(x1,y1,w1),D(x2,y2,w2)), Gaussian randomization is applied to O(x1,y1) to generate w1 coordinate data points; Gaussian randomization is applied to D(x2,y2) to generate w2 coordinate data points.
[0071] 1) Calculate the centroid of each O and D data point. ;
[0072] 2) Calculate the centroid distance (D) between each OD data point and its nearest OD data point: D (the actual distance between centroids, in meters);
[0073] 3) For those with a centroid distance of D<=D1, proceed to step 4); for those with a centroid distance of D>D1, proceed to step 5).
[0074] 4) Merge two OD data sets, calculate the centroid and eccentricity L (calculate the centroid of the current OD, calculate the distance between each element and the centroid, sort in ascending order, and take the distance at the corresponding percentage position based on the OD aggregation eccentricity); if L is greater than D2, cancel the merge and proceed to step 5); otherwise, proceed to step 1).
[0075] 5) Place it into the aggregated OD set (corresponding to the multiple target sets mentioned above).
[0076] 4. Calculate the route
[0077] 1) Calculate all possible route combinations based on the final OD set (corresponding to the multiple candidate bus routes mentioned above);
[0078] 2) Calculate relevant metrics for all routes: route distance, route time, coverage area (area of a circle formed by the largest line segment connecting the station and the OD centroid with the radius), average passenger flow (calculated from OD data), number of stations, etc.
[0079] 5. Output route based on relevant indicators
[0080] Based on the above indicators and the filtering rules given by the simulation, the top(n) of the corresponding routes are output.
[0081] In the above optional implementation, the ellipse filtering algorithm can accommodate route detours. The OD aggregation-related index algorithm set can effectively meet actual passenger needs. Based on the above processing, multiple routes and simulation parameters for each route can be dynamically and intelligently generated, achieving automated generation and analysis, improving route planning efficiency, and providing simulated route operation status.
[0082] Through the above optional implementation methods, elliptical filtering of data and threshold-based aggregation and differentiation are used to calculate the layout of route stops. This enables more rational planning of bus routes, for example, avoiding resource waste caused by insufficient passenger flow at bus stops, avoiding insufficient passenger coverage caused by too small a passenger range, and avoiding unreasonable stop allocation that results in excessive travel distances and times for passengers.
[0083] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0084] According to embodiments of this disclosure, this disclosure also provides a route generation apparatus. Figure 4 This is a structural block diagram of a route generation device provided according to an embodiment of the present disclosure, such as... Figure 4 As shown, the device includes: a first acquisition module 42, a second acquisition module 44, a processing module 46, and a generation module 48. The device will be described below.
[0085] The first acquisition module 42 is used to acquire a target OD data set based on the target start point and the target end point, wherein the target OD data set includes multiple target OD data; the second acquisition module 44 is connected to the first acquisition module 42 and is used to acquire a point set corresponding to the multiple target OD data, wherein the points included in the point set are the start points and end points corresponding to the multiple target OD data; the processing module 46 is connected to the second acquisition module 44 and is used to aggregate and differentiate the points in the point set based on the centroid distance threshold and the centrifugal distance threshold to obtain multiple target sets; the generation module 48 is connected to the processing module 46 and is used to generate a target bus route from the target start point to the target end point based on the multiple target sets.
[0086] As an optional embodiment, the first acquisition module 42 includes a first acquisition unit and a first filtering unit. The first acquisition unit is used to acquire an initial OD data set, wherein the initial OD data set includes multiple initial OD data. The first filtering unit is used to filter multiple target OD data from the multiple initial OD data based on the target start point and the target end point to obtain a target OD data set.
[0087] As an optional embodiment, the first filtering unit is further configured to construct a target ellipse with the target starting point and target ending point as the focus and ellipse parameters for determining the coverage area; and to filter out multiple target OD data from multiple initial OD data based on the target ellipse to obtain a target OD data set.
[0088] As an optional embodiment, the above processing module includes: an aggregation unit, a differentiation unit, and a processing unit, wherein the aggregation unit is used to perform aggregation operations on points in a point set based on a centroid distance threshold to obtain an aggregation set; the differentiation unit is used to determine whether to differentiate the points in the aggregation set that are subject to aggregation operations based on an eccentric distance threshold; and the processing unit is used to continue performing aggregation operations based on a centroid distance threshold if the determination result is that the points in the aggregation set that are subject to aggregation operations are not differentiated, until the points corresponding to the aggregation operations are differentiated based on an eccentric distance threshold to obtain multiple target sets.
[0089] As an optional embodiment, the above-mentioned aggregation unit is further configured to start the aggregation operation with the two closest points in the point set to obtain an aggregation set; the above-mentioned differentiation unit is further configured to determine the aggregation centroid of the aggregation set, and determine the centrifugal distance of the aggregation set based on the aggregation centroid; determine whether the centrifugal distance is greater than the centrifugal distance threshold; if the determination result is that the centrifugal distance is not greater than the centrifugal distance threshold, determine that the points in the aggregation set for the aggregation operation will not be differentiated.
[0090] As an optional embodiment, the above-mentioned aggregation unit is also used to determine the distance between itself and other unaggregated points in the point set when the number of points aggregated in the aggregation set is multiple, based on the aggregation centroid of the multiple points included in the aggregation set.
[0091] As an optional embodiment, the differentiation unit is further configured to obtain the distance between the points included in the aggregation set and the aggregation centroid, sort the obtained distances to obtain a sorting result, and determine the distance corresponding to the predetermined sorting position in the sorting result as the centrifugal distance.
[0092] As an optional embodiment, the differentiation unit is further configured to determine the distance corresponding to the predetermined percentage position in the ascending order as the centrifugal distance when the sorting is in ascending order and the predetermined sorting position is a predetermined percentage position in the sorting.
[0093] As an optional embodiment, the above-mentioned generation module includes a second acquisition unit and a generation unit, wherein the second acquisition unit is used to acquire the target centroid of multiple target sets; and the generation unit is used to generate a target bus route from the target starting point to the target ending point based on the target centroid of multiple target sets.
[0094] As an optional embodiment, the above-mentioned generation unit is further configured to generate multiple candidate bus routes from the target starting point to the target ending point based on the target centroid of multiple target sets; determine index parameters for selecting bus routes; and select the target bus route from the multiple candidate bus routes based on the index parameters.
[0095] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0096] The electronic device may include: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform any of the methods described above.
[0097] The readable storage medium may be a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to perform the method according to any of the foregoing.
[0098] The computer program product may include a computer program that, when executed by a processor, implements the method according to any of the preceding claims.
[0099] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0100] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. The RAM 503 may also store various programs and data required for the operation of the electronic device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0101] Multiple components in electronic device 500 are connected to I / O interface 505, including: input unit 506, such as keyboard, mouse, etc.; output unit 507, such as various types of monitors, speakers, etc.; storage unit 508, such as disk, optical disk, etc.; and communication unit 509, such as network card, modem, wireless transceiver, etc. Communication unit 509 allows electronic device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0102] The computing unit 501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as the route generation method described above. For example, in some embodiments, the route generation method described above can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the route generation method described above can be performed. Alternatively, in other embodiments, the computing unit 501 can be configured to perform the route generation method described above by any other suitable means (e.g., by means of firmware).
[0103] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0104] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable route generation apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0105] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0106] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0107] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0108] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0109] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0110] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A route generation method, comprising: Based on the target start point and target end point, obtain the target start and end data set, wherein the target start and end data set includes multiple target start and end data; Obtain the point set corresponding to the multiple target start and end data, wherein the points included in the point set are the start point and end point corresponding to the multiple target start and end data; Based on the centroid distance threshold and the centrifugal distance threshold, the points in the point set are aggregated and differentiated to obtain multiple target sets; Based on the multiple target sets, a target bus route is generated from the target origin to the target destination; Wherein, the centroid distance corresponding to the point set is the distance between the two closest points in the point set; The step of aggregating and differentiating points in the point set based on the centroid distance threshold and the eccentric distance threshold to obtain multiple target sets includes: performing an aggregation operation on the points in the point set based on the centroid distance threshold to obtain an aggregate set, wherein the eccentric distance of the aggregate set is determined based on the aggregation centroid of the aggregate set.
2. The method according to claim 1, wherein, The process of obtaining the target start and end point data set based on the target start and end points includes: Obtain an initial start and end data set, wherein the initial start and end data set includes multiple initial start and end data sets; Based on the target starting point and the target ending point, the target starting and ending data are filtered from the multiple initial start and end data to obtain the target starting and ending data set.
3. The method according to claim 2, wherein, Based on the target starting point and the target ending point, the multiple target starting and ending data are filtered from the multiple initial starting and ending data to obtain the target starting and ending data set, including: Construct a target ellipse with the target starting point and the target ending point as foci, and with ellipse parameters used to determine the coverage area; Based on the target ellipse, the target start and end data are selected from the multiple initial start and end data to obtain the target start and end data set.
4. The method according to claim 1, wherein, The process of aggregating and differentiating points in the point set based on centroid distance thresholds and centrifugal distance thresholds to obtain multiple target sets also includes: Based on the centrifugal distance threshold, determine whether to differentiate the points in the aggregation set that are related to the aggregation operation; If the determination result is that the points in the aggregation set for the aggregation operation are not differentiated, the aggregation operation continues based on the centroid distance threshold until the points for the corresponding aggregation operation are differentiated based on the centrifugal distance threshold, thus obtaining the multiple target sets.
5. The method according to claim 4, wherein, The step of performing an aggregation operation on the points in the point set based on the centroid distance threshold to obtain an aggregate set includes: starting by performing an aggregation operation on the two points in the point set that are closest to each other to obtain the aggregate set; The step of determining whether to differentiate the points in the aggregation set for the aggregation operation based on the centrifugal distance threshold includes: determining the aggregation centroid of the aggregation set, and determining the centrifugal distance of the aggregation set based on the aggregation centroid; determining whether the centrifugal distance is greater than the centrifugal distance threshold; and determining that the points in the aggregation set for the aggregation operation will not be differentiated if the determination result is that the centrifugal distance is not greater than the centrifugal distance threshold.
6. The method according to claim 5, wherein, During the aggregation operation based on the centroid distance threshold, when the number of points aggregated in the aggregation set is multiple, the distance between the aggregation centroid of the multiple points included in the aggregation set and other unaggregated points in the point set is determined.
7. The method according to claim 6, wherein, Determining the centrifugal distance of the aggregate set based on the aggregate centroid includes: Obtain the distance between the points included in the aggregate set and the centroid of the aggregate set, and sort the obtained distances to obtain the sorting result; The distance corresponding to the predetermined sorting position in the sorting result is determined as the centrifugal distance.
8. The method according to claim 7, wherein, The step of determining the distance corresponding to the predetermined sorting position in the sorting result as the centrifugal distance includes: When the sorting is in ascending order and the predetermined sorting position is a predetermined percentage position in the sorting, the distance corresponding to the predetermined percentage position in the ascending order is determined as the centrifugal distance.
9. The method according to claim 1, wherein, The step of generating a target bus route from the target origin to the target destination based on the multiple target sets includes: Obtain the centroid of the multiple target sets; Based on the target centroid of the multiple target sets, the target bus route from the target starting point to the target ending point is generated.
10. The method according to claim 9, wherein, The step of generating the target bus route from the target origin to the target destination based on the target centroid of the multiple target sets includes: Based on the target centroid of the multiple target sets, multiple candidate bus routes are generated from the target starting point to the target ending point; Determine the indicator parameters used to select bus routes; Based on the aforementioned index parameters, the target bus route is selected from the plurality of candidate bus routes.
11. A route generation apparatus, comprising: The first acquisition module is used to acquire a target start-end data set based on the target start point and the target end point, wherein the target start-end data set includes multiple target start-end data; The second acquisition module is used to acquire the point set corresponding to the multiple target start and end data, wherein the points included in the point set are the start point and end point corresponding to the multiple target start and end data; The processing module is used to aggregate and differentiate the points in the point set based on the centroid distance threshold and the centrifugal distance threshold to obtain multiple target sets; A generation module is used to generate a target bus route from the target origin to the target destination based on the multiple target sets; Wherein, the centroid distance corresponding to the point set is the distance between the two closest points in the point set; the processing module is further configured to perform an aggregation operation on the points in the point set based on the centroid distance threshold to obtain an aggregate set, wherein the centrifugal distance of the aggregate set is determined based on the aggregation centroid of the aggregate set.
12. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 10.
13. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 10.
14. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Multisource data-based customized bus route generation method
CN108053062A
Logistics distribution path selection method and device, equipment and storage medium
CN113705901A