Public Transport Query System

Through the improved FLoyd and Dijkstra algorithms, the problem of insufficient algorithms and difficulty in fuzzy query in the existing bus query system is solved, and the function of finding the least transfer or the most economical route from multiple routes is realized to meet the diverse needs of users. , and improves query efficiency.

CN114756596BActive Publication Date: 2024-11-05HARBIN INST OF TECH AT WEIHAI
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210240866.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-10
Publication Date
2024-11-05
Estimated Expiration
2042-03-10

AI Technical Summary

Technical Problem

The existing bus query system lacks advanced query algorithms, which cannot effectively meet users' needs to find the least transfer or the most economical route, and cannot quickly find the station name for fuzzy query. The query methods mostly use classified discussions, which cannot meet the expansion needs.

Method used

Using the improved FLoyd and Dijkstra algorithms, by changing the traditional mapping method, using routes as line headers of the critical matrix, setting all direct routes to a unified weight, combined with the Dijkstra algorithm, helping users find the least exchanges from many routes. Bike or the most economical route to achieve fuzzy query and display route maps.

Benefits of technology

It realizes the direct finding of the least transfer or the most economical route from many routes, meets the user's optimal route type selection, provides a fuzzy query method, improves query efficiency and user experience, and controls the time complexity at O(n^2 ).

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114756596B_ABST
    Figure CN114756596B_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of public transportation query, and discloses a public transportation query system, comprising a management module, the management module being electrically connected to the query system, a query module being provided outside the management module, the query module being electrically connected to the query system, the management module being used to store public transportation routes, the query module comprising fuzzy query sites, querying the least transfer, querying the least number of stations and displaying a route map, the fuzzy query sites, querying the least transfer, querying the least number of stations and displaying a route map are all electrically connected to the query module, in a possible implementation manner, fuzzy query sites: a user identifies whether a relevant site is contained by giving a keyword, so that the user can subsequently search for a route that meets his or her expectations by inputting a desired starting station and a terminal station, thereby solving the problems in the prior art that the algorithm is not advanced enough and the query method mostly adopts a classification discussion method for querying.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of public transportation query, and in particular to a public transportation query system. Background Art

[0002] The Weihai public transportation system lacks a systematic query mode, and can only query routes in a simple way, which cannot better meet customer needs and is not convenient and fast enough. When users want to find the route with the least transfers and the most economical route, passengers need to compare and select multiple routes by themselves, and cannot get the answer directly through the program. This query system not only meets the route search needs, but also allows users to choose the type of optimal route they want, such as the most economical or the most time-optimal;

[0003] In the existing ticket machines at subway stations and bus stations, users cannot be prompted with bus station names related to their destinations, and cannot quickly find vague station names in their minds when the route and location are unknown. This query system provides a fuzzy query method, where users can find the names of related stations by inputting information similar to the station name;

[0004] The algorithm is not advanced enough, and the query method mostly adopts the method of classification discussion, which cannot meet the needs of scalability. It mostly adopts the method of direct database search. The path query part of this query system adopts the query algorithm improved by the FLoyd and Di jkstra algorithms, and the time complexity is controlled at o(n^2). Summary of the invention

[0005] 1. Technical issues to be solved

[0006] In view of the deficiencies in the prior art, the present invention provides a bus query system, which has the advantages of changing the traditional mapping method, taking the route as the row head pointer of the critical matrix, setting the total of all directly accessible routes in the matrix to a certain unified weight (i.e., the route price), and combining the Dijkstra algorithm to help passengers directly find the route with the least transfers, or the route with the least cost, from among many routes, querying the algorithm part with the best economy, and controlling the time complexity within O(n^2). It is used to solve the problem that the algorithm in the prior art is not advanced enough, the query method mostly adopts the classification discussion method to query, which cannot meet the scalability requirements, and mostly adopts the method of direct database search. This query system adopts the query algorithm improved from the FLoyd and Dijkstra algorithms, and the time complexity is controlled within O(n^2).

[0007] (II) Technical solution

[0008] The present invention provides the following technical solution: a public transportation query system, comprising a management module, the management module being electrically connected to the query system, a query module being provided outside the management module, the query module being electrically connected to the query system, the management module being used to store public transportation routes, the query module comprising fuzzy query stations, querying the least transfers, querying the least number of stations and displaying a route map, the fuzzy query stations, querying the least transfers, querying the least number of stations and displaying a route map are all electrically connected to the query module.

[0009] In a possible implementation, fuzzy query sites: the user provides keywords to identify whether there are related sites, so that the user can search for a route that meets his or her expectations by inputting the desired starting and ending sites.

[0010] In a possible implementation, the route with the least number of transfers is queried: the user enters the starting station and the end station to query the route, obtains the route with the least number of transfers (including all stations on the path), and gives the total number of stations required.

[0011] In one possible implementation, the route with the fewest stops is queried: the user enters the starting station and the end station to query the route, obtains the route with the fewest stops (including only the stations that require transfers), and gives the total cost of the ride.

[0012] In a possible implementation, a bus route map is displayed: the user can view a map containing all bus routes in Weihai and find a specific route.

[0013] In a possible implementation, the algorithm process performed by the public transportation query system includes the following steps:

[0014] S1. Core algorithm design ideas,

[0015] Combined with Dijkstra algorithm to realize the query of least transfer, different from the conventional shortest path mapping method, in this problem, an improved adjacency matrix is ​​needed to store data: there should be an edge with weight 1 between two directly accessible stations. Therefore, the adjacency matrix can be used to find the solution with least transfer when finding the shortest path;

[0016] S2. Implementation and analysis of core algorithms.

[0017] In a possible implementation, in S2, the functions and processes of the core algorithm are:

[0018] ① Establish the adjacency matrix of the graph. The two-dimensional array A is used to store the shortest path weights between any pair of vertices. The two-dimensional array path is used to store the shortest path between any pair of vertices. The content of each cell represents the vertex on the path from point i to point j.

[0019] ② Pass the adjacency matrix data into the two-dimensional array A, and assign values ​​to all elements in the two-dimensional data path. If there is an edge between points i and j, the value is i, and if there is no edge, the value is -1;

[0020] ③ Initialize k=0, i=0, j=0 to find all possible binary groups of vertices, select the point numbered k as the middle point, start from the first element of the binary group, and determine whether A[i][j]>A[i][k]+A[k][j]. If the expression is true, proceed to step ④. If it is false, end this process and enter the next binary group (j++, and then i++ after the loop is completed);

[0021] ④ Update the value of A[i][j] to A[i][k]+A[k][j], and update the value of path[i][j] to path[k][j];

[0022] ⑤k++, repeat step ③ to make each vertex a passing middle point;

[0023] ⑥Finally, the path array stores the intermediate points passed, and the shortest path can be found one by one.

[0024] Compared with the prior art, the present invention provides a public transportation query system, which has the following beneficial effects:

[0025] 1. The present invention not only satisfies the route search, but also allows users to select the desired optimal route type, such as economic optimization or time optimization; the query system provides a fuzzy query method, and the name of the relevant station can be found by inputting information similar to the station name; the query system adopts the query algorithm improved from the FLoyd and Dijkstra algorithms. In the economic priority query method, by changing the traditional mapping method, the route is used as the row head pointer of the critical matrix, and the weights of all directly accessible routes in the matrix are set as fixed values. Combined with the Dijkstra algorithm, it helps passengers directly find the route with the least transfers, or the route with the least cost, from many routes. The algorithm part of querying the economic optimization controls the time complexity within O(n^2).

[0026] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 The overall functional module diagram of the public transportation query system provided by the present invention;

[0028] Figure 2 A schematic diagram of a test example of a bus route query system provided by the present invention Figure 1 ;

[0029] Figure 3 A schematic diagram of a test example of a bus route query system provided by the present invention Figure 2 ;

[0030] Figure 4 Schematic diagram of the second query route test example of the bus query system provided by the present invention Figure 1 ;

[0031] Figure 5 Schematic diagram of the second query route test example of the bus query system provided by the present invention Figure 2 ;

[0032] Figure 6 A schematic diagram of a test sample 1 of a fuzzy search test for a public transportation query system provided by the present invention;

[0033] Figure 7 A schematic diagram of a second test example of a fuzzy search test for a public transportation query system provided by the present invention;

[0034] Figure 8 A schematic diagram of a third test sample of a fuzzy search test of a public transportation query system provided by the present invention;

[0035] Fig. 9 This is a schematic diagram of a test display map of the public transportation query system provided by the present invention. DETAILED DESCRIPTION

[0036] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0037] Examples of embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0038] In the description of the present invention, it is to be understood that the terms “center”, “longitudinal”, “lateral”, “length”, “width”, “thickness”, “up”, “down”, “front”, “back”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside”, “outside”, “clockwise”, “counterclockwise”, “axial”, “radial”, “circumferential”, etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.

[0039] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0040] like Figure 1-9 As shown, the present invention provides a public transportation inquiry system, including a management module, the management module is electrically connected to the inquiry system, a inquiry module is provided outside the management module, the inquiry module is electrically connected to the inquiry system, the management module is used to store public transportation routes, the inquiry module includes fuzzy inquiry of stations, inquiry of minimum transfers, inquiry of minimum number of stations and display of route map, the fuzzy inquiry of stations, inquiry of minimum transfers, inquiry of minimum number of stations and display of route map are all electrically connected to the inquiry module.

[0041] In a possible implementation, fuzzy query sites: the user provides keywords to identify whether there are related sites, so that the user can search for a route that meets his or her expectations by inputting the desired starting and ending sites.

[0042] In a possible implementation, the route with the least number of transfers is queried: the user enters the starting station and the end station to query the route, obtains the route with the least number of transfers (including all stations on the path), and gives the total number of stations required.

[0043] In one possible implementation, the route with the fewest stops is queried: the user enters the starting station and the end station to query the route, obtains the route with the fewest stops (including only the stations that require transfers), and gives the total cost of the ride.

[0044] In a possible implementation, a bus route map is displayed: the user can view a map containing all bus routes in Weihai and find a specific route.

[0045] In a possible implementation, a method for implementing a public transportation query system algorithm includes the following steps:

[0046] S1. Core algorithm design and analysis,

[0047] The Dijkstra algorithm is used to implement the query with the least number of changes. Different from the conventional shortest path mapping method, this problem requires an improved adjacency matrix to store data: there should be an edge with a weight of one between two directly accessible stations. The adjacency matrix can be used to find the solution with the least number of changes when finding the shortest path.

[0048] (1) The data structures used in this part are adjacency matrix and array.

[0049] The algorithm used in this part is Dijkstra.

[0050] Figure 1 The pseudo code for the establishment:

[0051]

[0052]

[0053] Dijkstra pseudocode:

[0054]

[0055]

[0056] Fuzzy query algorithm:

[0057] (1) Data structures used: linked lists, arrays

[0058] (2.1) Link list initialization pseudo code:

[0059]

[0060]

[0061]

[0062] Fuzzy query pseudo code:

[0063]

[0064]

[0065] The main data structure used: the adjacency matrix of the graph.

[0066] The logical structure is divided into two parts: V and E sets, where V is the vertex and E is the edge. Therefore, a one-dimensional data is used to store all the vertex data in the graph; a two-dimensional array is used to store the data of the relationship between vertices.

[0067] S2. Operation results and analysis.

[0068] In a possible implementation, in S2, the functions and processes of the core algorithm are:

[0069] ① Establish the adjacency matrix of the graph. The two-dimensional array A is used to store the shortest path weights between any pair of vertices. The two-dimensional array path is used to store the shortest path between any pair of vertices. The content of each cell represents the vertex on the path from point i to point j.

[0070] ② Pass the adjacency matrix data into the two-dimensional array A, and assign values ​​to all elements in the two-dimensional data path. If there is an edge between points i and j, the value is i, and if there is no edge, the value is -1;

[0071] ③ Initialize k=0, i=0, j=0 to find all possible binary groups of vertices, select the point numbered k as the middle point, start from the first element of the binary group, and determine whether A[i][j]>A[i][k]+A[k][j]. If the expression is true, proceed to step ④. If it is false, end this process and enter the next binary group (j++, and then i++ after the loop is completed);

[0072] ④ Update the value of A[i][j] to A[i][k]+A[k][j], and update the value of path[i][j] to path[k][j];

[0073] ⑤k++, repeat step ③ to make each vertex a passing middle point;

[0074] ⑥Finally, the path array stores the intermediate points passed, and the shortest path can be found one by one.

[0075] The time complexity of Floyd's algorithm is O(n3) and the space complexity is O(n2).

[0076] Query route test:

[0077] Test example 1:

[0078] Enter "Zhaizi Station" as the starting station and "Weihai North Station" as the terminal station.

[0079] Click the button with the least number of stops to get the following route. Figure 2 As shown,

[0080] Click the button with the least number of transfers to get the following routes, such as Figure 3 As shown;

[0081] Test example 2:

[0082] Enter "Harbin Institute of Technology Station" as the starting station and "Weihai North Station" as the terminal station

[0083] Click the button with the least number of stops to get the following route. Figure 4 As shown,

[0084] Click the button with the least number of transfers to get the following routes, such as Figure 5 as shown

[0085] Fuzzy search test:

[0086] Test example 1:

[0087] Enter "flower", click the query button, and the following relevant sites are obtained, such as Figure 6 as shown

[0088] Test example 2:

[0089] Enter "ha", click the query button, and the following relevant sites are obtained, such as Figure 7 as shown

[0090] Test example 3:

[0091] Enter "graph", click the query button, no relevant sites are found, and the following prompt information is obtained, such as Figure 8 as shown

[0092] Display map test:

[0093] Click the display map button to display the map, as Fig. 9 as shown

[0094] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to the embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.

[0095] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.

[0096] Next, the technical solutions in the present invention will be clearly and completely described in conjunction with the accompanying drawings in the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The description of at least one exemplary embodiment is actually only illustrative and in no way restrictive of the present invention and its application or use. Based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

Claims

1. Public transport enquiry system, It is characterized in that It includes a management module, which is electrically connected to a query system. The management module has a query module outside, which is electrically connected to the query system. The management module is used to store bus routes. The query module includes fuzzy query sites, query for the least transfer, query for the least number of stations, and display of route maps. The fuzzy query sites, query for the least transfer, query for the least number of stations, and display of route maps are all electrically connected to the query module. The method of using the bus query system includes the following steps: S1. Core algorithm design and analysis, combined with Dijkstra algorithm to achieve the query with the least transfer. Different from the conventional shortest path mapping method, in this problem, an improved adjacency matrix is ​​needed to store data: there should be an edge with a weight of one between two directly accessible stations. Therefore, the adjacency matrix can be used to find the solution with the least transfer when finding the shortest path. S2. Operation results and analysis; In S2, the functions and processes of the core algorithm are: ① Establish the adjacency matrix of the graph. The two-dimensional array A is used to store the shortest path weights between any pair of vertices. The two-dimensional array path is used to store the shortest path between any pair of vertices. The content of each cell represents the vertex on the path from point i to point j. ② Pass the adjacency matrix data into the two-dimensional array A, and assign values ​​to all elements in the two-dimensional data path. If there is an edge between points i and j, the value is i, and if there is no edge, the value is -1; ③ Initialize k=0, i=0, j=0 to find all possible binary tuples of vertices, select the point numbered k as the middle point, start from the first element of the binary tuple, and determine whether A[i][j]>A[i][k]+A[k][j]. If the expression is true, proceed to step ④. If it is false, end this process and enter the next binary tuple (j++, and then perform i++ after the loop is completed); ④ Update the value of A[i][j] to A[i][k]+A[k][j], and update the value of path[i][j] to path[k][j]; ⑤k++, repeat step ③ to make each vertex a passing middle point; ⑥Finally, the path array stores the intermediate points passed, and the shortest path can be found one by one.

2. The public transportation query system according to claim 1, It is characterized in that Fuzzy query site: Users provide keywords to identify whether there are related sites, so that users can search for routes that meet their expectations by entering the desired starting and ending stations.

3. The public transportation query system according to claim 1, It is characterized in that Query the route with the least number of transfers: The user enters the starting station and the end station to query the route, obtains the route with the least number of transfers (including all stations on the path), and gives the total cost.

4. The public transportation query system according to claim 1, It is characterized in that Query the route with the least number of stops: The user enters the starting station and the end station to query the route, and obtains the route with the least number of stops (including only the stations that require transfers), and gives the total number of stops required.

5. The public transportation query system according to claim 1, It is characterized in that Display bus route map: Users can view a map containing all bus routes in Weihai and find specific routes.

Citation Information

Patent Citations

  • Bus route inquiry method and equipment based on big data dimensionality reduction

    CN108491556A

  • Bus data reading method and device, terminal device and readable storage medium

    CN108629456A

  • Method and device for quickly querying bus line, terminal equipment and storage medium

    CN108763549A

  • Bus route query method and device, terminal equipment and readable storage medium

    CN109726262A

  • Diversified route planning for public transportation network

    US20170059341A1