A method for analyzing the entry and exit of leased vehicles from an administrative region
By combining the ray method and the inverse address analysis method, the GPS trajectory and administrative region boundaries of the rental vehicle are analyzed, and the problems of insufficient accuracy and efficiency in the prior art are solved, and accurate analysis and efficient judgment of multiple administrative regions are achieved.
Patent Information
- Application Number
- CN202111366534.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-18
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2041-11-18
AI Technical Summary
The prior art analyzes that when a rental vehicle enters and exits an administrative area, the accuracy and efficiency are insufficient, and it is impossible to analyze it in combination with multiple administrative areas.
The ray method and inverse address analysis method are used to obtain the administrative area and GPS trajectory bound by the vehicle, and the trajectory point is traversed to determine whether it is in the administrative area. The AND gate sums up the state, and the state collection is divided into the first order to obtain the inlet and out state points.
The accuracy and efficiency of the judgment of the trajectory of the rental vehicle entering and leaving the administrative area is improved, and it can directly analyze whether the vehicle is driving out of multiple administrative areas at the same time, breaking away from the limitations of analyzing a single administrative area.
Smart Images

Figure CN114090709B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of big data analysis, and particularly to a method for analyzing the entry and exit of rental vehicles from administrative regions. Background Art
[0002] Vehicle rental refers to a transaction form in which the right of asset use of a vehicle is separated from the right of ownership. The lessor has the ownership of the asset, and the lessee has the right of asset use. The lessor and the lessee sign a lease contract to exchange the right of use. The vehicle rental industry is called the transportation service industry. Because of the advantages of not having to handle insurance, not having to undergo annual inspections and repairs, and being able to replace models at will, using car rental instead of buying a car to control enterprise costs is gradually favored by domestic enterprises, institutions and individual users.
[0003] During the vehicle rental process, the rental company binds one or more administrative regions to the rented vehicles, which can not only facilitate the parking and management of the vehicles, but also provide a certain guarantee for the vehicle property safety of the rental company. Therefore, mastering and analyzing the entry and exit status of rental vehicles in administrative regions is an essential part of monitoring whether the vehicles are parked correctly. The prior art is to obtain the longitude and latitude of the final parking position of the rental vehicle and perform reverse geocoding, and compare the administrative region corresponding to the longitude and latitude with the bound administrative region to determine whether the vehicle has exited the administrative region. However, due to the non-round polygon boundary of the administrative region and the possible drift of the GPS data reported by the terminal, the system is prone to misjudge the vehicle status. In addition, the rental vehicle only analyzes a specific administrative region and cannot combine the characteristics of multiple administrative regions for analysis, which further limits the accuracy and efficiency of judging the entry and exit of the vehicle trajectory from the administrative region.
[0004] In the process of implementing the present invention, the inventor found that there are at least the following problems in the prior art:
[0005] The accuracy and efficiency of judging the entry and exit of the rental vehicle trajectory from the administrative region in the prior art need to be further improved, and multiple administrative regions cannot be combined for analysis. Summary of the Invention
[0006] The purpose of the present invention is to provide a method for analyzing the entry and exit of rental vehicles from administrative regions to solve the technical problems in the prior art that the accuracy and efficiency of judging the entry and exit of the rental vehicle trajectory from the administrative region need to be further improved, and multiple administrative regions cannot be combined for analysis. The many technical effects that can be produced by the preferred technical solutions among the many technical solutions provided by the present invention are described in detail below.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] A method for analyzing the entry and exit of a leased vehicle from an administrative region provided by the present invention includes the following steps:
[0009] S100: Obtain the administrative region bound to the vehicle and the GPS track of the previous day;
[0010] S200: Obtain the set of boundary points of all administrative regions in the country, and store the names, numbers, and the set of boundary longitude and latitude points sorted clockwise or counterclockwise corresponding to all administrative regions in a Mysql database;
[0011] S300: Traverse the track points of the GPS track, use the ray method to determine whether the track point is within the administrative region, and use reverse geocoding to confirm the boundary points of the administrative region;
[0012] S400: Use an AND gate to summarize the status of the GPS track in each administrative region, where the status includes within the administrative region and outside the administrative region;
[0013] S500: Perform a first-order difference on the set of the statuses after summarization by the AND gate to obtain the status points of entry and exit from each administrative region;
[0014] S600: Summarize the status points and upload them to the terminal.
[0015] Preferably, in step S300, the ray method is used to determine whether the track point is within the administrative region; if so, it is determined that the track point is within the administrative region, the administrative region status status is marked as 0, and the flag is assigned 0, and the next track point is continued to be judged; if not, it is determined that the track point is outside the administrative region, which is the first boundary point for one entry and exit from the administrative region, the administrative region status status is marked as 1, and the flag is assigned 0, and the status of the boundary point is confirmed using reverse geocoding.
[0016] Preferably, in step S300, reverse geocoding is used to confirm the status of the boundary point, and it is judged whether the address of the boundary point is within the administrative region; if so, it is judged that the ray method judgment result of the boundary point is a misjudgment, and the administrative region status status is set to 0, and the next track point is continued to be judged; if not, it is judged that the boundary point is outside the administrative region, and the flag is assigned 1.
[0017] Preferably, in step S300, it further includes determining whether the boundary point is drift data; obtaining the previous valid longitude and latitude within the administrative region, calculating the distance between the boundary point and the previous trajectory point using the haversine formula, obtaining the time difference based on the reporting times of the two points, calculating the average speed between the two points based on the distance and the time difference, and comparing it with the set average speed threshold; if the average speed is greater than the average speed threshold, the boundary point is drift data, setting the administrative region status status to 0 and flag to 0; if the average speed is less than the average speed threshold, the boundary point is normal data, marking the administrative region status status as 1 and flag as 1.
[0018] Preferably, after determining whether the boundary point is drift data in step S300, continue to use the ray method and inverse geocoding method to determine the next trajectory point until it is determined to drive back to the first point of the administrative region, marking the administrative region status status as 0 and flag as 1.
[0019] Preferably, step S400 further includes extracting the status values of all trajectory points in step S300 and dividing them into different status sets according to different administrative regions.
[0020] Preferably, after performing a first-order difference on the status set after the AND operation in step S500, extract all non-zero fields.
[0021] Preferably, in the non-zero fields, 1 represents the departure point and -1 represents the return point.
[0022] Preferably, in step S100, all the data bound to the vehicles is uploaded to the Mysql database; the GPS trajectory is stored in the Hbase database; the GPS trajectory is obtained through satellite positioning, and the data segment includes GPS time, longitude and latitude, and positioning status.
[0023] Preferably, steps S100 to S500 are all implemented in the Python language.
[0024] Implementing one of the above technical solutions of the present invention has the following advantages or beneficial effects:
[0025] By adopting the method combining the ray method and inverse geocoding method, and performing a first-order difference after the AND operation on the status of each administrative region, the present invention can improve the accuracy and efficiency of judging whether a rental vehicle's trajectory enters or exits an administrative region, directly analyze whether a rental vehicle exits multiple administrative regions simultaneously in terms of data, and get rid of the dilemma of only analyzing a single administrative region in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings. In the drawings:
[0027] Figure 1 is the specific flowchart of the embodiments of the present invention;
[0028] Figure 2 is the simplified flowchart of the embodiments of the present invention. Detailed Embodiments
[0029] In order to make the objectives, technical solutions and advantages of the present invention clearer, the following various exemplary embodiments to be described will refer to the corresponding accompanying drawings, which form a part of the exemplary embodiments and describe various exemplary embodiments that may be adopted to implement the present invention. Unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. It should be understood that they are only examples of processes, methods, devices, etc. consistent with some aspects of the present invention disclosed in detail in the appended claims. Other embodiments may also be used, or structural and functional modifications may be made to the embodiments listed herein without departing from the scope and essence of the present invention.
[0030] In the description of the present invention, it should be understood that terms such as "center", "longitudinal", "lateral", etc. indicate the orientation or positional relationship based on the accompanying drawings, which are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the elements referred to must have a specific orientation, be constructed and operated in a specific orientation. Terms such as "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. The meaning of the term "plurality" is two or more. The terms "connected" and "coupled" should be understood in a broad sense. For example, they can be fixedly connected, detachably connected, integrally connected, mechanically connected, electrically connected, communicatively connected, directly connected, indirectly connected through an intermediate medium, and can be the internal connection of two elements or the interaction relationship between two elements. The term "and / or" includes any and all combinations of one or more of the related listed items. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0031] In order to illustrate the technical solutions described in the present invention, the following will be described through specific embodiments, and only the parts related to the embodiments of the present invention are shown.
[0032] Embodiment 1:
[0033] As Figure 1 , Figure 2 shown, the present invention provides a method for analyzing the entry and exit of a leased vehicle from an administrative region, including the steps of:
[0034] S100: Obtain the administrative region bound to the vehicle and the GPS track of the previous day;
[0035] S200: Obtain the set of boundary points of all administrative regions in the country, and store the names, numbers, and the set of boundary longitude and latitude points sorted clockwise or counterclockwise corresponding to all administrative regions in the Mysql database;
[0036] S300: Traverse the track points of the GPS track, use the ray method to determine whether the track points are within the administrative region, and use reverse geocoding to confirm the boundary points of the administrative region;
[0037] S400: Use an AND gate to summarize the status of the GPS track in each administrative region, where the status includes within the administrative region and outside the administrative region;
[0038] S500: Perform a first-order difference on the set of statuses after summarizing with the AND gate to obtain the status points for entering and exiting each administrative region;
[0039] S600: Summarize the status points and upload them to the terminal. Specifically, the vehicle leasing company stores the leased vehicle and the bound administrative region information in the Mysql database, the GPS track of the vehicle for the previous day is stored in the Hbase database, the set of boundary points of all administrative regions in the country can be obtained through an open-source map platform, the administrative region bound to the vehicle and the GPS track information of the previous day are called through Python, a method combining the ray method and the reverse geocoding method is used, and after performing an AND operation on the statuses of each administrative region and then performing a first-order difference, the accuracy and efficiency of judging whether the leased vehicle track enters and exits the administrative region can be improved, and it can directly analyze on the data whether the leased vehicle exits multiple administrative regions simultaneously, getting rid of the dilemma of only analyzing a single administrative region in the prior art.
[0040] As an alternative implementation, in step S300, the ray method is used to determine whether a trajectory point is within the administrative region; if so, it is determined that the trajectory point is within the administrative region, the administrative region status status is marked as 0, and the flag is assigned 0, and the next trajectory point is continuously determined; if not, it is determined that the trajectory point is outside the administrative region and is the first boundary point for entering and exiting the administrative region once. The administrative region status status is marked as 1, and the flag is assigned 0, and the inverse geocoding is used to confirm the status of the boundary point. Specifically, a ray is drawn from the trajectory point and intersects with the polygon boundary of the administrative region where the trajectory point is located. Calculating the number of intersection points between the trajectory point and the polygon boundary can determine whether the trajectory point is within the administrative region. Because when the ray passes through the polygon, there are only two states: entering the polygon or exiting the polygon. If the point is inside the polygon, the first intersection point of the ray and the polygon must be exiting the polygon, and entering the polygon and exiting the polygon occur in pairs. Therefore, when the number of intersection points between the ray and the polygon is odd, it proves that the point is inside the polygon. Then, if the number of intersection points is odd, the trajectory point is inside the polygon boundary of the administrative region; if the number of intersection points is even, the trajectory point is outside the polygon boundary of the administrative region. For the trajectory points determined to be outside the administrative region, obviously, it is within the polygon boundary of the administrative region, and the actual geographical location of the trajectory point needs to be further confirmed to prevent misjudgment. The software marks whether it is within the administrative region with 0 and 1, where 0 means within the administrative region and 1 means outside the administrative region, and the marked item is recorded as status.
[0041] As an alternative implementation, in step S300, the inverse geocoding is used to confirm the status of the boundary point, and it is determined whether the address of the boundary point is within the administrative region; if so, it is determined that the ray method judgment result of the boundary point is a misjudgment, and the administrative region status status is set to 0, and the next trajectory point is continuously determined; if not, it is determined that the boundary point is outside the administrative region, and the flag is assigned 1. Specifically, the inverse geocoding is performed on the trajectory points determined to be outside the administrative region, which can further confirm the points entering and exiting the boundary. By comparing the longitude and latitude information in the GPS information segment of this boundary point with the name, number, and the set of boundary longitude and latitude points sorted clockwise or counterclockwise stored in the Mysql database in step S200, the specific location where this boundary point is parked can be obtained, and then it can be determined whether the trajectory point is within the administrative region. If so, it means that the result of the previous determination is a misjudgment, and the administrative region status should be changed. If not, it is determined that the boundary point is outside the administrative region, and the flag is assigned 1. Where flag being 1 indicates the state of driving out and not returning.
[0042] As an alternative implementation, step S300 further includes determining whether a boundary point is drift data; obtaining the previous valid longitude and latitude within the administrative region, calculating the distance between the boundary point and the previous trajectory point using the haversine formula, obtaining the time difference based on the reporting times of the two points, calculating the average speed between the two points based on the distance and the time difference, and comparing it with a set average speed threshold; if the average speed is greater than the average speed threshold, the boundary point is drift data, setting the administrative region status status to 0 and flag to 0; if the average speed is less than the average speed threshold, the boundary point is normal data, marking the administrative region status status as 1 and flag as 1. Specifically, since no filtering is performed on abnormal data, the GPS data reported by the vehicle terminal may exhibit drift, leading to misjudgment of the vehicle's status. Therefore, it is necessary to determine whether there is drift data at the boundary point. The haversine formula can calculate the distance between two points based on longitude and latitude. By obtaining the previous valid longitude and latitude within the administrative region and substituting the valid longitude and latitude of the boundary point and the previous trajectory point into the haversine formula, the distance between the two points can be obtained. Subsequently, based on the time difference reported between the two trajectory points, the average speed between the two points can be obtained. Through big data analysis, the average speed threshold selected in the embodiments of the present invention is 60 m / s. By comparing with this threshold, if the average speed between the two trajectory points is greater than this threshold, it proves that the trajectory point is drift data and should be filtered out at the reporting terminal to improve the accuracy of monitoring.
[0043] As an alternative implementation, after determining whether a boundary point is drift data in step S300, the ray method and the reverse geocoding method are continued to determine the next trajectory point until the first point of driving back into the administrative region is determined, marking the administrative region status status as 0 and flag as 1. Specifically, there are multiple trajectory points on the GPS trajectory reported daily, and the status of each trajectory point needs to be judged and merged. The next trajectory point after the boundary point enters the scope of the next administrative region, and the ray method and the reverse geocoding method in step S300 need to be repeated again until the first point of driving back into the administrative region this time is found. The status information of the first point driving back into the administrative region is that status is 0 and flag is 1. Among them, flag being assigned 1 indicates driving out and not returning, and when it is confirmed that the trajectory point drives back into the administrative region, flag is assigned 0.
[0044] As an optional implementation manner, step S400 further includes extracting the status values of all the trajectory points in step S300 and dividing different status sets according to different administrative regions. Specifically, when a rental vehicle is bound to multiple administrative regions, the above algorithm is used to obtain the status sets of the trajectory and each administrative region. An alarm or warning will only be generated when the trajectory points go out of all administrative regions. The trajectory points are distributed in different administrative regions. Only by combining the status state sets of the trajectory points in different administrative regions can they be ANDed. Since 1 represents driving out and 0 represents driving in, as long as there is one administrative region that has not been driven out, it is determined that the trajectory point is still within the administrative region to which it belongs. In the final status set obtained, all the points with a value of 1 are the points outside all the bound administrative regions, and the points with a value of 0 are the points within all the bound administrative regions.
[0045] As an optional implementation manner, after taking the first-order difference of the status set obtained by ANDing in step S400 in step S500, all non-zero fields are extracted. Specifically, the first-order difference of the status set is taken to extract non-zero fields. 1 represents a driving-out point, and -1 represents a driving-back point. According to the result of the first-order difference of the status set, the driving-in and driving-out status of the rental vehicle in the bound administrative region can be obtained.
[0046] As an optional implementation manner, in the non-zero fields, 1 represents a driving-out point, and -1 represents a driving-back point. Specifically, 1 and -1 are the results of the first-order difference after ANDing the status set.
[0047] As an optional implementation manner, in step S100, all the data bound to the vehicles is uploaded to the Mysql database; the GPS trajectory is stored in the Hbase database; the GPS trajectory is obtained through satellite positioning, and the data segment includes GPS time, longitude and latitude, and positioning status. Specifically, MySQL is a relational database management system and is one of the most popular relational database management systems. The SQL language used by MySQL is the most commonly used standardized language for accessing databases. Due to its small size, fast speed, open source and other characteristics, MySQL is generally selected as the website database for the development of small and medium-sized websites. Storing the data of rental vehicles and the boundary data of administrative regions in the same database facilitates the call of Python. Each vehicle saves and retrieves the GPS trajectory of the previous day in the Hbase database. The fields included in the GPS trajectory are GPS time, longitude and latitude, and positioning status. The GPS data is sorted in ascending order according to the reporting time. Since non-positioning data is meaningless and the base station positioning data may not be accurate enough, only satellite positioning data is taken during analysis, and invalid data misreported by the vehicle-mounted terminal, such as negative or all-zero longitude and latitude, is deleted.
[0048] As an alternative implementation, steps S100 to S500 are all implemented in the Python language. Specifically, the Python language is only the preferred implementation language for this implementation.
[0049] The embodiment is only a special case and does not indicate that the present invention has only such an implementation.
[0050] The above are only the preferred embodiments of the present invention. Those skilled in the art will know that various changes or equivalent replacements can be made to these features and embodiments without departing from the spirit and scope of the present invention. Additionally, under the teaching of the present invention, these features and embodiments can be modified to adapt to specific situations and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application belong to the protection scope of the present invention.
Claims
1. A method for analyzing the entry and exit of leased vehicles from an administrative region, characterized in that, Including the steps: S100: Obtain the administrative region bound to the vehicle and the GPS track of the previous day; S200: Obtain the set of boundary points of all administrative regions in the country, and store the names, numbers, and the set of boundary longitude and latitude points sorted clockwise or counterclockwise corresponding to all the administrative regions in a Mysql database; S300: Traverse the track points of the GPS track, use the ray method to determine whether the track point is within the administrative region, and use reverse geocoding to confirm the boundary points of the administrative region; S400: Use an AND gate to summarize the status of the GPS track in each administrative region, where the status includes within the administrative region and outside the administrative region; S500: Perform a first-order difference on the set of the statuses after summarization by the AND gate to obtain the status points of entering and leaving each administrative region; S600: Summarize the status points and upload them to the terminal.
2. The method for analyzing the entry and exit of a leased vehicle from an administrative region according to claim 1, wherein In step S300, use the ray method to determine whether the track point is within the administrative region; if so, determine that the track point is within the administrative region, mark the administrative region status status as 0, assign flag as 0, and continue to judge the next track point; if not, determine that the track point is outside the administrative region, which is the first boundary point of entering and leaving the administrative region once, mark the administrative region status status as 1, assign flag as 0, and use reverse geocoding to confirm the status of the boundary point.
3. The method for analyzing the entry and exit of a leased vehicle from an administrative region according to claim 2, wherein In step S300, use reverse geocoding to confirm the status of the boundary point, and judge whether the address of the boundary point is within the administrative region; if so, judge that the ray method judgment result of the boundary point is a misjudgment, set the administrative region status status to 0, and continue to judge the next track point; if not, judge that the boundary point is outside the administrative region, and assign flag as 1.
4. The method for analyzing the entry and exit of a leased vehicle from an administrative region according to claim 3, wherein, Step S300 also includes judging whether the boundary point is drift data; obtain the previous valid longitude and latitude within the administrative region, use the haversine formula to calculate the distance between the boundary point and the previous track point, obtain the time difference according to the reporting times of the two points, calculate the average speed between the two points based on the distance and the time difference, and compare it with the set average speed threshold; if the average speed is greater than the average speed threshold, the boundary point is drift data, set the administrative region status status to 0, assign flag as 0; if the average speed is less than the average speed threshold, the boundary point is normal data, mark the administrative region status status as 1, assign flag as 1.
5. The method for analyzing the entry and exit of a leased vehicle from an administrative region according to claim 1, characterized in that, After judging whether the boundary point is drift data in step S300, continue to use the ray method and reverse geocoding method to judge the next track point until judging to drive back to the first point of the administrative region, mark the administrative region status status as 0, assign flag as 1.
6. The method for analyzing the entry and exit of a leased vehicle from an administrative region according to claim 1, wherein, Step S400 also includes extracting the status values of all the track points in step S300 and dividing different status sets according to different administrative regions.
7. A method for analyzing the entry and exit of a leased vehicle from an administrative region according to claim 6, characterized in that, After performing a first-order difference on the status set after the phase of step S400 in step S500, all non-zero fields are extracted.
8. A method for analyzing the entry and exit of a leased vehicle from an administrative region according to claim 7, characterized in that, Among the non-zero fields, 1 represents the departure point, and -1 represents the return point.
9. The method for analyzing the entry and exit of a leased vehicle from an administrative region according to claim 1, wherein In step S100, the data bound by all vehicles is uploaded to the Mysql database; the GPS trajectory is stored in the Hbase database; the GPS trajectory is obtained through satellite positioning, and the data segment includes GPS time, longitude and latitude, and positioning status.
10. A method for analyzing the entry and exit of a leased vehicle from an administrative region according to claim 1, characterized in that, Steps S100 to S500 are all implemented in the Python language.
Citation Information
Patent Citations
Method for judging whether vehicle has cross-area behavior
CN109544968A
Method for drawing automobile geographic position distribution diagram
CN112559650A