Method and system for calculating travel cost based on multiple fences

By introducing the itinerary cost calculation method of multi -fence in the online car counting fee system, the problem of unable to adapt to the differences in geographical characteristics of different cities cannot be adapted to different cities, and a more flexible and refined billing system has been achieved, which has improved. The accuracy and transparency of billing enhance the competitiveness of the platform.

CN119379370APending Publication Date: 2025-01-28BEIJING LONGJU YIXING TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411409036.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The existing online car-hailing billing system relies on a single fence and cannot effectively deal with the diversity of billing needs caused by differences in geographical characteristics of different cities, resulting in a lack of flexibility and adaptability of billing rules, affecting service fairness and transparency.

Method used

Adopt the itinerary cost calculation method and system based on multi -fence, through real -time receiving driver's driving point data, combined with the presets of multiple fence areas and priority, use the geometry computing technology to calculate the intersection of the driving trajectory and the fence area to achieve the realization of the geometry computing technology to achieve the realization of the intersection of the trajectory and the fence area. Refined charging.

Benefits of technology

It improves the rationality and accuracy of billing, enhances drivers' trust in the platform, supports refined operations, and improves market competitiveness and operating efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379370A_ABST
    Figure CN119379370A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for calculating travel cost based on multiple fences. The invention relates to the technical field of online car hailing. The data acquisition module starts to work in real time and acquires driving point position data once from the mobile phone application of the designated driver according to the frequency (such as every five seconds); and reading the stored driving point location data from the HBase database, performing data cleaning and format conversion, converting the point location data into a coordinate form, and constructing a LineString object to represent a driving track of a driver. Converting the loaded fence data into a Polygon object to represent a fence area; according to the priorities of the fences, complementary set solving operation is carried out on the multiple fences; through a charging mechanism supporting radial multi-region fences, different charging standards can be set according to characteristics and costs of different regions, and fine charging is realized. The charging mode is more in line with the actual situation, and unfairness caused by a one-by-one charging mode can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of online car-hailing, and in particular to a fence billing method for online car-hailing, and in particular to a method and system for calculating multi-fence travel costs. Background Art

[0002] In the existing technical framework of the online car-hailing service industry, a single geofencing-based billing mechanism is generally adopted, such as CN201811408420.8 discloses an online car-hailing dispatching method and device (publication date: 2019-4-19); CN201710701708.3 discloses an order management method, device, server and computer-readable storage medium (publication date: 2018-5-8);

[0003] CN202310677614.2 discloses a method, device, computer equipment and storage medium for pricing online ride-hailing services (publication date: 2023-7-11);

[0004] The traditional mechanism determines the applicable charging rules based on the starting location of the order. Specifically, by identifying the geographical location where the passenger initiates the order and matching it with the preset geographical fence, the rate standard is determined. However, this charging model has significant limitations when faced with the diverse charging needs generated by the unique geographical characteristics of different cities.

[0005] For example, some cities may have vast suburbs. Due to low population density and high service costs, these areas need to set different charging standards from the city center to maintain the economic feasibility of services. For another example, the difference in driving distance and time cost between mountainous cities and plain cities also puts higher requirements on the setting of charging rules.

[0006] In other words, the shortcoming of the current single-ring billing method is that it fails to fully consider the actual impact of differences in geographical characteristics between cities on the operating costs of online ride-hailing services, resulting in a lack of flexibility and adaptability in the billing rules. This may not only harm the interests of passengers and drivers, affect the fairness and transparency of services, but also restrict the expansion and competitiveness of online ride-hailing platforms in different urban markets.

[0007] To this end, the present invention proposes a method and system for calculating travel costs based on multiple fences. Summary of the invention

[0008] In view of this, the present invention hopes to provide a method and system for calculating trip costs based on multiple fences to solve or alleviate the technical problems existing in the prior art, namely, how to realize billing that supports radial multi-area fences, and the billing is more reasonable and accurate. It can increase the willingness of drivers to accept orders; different billing in different areas can support business scenarios of refined operations; the technical solution of the present invention is implemented as follows:

[0009] First, a method for calculating multi-fence trip costs:

[0010] 1. Overview:

[0011] The present invention aims to address the problems existing in the online car-hailing billing system, and realizes refined billing that supports radial multi-area fences by introducing advanced data collection, storage, processing and display technologies. The solution first initializes the data acquisition module, receives the driving point data uploaded by the designated driver in real time, and stores it in a high-performance HBase database. At the same time, load the preset fence information from the MySQL database, including the coordinate points and priority of the fence. Then, use geometric knowledge to convert the driving point data into a LineString object, convert the fence data into a Polygon object, and perform a complement operation to form a ring shape. Next, calculate the intersection of the driving trajectory and each fence area, obtain the trajectory data segment in each fence area, and calculate the total mileage fee based on the length of the trajectory data segment and the corresponding unit price. Finally, display the calculation results to the designated driver in real time to achieve clear and accurate billing.

[0012] (II) Technical solution:

[0013] To achieve the above technical goal, after receiving the activation instruction input by the user, the following operation steps are performed.

[0014] 2.1 Step S1, data acquisition initialization:

[0015] Initialize the data collection module and set the data collection frequency (such as once every 5 seconds) that can receive the driving point data uploaded by the designated driver in real time.

[0016] 2.2 Step S2, fence data loading:

[0017] Load preset fence information from MySQL database.

[0018] 2.2.1 Step S200, query fence information:

[0019] All preset fence information is retrieved from the database, including the fence coordinate points and priority.

[0020] The operation method is: execute SQL query statements for the fence information table, extract fence data from the database, and obtain all necessary data fields.

[0021] 2.2.2 Step S201, load fence data into memory:

[0022] Load the queried fence data into the system memory so that subsequent data processing and billing operations can access it quickly.

[0023] The operation method is: convert the query results into a list or a dictionary and store them in the system memory.

[0024] 2.3 Step S3, real-time data acquisition:

[0025] The data collection module starts real-time data collection, obtains driving point data from the mobile phone application of the designated driver, and stores the data in the HBase database.

[0026] Read the stored driving point data from the HBase database, perform data cleaning and format conversion, convert the point data into coordinate form, and construct a LineString object to represent the driver's driving trajectory.

[0027] 2.3.1 Step S300, start real-time data collection:

[0028] Start the data collection module and obtain the driving point data from the mobile phone application of the designated driver at a preset frequency (such as every 5 seconds).

[0029] The operation method is: activate the data collection module, communicate with the mobile phone application of the designated driver through API or SDK, set a timer or scheduler to execute (once) the data collection task at a frequency (such as every 5 seconds), and obtain real-time driving point data.

[0030] 2.3.2 Step S301, store data in HBase database:

[0031] The collected driving point data is stored in the HBase database for subsequent data processing and analysis.

[0032] The operation method is: organize the collected data according to the HBase data model and insert it into the corresponding data table.

[0033] 2.3.3 Step S302, reading driving point data:

[0034] Read the stored driving point data from the HBase database to prepare for subsequent data cleaning and format conversion.

[0035] The operation method is: execute the HBase query statement to retrieve the required driving point data from the data table.

[0036] 2.3.4 Step S303, data cleaning and format conversion:

[0037] The read driving point data is cleaned and formatted for subsequent data processing and billing operations.

[0038] The operation method is: remove noise and outliers in the data to ensure the accuracy and reliability of the data. Convert point data into longitude and latitude coordinates for geospatial analysis;

[0039] At the same time, a LineString object is constructed to represent the driver's driving trajectory, providing a basis for subsequent trajectory analysis and billing.

[0040] 2.3.5 Step S304, construct a LineString object:

[0041] Based on the cleaned and converted point data, a LineString object is constructed to represent the driver's driving trajectory.

[0042] The operation method is: use the LineString class in the GeoTools geospatial data processing library or the Shapel geospatial data processing library to connect the coordinate points in chronological order to form a continuous driving trajectory.

[0043] 2.4 Step S4, fence processing and complement calculation:

[0044] The loaded fence data is converted into a Polygon object to represent the fence area; according to the priority of the fence, multiple fences are complemented to form a ring shape that is convenient for subsequent intersection calculation with the driving trajectory.

[0045] 2.4.1 Step S400, convert fence data into Polygon object:

[0046] Convert the loaded fence data into a Polygon object in geospatial data processing for subsequent fence processing and complement calculation.

[0047] The operation method is: according to the coordinate points of the fence, use the Polygon class in the GeoTools geospatial data processing library or the Shapel geospatial data processing library to construct a Polygon object representing the fence area.

[0048] 2.4.2 Step S401, sort the fences according to priority:

[0049] When processing multiple fences, they are sorted according to their priorities so that complement calculations can be performed in priority order.

[0050] The operation method is: sort the fences according to the priority field in the loaded fence data; fences with higher priorities should be placed in front so that they can be given priority in the complement calculation.

[0051] 2.4.3 Step S402, perform complement calculation:

[0052] The sorted fences are subjected to a complement operation to form a ring graph that is convenient for subsequent intersection calculation with the driving trajectory.

[0053] The operation method is: use the difference function or complement function in the geospatial data processing library to perform complement operations on adjacent fences; the rules are:

[0054] Starting from the fence with the highest priority, complement the fences with the subsequent fences in turn until all fences have been processed.

[0055] 2.4.4 Step S403, forming a ring shape:

[0056] Through complement calculation, the graphs obtained after finding the complement are sorted and organized to form a series of circular graphs representing the complement relationship between fences of different priorities.

[0057] 2.5 Step S5, trajectory and fence intersection calculation:

[0058] Calculate the intersection of the driver's driving trajectory LineString and each fence area Polygon to obtain the trajectory data segment within each fence area;

[0059] Based on the length of the trajectory data segment within each fence area and the corresponding unit price, the total mileage fee is calculated and summarized to generate the final fee list.

[0060] 2.5.1 Step S500, calculate the intersection of the trajectory and the fence:

[0061] Determine whether the driver's driving trajectory crosses a fenced area, as well as the specific location and length of the crossing.

[0062] The operation method is: use the intersection function (intersection) in the GeoTools geospatial data processing library or the Shapel geospatial data processing library to calculate the intersection of the driver's driving trajectory LineString and the Polygon of each fence area, and summarize the results to form a series of line segments (LineString) representing the driving trajectory within the fence area.

[0063] 2.5.2 Step S501, obtaining trajectory data segment:

[0064] The trajectory data segments within each fence area are extracted from the intersection results for subsequent mileage fee calculation.

[0065] The operation method is: traverse the intersection results, extract the trajectory data segments within each fence area, and store them in the corresponding data structure.

[0066] 2.5.3 Step S502, calculate the length of the trajectory data segment:

[0067] The length of the trajectory data segment within each fence area is calculated so that the mileage fee can be calculated based on the unit price.

[0068] The operation method is: use the length calculation function in the GeoTools geospatial data processing library or the Shapel geospatial data processing library to calculate the length of each trajectory data segment.

[0069] 2.5.4 Step S503, calculate the mileage fee based on the unit price:

[0070] The mileage fee within each fenced area is calculated based on the length of the trajectory data segment within the fenced area and the corresponding unit price.

[0071] The operation method is: multiply the length of the trajectory data segment by the corresponding unit price to obtain the mileage fee within the fence area.

[0072] 2.5.5 Step S504, summarize the mileage fees to generate a fee list:

[0073] Summarize the mileage charges within all fenced areas to generate a final list of charges.

[0074] The operation method is: add up the mileage fees in each fenced area to obtain the total mileage fee; at the same time, record the information of each fenced area and the corresponding mileage fee in the fee list.

[0075] (III) Mechanism for solving technical problems:

[0076] 3.1 Fence information setting:

[0077] Through the preset fence information, the scope and importance of the billing area are clarified, providing a basis for refined billing. The driving point data is converted into a LineString object to represent the driving trajectory, and the fence data is converted into a Polygon object to represent the fence area. Using geometric knowledge, abstract data is converted into specific geometric objects to facilitate subsequent intersection calculation and billing processing.

[0078] 3.2 Complement operation and ring graph formation:

[0079] Through complement operations, the charging problem of multiple fence overlapping areas is solved to ensure the consistency and accuracy of the charging rules. The formation of a ring graph helps to intuitively display the relationship between fences, which is easy to understand and apply. Using geometric calculation technology, the intersection of the driving trajectory and the fence area is accurately calculated to provide accurate trajectory data segments for charging.

[0080] 3.3 Application of billing rules and fee calculation:

[0081] Combine the preset billing rules and the real-time calculated track data segment length to achieve refined billing. Different unit prices are set for different regions to reflect cost differences and market demand changes between regions.

[0082] In the second aspect, a calculation system based on multi-fence trip costs:

[0083] like Figure 2 As shown, the system is used to implement the calculation method described above, which includes:

[0084] A data collection module that receives driving point data uploaded by the designated driver in real time.

[0085] The data preprocessing module cleans and formats the received data, such as deduplication and outlier processing, to improve data quality.

[0086] Data storage module using database technology: realize efficient storage and query of data.

[0087] A data conversion module that converts stored data into geometric objects: to facilitate subsequent geometric calculations and intersection calculations.

[0088] The intersection of the driving trajectory and the fence area is calculated to obtain a geometric calculation module of the trajectory data segment.

[0089] A billing rules engine that loads and applies preset billing rules.

[0090] Cost calculation module for calculating total mileage charges: Calculates total mileage charges based on the results of the geometry calculation module and the charging rules.

[0091] A user interface module that displays billing results and expense lists.

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

[0093] 1. Improve the rationality and accuracy of billing: By supporting the billing mechanism of radial multi-area fences, the present invention can set different billing standards according to the characteristics and costs of different areas to achieve refined billing. This billing method is more in line with the actual situation and can avoid the unfairness caused by the one-size-fits-all billing model. This solution relies on real-time and accurate driving point data and preset fence information. Through geometric calculations and a billing rule engine, it can accurately calculate the intersection of the driver's driving trajectory and the fence area, and then derive a reasonable fee.

[0094] 2. Improve drivers' willingness to accept orders: Clear and accurate billing results and expense lists help drivers understand the source of each expense, increasing the transparency of billing. Transparent billing methods can increase drivers' trust in the platform, making them more willing to accept orders. By supporting a multi-region fence billing mechanism, the present invention can ensure that drivers who accept orders in different regions can receive fair billing treatment.

[0095] 3. Supporting refined operations: According to the characteristics of different regions and market demands, the platform can flexibly adjust billing standards and strategies. Regional differentiation strategies can help the platform better meet user needs and improve market competitiveness. Through automated data collection, processing, calculation and display processes, the present invention can significantly improve operational efficiency and reduce manual intervention and errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0096] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0097] Figure 1 It is a schematic diagram of the method flow of the present invention;

[0098] Figure 2 It is a schematic diagram of the system composition of the present invention;

[0099] Figure 3 It is a schematic diagram of multiple track segments of the present invention;

[0100] Figure 4 The figure is a schematic diagram of the execution flow of the solution of the first embodiment of the present invention. DETAILED DESCRIPTION

[0101] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below;

[0102] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0103] Explanation of relevant terms:

[0104] (1) Driving point data: location information uploaded in real time by the designated driver during driving.

[0105] (2) Fence data: data used to define the boundaries of a specific area for billing or management purposes.

[0106] (3) Preset fence information (coordinate points and priority): The pre-set area scope and its importance, which is used to formulate billing rules.

[0107] (4) HBase database: a high-performance distributed database that stores driving point data.

[0108] (5) LineString object: a continuous line segment object representing the driving path of the designated driver.

[0109] (6)Polygon object: A polygonal geometric object representing a fence area.

[0110] (7) Complement operation: An operation to calculate the non-overlapping parts between multiple fences based on the fence priority.

[0111] (8) Ring figure: A geometric figure formed after the complement operation, used to represent the relationship between fences.

[0112] (9) Intersection calculation of driving trajectory: the process of determining the overlapping part of the driving path and the fence area.

[0113] (10) Trajectory data segment: the specific road section information where the driving trajectory intersects with the fence.

[0114] (111) Track data segment length and corresponding unit price: the distance of each driving track segment within the fence and its billing standard.

[0115] Embodiment 1: Figure 1 , 3 As shown in Figure 4, this embodiment discloses a method for calculating the cost of a multi-fence trip; a designated driver service platform is provided, and the driver uploads the driving point data in real time (once every 5 seconds) through a mobile phone application. The platform operator sets up multiple fences in different areas according to business needs, and each fence has different billing standards and priorities. Now, we need to calculate the driving cost of the driver in different fence areas based on the driver's driving trajectory and fence information, and show the result to the driver; the execution process of the solution is as follows.

[0116] P1. Data collection and storage:

[0117] Driver side: The designated driver uploads driving location data (such as longitude, latitude, and timestamp) every 5 seconds via the mobile app.

[0118] Storage: The collected point data is stored in the HBase database in real time for subsequent processing.

[0119] P2. Fence information creation:

[0120] Operation side: Operation personnel create fence information through the management platform, including fence coordinate points, priority, billing unit price, etc.

[0121] Storage: Fence information is saved in a MySQL database for easy management and query.

[0122] It is understandable that supporting the setting of radial multi-area fences provides a basis for refined operations.

[0123] P3. Data acquisition:

[0124] Get the location data uploaded by the driver from the HBase database.

[0125] Get the underlying data for multiple fences from a MySQL database.

[0126] P4. Convert point data into lines:

[0127] Use a geospatial data processing library (such as GeoTools) to convert the point data obtained from HBase into a LineString object to represent the driver's driving trajectory.

[0128] P5. Convert fence data into surface:

[0129] Also using the geospatial data processing library, the fence coordinate point data obtained from MySQL is converted into a Polygon object to represent the fence area.

[0130] P6. Find the complement to form a ring shape:

[0131] According to the priority of the fences, multiple Polygons are complemented to form a ring shape. In this way, even if there are overlaps between fences, the driving distance of the driver in each fence area can be accurately calculated.

[0132] It should be pointed out that in geospatial data processing, complementation usually refers to subtracting one or more smaller areas (such as fence areas) from a larger area (such as the entire map range) to obtain the remaining part. But in this scenario, complementation is more accurately a logical "exclusion" operation of overlapping fence areas based on the priority of the fences to ensure that each fence area is independent when billed and does not result in duplicate billing due to overlap. When there is overlap between fences, a ring-like figure can be formed through the complementation operation. These ring figures are actually composed of multiple fence boundaries and their complement boundaries, which represent the space that the driver's driving trajectory in different fence areas may traverse.

[0133] For example, Figure 3 It shows multiple fence areas and their overlapping relationships. By using the complement operation, Figure 3 Each fenced area is clearly defined with no overlap, making it easier to calculate costs later.

[0134] It can be understood that the accuracy and rationality of billing are ensured through complement calculation. Even if the fences overlap, the fees can be correctly calculated based on the priority and complement relationship.

[0135] P7. Obtain trajectory data by finding the intersection:

[0136] The annular figure is intersected with the driver's driving trajectory LineString to obtain the trajectory data segment within each fence area.

[0137] P8. Calculate mileage fee:

[0138] Traverse the trajectory data segment in each fence area and calculate its length. Calculate the mileage fee in each fence area based on the trajectory length and the unit price of the fence. Add up the mileage fees in all fence areas to get the total mileage fee.

[0139] Furthermore, through the intersection calculation of the circular graph formed in step P6 and step P7, we can obtain the driver's driving trajectory in different fenced areas. These trajectories are divided into multiple segments (such as L1 to L5), and each segment corresponds to a specific fenced area. For each segment, calculate its length (using the length calculation function in the geospatial data processing library), and then multiply it by the unit price of the corresponding fenced area to obtain the mileage fee for the segment. Finally, add up the mileage fees of all segments to get the total mileage fee.

[0140] For example, Figure 3 As shown, the above calculation rules are:

[0141] Calculate the mileage fee = track L1 in fence P1 * unit price of fence P1 + ... + track Ln in fence Pn * unit price of fence Pn.

[0142] Among them, "the unit price of track L1 in fence P1 fence P1" represents the driving cost of the first track (L1) in the fence P1 area, and "the unit price of track Ln fence Pn in...+ fence Pn" represents the sum of the driving costs of all other track segments in their respective fence areas. Finally, these costs are accumulated to form the total mileage fee.

[0143] It is understandable that different billing is supported in different areas, which improves the flexibility and accuracy of billing. At the same time, by accurately calculating the track length and unit price, the rationality and fairness of the fee are ensured.

[0144] P9. Results display:

[0145] The calculated fare result is returned to the driver's mobile phone.

[0146] The charging results of different areas are displayed on the driver's side, allowing the driver to clearly understand the cost structure.

[0147] It is understandable that the willingness and satisfaction of drivers to accept orders will be improved. By making the fee calculation process transparent, the drivers' sense of trust and belonging will be enhanced. At the same time, data support for refined operations will be provided to the platform to optimize business processes and user experience.

[0148] It is understandable that through complement calculation and intersection calculation, the overlapping relationship between fences can be accurately handled to ensure the accuracy and rationality of billing. This is especially important for the billing of radial multi-area fences, because in actual scenarios, fences are often not isolated, but have complex overlapping and inclusion relationships. By accurately calculating the trajectory length and unit price, the rationality and fairness of the fee are ensured. This avoids the gray areas and controversial points that may exist in traditional billing methods, and improves the satisfaction of drivers and platforms. By making the fee calculation process transparent and displaying the charging results of different areas, drivers can clearly understand the fee composition and billing standards. This enhances the driver's sense of trust and belonging, and increases their willingness and enthusiasm to accept orders.

[0149] In summary, the setting of different charging standards in different regions provides the platform with space for refined operations. The platform can flexibly adjust the fences and charging standards according to business needs and market conditions to optimize business processes and user experience. At the same time, through data analysis, the platform can deeply understand the driving behavior and user needs of drivers, providing strong support for future business decisions.

[0150] Embodiment 2: This embodiment further discloses the Python execution program of the calculation method described in Embodiment 1 as follows:

[0151]

[0152]

[0153]

[0154]

[0155]

[0156]

[0157] In the above program:

[0158] (1) Data generation and storage:

[0159] The simulate_driver_data function generates driver point data.

[0160] The store_driver_data_to_hbase function stores the point data in HBase. The create_fence_data function generates fence data.

[0161] The store_fence_data_to_mysql function stores fence data to MySQL.

[0162] (2) Data acquisition and conversion:

[0163] The get_driver_data_from_hbase function gets point data from HBase. The get_fence_data_from_mysql function gets fence data from MySQL. The points_to_linestring function converts point data into LineString objects. The fence_to_polygon function converts fence data into Polygon objects.

[0164] (3) Find the complement and intersection:

[0165] The compute_complements function is used to find the complement of a set.

[0166] The compute_intersections function computes the intersections of the trajectory and the fence.

[0167] (4) Cost calculation and display:

[0168] The compute_fee function calculates the total mileage fee.

[0169] The final result is printed.

[0170] All the above embodiments only express the implementation methods of the relevant practical applications of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.

[0171] For those skilled in the art, it can be further appreciated that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0172] At the same time, those skilled in the art can understand that all or part of the processes in all the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

Claims

1. A method for calculating multi-fence travel costs, characterized in that: The following steps are included: S1, setting the data collection frequency that can receive the driving point data uploaded by the designated driver in real time; S2, loading preset fence information from the database; S3, start real-time data collection, obtain driving point data from the mobile phone application of the designated driver and store it in the database; read the stored driving point data, convert the point data into coordinate form, and construct a LineString object to represent the driver's driving trajectory; S4, converting the loaded fence data into a Polygon object to represent the fence area; According to the priority of the fences, a complement operation is performed on multiple fences to form a ring graph for subsequent intersection calculation with the driving trajectory; S5, calculating the intersection of the driver's driving trajectory LineString and each fence area Polygon, and obtaining the trajectory data segment in each fence area; The total mileage fee is calculated based on the length of the trajectory data segment within each fence area and the corresponding unit price.

2. The calculation method according to claim 1, characterized in that: The execution process of S2 includes: S200, executing an SQL query statement for the fence information table, extracting fence data from the database, and obtaining all necessary data fields; S201, converting the query result into a list or a dictionary and storing it in the system memory.

3. The calculation method according to claim 1, characterized in that: The execution process of S3 includes: S300, communicates with the driver's mobile app through API or SDK, sets a timer or scheduler to perform data collection tasks according to frequency, and obtains real-time driving point data; S301, organizing the collected data according to the HBase data model and inserting it into the corresponding data table; S302, executing HBase query statements to retrieve required driving point data from the data table.

4. The calculation method according to claim 3, characterized in that: In the S3, it also includes: removing noise and outliers in the data to ensure the accuracy and reliability of the data; converting the point data into longitude and latitude coordinates; Construct a LineString object to represent the driver's driving trajectory.

5. The calculation method according to any one of claims 1 to 3, characterized in that: The execution process of S4 includes: S400, constructing a Polygon object representing the fence area according to the coordinate points of the fence; S401, sorting the fences according to the priority field in the loaded fence data; the fence with a higher priority is arranged at the front; S402, performing a complement operation on adjacent fences based on difference logic or complement logic; S403, sorting and organizing the graphs obtained after the complement calculation to form a series of ring graphs representing the complement relationship between fences of different priorities.

6. The calculation method according to claim 5, characterized in that: In S402, the complement operation is performed as follows: starting from the fence with the highest priority, the complement operation is performed with subsequent fences in sequence until all fences are processed.

7. The calculation method according to any one of claims 1 to 3, characterized in that: The execution process of S5 includes: S500, using intersection logic, calculates the intersection of the driver's driving trajectory LineString and each fence area Polygon, and summarizes the obtained results to form a series of line segments representing the driving trajectory within the fence area; S501, traversing the intersection results, extracting the trajectory data segments within each fence area, and storing them in a corresponding data structure; S502, calculating the length of each trajectory data segment; S503: Multiply the length of the trajectory data segment by the corresponding unit price to obtain the mileage fee within the fenced area.

8. The calculation method according to claim 7, characterized in that: In the S5, it also includes: adding the mileage fees in each fenced area to obtain the total mileage fee; and recording the information of each fenced area and the corresponding mileage fee in the fee list.

9. A system for implementing the calculation method according to any one of claims 1 to 8, characterized in that: The system comprises: A data collection module that receives driving point data uploaded by the designated driver in real time; Data storage module using database technology; A data conversion module that converts stored data into geometric objects; Calculate the intersection of the driving trajectory and the fence area to obtain a geometric calculation module of the trajectory data segment; A billing rules engine that loads and applies preset billing rules; Cost calculation module that calculates total mileage charges.

10. The system according to claim 9, characterized in that: The system also includes a user interface module for displaying the billing results and the expense list.

Citation Information

Patent Citations

  • Order management method and apparatus, server, and computer-readable storage medium

    CN108009653A

  • Online car-hailing order dispatching method and device

    CN109657923A

  • Online car-hailing pricing method and device, computer equipment and storage medium

    CN116416014A