A method for calculating subway transfer passenger flow based on electronic map application program interface

By using the electronic map API and subway AFC data, multiple databases are constructed and associated, and the problems of complexity and deviation of subway transfer passenger flow calculation in the existing technology are solved, and efficient and accurate passenger flow calculation is achieved.

CN118708825BActive Publication Date: 2025-02-11SHANDONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411188543.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2025-02-11
Estimated Expiration
2044-08-28

AI Technical Summary

Technical Problem

There is a lack of a unified calculation method in the prior art to determine the flow of subway passengers. The existing methods have problems such as computational complexity, large deviations, high costs and data accuracy dependence on equipment and manpower.

Method used

Using the electronic map API method, we use the site combination database, latitude and longitude database and trajectory transfer point database, combined with subway AFC data, correlation matching and trajectory correction are performed to count the transfer passenger flow of subway stations.

Benefits of technology

It achieves concise calculations, conform to most travel habits, low operating costs, and accurate calculation results, improving the efficiency and accuracy of subway transfer passenger flow calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118708825B_ABST
    Figure CN118708825B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for calculating subway transfer passenger flow based on an electronic map application program interface, which belongs to the field of public transportation technology. The method forms a station combination database by traversing and combining urban subway stations; obtains the station latitude and longitude and the station POI ID through the electronic map API according to the subway station name, builds a station latitude and longitude combination database, and then obtains the trajectory route and trajectory time through the electronic map API according to the database to determine the transfer point. Travel samples are identified in the subway AFC data, and the trajectory is corrected by the relative error between the sample travel time and the trajectory time, and then the travel sample is associated and matched with the path transfer point, and the trajectory is backtracked to obtain the transfer passenger flow and statistical indicators. The present invention has a small amount of calculation and simple operation steps, and at the same time does not rely too much on video equipment and staff, has higher accuracy, lower cost, and the obtained results are closer to reality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of public transportation, and in particular relates to a method for calculating subway transfer passenger flow based on an electronic map application program interface. Background Art

[0002] In recent years, with the rapid development of rail transit, theoretical research on the probability of passengers choosing each path, passenger flow distribution, and the flow and direction of transfer passengers will help to accurately grasp the operating efficiency of the rail transit network and judge the passenger flow distribution rules, so as to adjust the train operation plan in time and improve the operational service level of urban rail transit.

[0003] At present, the passenger flow of the starting and ending points can be easily obtained through ticket purchase, card swiping, code scanning, etc. at the gate in and out data, but there is no unified calculation method for determining the transfer volume. The existing methods for determining the transfer passenger flow mainly include network model method (such as minimum transfer method, shortest path method, passenger flow classification model, etc.), machine vision method and GPS (Global Positioning System) positioning analysis method. Among them, the network model method mainly calculates the transfer passenger flow by adding constraints and constructing a calculation model. However, many constraints make the calculation model more and more complicated. At the same time, the subjectivity of establishing the constraints of this method may lead to large deviations; the machine vision method mainly uses video equipment such as high-definition cameras or face recognition equipment to extract key information from the video through computer vision algorithms to determine the flow direction of passengers and then the number of transfer passengers at the station. This method has too high requirements on the transfer station environment and requires huge manpower and material resources. It is too expensive, and the data accuracy is highly dependent on the collection equipment and staff, with large errors; the GPS positioning analysis method is an advanced and efficient method for determining the transfer passenger flow. It mainly determines the user's stay time and movement trajectory near the subway transfer station by analyzing the user's GPS positioning data. However, this method first involves data privacy issues, and secondly, the data source and collection method may be biased due to geographical reasons.

[0004] In recent years, with the application of intelligent technology in the field of transportation, the advantages of electronic map APP (Application) represented by Amap in user travel have become more and more obvious. The method of obtaining user trajectories through electronic maps conforms to the travel habits of most users. At the same time, the API (Application Programming Interface) of electronic maps is free to obtain, and its cost requirement is less than other technical solutions. It has the advantages of small calculation amount, simple steps and operation, accurate results, and can obtain full-mode and full-sample transfer points. The present invention is a calculation method for calculating rail transit transfer passenger flow based on electronic map API. Summary of the invention

[0005] In view of the above problems existing in the prior art, the present invention proposes a method for calculating subway transfer passenger flow based on an electronic map application program interface, which has a reasonable design, solves the shortcomings of the prior art, and has good effects.

[0006] A method for calculating subway transfer passenger flow based on an electronic map application program interface comprises the following steps:

[0007] S1: According to the subway station information table, the stations are traversed and combined to obtain all station combinations, and a station combination database is constructed, which is recorded as DatabaseA;

[0008] S2: Obtain the longitude and latitude of the site and build a longitude and latitude database, recorded as DatabaseB;

[0009] S3: Associating the obtained site combination database DatabaseA with the obtained latitude and longitude database DatabaseB, that is, matching the site combination with the site longitude and latitude, to obtain a site longitude and latitude combination database, recorded as DatabaseC;

[0010] S4: According to the database DatabaseC, through the electronic map API, obtain the navigation trajectories in five different modes based on the shortest travel time mode, the shortest travel distance mode, the least transfer mode, the least walking mode, and the subway map mode, and extract the trajectory of only taking the subway and the trajectory time, which are recorded as the trajectory transfer point database DatabaseD;

[0011] S5: Based on the data of the subway automatic ticket vending and checking system AFC, and the entry and exit stations and card swiping time data of the travel samples, the starting point, end point, starting point transaction time, end point transaction time and transaction date of all travel samples are obtained, and a travel sample database is constructed, recorded as DatabaseE, and the travel time of the travel samples is calculated. ;

[0012] S6: Database E is associated with the trajectory transfer point database Database D, and the travel time of the travel sample is used to match Perform trajectory correction and determine the travel sample transfer point database;

[0013] S7: According to the database Database, the passenger transfer flow of each subway station within a period of time is counted.

[0014] Furthermore, the S2 comprises the following sub-steps:

[0015] S21: According to the electronic map geocoding API, determine the base URL, that is, the geocoding API service address;

[0016] S22: Determine necessary parameters and constrain query conditions; specifically:

[0017] Determine the request parameter city, that is, the city code;

[0018] Determine the request parameter key, that is, the KEY value of the electronic map route planning function. This parameter is applied after registering the electronic map open platform;

[0019] Determine the request parameter address, that is, the station name, and specify the query type as subway station. The station name is obtained from the subway station information table, which includes the names and station codes of all completed subway stations in the city.

[0020] S23: concatenate the request parameters city, key and address into a complete URL, create an HTTP request, send the request and get a response;

[0021] S24: read the data returned by the HTTP request, and parse and extract the longitude and latitude of the site and the POI ID of the site;

[0022] S25: Export the extracted site longitude and latitude and site POI ID data into a table file and perform format processing, which is recorded as the longitude and latitude database Database B.

[0023] Furthermore, the S4 comprises the following sub-steps:

[0024] S41: Determine the URL of the bus route planning API interface through the electronic map API, that is, the bus route planning API service address;

[0025] S42: Determine necessary parameters and constrain query conditions; specifically:

[0026] Determine the request parameter key, that is, the KEY value of the electronic map route planning function;

[0027] Determine the request parameters origin and destination, that is, the latitude and longitude of the starting point and the latitude and longitude of the end point. The parameters are stored in the site longitude and latitude combination database DatabaseC;

[0028] Determine the request parameters originpoi and destinationpoi, that is, the starting POI ID and the ending POI ID, which are stored in the site latitude and longitude combination database DatabaseC;

[0029] Determine the request parameters ad1 and ad2, that is, the cities where the starting point and the end point are located. For details, refer to the administrative area code table;

[0030] Determine the request parameter strategy, that is, the public transportation transfer strategy. The selected public transportation transfer strategies include the shortest travel time mode, the shortest travel distance mode, the least transfer mode, the least walking mode, and the subway map mode, which are used to constrain the search planning standards and obtain trajectories under different modes;

[0031] S43: concatenate the request parameters key, origin, destination, originpoi, destinationpoi, ad1, ad2, and strategy into a complete URL, create an HTTP request, send the request, and obtain a response;

[0032] S44: Receive the data returned by the HTTP request, filter out the trajectory information except for the subway mode, and extract the transfer point, trajectory time and riding line of the returned trajectory. The trajectory time corresponding to the subway map mode is recorded as The trajectory times corresponding to the shortest travel time mode, the most economical mode, the least transfer mode, and the least walking mode are , , , ;

[0033] S45: Export the extracted data into a corresponding table file and unify all path formats, which is recorded as the trajectory transfer point database DatabaseD.

[0034] Furthermore, the S5 comprises the following sub-steps:

[0035] S51: construct an original database including entry and exit times and entry and exit station codes through the subway AFC data provided by the subway operation service provider;

[0036] S52: Clean and filter the data in the original database, desensitize the user information, build a valid database, extract the start and end point coding information in the valid database, desensitize it, and then obtain the start and end point names of the travel samples, extract the start point, end point, start point transaction time, end point transaction time and transaction date, and build a travel sample database DatabaseE;

[0037] S53: Calculate the travel time of each sample, the expression is:

[0038] ;

[0039] in, is the travel time of the sample, is the departure time of the sample, is the sample’s entry time.

[0040] Furthermore, the S6 comprises the following sub-steps:

[0041] S61: Match the trajectory in the subway map mode with the travel sample database DatabaseE;

[0042] S62: The relative error between each sample travel time and the trajectory time under the five modes is ,in Pick ; First, calculate the relative error between each sample travel time and the trajectory time in the subway map mode ,like , use the trajectory in the subway map mode to extract the transfer points of the trajectory; otherwise, calculate the relative error in other modes and pass Get the trajectory in the corresponding mode and extract the transfer point of the trajectory;

[0043] in The expression is:

[0044] ;

[0045] in, represents the travel time under different modes, Pick .

[0046] S63: Match the corrected trajectory with the travel sample database DatabaseE, extract the transfer points of the trajectory, and construct the database Database.

[0047] Beneficial technical effects brought by the present invention:

[0048] The present invention constructs a travel navigation route database through an electronic map API to determine the path transfer station. It does not require too many constraint indicators and calculation models, and the calculation is simple and in line with the travel habits of most people. The travel OD sample is identified from the subway AFC data, and the constructed travel navigation route database is used to associate and match the identified travel OD sample. It does not rely on video equipment and staff, and has low operating costs and saves manpower and material resources. The subway AFC data source is through the subway gate, including the full sample travel population and all-mode travel types. Its data characteristics avoid the bias of GPS positioning, making the calculation results more accurate. The present invention achieves a small amount of calculation and simple operation steps, which improves the efficiency of determining the subway transfer passenger flow; at the same time, it does not rely too much on video equipment and staff, and its path conforms to the travel habits of most users, so that the calculation accuracy of the transfer passenger flow is higher, the cost is lower, and the results are closer to reality. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1This is a data processing process diagram of the subway transfer passenger flow calculation method based on the electronic map API proposed by the present invention.

[0050] Figure 2 This is a flow chart of the method for calculating subway transfer passenger flow based on electronic map API proposed by the present invention.

[0051] Figure 3 This is a flow chart of obtaining site longitude and latitude based on electronic map API proposed by the present invention.

[0052] Figure 4 This is a flowchart of obtaining navigation tracks based on the electronic map API proposed by the present invention.

[0053] Figure 5 This is a diagram of the computing architecture of Example 1 proposed in the present invention. DETAILED DESCRIPTION

[0054] The specific implementation of the present invention is further described below in conjunction with specific embodiments:

[0055] A method for calculating subway transfer passenger flow based on electronic map application program interface, such as Figure 1 and Figure 2 As shown, the following steps are included:

[0056] S1: According to the subway station information table, the stations are traversed and combined to obtain all station combinations, and a station combination database is constructed, which is recorded as DatabaseA;

[0057] According to the statistics of subway station information in different cities, a subway station information table is constructed;

[0058] According to the subway station information table, all stations are traversed and combined, that is, the combination between every two subway stations is output, and the station combination database DatabaseA is constructed, as shown in Table 1;

[0059] Table 1 Main fields of DatabaseA

[0060] ;

[0061] S2: Obtain the longitude and latitude of the site and build a longitude and latitude database, recorded as DatabaseB;

[0062] like Figure 3 As shown, S2 includes the following sub-steps:

[0063] S21: According to the electronic map geocoding API, determine the base URL (Uniform Resource Locator, Chinese called uniform resource locator), that is, the geocoding API service address;

[0064] S22: Determine necessary parameters and constrain query conditions; specifically:

[0065] Determine the request parameter city, that is, the city code. Use the city code to specify the query city and further restrict the search range. This information can be obtained by referring to the city code table.

[0066] Determine the request parameter key, that is, the KEY value of the electronic map route planning function. This parameter is applied after registering the electronic map open platform;

[0067] Determine the request parameter address, that is, the station name, and specify the query type as subway station. The station name is obtained from the subway station information table, which includes the names and station codes of all completed subway stations in the city.

[0068] Determine whether the site information is correct, that is, whether the site can be found normally. If it cannot be found, modify the site information or delete the information;

[0069] S23: concatenate the request parameters city, key and address into a complete URL, create an HTTP request, send the request and get a response;

[0070] S24: read the data returned by the HTTP request, and parse and extract the longitude and latitude of the site and the POI ID (Point of Interest Identifier) ​​of the site, as shown in Table 2;

[0071] Table 2 Main fields of returned data

[0072] ;

[0073] S25: The extracted site longitude and latitude and site POI ID data are exported to a table file and formatted, and the Location in the returned data is segmented and recorded as a longitude and latitude database Database B, where the main fields include site name, site POI ID, longitude and latitude.

[0074] S3: Associating the obtained site combination database DatabaseA with the obtained latitude and longitude database DatabaseB, that is, matching the site combination with the site longitude and latitude, to obtain a site longitude and latitude combination database, recorded as DatabaseC, as shown in Table 3;

[0075] Table 3 DatabaseC sample table

[0076] ;

[0077] S4: According to the database DatabaseC, through the electronic map API, obtain the navigation trajectories in five different modes based on the shortest travel time mode, the shortest travel distance mode, the least transfer mode, the least walking mode, and the subway map mode, and extract the trajectory of only taking the subway and the trajectory time, which are recorded as the trajectory transfer point database DatabaseD;

[0078] like Figure 4 As shown, S4 includes the following sub-steps:

[0079] S41: Determine the URL of the bus route planning API interface through the electronic map API, that is, the bus route planning API service address ;

[0080] S42: Determine necessary parameters and constrain query conditions; specifically:

[0081] Determine the request parameter key, that is, the KEY value of the electronic map route planning function;

[0082] Determine the request parameters origin and destination, that is, the latitude and longitude of the starting point and the latitude and longitude of the end point. The parameters are stored in the site longitude and latitude combination database DatabaseC;

[0083] Determine the request parameters originpoi and destinationpoi, that is, the starting POI ID and the ending POI ID, which are stored in the site latitude and longitude combination database DatabaseC;

[0084] Determine the request parameters ad1 and ad2, that is, the cities where the starting point and the end point are located (this parameter only supports adcode). For details, refer to the administrative area code table;

[0085] Determine the request parameter strategy, that is, the public transportation transfer strategy. The selected public transportation transfer strategies include the shortest travel time mode, the shortest travel distance mode, the least transfer mode, the least walking mode, and the subway map mode, which are used to constrain the search planning standards and obtain trajectories under different modes;

[0086] The public transportation transfer strategies in electronic maps (such as Amap) are shown in Table 4:

[0087] Table 4 Public transport transfer strategy

[0088]

[0089] The parameters origin and destination, and the parameters originpoi and destinationpoi are all located in the database DatabaseC, so you only need to import the database to obtain the parameters.

[0090] S43: concatenate the request parameters key, origin, destination, originpoi, destinationpoi, ad1, ad2, and strategy into a complete URL, create an HTTP request, send the request, and obtain a response;

[0091] S44: Receive the data returned by the HTTP request, filter out the trajectory information except for the subway mode, and extract the transfer point and trajectory time of the returned trajectory. Only extract the trajectory information of a pair of start and end points each time, return to step S42, and obtain the start and end point information of the next column of data until all the trajectory information consisting of the start and end points in DatabaseC is extracted; record the trajectory time corresponding to the subway map mode as The trajectory times corresponding to the shortest travel time mode, the most economical mode, the least transfer mode, and the least walking mode are , , , ; The specific process is:

[0092] The returned data is parsed using the json function, the information is assigned to the corresponding spreadsheets, and the trajectory information other than the subway mode is filtered out, which is recorded as the navigation route database D5;

[0093] From the obtained navigation route database D5, it can be seen that the data has the following three forms:

[0094] (1) No need to transfer, you can reach the destination by taking only one line;

[0095] (2) Transfer once: After taking the first line to the transfer station, transfer to the second line from the transfer station and finally reach the destination;

[0096] (3) Multiple transfers: After taking the first line and reaching the first transfer station, transfer to the second line from the transfer station, and so on, with multiple transfers, until finally reaching the destination;

[0097] S45, extracting the starting point, end point, transfer station, trajectory time and riding route in D5, exporting the extracted data field form into a corresponding table file and unifying all path formats, recorded as trajectory transfer point DatabaseD, as shown in Table 5;

[0098] Table 5 DatabaseD data field format

[0099] ;

[0100] S5: Based on the data of the subway automatic ticket vending and checking system AFC, and the entry and exit stations and card swiping time data of the travel samples, the starting point, end point, starting point transaction time, end point transaction time and transaction date of all travel samples are obtained, and a travel sample database is constructed, recorded as DatabaseE, and the travel time of the travel samples is calculated. ;

[0101] S5 includes the following sub-steps:

[0102] S51: The subway AFC data provided by the subway operation service provider is desensitized to add a unique number to each sample, and an original database including entry and exit time and entry and exit station codes is constructed, which is recorded as Database0, as shown in Table 6;

[0103] Table 6 Database0 main fields

[0104] ;

[0105] S52: First, the data in the original database is cleaned and screened;

[0106] In subway AFC data, the following invalid data types may appear:

[0107] (1) Data whose exit time is earlier than the entry time;

[0108] (2) The data of the inbound station and the outbound station are the same;

[0109] (3) Data outside the subway line operating hours;

[0110] (4) The card swipe data encoding for entering and exiting the station cannot match the data of the actual subway station;

[0111] (5) Data on travel time that exceeds 4 hours will be considered invalid.

[0112] After filtering out invalid data and desensitizing user information, a valid database is obtained, which is recorded as Database1. The main fields of Database1 include transaction date, transaction station, last transaction station, transaction time, last transaction time, transaction type, ticket type, and desensitized ticket number.

[0113] The start and end point coding information in the valid database Database1 is extracted and desensitized to obtain the start and end point names of the travel samples, and useless information is filtered out to obtain the travel sample database DatabaseE. The main fields include the start point, end point, start point transaction time, end point transaction time and transaction date; among them, the end point and start point are the transaction station and the last transaction station, and the end point transaction time and the start point transaction time are the transaction time and the last transaction time.

[0114] S53: Calculate the travel time of each sample, the expression is:

[0115] ;

[0116] in, is the travel time of the sample, is the departure time of the sample, is the sample’s entry time.

[0117] S6: Database E is associated with the trajectory transfer point database Database D, and the travel time of the travel sample is used to match Perform trajectory correction and determine the travel sample transfer point database;

[0118] S6 includes the following sub-steps:

[0119] S61: Since the trajectory output by the subway map mode must be a subway route, the trajectory in the subway map mode is matched with the travel sample database DatabaseE;

[0120] S62: The relative error between each sample travel time and the trajectory time under the five modes is ,in Pick ; First, calculate the relative error between each sample travel time and the trajectory time in the subway map mode ,like , use the trajectory in the subway map mode to extract the transfer points of the trajectory; otherwise, calculate the relative error in other modes and pass Get the trajectory in the corresponding mode and extract the transfer point of the trajectory;

[0121] in The expression is:

[0122] ;

[0123] in, represents the travel time under different modes, Pick .

[0124] S63: Match the corrected trajectory with the travel sample database DatabaseE, extract the transfer points of the route trajectory, and construct the database Database.

[0125] S7: Count the passenger transfer flow at each subway station within a period of time according to the database Database;

[0126] In addition, the passenger flow of each station can be counted as follows:

[0127] ;

[0128] in is the passenger flow of a station, is the number of inbound traffic to the site, The number of transfers for this station;

[0129] The passenger flow of each line is:

[0130] ;

[0131] in, is the passenger flow of a certain route, For the The passenger flow of each station, is the number of stations on a certain line.

[0132] Example 1: The electronic map used in this example is Amap, such as Figure 5 As shown in the figure, the above-mentioned subway transfer passenger flow calculation method based on Amap API is divided into three parts:

[0133] 1. Navigation track acquisition part

[0134] 1): Build a travel origin and destination database in Qingdao. Through the Qingdao subway station information table, traverse the combination, generate station combinations, and build a station combination set, that is, output the combination between all subway stations, and record it as Qingdao station combination database DatabaseA.

[0135] The main fields of Qingdao City Station Combination Database DatabaseA are the starting point and the end point, and the main fields of Qingdao City Metro Station Information Table are the station code and the Chinese name of the station.

[0136] 2): According to the Amap Geocoding API, determine the base URL, i.e. the Geocoding API service address (https: / / restapi.amap.com / v3 / geocode / geo?parameters).

[0137] Determine the necessary parameters and constrain the query conditions:

[0138] (1) Request parameter city, i.e. city code: 370020;

[0139] (2) Request parameter key, that is, obtain the KEY value of the Amap route planning function. This parameter is applied after registering the Amap open platform;

[0140] (3) The request parameter address, i.e. the station name, needs to specify the query type as subway station. The station name is obtained through the Qingdao subway station information table.

[0141] Upload the parameters city, key, and address to the URL and concatenate the complete URL; create an HTTP request, send the request and get a response. Use the request module to send HTTP requests such as GET and POST. The request method used in this embodiment is GET.

[0142] Read the data returned by the HTTP request, parse and extract the longitude and latitude of the station and the POI ID of the station; the returned result is a JSON data structure, and the name, id, location and other information need to be extracted from the returned result, and then add this information to the spreadsheet for output, so as to obtain the POI (point of interest), which is recorded as database D1, as shown in Table 7;

[0143] Table 7 Partial data of database D1

[0144] ;

[0145] The extracted database D1 table file is formatted to obtain a more easily processable site longitude and latitude database, which is recorded as Qingdao site longitude and latitude database Database B; the processed data fields include site name, site POIID, longitude and latitude, as shown in Table 8;

[0146] Table 8 Partial data of Qingdao station latitude and longitude database Database B

[0147] ;

[0148] 3): Associate and match Qingdao site combination database DatabaseA with Qingdao site latitude and longitude database DatabaseB to build Qingdao site latitude and longitude combination database DatabaseC, which contains request parameters origin and destination, originpoi and destinationpoi, as shown in Table 9;

[0149] Table 9 Partial data of Qingdao station latitude and longitude combination database Database C

[0150] ;

[0151] 4): Determine the URL of the bus route planning API interface through the Amap API, that is, the bus route planning API service address (https: / / restapi.amap.com / v5 / direction / transit / integrated?parameters);

[0152] Determine the necessary parameters and constrain the query conditions:

[0153] Determine the request parameter key, that is, the KEY value of the electronic map route planning function;

[0154] Determine the request parameters ad1 and ad2, that is, the cities of the starting point and the end point (this parameter only supports adcode): 370020;

[0155] Determine the request parameter strategy, i.e., the public transportation transfer strategy. The selected public transportation transfer strategies include the shortest travel time mode, the shortest travel distance mode, the least transfer mode, the least walking mode, and the subway map mode, which are used to constrain the search planning criteria and thus obtain trajectories under different modes;

[0156] Upload the parameters key, origin and destination, originpoi and destinationpoi, ad1 and ad2, and strategy to the URL and concatenate the complete URL;

[0157] Create an HTTP request, send the request and get a response; receive the data returned by the HTTP request (JSON or XML format), extract information from the nested dictionary, and then assign this information to a specific cell in the spreadsheet (use the json function to parse the data and extract the required field information), recorded as Qingdao navigation route database D5;

[0158] From the database D5 obtained, we can see that the data has the following forms:

[0159] (1) No transfer required; (2) One transfer; (3) Two transfers; (4) Three transfers.

[0160] According to the data statistics of database D5, the field information required for three transfers is the most, so the fields are unified, the starting point, end point, transfer station, trajectory time and riding line in D5 are extracted, and the information is exported to the corresponding table file in a unified format to build the Qingdao trajectory transfer point database DatabaseD, as shown in Table 10;

[0161] Table 10 Partial data of Qingdao City track transfer point database DatabaseD

[0162] ;

[0163] 2. Travel sample identification part

[0164] 1): The AFC data of Qingdao Metro for one week from February 6, 2023 to February 12, 2023 is desensitized to add a unique number to each sample, and the original database Database0 is established, which includes ticket number, transaction time, transaction type (there are 36 types of transactions, and the data contains information on all types of passengers taking the subway on a certain day), transaction station, last transaction station and other information indicators.

[0165] 2): According to the original database Database0, perform data cleaning and preliminary processing on it, and use desensitization technology to blur the user information; filter out the invalid data, and then obtain a valid database, recorded as Database1, as shown in Table 11;

[0166] Table 11 Partial data of Qingdao travel sample valid database Database1

[0167] ;

[0168] 3): Extract the start and end point coding information in the valid database Database1, use the desensitization technology to obtain the names of the start and end points of the travelers, and filter out useless information to obtain the travel sample database DatabaseE, as shown in Table 12;

[0169] Table 12 Partial data of Qingdao travel sample database DatabaseE

[0170] ;

[0171] 4): Calculate the travel time of each sample according to the formula:

[0172] ;

[0173] in, is the travel time of the sample, is the departure time of the sample, is the entry time of the sample.

[0174] 5): Match the trajectory in the subway map mode with the travel sample database DatabaseE;

[0175] 6): The relative error between the travel time of each sample and the trajectory time under the five modes is ,in Pick ; First, calculate the relative error between each sample travel time and the trajectory time in the subway map mode ,like , use the trajectory in the subway map mode to extract the transfer points of the trajectory; otherwise, calculate the relative error in other modes and pass Get the trajectory in the corresponding mode and extract the transfer point of the trajectory;

[0176] in The expression is:

[0177] ;

[0178] in, represents the travel time under different modes, Pick .

[0179] 7): Match the corrected trajectory with the travel sample database DatabaseE, extract the transfer points of the route trajectory, and build the database Database.

[0180] 3. Passenger flow index calculation part

[0181] According to the database, the passenger transfer flow at each subway station within a week is counted.

[0182] In addition, the passenger flow of each station can be counted as follows:

[0183] ;

[0184] in is the passenger flow of a station, is the number of inbound traffic to the site, The number of transfers for this station;

[0185] The passenger flow of each line is:

[0186] ;

[0187] in, is the passenger flow of a certain route, For the The passenger flow of each station, is the number of stations on a certain line.

[0188] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.

Claims

1. A method for calculating subway transfer passenger flow based on an electronic map application program interface, characterized in that: The following steps are involved: S1: According to the subway station information table, the stations are traversed and combined to obtain all station combinations, and a station combination database is constructed, which is recorded as DatabaseA; S2: Obtain the longitude and latitude of the site and build a longitude and latitude database, recorded as DatabaseB; S3: Associating the obtained site combination database DatabaseA with the obtained latitude and longitude database DatabaseB, that is, matching the site combination with the site longitude and latitude, to obtain a site longitude and latitude combination database, recorded as DatabaseC; S4: According to the database DatabaseC, through the electronic map API, obtain the navigation trajectories in five different modes based on the shortest travel time mode, the shortest travel distance mode, the least transfer mode, the least walking mode, and the subway map mode, and extract the trajectory of only taking the subway and the trajectory time, which are recorded as the trajectory transfer point database DatabaseD; S5: Based on the data of the subway automatic ticket vending and checking system AFC, and the entry and exit stations and card swiping time data of the travel samples, the starting point, end point, starting point transaction time, end point transaction time and transaction date of all travel samples are obtained, and a travel sample database is constructed, recorded as DatabaseE, and the travel time of the travel samples is calculated. ; S6: Database E is associated with the trajectory transfer point database Database D, and the travel time of the travel sample is used to match Perform trajectory correction and determine the travel sample transfer point database; S7: Count the passenger transfer flow at each subway station within a period of time according to the database Database; The S2 comprises the following sub-steps: S21: According to the electronic map geocoding API, determine the base URL, that is, the geocoding API service address; S22: Determine necessary parameters and constrain query conditions; specifically: Determine the request parameter city, that is, the city code; Determine the request parameter key, that is, the KEY value of the electronic map route planning function. This parameter is applied after registering the electronic map open platform; Determine the request parameter address, that is, the station name, and specify the query type as subway station. The station name is obtained from the subway station information table, which includes the names and station codes of all completed subway stations in the city. S23: concatenate the request parameters city, key and address into a complete URL, create an HTTP request, send the request and get a response; S24: read the data returned by the HTTP request, and parse and extract the longitude and latitude of the site and the POI ID of the site; S25: exporting the extracted site longitude and latitude and site POI ID data into a table file and formatting it, which is recorded as the longitude and latitude database Database B; The S4 comprises the following sub-steps: S41: Determine the URL of the bus route planning API interface through the electronic map API, that is, the bus route planning API service address; S42: Determine necessary parameters and constrain query conditions; specifically: Determine the request parameter key, that is, the KEY value of the electronic map route planning function; Determine the request parameters origin and destination, that is, the latitude and longitude of the starting point and the latitude and longitude of the end point. The parameters are stored in the site longitude and latitude combination database DatabaseC; Determine the request parameters originpoi and destinationpoi, that is, the starting POI ID and the ending POI ID, which are stored in the site latitude and longitude combination database DatabaseC; Determine the request parameters ad1 and ad2, that is, the cities where the starting point and the end point are located. For details, refer to the administrative area code table; Determine the request parameter strategy, that is, the public transportation transfer strategy. The selected public transportation transfer strategies include the shortest travel time mode, the shortest travel distance mode, the least transfer mode, the least walking mode, and the subway map mode, which are used to constrain the search planning standards and obtain trajectories under different modes; S43: concatenate the request parameters key, origin, destination, originpoi, destinationpoi, ad1, ad2, and strategy into a complete URL, create an HTTP request, send the request, and obtain a response; S44: Receive the data returned by the HTTP request, filter out the trajectory information except for the subway mode, and extract the transfer point, trajectory time and riding line of the returned trajectory. The trajectory time corresponding to the subway map mode is recorded as The trajectory times corresponding to the shortest travel time mode, the most economical mode, the least transfer mode, and the least walking mode are , , , ; S45: exporting the extracted data into a corresponding table file and unifying all path formats, recorded as a trajectory transfer point database DatabaseD; The S5 comprises the following sub-steps: S51: construct an original database including entry and exit times and entry and exit station codes through the subway AFC data provided by the subway operation service provider; S52: Clean and filter the data in the original database, desensitize the user information, build a valid database, extract the start and end point coding information in the valid database, desensitize it, and then obtain the start and end point names of the travel samples, extract the start point, end point, start point transaction time, end point transaction time and transaction date, and build a travel sample database DatabaseE; S53: Calculate the travel time of each sample, the expression is: ; in, is the travel time of the sample, is the departure time of the sample, is the sample’s entry time; The S6 comprises the following sub-steps: S61: Match the trajectory in the subway map mode with the travel sample database DatabaseE; S62: The relative error between each sample travel time and the trajectory time under the five modes is ,in Pick ; First, calculate the relative error between each sample travel time and the trajectory time in the subway map mode ,like , use the trajectory in the subway map mode to extract the transfer points of the trajectory; otherwise, calculate the relative error in other modes and pass Get the trajectory in the corresponding mode and extract the transfer point of the trajectory; in The expression is: ; in, represents the travel time under different modes, Pick ; S63: Match the corrected trajectory with the travel sample database DatabaseE, extract the transfer points of the trajectory, and construct the database Database.

Citation Information

Patent Citations

  • Public transport passenger flow monitoring method and device based on multi-source data and storage medium

    CN111079875A

  • Refined passenger flow prediction method and system for newly opened line of urban rail transit

    CN117408737A