CN108491556A - Bus line inquiry method based on big data dimension-reduction treatment and query facility - Google Patents

Bus line inquiry method based on big data dimension-reduction treatment and query facility Download PDF

Info

Publication number
CN108491556A
CN108491556A CN201810351310.6A CN201810351310A CN108491556A CN 108491556 A CN108491556 A CN 108491556A CN 201810351310 A CN201810351310 A CN 201810351310A CN 108491556 A CN108491556 A CN 108491556A
Authority
CN
China
Prior art keywords
route
direct path
line
path matrix
terminus
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810351310.6A
Other languages
Chinese (zh)
Inventor
王防修
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Polytechnic University
Original Assignee
Wuhan Polytechnic University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Polytechnic University filed Critical Wuhan Polytechnic University
Priority to CN201810351310.6A priority Critical patent/CN108491556A/en
Publication of CN108491556A publication Critical patent/CN108491556A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • G06Q10/047Optimisation of routes or paths, e.g. travelling salesman problem
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/40Business processes related to the transportation industry

Landscapes

  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Tourism & Hospitality (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Game Theory and Decision Science (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Development Economics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Primary Health Care (AREA)
  • Navigation (AREA)

Abstract

The invention discloses a kind of bus line inquiry method and query facility based on big data dimension-reduction treatment.The query facility of the present invention obtains all circuits of public transit system,Circuit based on acquisition establishes line library,And the line library is preserved into default storage unit,Count each site information in the line library,Based on the site information,Establish the most short direct path matrix between website in the line library,Based on the most short direct path matrix,Can determine go directly between initiating station to be found and terminus,When the initiating station to be found and terminus can go directly,The most short straightforward line determined based on the most short direct path matrix is searched in the line library,Pass through most short direct path matrix described in inquiry,It can be with the optimal route between quick search any two website,The data of public bus network will be reduced to two dimension by dimension-reduction treatment,So as to solve the problems, such as optimal route in public transit system using Floyd algorithms and dijkstra's algorithm.

Description

Bus line inquiry method based on big data dimension-reduction treatment and query facility
Technical field
The present invention relates to public bus network inquiring technology field more particularly to a kind of public transport lines based on big data dimension-reduction treatment Road querying method and query facility.
Background technology
With the quickening of Urbanization Process In China, the scale in city is increasing, must be tight so as to cause civic trip Public transport is relied on again.Therefore, optimal route problem becomes the hot spot in research traffic problems, it most preferably goes out line in solution public transport Road, city are rescued optimum line, logistics distribution, expressway network toll etc. and are sent out with the closely related problem of people's daily life Wave important role.In recent years, the traffic system in city have developed rapidly, and be trip and the every daily routines of progress of the public Great convenience is brought, but is also faced with the select permeability of optimum line simultaneously.So design one can provide to the user most The intelligent transportation system of excellent circuit undoubtedly carries out daily routines for people and provides a convenient.Therefore, this, which is one, is worth research Project.
What investigation showed the preferred consideration of people's trip is that number of transfer is minimum, and it is most short that next is only the time.Therefore, it is seeking When looking for optimal route, " number of transfer is minimum " should be selected to be used as primary optimization aim, " trip takes minimum " can be used as passenger and examine The second key factor considered.But two factors are influenced each other, are mutually restricted, and this system can both find out optimal under single goal Solution, can also find out the optimal solution under multiple target.Therefore, the standard of optimal solution is defined as follows:
(a) shortest path, so-called shortest path refer to from start site to being sought in be possible to circuit the website of destination It asks apart from a shortest circuit as optimal travel route, this method is fully considered apart from shortest requirement, and for transfer Number is without a moment's thought.
(b) least bus change number, transfer train number refer to that passenger completes number of transfer needed for primary trip process, number How much be weigh travel route it is optimal whether another key factor, if number of transfer is more, traveler can be abandoned to public transport Selection, turn to other more efficiently modes, optimal travel route should be ensured that under the premise of minimum number of transfer It arrives at the destination, a large amount of practical investigations show that optimal trip number of transfer is not to be exceeded 3 times.
Due to big city public transit system has the characteristics that more than website and complex circuit, therefore can not apply Floyd algorithms and Dijkstra's algorithm solves the optimal route between any two website.Therefore, structure can apply Floyd algorithms and Dijkstra The two-dimensional data table of algorithm optimizing is the key that solve optimal public bus network.
The above is only used to facilitate the understanding of the technical scheme, and is not represented and is recognized that the above is existing skill Art.
Invention content
The main purpose of the present invention is to provide a kind of bus line inquiry method based on big data dimension-reduction treatment and look into Ask equipment, it is intended to which solving big city public transit system in the prior art has website mostly complex circuit, therefore Floyd can not be applied to calculate The technical issues of method and dijkstra's algorithm solve the optimal route between any two website.
To achieve the above object, the present invention provides a kind of bus line inquiry method based on big data dimension-reduction treatment, institute The method of stating includes the following steps:
Obtain all circuits of public transit system;
Circuit based on acquisition establishes line library, and the line library is preserved into default storage unit;
Count each site information in the line library stored in the default storage unit;
Based on the site information, the most short direct path matrix between website in the line library is established;
When receiving circuit query request, based on the most short direct path matrix, initiating station and terminal to be found are determined It can go directly between standing;
When can go directly between the initiating station to be found and terminus, searched based on described in most in the line library The most short straightforward line that short direct path matrix determines.
Preferably, each site information in the line library stored in the statistics default storage unit, specifically includes:
The line library is traversed, the targeted sites that can be gone directly in the line library are searched and the targeted sites can be made Between go directly all target lines;
Based on the target line, the website number between the targeted sites corresponding with the target line is counted respectively Mesh;
Correspondingly, described to be based on the site information, establish the most short direct path square between website in the line library Battle array, specifically includes:
Compare the station number, ascertain the number minimum station number;
The most short direct path matrix in the line library between website is established based on the minimum station number of the number.
Preferably, described when receiving circuit query request, based on the most short direct path matrix, determine to be found Can after going directly between initial station and terminus, the method further includes:
When can not go directly between the initiating station to be found and terminus, the most short direct path matrix based on described in, Target transfer website is searched using enumerative technique, the corresponding target transfer route of the target transfer website is that transfer number is minimum Transfer route;
The line library is traversed, searches first line and the second circuit respectively, wherein the first line is based on described The circuit to go directly between the initiating station and target terminal that most short direct path matrix determines, second circuit be based on Circuit between the most short direct path matrix target terminal determined and terminus.
Preferentially, described to be based on the site information, establish the most short direct path square between website in the line library After battle array, the method further includes:
Based on the most short direct path matrix, sought between the initiating station and terminus using DIJKSTRA algorithms First route, first route are the riding time shortest route sought based on DIJKSTRA algorithms.
Preferably, described based on the most short direct path matrix, using DIJKSTRA algorithms seek the initiating station and The first route between terminus, first route is after riding time shortest route, the method further includes:
It is sought using DIJKSTRA algorithms based on the most short direct path matrix by increasing the time weighting of transfer The number of transfer of the second route between the initiating station and terminus, second route is more secondary than the transfer of first route Number is few.
Preferably, described to be based on the site information, establish the most short direct path square between website in the line library Battle array, the shortest path matrix is after two-dimensional matrix, the method further includes:
Based on the most short direct path matrix, route matrix corresponding with the most short direct path matrix is generated;
Based on the route matrix, the third route between the initiating station and terminus, institute are sought using FLOYD algorithms It is the riding time shortest route sought based on FLOYD algorithms to state third route.
Preferably, described to be based on the route matrix, it is sought between the initiating station and terminus using FLOYD algorithms Third route, the third route are the riding time shortest route sought based on FLOYD algorithms, are specifically included:
It is generated and the most short through road based on the most short direct path matrix by increasing the time weighting of transfer The corresponding weight route matrix of drive matrix;
Based on the weight route matrix, the 4th tunnel between the initiating station and terminus is sought using FLOYD algorithms The number of transfer of line, the 4th route is fewer than the number of transfer of the third route.
Preferably, it is described between the website start site to be found and terminus point there are when through route, traversal After circuit library lookup circuit corresponding with the through route, the method further includes:
The line library is traversed, all circuits that the initiating station can be made to go directly with terminus are found out.
In addition, to achieve the above object, the present invention also provides a kind of query facility, the query facility includes:Memory, Processor and the public transport line based on big data dimension-reduction treatment that is stored on the memory and can run on the processor Road polling routine, the public bus network polling routine based on big data dimension-reduction treatment be arranged for carrying out it is as described above based on The step of bus line inquiry method of big data dimension-reduction treatment.
The query facility of the present invention obtains all circuits of public transit system, and the circuit based on acquisition establishes line library, and by institute It states line library to preserve into default storage unit, counts each site information in the line library stored in the default storage unit, Based on the site information, the most short direct path matrix between website in the line library is established, circuit query is received and asks When asking, based on the most short direct path matrix, can determine go directly between initiating station to be found and terminus, described to be checked It looks for when can go directly between initiating station and terminus, is searched in the line library based on the most short direct path matrix determination Most short straightforward line, by inquiry described in most short direct path matrix, can be with optimal between quick search any two website The data of public bus network will be reduced to two dimension by circuit by dimension-reduction treatment, so as to be calculated using Floyd algorithms and Dijkstra Method solves the problems, such as optimal route in public transit system.
Description of the drawings
Fig. 1 is the query facility structural schematic diagram for the hardware running environment that the embodiment of the present invention is related to;
Fig. 2 is that the present invention is based on the signals of the flow of the bus line inquiry method first embodiment of big data dimension-reduction treatment Figure;
Fig. 3 is bus station statistical result schematic diagram;
Fig. 4 is the most short direct path matrix schematic diagram of public transit system;
Fig. 5 is most time saving through route query result schematic diagram;
Fig. 6 is most time saving all route inquiry result schematic diagrams;
Fig. 7 is that the present invention is based on the signals of the flow of the bus line inquiry method second embodiment of big data dimension-reduction treatment Figure;
Fig. 8 is that the present invention is based on the signals of the flow of the bus line inquiry method 3rd embodiment of big data dimension-reduction treatment Figure;
Fig. 9 is to transfer to the riding route schematic diagram that weight is 0 based on DIJKSTRA algorithms;
Figure 10 is to transfer to the riding route schematic diagram that weight is 5 based on DIJKSTRA algorithms;
Figure 11 is to transfer to the riding route schematic diagram that weight is 30 based on DIJKSTRA algorithms;
Figure 12 is that the present invention is based on the signals of the flow of the bus line inquiry method fourth embodiment of big data dimension-reduction treatment Figure;
Figure 13 is based on FLOYD algorithm times shortest riding route schematic diagram;
Figure 14 is based on the minimum riding route schematic diagram of FLOYD algorithm numbers of transfer
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific implementation mode
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
Referring to Fig.1, Fig. 1 is the structural representation of the query facility for the hardware running environment that the embodiment of the present invention is related to Figure.
As shown in Figure 1, the query facility may include:Processor 1001, such as CPU, communication bus 1002, user interface 1003, network interface 1004, memory 1005.Wherein, communication bus 1002 is for realizing the connection communication between these components. User interface 1003 may include display screen (Display), input unit such as keyboard (Keyboard), optional user interface 1003 can also include standard wireline interface and wireless interface.Network interface 1004 may include optionally that the wired of standard connects Mouth, wireless interface (such as WI-FI interfaces).Memory 1005 can be high-speed RAM memory, can also be stable memory (non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be independently of aforementioned processor 1001 storage device.
It will be understood by those skilled in the art that structure shown in Fig. 1 does not constitute the restriction to storage device, can wrap It includes than illustrating more or fewer components, either combines certain components or different components arrangement.
As shown in Figure 1, as may include that operating system, network are logical in a kind of memory 1005 of computer storage media Believe module, Subscriber Interface Module SIM and the public bus network polling routine based on big data dimension-reduction treatment.
In server shown in FIG. 1, network interface 1004 is mainly used for external network into row data communication;User interface 1003 are mainly used for receiving the input instruction of user;The query facility is called in memory 1005 by processor 1001 and is stored The public bus network polling routine based on big data dimension-reduction treatment, and execute following operation:
Obtain all circuits of public transit system;
Circuit based on acquisition establishes line library, and the line library is preserved into default storage unit;
Count each site information in the line library stored in the default storage unit;
Based on the site information, the most short direct path matrix between website in the line library is established;
When receiving circuit query request, based on the most short direct path matrix, initiating station and terminal to be found are determined It can go directly between standing;
When can go directly between the initiating station to be found and terminus, searched based on described in most in the line library The most short straightforward line that short direct path matrix determines.
Further, processor 1001 can call the public transport based on big data dimension-reduction treatment stored in memory 1005 Circuit query program also executes following operation:
The line library is traversed, the targeted sites that can be gone directly in the line library are searched and the targeted sites can be made Between go directly all target lines;
Based on the target line, the website number between the targeted sites corresponding with the target line is counted respectively Mesh;
Correspondingly, described to be based on the site information, establish the most short direct path square between website in the line library Battle array, specifically includes:
Compare the station number, ascertain the number minimum station number;
The most short direct path matrix in the line library between website is established based on the minimum station number of the number.
Further, processor 1001 can call the public transport based on big data dimension-reduction treatment stored in memory 1005 Circuit query program also executes following operation:
When can not go directly between the initiating station to be found and terminus, the most short direct path matrix based on described in, Target transfer website is searched using enumerative technique, the corresponding target transfer route of the target transfer website is that transfer number is minimum Transfer route;
The line library is traversed, searches first line and the second circuit respectively, wherein the first line is based on described The circuit to go directly between the initiating station and target terminal that most short direct path matrix determines, second circuit be based on Circuit between the most short direct path matrix target terminal determined and terminus.
Further, processor 1001 can call the public transport based on big data dimension-reduction treatment stored in memory 1005 Circuit query program also executes following operation:
Based on the most short direct path matrix, sought between the initiating station and terminus using DIJKSTRA algorithms First route, first route are the riding time shortest route sought based on DIJKSTRA algorithms.
Further, processor 1001 can call the public transport based on big data dimension-reduction treatment stored in memory 1005 Circuit query program also executes following operation:
It is sought using DIJKSTRA algorithms based on the most short direct path matrix by increasing the time weighting of transfer The number of transfer of the second route between the initiating station and terminus, second route is more secondary than the transfer of first route Number is few.
Further, processor 1001 can call the public transport based on big data dimension-reduction treatment stored in memory 1005 Circuit query program also executes following operation:
Based on the most short direct path matrix, route matrix corresponding with the most short direct path matrix is generated;
Based on the route matrix, the third route between the initiating station and terminus, institute are sought using FLOYD algorithms It is the riding time shortest route sought based on FLOYD algorithms to state third route.
Further, processor 1001 can call the public transport based on big data dimension-reduction treatment stored in memory 1005 Circuit query program also executes following operation:
It is generated and the most short through road based on the most short direct path matrix by increasing the time weighting of transfer The corresponding weight route matrix of drive matrix;
Based on the weight route matrix, the 4th tunnel between the initiating station and terminus is sought using FLOYD algorithms The number of transfer of line, the 4th route is fewer than the number of transfer of the third route.
Further, processor 1001 can call the public transport based on big data dimension-reduction treatment stored in memory 1005 Circuit query program also executes following operation:
The line library is traversed, all circuits that the initiating station can be made to go directly with terminus are found out.
Through the above scheme, query facility obtains all circuits of public transit system to the present embodiment, and the circuit based on acquisition is established Line library, and the line library is preserved into default storage unit, count the line library stored in the default storage unit In each site information, be based on the site information, establish the most short direct path matrix between website in the line library, receive When being asked to circuit query, based on the most short direct path matrix, can determine straight between initiating station to be found and terminus It reaches, when can go directly between the initiating station to be found and terminus, is searched in the line library based on described most short straight The most short straightforward line determined up to path matrix can be with quick search arbitrary two by most short direct path matrix described in inquiry The data of public bus network will be reduced to two dimension by the optimal route between a website by dimension-reduction treatment, so as to be calculated using Floyd Method and dijkstra's algorithm solve the problems, such as optimal route in public transit system.
Based on above-mentioned hardware configuration, propose that the present invention is based on the implementations of the bus line inquiry method of big data dimension-reduction treatment Example.
It is that the present invention is based on the streams of the bus line inquiry method first embodiment of big data dimension-reduction treatment with reference to Fig. 2, Fig. 2 Journey schematic diagram.
In the first embodiment, the bus line inquiry method based on big data dimension-reduction treatment includes the following steps:
S10:Obtain all circuits of public transit system.
It should be noted that the executive agent of the present embodiment method is to be capable of the first original circuit of urban mass-transit system to be divided Analysis, processing, and then the equipment for carrying out optimal route inquiry, can be mobile phone, computer, portable processing terminal or dedicated query Equipment, the present embodiment do not limit this.
It should be noted that since the presentation format of each circuit in public transit system is inconsistent, for example,
The L001 circuits being made of 3 fields, presentation format are:L001 pricing for segment S0619-S1914-S0388- S0348-S0392-S0429-S0436-S3885-S3612-S0819-S3524-S0820-S1914-S0388-S0384- S0392-S0429-S0436-S3885-S3612-S0819-S3524-S0820-S3914-S0128-S0710;
The L017 circuits being made of 4 fields, presentation format are:L017 pricing for segment goes in ring S3748-S2160-S0732- S3078-S2808-S2816-S3028-S1123-S3029-S2764-S2543-S2742-S2533-S1839-S2751- S2755-S2937-S1929-S1007-S0940-S1907-S2085-S0609-S0483-S0604-S2650-S3693- S1659-S2962-S0622-S0456-S0427-S0582-S0577-S1895-S3648-S0668-S3081-S3078- S2082-S0683-S2160-S3748。
It should be noted that L001 therein and L017 expressions is public bus network number, uplink and go in ring expression are public The driving mode of friendship, what segmentation calculated expression is specific pricing mode, and what numeric string therein indicated is circuit composition.
It is understood that this circuit format indicates inconsistent, query facility can not be to operation that it is counted Processing can be standardized the presentation format of these circuits, i.e., so after the circuit for obtaining former public transit system It is indicated in a unified format, for example, can be made of the unification of each circuit 4 fields:Line number;Marked price regulation;Row Sail mode;Circuit forms.Certainly, specific unified format can include more or fewer fields, and the sequence of each field also may be used It is modified with concrete condition, the present embodiment does not limit this.
S20:Circuit based on acquisition establishes line library, and the line library is preserved into default storage unit.
Inquiry velocity to improve circuit will establish normal line after the representation to the circuit unitizes Lu Ku, and the standard circuit library is preserved into memory, for four kinds of different types of circuits it is interior also have in it is different Representation, in the present embodiment, different types of circuit are as follows in intrinsic representation:
1) for " round-trip " situation, which is indicated in memory with double linked list, such as:
2) for " uplink " situation, which is indicated in memory with single linked list, such as:
3) for " downlink " situation, which is indicated in memory with single linked list, such as:
4) for " belt " situation, which is indicated in memory with circular linked list, such as:
S30:Count each site information in the line library stored in the default storage unit.
In order to establish the bivariate table of public transit system, need to count all websites in line library, the result of statistics can be found in Fig. 3.
S40:Based on the site information, the most short direct path matrix between website in the line library is established.
In the concrete realization, the line library can be traversed, search the targeted sites that can go directly in the line library with And all target lines gone directly between the targeted sites can be made, it is based on the target line, respectively statistics and the target Station number between the corresponding targeted sites of circuit, the station number, ascertain the number minimum station number, The most short direct path matrix in the line library between website is established based on the minimum station number of the number.
In the present embodiment, it can go directly according between two websites, establish two dimensional path matrix, specific practice is as follows:
If 1) can go directly between two websites, one shortest path value is only stored in two-dimensional matrix;
If 2) cannot go directly between two websites, it is indicated, is established with infinitely great symbol ∞ in two-dimensional matrix Matrix can be found in Fig. 4.
S50:When receiving circuit query request, based on the most short direct path matrix, determine initiating station to be found with It can go directly between terminus.
In the present embodiment, in order to seek shortest path between two websites, correspondence only need to be read from shortest path matrix The numerical value of position, if the numerical value read is Finite Number, then it represents that can go directly between two websites, be if read Infinitely great symbol, then it represents that cannot go directly between two websites.
S60:When can go directly between the initiating station to be found and terminus, is searched in the line library and be based on institute State the most short straightforward line that most short direct path matrix determines.
It is Finite Number in the numerical value of reading, i.e., when can go directly between initiating station and terminus, to being looked into memory line library A circuit equal to the shortest path, specific query result is looked for can be found in Fig. 5.
It should be noted that for passenger, it is sometimes desirable to know all straightforward lines, therefore, be looked for from line library It is also the work for being frequently necessary to carry out to go out all straightforward lines, and specific practice is to traverse all circuits in line library, find out All circuits that can be gone directly, specific query result can be found in Fig. 6.
The query facility of the present embodiment obtains all circuits of public transit system, and the circuit based on acquisition establishes line library, and will The line library is preserved into default storage unit, counts each website letter in the line library stored in the default storage unit Breath is based on the site information, establishes the most short direct path matrix between website in the line library, receive circuit query When request, based on the most short direct path matrix, can determine go directly between initiating station to be found and terminus, be waited for described When can go directly between lookup initiating station and terminus, searched in the line library true based on the most short direct path matrix Fixed most short straightforward line, by inquiry described in most short direct path matrix, can between quick search any two website most The data of public bus network will be reduced to two dimension by excellent circuit by dimension-reduction treatment, so as to utilize Floyd algorithms and Dijkstra Algorithm solves the problems, such as optimal route in public transit system.
Further, as shown in fig. 7, proposing that the present invention is based on the public transport lines of big data dimension-reduction treatment based on first embodiment Road querying method second embodiment, in the present embodiment, after step S50, the method further includes:
S70:When can not go directly between the initiating station to be found and terminus, based on the most short direct path square Battle array searches target transfer website using enumerative technique, the corresponding target transfer route of the target transfer website be transfer number most Few transfer route.
S80:Traverse the line library, search first line and the second circuit respectively, wherein the first line be based on The circuit to go directly between the most short direct path matrix initiating station determined and target terminal, second circuit are Based on the circuit between the most short direct path matrix target terminal determined and terminus.
In the present embodiment, when two websites can not go directly, enumerative technique may be used, according to most short direct path matrix An optimal solution is found out, all optimal solutions are then found out from line library.
Certainly in actual riding process, it is possible that the case where transfer once can not also reach, needs transfer two Secondary situation can also equally use enumerative technique, obtain the optimal route of transfer twice and looked into it is of course also possible to traverse line library The riding scheme of all transfers twice is found out, provides more selections to the user.
In the concrete realization, if transfer still can not reach twice, user still wants to selection bus trip mode, i.e., such as Fruit wonders 3 details of transfer, then detailed route can be obtained by searching of line library, for example, searching of line library Optimum line between S0442 to the S0624 that obtained transfer is 3 times can be found in table 1.
Table 1
Transfer circuit is found out in line library, then is based on the shortest path matrix, finds out initiating station and terminal Most time saving through route between standing, the most time saving through route between terminal and terminus.
In the present embodiment, when cannot go directly between the initiating station to be found and terminus, it can be obtained by enumerative technique Primary, transfer public bus network of the base to transfer three times twice must be changed to, and can be found out by traversal line library all possible Circuit provides more selections to the user.
Further, as shown in figure 8, proposing that the present invention is based on the public transport lines of big data dimension-reduction treatment based on first embodiment Road querying method 3rd embodiment, in the present embodiment, after step S40, the method further includes:
S90:Based on the most short direct path matrix, using DIJKSTRA algorithms seek the initiating station and terminus it Between the first route, first route is the riding time shortest route sought based on DIJKSTRA algorithms.
Due to establishing the 2-D data of public transit system, in the case where exchange number does not limit, riding time is most Short-circuit line can be solved using DIJKSTRA algorithms.
It is understood that using the circuit that DIJKSTRA algorithms are sought it is that riding time is shortest, but the result calculated May be the more public bus network of number of transfer, although theoretically, the riding time of this result is shortest, transfer The more situation of number can also cause many troubles to passenger, so this riding scheme and impracticable.
In order to overcome the problems, such as that number of transfer is more, trip is troublesome, it can be based on the most short direct path matrix, pass through increasing The time weighting for adding transfer seeks the route between the initiating station and terminus using DIJKSTRA algorithms, it will be understood that increases Add the calculated route of the weighted value of transfer time shorter than the route transfer time of initial calculation, certainly, the transfer time Weight is bigger, and the number of transfer of calculated route is fewer, but the weight of transfer time has been added to a certain degree, such as After increasing 10,30 or even 50, calculated route still will be changed to twice or thrice, illustrate two websites to be found it Between cannot go directly or the less route of number of transfer cannot be found out, then can terminate calculating, need not be further continued for increasing and change Weight between taking the opportunity.
In the concrete realization, the factor that passenger considers is different, and the demand to riding route is also different, and some passengers pay no attention to Number of transfer only considers that riding time, some passengers then wish that a road for using number of transfer minimum, another part passenger may Compromise considers two factors of riding time and number of transfer, based on the most short direct path matrix, by change transfer when Between weighted value, so that it may to seek different riding schemes using DIJKSTRA algorithms, more selections are provided for passenger.Based on not Same transfer time weighted value, different riding schemes can be obtained by DIJKSTRA algorithms, for details, reference can be made to Fig. 9, Figure 10 And Figure 11.
In the present embodiment, due to will indicate that the three-dimensional data of public transit system is reduced to 2-D data, so as to so that DIJKSTRA algorithms are applied in the route optimal solution calculating of public transit system, and the time weighting value by changing transfer, just It can utilize DIJKSTRA algorithms that can provide more routes to the user alternatively, facilitate passenger's trip, raising multiplies Visitor's experiences by bus.
Further, as shown in figure 12, propose that the present invention is based on the public transport of big data dimension-reduction treatment based on first embodiment Circuit query method fourth embodiment, in the present embodiment, after step S40, the method further includes:
S100:Based on the most short direct path matrix, routing square corresponding with the most short direct path matrix is generated Battle array.
It is understood that DIJKSTRA algorithms and FLOYD algorithms are all classical shortest path firsts, the difference of the two It is, DIJKSTRA algorithms are a kind of single source path algorithms, for calculating a vertex to remaining each vertex in two-dimensional matrix The calculating basis of shortest path first, the algorithm is shortest path matrix;FLOYD algorithms are a kind of multi-source routing algorithms, are used for The shortest path first on any two vertex in two-dimensional matrix is calculated, the calculating basis of the algorithm is route matrix.Therefore, to The optimal solution of public bus network is sought by FLOYD algorithms, then needs to calculate route matrix.
S110:Based on the route matrix, the third road between the initiating station and terminus is sought using FLOYD algorithms Line, the third route are the riding time shortest route sought based on FLOYD algorithms.
It should be noted that being although that riding time is shortest, but it may based on the calculated route of FLOYD algorithms Need more number of transfer.
In the concrete realization, by increasing the time weighting of transfer, weight route matrix is calculated, FLOYD algorithms are utilized The minimum circuit of number of transfer, same initiating station and terminus are found out, based on different route matrixs, as a result difference is very big, For details, reference can be made to Figure 13 and Figure 14.
In the present embodiment, due to will indicate that the three-dimensional data of public transit system is reduced to 2-D data, so as to so that FLOYD Algorithm is applied in the route optimal solution calculating of public transit system, and riding time shortest line can be sought out based on route matrix Road can seek out the minimum circuit of number of transfer based on weight route matrix, provide a variety of choice for traveling for passenger, raising multiplies Visitor's experiences by bus.
It should be noted that herein, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that process, method, article or system including a series of elements include not only those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including this There is also other identical elements in the process of element, method, article or system.
The embodiments of the present invention are for illustration only, can not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical scheme of the present invention substantially in other words does the prior art Going out the part of contribution can be expressed in the form of software products, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disc, CD), including some instructions use so that a station terminal equipment (can be mobile phone, Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
It these are only the preferred embodiment of the present invention, be not intended to limit the scope of the invention, it is every to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (9)

1. a kind of bus line inquiry method based on big data dimension-reduction treatment, which is characterized in that the method includes following steps Suddenly:
Obtain all circuits of public transit system;
Circuit based on acquisition establishes line library, and the line library is preserved into default storage unit;
Count each site information in the line library stored in the default storage unit;
Based on the site information, the most short direct path matrix between website in the line library is established;
When receiving circuit query request, based on the most short direct path matrix, determine initiating station to be found and terminus it Between can go directly;
When can go directly between the initiating station to be found and terminus, searched in the line library based on described most short straight The most short straightforward line determined up to path matrix.
2. the method as described in claim 1, which is characterized in that the line library stored in the statistics default storage unit In each site information, specifically include:
The line library is traversed, the targeted sites that can be gone directly in the line library are searched and can be made between the targeted sites Through all target lines;
Based on the target line, the station number between the targeted sites corresponding with the target line is counted respectively;
Correspondingly, described to be based on the site information, the most short direct path matrix between website in the line library is established, is had Body includes:
Compare the station number, ascertain the number minimum station number;
The most short direct path matrix in the line library between website is established based on the minimum station number of the number.
3. the method as described in claim 1, which is characterized in that it is described when receiving circuit query request, based on described most short Can direct path matrix determine after going directly between initiating station to be found and terminus, the method further includes:
When can not go directly between the initiating station to be found and terminus, based on the most short direct path matrix, utilize Enumerative technique searches target transfer website, and the corresponding target transfer route of the target transfer website is the minimum transfer of transfer number Route;
The line library is traversed, searches first line and the second circuit respectively, wherein the first line is based on described most short The circuit to go directly between the initiating station and target terminal that direct path matrix determines, second circuit are based on described Circuit between the most short direct path matrix target terminal determined and terminus.
4. the method as described in claim 1, which is characterized in that it is described to be based on the site information, it establishes in the line library After most short direct path matrix between website, the method further includes:
Based on the most short direct path matrix, first between the initiating station and terminus is sought using DIJKSTRA algorithms Route, first route are the riding time shortest route sought based on DIJKSTRA algorithms.
5. method as claimed in claim 4, which is characterized in that it is described based on the most short direct path matrix, it utilizes DIJKSTRA algorithms seek the first route between the initiating station and terminus, and first route is that riding time is shortest After route, the method further includes:
Based on the most short direct path matrix, by increasing the time weighting of transfer, sought using DIJKSTRA algorithms described The second route between initiating station and terminus, the number of transfer of the number of transfer of second route than first route It is few.
6. the method as described in claim 1, which is characterized in that it is described to be based on the site information, it establishes in the line library Most short direct path matrix between website, the shortest path matrix is after two-dimensional matrix, the method further includes:
Based on the most short direct path matrix, route matrix corresponding with the most short direct path matrix is generated;
Based on the route matrix, the third route between the initiating station and terminus is sought using FLOYD algorithms, described Three-route is the riding time shortest route sought based on FLOYD algorithms.
7. method as claimed in claim 6, which is characterized in that it is described to be based on the route matrix, it is sought using FLOYD algorithms Third route between the initiating station and terminus, the third route be riding time for being sought based on FLOYD algorithms most Short route, specifically includes:
It is generated and the most short direct path square based on the most short direct path matrix by increasing the time weighting of transfer The corresponding weight route matrix of battle array;
Based on the weight route matrix, the 4th route between the initiating station and terminus, institute are sought using FLOYD algorithms The number of transfer for stating the 4th route is fewer than the number of transfer of the third route.
8. the method as described in claim 1, which is characterized in that described in the website start site to be found and terminus point Between there are circuit library lookup circuit corresponding with the through route when through route, is traversed after, the method is also Including:
The line library is traversed, all circuits that the initiating station can be made to go directly with terminus are found out.
9. a kind of query facility, which is characterized in that the query facility includes:Memory, processor and it is stored in the storage It is described based on big number on device and the public bus network polling routine based on big data dimension-reduction treatment that can run on the processor It is arranged for carrying out according to the public bus network polling routine of dimension-reduction treatment and is based on big data as described in any item of the claim 1 to 8 The step of bus line inquiry method of dimension-reduction treatment.
CN201810351310.6A 2018-04-18 2018-04-18 Bus line inquiry method based on big data dimension-reduction treatment and query facility Pending CN108491556A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810351310.6A CN108491556A (en) 2018-04-18 2018-04-18 Bus line inquiry method based on big data dimension-reduction treatment and query facility

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810351310.6A CN108491556A (en) 2018-04-18 2018-04-18 Bus line inquiry method based on big data dimension-reduction treatment and query facility

Publications (1)

Publication Number Publication Date
CN108491556A true CN108491556A (en) 2018-09-04

Family

ID=63313684

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810351310.6A Pending CN108491556A (en) 2018-04-18 2018-04-18 Bus line inquiry method based on big data dimension-reduction treatment and query facility

Country Status (1)

Country Link
CN (1) CN108491556A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109492111A (en) * 2018-09-19 2019-03-19 平安科技(深圳)有限公司 Shortest path query method, system, computer equipment and storage medium
CN109670049A (en) * 2018-11-19 2019-04-23 平安科技(深圳)有限公司 Map path query method, apparatus, computer equipment and storage medium
CN109726262A (en) * 2019-01-10 2019-05-07 武汉轻工大学 Querying method, device, terminal device and the readable storage medium storing program for executing of public bus network
CN113505316A (en) * 2021-09-10 2021-10-15 南通飞旋智能科技有限公司 Bus route recommendation method and system based on artificial intelligence

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105023426A (en) * 2015-05-18 2015-11-04 南京邮电大学 Urban public transport route selection method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105023426A (en) * 2015-05-18 2015-11-04 南京邮电大学 Urban public transport route selection method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
朱凯: "多维智能floyd算法的研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
王防修: "Dijkstra算法在智能公交查询系统中的应用", 《武汉工业学院学报》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109492111A (en) * 2018-09-19 2019-03-19 平安科技(深圳)有限公司 Shortest path query method, system, computer equipment and storage medium
CN109670049A (en) * 2018-11-19 2019-04-23 平安科技(深圳)有限公司 Map path query method, apparatus, computer equipment and storage medium
CN109726262A (en) * 2019-01-10 2019-05-07 武汉轻工大学 Querying method, device, terminal device and the readable storage medium storing program for executing of public bus network
CN109726262B (en) * 2019-01-10 2020-12-25 武汉轻工大学 Bus route query method and device, terminal device and readable storage medium
CN113505316A (en) * 2021-09-10 2021-10-15 南通飞旋智能科技有限公司 Bus route recommendation method and system based on artificial intelligence
CN113505316B (en) * 2021-09-10 2021-11-16 南通飞旋智能科技有限公司 Bus route recommendation method and system based on artificial intelligence

Similar Documents

Publication Publication Date Title
CN108491556A (en) Bus line inquiry method based on big data dimension-reduction treatment and query facility
CN110401973A (en) Network search method and device, terminal, storage medium
US9080890B2 (en) Method and system for obtaining destination information from proximate devices based on time and heading information
CN102538806B (en) A kind of paths planning method and relevant device
CN103376117B (en) A kind of information search method, system and GPS navigation server
CN106973150B (en) Positioning accuracy level adjustment method, device and mobile terminal
US20070011145A1 (en) System and method for operation control functionality
US20120124039A1 (en) Online Search Based On Geography Tagged Recommendations
JP2014021652A (en) Information sharing system, information sharing method, and terminal device
CN109489674B (en) Method, device and storage medium for determining road section based on position
CN102867031A (en) Method and system for optimizing point of interest (POI) searching results, mobile terminal and server
US10317238B2 (en) Navigation system with ranking mechanism and method of operation thereof
CN107687856A (en) Air navigation aid, terminal and computer-readable storage medium based on electronic map
CN109084795A (en) The method and device of search service facility based on Map Services
US20200141759A1 (en) Using Major Route Decision Points to Select Traffic Cameras for Display
CN109345001A (en) The unbalance method of adjustment of shared bicycle website and system based on Pareto multiobjective selection
JP2014021654A (en) Information sharing system, information sharing method, and terminal device
CN107807922A (en) Method and apparatus for determining party venue
CN108268504A (en) A kind of method and apparatus for the region of search for dividing point of interest
CN111882109A (en) Order allocation method and system
KR20020084716A (en) Method and system serving for navigation and parking information via network
CN113139139A (en) Method, apparatus, electronic device, and medium for determining boarding point
CN105939388B (en) A kind of method and content controller of transmission service content
Liu et al. Gravitational field routing strategy considering the distribution of traffic flow
CN107504973A (en) Based on the preferential navigation terminal of arcade shop premises

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20180904

RJ01 Rejection of invention patent application after publication