A method for optimizing passenger intermodal transportation system

Through custom .csv format and reverse analysis function calls, the data format of the passenger intermodal transportation system is optimized, the problems of data not universal and slow loading between existing software are solved, and efficient data processing across software is achieved.

CN115186508BActive Publication Date: 2025-08-29CHINA ACAD OF TRANSPORTATION SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210945462.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-08
Publication Date
2025-08-29
Estimated Expiration
2042-08-08

AI Technical Summary

Technical Problem

When existing traffic simulation software builds and loads passenger intermodal transportation data, it is necessary to construct a large amount of non-common data on each software, resulting in huge workload and slow data loading speed, especially inefficient in large-scale scenarios.

Method used

Use custom .csv format tools to edit and store data, reversely analyze the function call stack of traffic simulation software, write plug-ins and Hook functions, realize the unified and optimization of data formats, reduce redundant storage, and improve data loading speed.

Benefits of technology

It realizes the universality of custom data formats in multiple traffic simulation software, greatly reducing data construction costs and loading time, and improving data reading efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115186508B_ABST
    Figure CN115186508B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of transportation technology, and discloses a method for optimizing a passenger intermodal transport system. The present invention first defines a data format that is convenient for reading and loading, specifically using a .csv format tool for visualization operations; then, data is differentiated according to data content, integer data is directly stored in an integer table, and floating-point numbers are stored in a floating-point table; road data and traffic data are split into multiple tabular data, each data being stored sequentially without setting interval data; a tool module is written to match multiple traffic simulation software to support the format data defined in the above steps; then, reverse analysis of the traffic simulation software is performed; and finally, the original system function is called to complete file creation and replacement to match other traffic simulation software. The present invention implements a custom data format that can be applied to all traffic simulation software, thereby conveniently being able to perform simulations in various traffic simulation software, greatly reducing the cost of data construction of the present invention.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of traffic simulation, and in particular to a method for optimizing a passenger intermodal transport system. Background Art

[0002] As an important part of the comprehensive transportation service system, passenger intermodal transport can give full play to the comparative advantages of various passenger transport modes, improve the efficiency of transport combinations and service levels, and is an important entry point for promoting the construction of a strong transportation country. At present, the country's passenger intermodal transport started late, but has developed rapidly. To promote the development of passenger intermodal transport, special actions for passenger intermodal transport should be carried out, the capacity, schedule and information connection of different modes of transport should be promoted, and the development of air-rail, road-rail and other intermodal transport services should be encouraged. Therefore, there are different means of transportation for coordination and connection, as well as calculations and simulations related to capacity. By simulating the present invention, the entire process can be roughly verified, and the connection of the entire process can be optimized. At the same time, by simulating the present invention, it is more convenient to display and demonstrate passenger intermodal transport.

[0003] Currently, in order to optimize passenger intermodal transportation systems, transportation plans are simulated and optimized based on traffic simulation software. There are many existing traffic simulation software, including TESS. SUMO is a free, open-source traffic system simulation software that can achieve micro-control of traffic flow, that is, the route of each vehicle on the road can be individually planned and CityTrafficSimulator.

[0004] Current traffic simulation software has the following problems: Problem 1: Each of the above-mentioned simulation software has its own file format and content. When simulation needs to be performed on a certain software, a large number of data models need to be constructed, including road network data, traffic data, vehicle data, bus-specific data, motor vehicle data, non-motor vehicle data, railway data, aircraft data, etc. These data are not universal in every software, so such data need to be input and constructed in each software, which results in a huge workload.

[0005] Question 2: Since passenger intermodal transport, as an integrated transport service system, requires the construction of a large amount of data, when the amount of data is relatively small, the above-mentioned simulation software is relatively fast in reading data and constructing simulation scenarios. However, when the amount of data in this scenario is particularly large, its reading of data and construction of scenarios is particularly slow, and it takes a very long time to wait. Therefore, a solution is needed that can solve the problem of needing to construct different data in each software, and by constructing the data once, it can serve multiple simulation software. At the same time, the data format is designed to optimize data loading, thereby increasing the data loading speed. Therefore, a method for optimizing the passenger intermodal transport system is needed. Summary of the Invention

[0006] The purpose of the present invention is to provide a method for optimizing the passenger intermodal transport system, to realize a customized data format that is applicable to all traffic simulation software, so that simulation can be easily performed in various traffic simulation software, greatly reducing the cost of data construction.

[0007] The present invention is implemented as follows: a method for optimizing a passenger intermodal transport system; specifically, the method is performed according to the following steps;

[0008] S1: Define a data format that is easy to read and load, specifically using a .csv format tool for visualization operations, including editing road data and traffic data, and saving this data into a .csv file using the TESS software;

[0009] Since the data provided by the TESS software is in .csv format, the present invention reads the contents of the .csv file based on the data file generated by TESS by writing a tool, reads the data therein, and then converts it into the format data customized by the present invention. The data format that needs to be read by the present invention can be viewed through the .csv file. If the present invention needs to be loaded into the program for simulation, the customized format of the present invention can be used, which not only improves the readability of the data but also optimizes the data loading speed.

[0010] S2: Data is divided according to data content. Integer data is directly stored in the integer table, and floating point data is stored in the floating point table. Road data and traffic data are split into multiple tables of data, and each data is stored sequentially without setting interval data.

[0011] S3: Writing a tool module to match various traffic simulation software to support the format data defined in step S1; writing a tool to read all .csv files and store the coordinate information, then searching for all identical coordinates and recording all identical coordinate information. The present invention stores all coordinate information in one file, and only stores one copy of the identical coordinates. The coordinate data is accessed by storing the index information of the coordinates in the original file, which can greatly reduce the storage of identical data.

[0012] S4: Since some traffic simulation software, such as TESS, supports writing an extensible plug-in to add extended functions, the present invention reversely analyzes the traffic simulation software by writing a plug-in, obtains stack information through the system function StackFrame function, and starts analysis from the outermost stack call of the function to improve the analysis speed;

[0013] S5: Call the original system function to complete the file creation and replacement to match other traffic simulation software. Through reverse analysis of its code for reading data format files, the getData function is found through reverse analysis, and then this function is replaced with the module written in step S3 to replace the traffic simulation software to read data files.

[0014] Furthermore, in step S2, since in the traffic simulation software, the coordinate information contains the most data content, and the coordinate information occupies a lot of space and there is a lot of repeated information, that is, one coordinate information may appear in many .csv files, so filling in one coordinate information in each place is relatively redundant. The coordinate information in the road data and traffic data is stored separately in the file. Specifically, an array is used to store all the coordinate data, and the number of each coordinate in the array corresponds to the subscript of the array and records all the same coordinate information. Only one copy of the same coordinate is stored, and the coordinate data is accessed by writing the index information of the stored coordinates.

[0015] Furthermore, in step S4, by hooking the function, all calls of the process to read the file are obtained through the hook, and the file name of each defined file format is specifically judged to determine the call stack information of the function.

[0016] Compared with the prior art, the present invention has the following beneficial effects:

[0017] 1. A custom data format is implemented that is applicable to all traffic simulation software, so that simulation can be easily performed in various traffic simulation software, greatly reducing the cost of data construction of the present invention.

[0018] 2. Based on reverse analysis, the present invention finds the object storing data in the memory of the traffic simulation software.

[0019] 3. The module software of the present invention reads customized data content and reads the data content according to the format of the present invention. When the traffic simulation software is opened, the present invention does not call the original function, but directly reads the customized file of the present invention. After the reading is completed, the present invention directly assigns the value to the storage container vector, thus completing the file reading and assignment operations. Therefore, this method can replace the data format originally supported by the software with the data content in the customized format of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.

[0021] Figure 1 It is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the invention for which protection is sought, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0023] See also Figure 1 , a method for optimizing a passenger intermodal transportation system, specifically performed according to the following steps;

[0024] S1: Define a data format that is easy to read and load, specifically using a .csv format tool for visualization operations, including editing road data and traffic data, and saving this data into a .csv file using the TESS software;

[0025] Since the data provided by the TESS software is in .csv format, the present invention reads the contents of the .csv file based on the data file generated by TESS by writing a tool, reads the data therein, and then converts it into the format data customized by the present invention. The data format that needs to be read by the present invention can be viewed through the .csv file. If the present invention needs to be loaded into the program for simulation, the customized format of the present invention can be used, which not only improves the readability of the data but also optimizes the data loading speed.

[0026] The existing data format provides convenient readability, but it contains redundant information about the data reading speed and the size of the entire data. For example:

[0027] Section ID Section Name Width (m) Inner Point Sequence Left Breakpoint Sequence Right Breakpoint Sequence

[0028] 101 101 10.5(-501.08-915.644)(-503.036-921.93)

[0029] 102 102 10.5(-501.08-915.644)(-503.036-921.93)

[0030] As can be seen from the above data, each data has an identifier, and the data is separated by () brackets. If the above data is stored in the same file, its content is stored in the .csv file in the form of a string for easy reading.

[0031] S2: The present invention distinguishes data according to data content, stores integer data directly into an integer table, and stores floating-point numbers into a floating-point table. Road data and traffic data are split into multiple table data, and each data is stored sequentially without setting interval data.

[0032] In traffic simulation software, the most common data is coordinate information, which occupies a lot of space and contains a lot of duplicate information. That is, one coordinate information may appear in many .csv files. Therefore, it is redundant to fill in a coordinate information in each place. The coordinate information in the road data and traffic data is stored separately in the file. Specifically, an array is used to store all the coordinate data, and the number of each coordinate in the array corresponds to the subscript of the array and records all the same coordinate information. Only one copy of the same coordinate is stored, and the coordinate data is accessed by writing tools to the index information of the stored coordinates. In the coordinate file, all the coordinate information is stored: for example

[0033] -501.08,-915.644

[0034] -502.08,-917.644

[0035] The coordinate information is stored individually, with the information stored closely together, while all floating-point data is stored sequentially. The present invention assumes that two coordinates constitute a group of information when reading. Each coordinate is assigned a sequential number in the present invention: the first coordinate is numbered 1, the second 2, and so on. In the traffic information file, the present invention stores the coordinate information number, so the number is just an integer, which greatly reduces the amount of data.

[0036] When reading a coordinate information file, the present invention reads the entire coordinate file into memory at once and uses an array to store all the coordinate data. Furthermore, the number of each coordinate in the array corresponds to the array index. Therefore, the coordinate information of the present invention does not require a time-consuming query operation, but is directly read with a time complexity of O1.

[0037] The specific implementation is as follows:

[0038] First, the coordinate information of the present invention is 2 floating point numbers, so the present invention defines a data structure to store 2 floating point data. At the same time, if the present invention is 3-dimensional coordinate data, 3 floating point data are used.

[0039] Structpos{Defines a structure that stores coordinate information.

[0040] Floatposx; stores x coordinate information

[0041] Floatposy; stores y coordinate information.}

[0042] Then the present invention defines a vector <pos>Vecposs uses a dynamic array vector container to store all coordinate information.

[0043] By using a pair of coordinate information as an element and storing it in a vector, the present invention can read a pair of coordinate information according to the sequence number. For example, if the traffic data of the present invention needs to read the data with sequence number 6, the present invention can directly access vecposs[6], which is the data required by the present invention.

[0044] The present invention stores the coordinate information in the above format, and for other information, the present invention only stores the data content, does not store the data description and format information, and stores the data in sequence, which can greatly save data storage space.

[0045] S3: Writing a tool module to match various traffic simulation software to support the format data defined in step S1; writing a tool to read all .csv files and store the coordinate information, then searching for all identical coordinates and recording all identical coordinate information. The present invention stores all coordinate information in one file, and only stores one copy of the identical coordinates. The coordinate data is accessed by storing the index information of the coordinates in the original file, which can greatly reduce the storage of identical data.

[0046] S4: Since some traffic simulation software, such as TESS, supports writing an extensible plug-in to add extended functions, the present invention reversely analyzes the traffic simulation software by writing a plug-in, obtains stack information through the system function StackFrame function, and starts analysis from the outermost stack call of the function to improve the analysis speed; by hooking the function, all calls of the process to read the file are obtained through the hook, and the file name of each defined file format is specifically judged to determine the call stack information of the function.

[0047] S5: Call the original system function to complete the file creation and replacement to match other traffic simulation software. Through reverse analysis of its code for reading data format files, and through reverse analysis, find the getData function, and then replace this function with the module written in step S3 to replace the traffic simulation software to read data files. The details are as follows:

[0048] In this embodiment, each simulation software will read a file in its own defined data format. Ultimately, the program will call the system's createFile interface to read the file contents. The present invention hooks this function. After hooking, the present invention can obtain all calls made by this process to read files. The present invention needs to determine the file name of each defined file format to determine the function call stack information. For example, for the TESS traffic simulation software, it will read the road.csv file to read the file content of road information. At this time, the present invention determines through the function call after hook that the file name of the current createFile system function call is the road.csv file, indicating that the current process is reading the present invention. The present invention obtains the current function call stack to determine the entire function flow of the process reading the road.csv file. After finding the function call flow, the present invention can very conveniently find the memory block storing the contents of the road.csv file.

[0049] In this embodiment, the specific implementation is as follows:

[0050] The following definition is the API prototype of the system's CreateFile function.

[0051] HANDLECreateFile(PCTSTRpszName,

[0052] DWORDdwDesiredAccess,

[0053] DWORDdwShareMode,

[0054] PSECURITY_ATTRIBUTESpsa,

[0055] DWORDdwCreationgDisposition,

[0056] DWORDdwFlagsAndAttributes,

[0057] HANDLEhFileTemplate);

[0058] The present invention needs to write a Hook function to hook the system function, so that the present invention can perceive the call of the system function.

[0059] HANDLEFake_CreateFile(PCTSTRpszName,

[0060] DWORDdwDesiredAccess,

[0061] DWORDdwShareMode,

[0062] PSECURITY_ATTRIBUTESpsa,

[0063] DWORDdwCreationgDisposition,

[0064] DWORDdwFlagsAndAttributes,

[0065] HANDLEhFileTemplate){

[0066] The present invention needs to implement the following functions within this function:

[0067] The present invention needs to judge the function parameters of the current call to obtain whether the current file name is required by the present invention: if the current file name pszName is equal to "road.csv", it means that the current process is reading the file road.csv. At this time, the present invention can obtain the current function call stack information. This stack is exactly the code for accessing the road.csv file that the present invention needs to obtain. Based on the function call stack, the present invention can know the entire calling process of reading the file. After obtaining the file content, the next step is to assign the file content to the memory variable for information storage. This variable stores the data content after reading the file. Therefore, no matter what traffic simulation software the present invention is, after finally reading the file content, it will be assigned to the storage variable of the file content.

[0068] In this embodiment, the present invention not only hooks the above-mentioned system function CreateFile, but also hooks the storage data structure of the data file. Regardless of the reading method used by the software, the data ultimately read must be stored. At the same time, since the size of the read file content is not fixed, some data storage containers are used to store the data. Currently, considering large amounts of data storage, the STL vector container is used for storage (sequential storage containers can support dynamic application of storage capacity and have extremely fast access speed). Of course, there is a very small possibility that the STL list container is used for storage (linked lists store data, which can dynamically apply for storage easily, delete data very quickly, and have slower access speed than vectors). Based on the characteristics of these two containers, vectors are more suitable for storing data of large amounts of files. The present invention also hooks the list. After hooking the above two containers and the file reading hook, the present invention operates the traffic simulation software to read the data. At this time, the above hook function will print the code call stack information of the present invention. Therefore, based on the file hook and the data storage hook, the present invention can accurately find the memory storage object where the data of the actual read data file is ultimately stored.

[0069] If(pszName=="target file name")

[0070] If the name of the data file that needs to be analyzed by the present invention is created at this time, the present invention obtains the stack information of the current function call, and prints the stack addresses of all functions based on the stack information. Combined with the hook of the container object of the present invention, the present invention also prints the function call stack information of the container object.

[0071] In this embodiment, the present invention implements the Hook of the container object as follows:

[0072] vector <data>Hook_getData(string filename){

[0073] This function is the function of the present invention's Hook simulation software to read data. The parameter filename originally passed in is the file format content of the traffic simulation software. Through the hook of the present invention, the present invention implements this function in its own module. The content of this function uses the file reading method of the present invention to read the file content filename of the present invention. At the same time, according to the above description, the present invention will read the data coordinate file into the file at one time. Therefore, the present invention reads the coordinate file and then reads other data files, and finally the present invention stores the data result object vector <data>Assign a value.}

[0074] The present invention only needs to write one copy of the module file for reading data and assigning values. Since the module of the present invention reads a custom data format, only one copy of the code is needed for reading data and assigning values. For different traffic simulation software, the present invention needs to reverse analyze the code for reading the data format file and find the getData function through reverse analysis. The module of the present invention then replaces this function to replace the traffic simulation software's reading of the data file, directly replacing the traffic simulation software's own data file reading function with the content read by the module of the present invention.

[0075] In this embodiment, the present invention finally calls the original system function to complete the file creation function.

[0076] ReturnCreateFile(pszName,dwDesiredAccess,dwShareMode,psa,dwCreationgDisposition,dwFlagsAndAttributes,hFileTemplate);}

[0077] Based on the function call stack, the present invention can reverse debug the assembly code by using the printed function information, and finally the present invention can accurately find the function that actually reads the file and assigns the value to the stored data object.

[0078] Assume that the function name found in the present invention is: vector <data>getData(string filename) function name.

[0079] Regarding the code search for traffic software reading data, the present invention first creates a vector object, and the construction of the vector object is a clue that can be found. The present invention searches for the code of the vector object created when reading the data file based on the vector creation and hooks it, so as to find the place where the data file is stored.

[0080] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.< / data> < / data> < / data> < / pos>

Claims

1. A method for optimizing a passenger intermodal transport system, characterized in that: Follow these steps: S1: Define a data format that is easy to read and load, specifically using a .csv format tool for visualization operations, including editing road data and traffic data, and saving this data into a .csv file using the TESS software; S2: Data is divided according to data content. Integer data is directly stored in the integer table, and floating point data is stored in the floating point table. Road data and traffic data are split into multiple tables of data, and each data is stored sequentially without setting interval data. S3: Writing a tool module to match various traffic simulation software to support the format data defined in step S1; S4: Reverse-engineer the traffic simulation software, obtain stack information through the system function StackFrame function, and start the analysis from the outermost stack call of the function to improve the analysis speed; by hooking the function, obtain all calls of the process to read the file through the hook, and specifically judge the file name of each defined file format to determine the call stack information of the function; S5: Call the original system function to complete file creation and replacement to match other traffic simulation software, reverse analyze the code for reading data format files, and find the getData function through reverse analysis, and then replace this function with the module written in step S3 to replace the traffic simulation software to read data files.

2. The method for optimizing a passenger intermodal transport system according to claim 1, characterized in that: In step S2, the coordinate information in the road data and traffic data is stored separately in a file. Specifically, an array is used to store all the coordinate data, and the number of each coordinate in the array corresponds to the array subscript and records all the same coordinate information. Only one copy of the same coordinate is stored, and the coordinate data is accessed by writing the index information of the stored coordinates.

3. The method for optimizing a passenger intermodal transport system according to claim 1, characterized in that: In step S1, the data in the .csv format file saved by the TESS software are all marked, and the data are also separated by brackets () .

4. The method for optimizing a passenger intermodal transport system according to claim 2, wherein: The coordinate information in the road data and traffic data is set as a group of information for every two coordinates, and a sequence number is set for each coordinate.

5. The method for optimizing a passenger intermodal transport system according to claim 3, wherein: The stack information is obtained through the system function StackFrame function. Based on vector creation, the code of the vector object created when reading the data file is found. The hook is used to start the analysis from the outermost stack call of the function to improve the analysis speed.

6. The method for optimizing a passenger intermodal transport system according to claim 1, characterized in that: In step S2, the vector container of stl is used to store data.

Citation Information

Patent Citations

  • Driving analog synthesis simulation method based on microscopic traffic flow simulation model

    CN101533455A

  • Preprocessing apparatus for floating car data and method thereof

    CN102201166A