A bus track deviation detection method, device and application
By eliminating the abnormal trajectory of bus GPS and using the grid and Franmine distance algorithm, the trajectory offset problem caused by bus GPS failure is solved, the accuracy of trajectory offset calculation and the accuracy of bus operation are improved, and passenger satisfaction is improved.
Patent Information
- Application Number
- CN202310163104.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-14
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2043-02-14
AI Technical Summary
In the prior art, the trajectory caused by the failure of the GPS on-board aircraft of the bus is not online or drifted, and the degree of trajectory deviation of the bus cannot be accurately monitored, affecting the arrival time of the station and passenger satisfaction.
By obtaining the bus's driving trajectory points and planned trajectory points, the abnormal driving trajectory segment is eliminated, and the trajectory offset degree is calculated using the grid and Franmine distance algorithm, and the abnormal trajectory caused by the vehicle's unline, disconnection and drift are eliminated.
It improves the accuracy of the calculation of bus trajectory deviation degree, reduces errors, ensures the accuracy of buses running according to planned trajectory, and improves passenger experience.
Smart Images

Figure CN116224408B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle trajectory detection, and specifically to a method, device and application for detecting the degree of deviation of a bus trajectory. Background Art
[0002] GPS is a high-precision radio navigation positioning system based on artificial satellites. It can provide accurate geographic location, driving speed and precise time information anywhere in the world and in near-Earth space.
[0003] During the daily operation of buses, it is often necessary to monitor the bus's operating status and route through GPS. The bus's route is often monitored through the bus's GPS reporting rate, the bus's online rate, and the bus's trajectory. Since the bus runs on a pre-planned trajectory, if the bus deviates from the trajectory, the bus's arrival time at the station will be inaccurate, resulting in serious consequences such as decreased passenger satisfaction. Therefore, monitoring whether the bus trajectory is running on the pre-set trajectory is of paramount importance.
[0004] In the existing technology, when the driving trajectory of a bus is determined by GPS signals, the on-board GPS has errors and is prone to failure, which may cause the vehicle to be offline or the trajectory to drift. Therefore, there is an urgent need for a method that can detect the degree of vehicle trajectory deviation even when the on-board GPS fails. Summary of the Invention
[0005] The present application provides a method, device and application for detecting the degree of bus trajectory deviation, which can first exclude abnormal driving trajectories caused by bus onboard computer failure during calculation, and then calculate the degree of bus deviation based on the grid and Flamenche distance.
[0006] In a first aspect, the present application provides a bus track deviation detection method, comprising:
[0007] Obtaining a driving trajectory point and a planned trajectory point of a bus, obtaining a driving trajectory according to the driving trajectory points, obtaining a planned trajectory according to the planned trajectory points, and removing abnormal driving trajectory segments from the driving trajectory to obtain a normal driving trajectory;
[0008] The normal driving trajectory and the planned trajectory are projected into a grid, the grid where the planned trajectory is located is traversed, and the driving trajectory in the grid is obtained. The starting point and the ending point of the driving trajectory segment of the current grid are projected into the corresponding planned trajectory segment to obtain the driving projection point. The starting point and the ending point of the planned trajectory segment of the current grid are projected into the corresponding driving trajectory segment to obtain the planning projection point. The closest distance from the driving projection point of the current grid to the planned trajectory is calculated and the corresponding point pair is obtained as the planned trajectory segmentation point pair. The closest distance from the planning projection point of the current grid to the driving trajectory is calculated and the corresponding point pair is obtained as the row The driving trajectory segmentation point pairs are used to segment the planned trajectory in the current grid to obtain a segmented planned trajectory. The driving trajectory segmentation point pairs are used to segment the driving trajectory in the current grid to obtain a segmented driving trajectory. The Flamenche distance between the segmented driving trajectory and the segmented planned trajectory in each grid is calculated. If the Flamenche distance is less than a first set threshold, it is considered that the driving trajectory segment in the grid is successfully matched. The number of the grid where the planned trajectory is located is obtained, and the degree of bus trajectory deviation is obtained based on the number of grids where the driving trajectory segment is successfully matched and the number of grids where the planned trajectory is located.
[0009] In a second aspect, the present application provides a bus track deviation degree detection device, comprising:
[0010] Acquisition module: acquires the driving trajectory points and planned trajectory points of a bus, acquires the driving trajectory according to the driving trajectory points, acquires the planned trajectory according to the planned trajectory points, and eliminates abnormal driving trajectory segments from the driving trajectory to obtain a normal driving trajectory;
[0011] Calculation module: Project the normal driving trajectory and the planned trajectory into a grid, traverse the grid where the planned trajectory is located, and obtain the driving trajectory in the grid, project the starting point and the end point of the driving trajectory segment of the current grid into the corresponding planned trajectory segment to obtain the driving projection point, project the starting point and the end point of the planned trajectory segment of the current grid into the corresponding driving trajectory segment to obtain the planning projection point, calculate the closest distance from the driving projection point of the current grid to the planned trajectory and obtain the corresponding point pair as the planned trajectory segmentation point pair, calculate the closest distance from the planned projection point of the current grid to the driving trajectory and obtain the corresponding point pair As the driving trajectory segmentation point pair, the planned trajectory is segmented in the current grid using the planned trajectory segmentation point pair to obtain a segmented planned trajectory. The driving trajectory is segmented in the current grid using the driving trajectory segmentation point pair to obtain a segmented driving trajectory. The Flamenche distance between the segmented driving trajectory and the segmented planned trajectory in each grid is calculated. If the Flamenche distance is less than a first set threshold, it is considered that the driving trajectory segment in the grid is successfully matched. The number of the grid where the planned trajectory is located is obtained, and the degree of bus trajectory deviation is obtained based on the number of grids where the driving trajectory segment successfully matches and the number of grids where the planned trajectory is located.
[0012] In a third aspect, the present application provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute a method for detecting the degree of bus track deviation.
[0013] In a fourth aspect, the present application provides a readable storage medium, in which a computer program is stored. The computer program includes a program code for controlling a process to execute a process, and the process includes a method for detecting the degree of bus track deviation.
[0014] Compared with the existing technology, this technical solution has the following characteristics and beneficial effects:
[0015] This solution eliminates abnormal driving trajectories caused by vehicle offline based on the speed between two adjacent trajectory points of the planned trajectory and the driving trajectory; this solution eliminates abnormal driving trajectories caused by vehicle offline by measuring the distance between the planned trajectory and the driving trajectory and the positions of the starting and ending points; this solution eliminates abnormal driving trajectories caused by vehicle drift through a thinning algorithm and a grid method; after eliminating all abnormal driving trajectories, this solution projects the normal driving trajectory and the planned trajectory onto a grid, and then uses thinning and other methods to obtain possible offset trajectory points; this solution reduces the error of subsequent calculations by first eliminating abnormal driving trajectories, and further increases the accuracy of the calculation through the Flamenche distance algorithm and the grid method.
[0016] The details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 is a flow chart of a method for detecting the degree of bus track deviation according to an embodiment of the present application;
[0019] Figure 2 is a schematic diagram of an abnormal driving trajectory segment according to an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of calculating the degree of trajectory deviation according to an embodiment of the present application;
[0021] Figure 4 This is a structural block diagram of a bus track deviation degree detection device according to an embodiment of the present application;
[0022] Figure 5 Schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments are not intended to represent all implementations consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with certain aspects of one or more embodiments of this specification, as detailed in the appended claims.
[0024] It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than those described in this specification. In addition, a single step described in this specification may be broken down into multiple steps for description in other embodiments, and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0025] To facilitate understanding of this solution, the bus trajectory generation method of this solution is explained here:
[0026] There is usually a bus onboard machine in the bus, which will mark points at a certain frequency and report GPS. By connecting these points, the bus's trajectory route can be obtained.
[0027] Example 1
[0028] This application provides a method for detecting the degree of bus track deviation. Figure 1 , the method comprising:
[0029] Obtaining a driving trajectory point and a planned trajectory point of a bus, obtaining a driving trajectory according to the driving trajectory points, obtaining a planned trajectory according to the planned trajectory points, and removing abnormal driving trajectory segments from the driving trajectory to obtain a normal driving trajectory;
[0030] The normal driving trajectory and the planned trajectory are projected into a grid, the grid where the planned trajectory is located is traversed, and the driving trajectory in the grid is obtained. The starting point and the ending point of the driving trajectory segment of the current grid are projected into the corresponding planned trajectory segment to obtain the driving projection point. The starting point and the ending point of the planned trajectory segment of the current grid are projected into the corresponding driving trajectory segment to obtain the planning projection point. The closest distance from the driving projection point of the current grid to the planned trajectory is calculated and the corresponding point pair is obtained as the planned trajectory segmentation point pair. The closest distance from the planning projection point of the current grid to the driving trajectory is calculated and the corresponding point pair is obtained as the row The driving trajectory segmentation point pairs are used to segment the planned trajectory in the current grid to obtain a segmented planned trajectory. The driving trajectory segmentation point pairs are used to segment the driving trajectory in the current grid to obtain a segmented driving trajectory. The Flamenche distance between the segmented driving trajectory and the segmented planned trajectory in each grid is calculated. If the Flamenche distance is less than a first set threshold, it is considered that the driving trajectory segment in the grid is successfully matched. The number of the grid where the planned trajectory is located is obtained, and the degree of bus trajectory deviation is obtained based on the number of grids where the driving trajectory segment is successfully matched and the number of grids where the planned trajectory is located.
[0031] In some embodiments, the purpose of removing abnormal driving trajectory segments from the driving trajectory is to improve the accuracy of subsequent calculations. Abnormal trajectories will bring great noise when calculating the degree of deviation in the subsequent calculation, so they need to be removed.
[0032] In some embodiments, in the step of "eliminating abnormal driving trajectory segments from the driving trajectory to obtain a normal driving trajectory", the planned trajectory and the driving trajectory are encoded and sorted in chronological order, and the driving trajectory segments in which the speeds of the two trajectory points before and after the driving trajectory exceed a first set speed or the distance between the two trajectory points exceeds a first set distance are detected as abnormal driving trajectories.
[0033] Specifically, the above-mentioned abnormal driving trajectory confirmation method can eliminate abnormal driving trajectories caused by the vehicle being offline. The vehicle being offline means that the GPS report is missing for a period of time during the vehicle operation, or the bus's on-board machine is recording at the same location for a period of time.
[0034] Specifically, geohash7 can be used to encode the planned trajectory and driving trajectory and sort them in chronological order. The purpose of this is to accurately view the actual running order of the driving trajectory. The geohash7 converts the two-dimensional latitude and longitude into a string, and each string represents a rectangular area. It is a coding method.
[0035] Specifically, in this solution, the first set speed is 30m / s, and the first set distance is 500 meters. Based on big data statistics, the speed of buses is within 30m / s. If it exceeds 30m / s, it usually occurs in places such as highways and overpasses, which does not meet the actual urban traffic needs. The frequency of the on-board computer of a conventional bus is one point every 10 seconds. If the distance between two points is greater than 500 meters, it is considered that the bus is traveling too fast and does not meet the urban traffic needs. When the first set speed is greater than 30m / s or the first set distance between two adjacent track points is greater than 500m, it is considered an abnormal driving trajectory and will be eliminated. When the on-board computer of the bus is marking at the same location, the next point will be far away, resulting in the first set distance being greater than 500m, and it will be eliminated.
[0036] In some embodiments, in the step of "eliminating abnormal driving trajectory segments from the driving trajectory to obtain a normal driving trajectory", the planned trajectory and the driving trajectory are encrypted, the trajectory matching rate of the driving trajectory and the planned trajectory is calculated, the distance between the driving trajectory and the starting point of the planned trajectory is obtained as the starting point distance, the distance between the driving trajectory and the ending point of the planned trajectory is obtained as the ending point distance, the distance of the driving trajectory is obtained as the driving distance, and the distance of the planned trajectory is obtained as the planned distance. When there is a driving trajectory segment whose starting point distance is greater than the driving distance or the ending point distance is greater than the driving distance by a value greater than a second set threshold, and the trajectory matching rate is less than a third set threshold, and the driving distance is less than the planned distance, the driving trajectory segment is considered to be an abnormal driving trajectory.
[0037] Furthermore, the planned trajectory and the driving trajectory are encrypted when they are encoded.
[0038] Specifically, due to the frequency of normal vehicle-mounted machine marking, the presented trajectory points are sparse. After encryption, the trajectory points can be marked at a frequency of one point every 10 meters, ensuring the trajectory quality of the driving trajectory and the planned trajectory.
[0039] Specifically, the above-mentioned abnormal driving trajectory confirmation method can eliminate abnormal driving trajectories caused by vehicle disconnection. Vehicle disconnection refers to an abnormal driving trajectory caused by the loss of the starting point and end point of the driving trajectory due to a malfunction of the on-board machine.
[0040] Specifically, geohash8 can be used to encode the driving trajectory and the planned trajectory.
[0041] In some specific embodiments, the driving trajectory and the planned trajectory are projected onto a grid, the number of grids where the planned trajectory is located is obtained, the number of grids where the driving trajectory and the planned trajectory match is obtained, and the trajectory matching rate is obtained by dividing the number of grids where the driving trajectory and the planned trajectory match by the number of grids where the planned trajectory is located. The trajectory matching rate is denoted as match rate.
[0042] In some specific embodiments, the starting point distance is denoted as dist1, the ending point distance is denoted as dist2, the planned distance is denoted as mdm_dist, the driving distance is denoted as shift_dist, the second set threshold is set to 0.07, and the third set threshold is set to 0.9. When the driving trajectory segment satisfies dist1 / shift_dist > 0.07 or dist2 / shift_dist > 0.07 and match_rate < 0.9 and shift_dist < mdm_dist, this driving trajectory segment is considered an abnormal driving trajectory.
[0043] Specifically, when match_rate < 0.9, it indicates that the trajectory matching rate between the driving trajectory and the planned trajectory is below 0.9, and there is likely an abnormality. dist1 / shift_dist > 0.07 or dist2 / shift_dist > 0.07 means that there is a large distance between the starting point and the ending point of the planned trajectory and the driving trajectory, indicating a problem of missing the starting point or the ending point of the driving trajectory.
[0044] In some embodiments, in the step of "eliminating abnormal driving trajectory segments from the driving trajectory to obtain a normal driving trajectory", the driving trajectory points of the driving trajectory and the planned trajectory points of the planned trajectory are obtained, the driving trajectory points and the planned trajectory points are projected into a grid to obtain a driving grid and a planning grid, the grid matching rate of the driving grid to the planning grid is calculated, the driving trajectory segments with a grid matching rate less than a fourth set threshold are used as candidate drift trajectory segments, the candidate drift trajectory segments and the planned trajectory are thinned to obtain thinned driving trajectory points and thinned planning trajectory points, the correspondence between the thinned driving trajectory points and the thinned planning trajectory points is obtained to obtain multiple thinned point pairs, and the number of thinned point pairs for each thinned point is calculated. The angles and distances between the sparse driving trajectory points and the corresponding sparse planning trajectory points are determined. The sparse point pairs with distances below the fifth set threshold are retained, and all the sparse point pairs are divided into multiple point sets according to their angle information. The point pairs in each point set with distances less than the sixth set threshold are obtained as similar sparse point pairs. The point set with the largest number of similar sparse point pairs is obtained. If the proportion of similar sparse point pairs in the point set to all similar sparse point pairs reaches the seventh set threshold, and the number of sparse point pairs is greater than the eighth set threshold, and the average drift distance of the sparse point pairs in the point set is greater than the ninth set threshold, the driving trajectory segment corresponding to the sparse point pairs in the point set is considered to be an abnormal driving trajectory.
[0045] For example, Figure 2 The two trajectories in are one planning trajectory and one driving trajectory. Some driving trajectories have trajectory drift problems, and the trajectory segments with trajectory drift are removed.
[0046] Specifically, the above method can eliminate abnormal driving trajectories caused by point drift, which is caused by the point drifting in a fixed direction due to the marking error of the bus's onboard computer.
[0047] Specifically, after projecting the driving trajectory points and the planned trajectory points into a grid to obtain a driving grid and a planned grid, the grid ID is used to replace the trajectory points and the grid matching rate is calculated.
[0048] In some specific embodiments, since grid IDs are used instead of trajectory points, the grid size is 20m*20m. The purpose of using this grid size is to ensure the accuracy of subsequent calculations. If the grid is too large or too small, the calculation accuracy will be affected.
[0049] In some specific embodiments, the grid matching rate is the ratio of the successfully matched grid to all planned trajectory grids, the fourth set threshold is 0.8, and the driving trajectory segment with the grid matching rate less than 0.8 is used as a candidate drift trajectory segment.
[0050] In some specific embodiments, the fifth set threshold is 250 meters, that is, the thinned point pairs with a distance below 250 meters are retained, the angle information is 90°, and 4 point sets are constructed with each 90° interval as a set, and each point set contains multiple thinned point pairs.
[0051] In some specific embodiments, the sixth set threshold is 50 meters, that is, if the distance between the thinned point pairs in each point set is less than 50 meters, the point pairs are considered to be similar thinned point pairs.
[0052] In some specific embodiments, the seventh set threshold is 0.35, the eighth set threshold is 4, and the ninth set threshold is 50 meters. That is to say, if the proportion of similar thinned point pairs in one point set to all similar thinned point pairs reaches 0.35, and the number of thinned point pairs in the point set is greater than 4, and the average drift distance of the thinned point pairs in the point set is greater than 50 meters, then the driving trajectory segment corresponding to the thinned point pairs in the point set is considered to be an abnormal driving trajectory.
[0053] Specifically, a dynamic time warping algorithm is used to obtain the correspondence between the thinned driving trajectory points and the thinned planning trajectory points.
[0054] The dynamic time warping algorithm is mostly used to calculate the similarity of time series. It is an existing technology and will not be described in detail in this solution.
[0055] Furthermore, in the step of "thinning the candidate drift trajectory segments and the planned trajectory to obtain thinned driving trajectory points and thinned planning trajectory points", the candidate drift trajectory segments and the planned trajectory segments are thinned to obtain preliminary thinned driving trajectory points and preliminary thinned planning trajectory points, and the angles of every three points in the preliminary thinned driving trajectory points and the preliminary thinned planning trajectory points are calculated sequentially, and the points whose angles are within the first set interval are saved as thinned driving trajectory points and thinned planning trajectory points.
[0056] Specifically, the first setting interval is 20°-160°, and points with angles within 20°-160° are used as thinning driving trajectory points and thinning planning trajectory points.
[0057] In some embodiments, before “projecting the normal driving trajectory and the planned trajectory into a grid”, the normal driving trajectory and the planned trajectory are encrypted.
[0058] In some embodiments, the driving trajectory existing in the grid where the planned trajectory is located is traversed, and the driving trajectory is compared with the planned trajectories of the adjacent 8 grids to determine whether they match.
[0059] Furthermore, the normal driving trajectory and the planned trajectory are encrypted every 10 meters.
[0060] In some specific embodiments, the grid used in “projecting the normal driving trajectory and the planned trajectory into a grid” is a grid of 100m*100m in size.
[0061] In some specific embodiments, the purpose of segmentation is to separate the overlapping portion of the normal driving trajectory and the planned trajectory, thereby improving the accuracy of calculating the degree of deviation.
[0062] In some specific embodiments, the first set distance is 120 m, and if the Flamenche distance is less than 120 m, it is considered that the driving trajectory segment within the grid is successfully matched.
[0063] Specifically, the Flemingham distance is the shortest maximum distance between two directional curves, which cannot be backtracked. The calculation method of the Flemingham distance is prior art and will not be further described in this solution.
[0064] For example, Figure 3 As shown, the light-colored part is the planned trajectory, and the dark-colored part is the driving trajectory. This solution can calculate the degree of deviation of the driving trajectory.
[0065] In some embodiments, in the step of "obtaining the degree of bus track deviation based on the number of grids where the driving track segments are successfully matched and the number of grids where the planned track is located", the degree of bus track deviation is obtained by dividing the number of grids where the driving track segments are successfully matched by the number of grids where the planned track is located.
[0066] Example 2
[0067] Based on the same idea, refer to Figure 4 , the present application also proposes a bus track deviation degree detection device, comprising:
[0068] Acquisition module: Acquiring a driving trajectory point and a planned trajectory point of a bus, obtaining a driving trajectory and a planned trajectory according to the driving trajectory points and the planned trajectory points, and eliminating abnormal driving trajectory segments from the driving trajectory to obtain a normal driving trajectory;
[0069] A calculation module is provided: projecting the normal driving trajectory and the planned trajectory into a grid, obtaining a driving trajectory segment and a planned trajectory segment in each grid, projecting the starting point and the ending point of the driving trajectory segment into the corresponding planned trajectory segment to obtain a running projection point, projecting the starting point and the ending point of the planned trajectory segment into the corresponding driving trajectory segment to obtain a planned projection point, calculating the closest distances from the starting point and the ending point of the driving trajectory to the planned projection point and obtaining the corresponding point pair as a driving trajectory segmentation point pair, calculating the closest distances from the starting point and the ending point of the planned trajectory to the running projection point and obtaining the corresponding point pair as a planned trajectory segmentation point pair, using the driving trajectory segmentation point and the planned trajectory segmentation point to segment the trajectory in the grid to obtain a segmented driving trajectory and a segmented planned trajectory, calculating the Flamenche distance between the segmented driving trajectory and the segmented planned trajectory of each grid, and if the Flamenche distance is less than a first set threshold, it is considered that the driving trajectory segment in the grid is successfully matched, obtaining the number of grids where the planned trajectory is located, and obtaining the degree of bus trajectory deviation based on the number of grids where the driving trajectory segment is successfully matched and the number of grids where the planned trajectory is located.
[0070] Example 3
[0071] This embodiment also provides an electronic device, referring to Figure 5 , including a memory 404 and a processor 402, wherein the memory 404 stores a computer program, and the processor 402 is configured to run the computer program to execute the steps in any of the above-mentioned bus track cheapness detection method embodiments.
[0072] Specifically, the processor 402 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0073] Memory 404 may include a large-capacity memory 404 for data or instructions. By way of example, and not limitation, memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 404 may include removable or non-removable (or fixed) media. Where appropriate, memory 404 may be internal or external to the data processing device. In certain embodiments, memory 404 is non-volatile memory. In certain embodiments, memory 404 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM) or a flash memory (FLASH), or a combination of two or more of these. In appropriate circumstances, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM may be a fast page mode dynamic random access memory 404 (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0074] The memory 404 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 402 .
[0075] The processor 402 reads and executes the computer program instructions stored in the memory 404 to implement the implementation process of any one of the bus track deviation degree detection methods in the above embodiments.
[0076] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408 , wherein the transmission device 406 is connected to the processor 402 , and the input / output device 408 is connected to the processor 402 .
[0077] Transmission device 406 can be used to receive or transmit data via a network. Specific examples of such networks may include wired or wireless networks provided by the electronic device's communications provider. In one embodiment, the transmission device includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, transmission device 406 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0078] The input and output device 408 is used to input or output information. In this embodiment, the input information may be the driving trajectory and planned trajectory of the bus, and the output information may be the degree of deviation of the bus.
[0079] Optionally, in this embodiment, the processor 402 may be configured to execute the following steps through a computer program:
[0080] S101. Obtaining driving trajectory points and planned trajectory points of a bus, obtaining a driving trajectory based on the driving trajectory points, obtaining a planned trajectory based on the planned trajectory points, and removing abnormal driving trajectory segments from the driving trajectory to obtain a normal driving trajectory;
[0081] S102: Project the normal driving trajectory and the planned trajectory into a grid, traverse the grid where the planned trajectory is located, and obtain the driving trajectory in the grid, project the starting point and the ending point of the driving trajectory segment of the current grid into the corresponding planned trajectory segment to obtain the driving projection point, project the starting point and the ending point of the planned trajectory segment of the current grid into the corresponding driving trajectory segment to obtain the planning projection point, calculate the closest distance from the driving projection point of the current grid to the planned trajectory and obtain the corresponding point pair as the planned trajectory segmentation point pair, calculate the closest distance from the planned projection point of the current grid to the driving trajectory and obtain the corresponding point pair As the driving trajectory segmentation point pair, the planned trajectory is segmented in the current grid using the planned trajectory segmentation point pair to obtain a segmented planned trajectory. The driving trajectory is segmented in the current grid using the driving trajectory segmentation point pair to obtain a segmented driving trajectory. The Flamenche distance between the segmented driving trajectory and the segmented planned trajectory in each grid is calculated. If the Flamenche distance is less than a first set threshold, it is considered that the driving trajectory segment in the grid is successfully matched. The number of the grid where the planned trajectory is located is obtained, and the degree of bus trajectory deviation is obtained based on the number of grids where the driving trajectory segment successfully matches and the number of grids where the planned trajectory is located.
[0082] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be repeated here.
[0083] In general, various embodiments may be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention may be implemented in hardware, while other aspects may be implemented in firmware or software that may be executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flow charts, or using some other graphical representation, it should be understood that, as non-limiting examples, the blocks, devices, systems, techniques, or methods described herein may be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or a controller or other computing device, or some combination thereof.
[0084] The embodiments of the present invention may be implemented by computer software that is executable by a data processor of a mobile device, such as in a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets and / or macros may be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. A computer program product may include one or more computer executable components that are configured to perform an embodiment when the program is run. One or more computer executable components may be at least one software code or a portion thereof. In addition, it should be noted at this point that, for example, Figure 5Any block of the logic flow in the program may represent program steps, or interconnected logic circuits, blocks and functions, or a combination of program steps and logic circuits, blocks and functions. The software may be stored on physical media such as memory chips or memory blocks implemented within the processor, magnetic media such as hard disks or floppy disks, and optical media such as, for example, DVDs and their data variants, CDs, etc. Physical media are non-transitory media.
[0085] Those skilled in the art should understand that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0086] The above embodiments merely illustrate several embodiments of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for detecting the degree of bus track deviation, characterized in that: The following steps are involved: Obtaining a driving trajectory point and a planned trajectory point of a bus, obtaining a driving trajectory according to the driving trajectory points, obtaining a planned trajectory according to the planned trajectory points, and removing abnormal driving trajectory segments from the driving trajectory to obtain a normal driving trajectory; The normal driving trajectory and the planned trajectory are projected into a grid, the grid where the planned trajectory is located is traversed, and the driving trajectory in the grid is obtained. The starting point and the ending point of the driving trajectory segment of the current grid are projected into the corresponding planned trajectory segment to obtain the driving projection point. The starting point and the ending point of the planned trajectory segment of the current grid are projected into the corresponding driving trajectory segment to obtain the planning projection point. The closest distance from the driving projection point of the current grid to the planned trajectory is calculated and the corresponding point pair is obtained as the planned trajectory segmentation point pair. The closest distance from the planning projection point of the current grid to the driving trajectory is calculated and the corresponding point pair is obtained as the row The driving trajectory segmentation point pair is used to segment the planned trajectory in the current grid to obtain a segmented planned trajectory. The driving trajectory segmentation point pair is used to segment the driving trajectory in the current grid to obtain a segmented driving trajectory. The Flamenche distance between the segmented driving trajectory and the segmented planned trajectory in each grid is calculated. If the Flamenche distance is less than a first set threshold, it is considered that the driving trajectory segment in the grid is successfully matched. The number of grids where the planned trajectory is located is obtained, and the number of grids where the driving trajectory segment is successfully matched is divided by the number of grids where the planned trajectory is located to obtain the degree of bus trajectory deviation.
2. A bus track deviation degree detection method according to claim 1, characterized in that: In the step of "eliminating abnormal driving trajectory segments from the driving trajectory to obtain a normal driving trajectory", the planned trajectory and the driving trajectory are encoded and sorted in chronological order, and a driving trajectory segment in which the speed of two trajectory points before and after the driving trajectory exceeds a first set speed or the distance between the two trajectory points exceeds a first set distance is detected as an abnormal driving trajectory.
3. A bus track deviation degree detection method according to claim 1, characterized in that: In the step of "eliminating abnormal driving trajectory segments from the driving trajectory to obtain a normal driving trajectory", the planned trajectory and the driving trajectory are encrypted, the trajectory matching rate of the driving trajectory and the planned trajectory is calculated, the distance between the driving trajectory and the starting point of the planned trajectory is obtained as the starting point distance, the distance between the driving trajectory and the ending point of the planned trajectory is obtained as the ending point distance, the distance of the driving trajectory is obtained as the driving distance, and the distance of the planned trajectory is obtained as the planned distance. When there is a driving trajectory segment where the ratio of the starting point distance to the upper driving distance or the ratio of the ending point distance to the upper driving distance is greater than a second set threshold, the trajectory matching rate is less than a third set threshold, and the driving distance is less than the planned distance, the driving trajectory segment is considered to be an abnormal driving trajectory.
4. A bus track deviation degree detection method according to claim 3, characterized in that: When encoding the planned trajectory and the driving trajectory, the planned trajectory and the driving trajectory are encrypted.
5. A bus track deviation degree detection method according to claim 1, characterized in that: In the step of "eliminating abnormal driving trajectory segments from the driving trajectory to obtain a normal driving trajectory", driving trajectory points of the driving trajectory and planned trajectory points of the planned trajectory are obtained, the driving trajectory points and the planned trajectory points are projected into a grid to obtain a driving grid and a planning grid, a grid matching rate of the driving grid to the planning grid is calculated, driving trajectory segments with a grid matching rate less than a fourth set threshold are used as candidate drift trajectory segments, the candidate drift trajectory segments and the planned trajectory are thinned to obtain thinned driving trajectory points and thinned planning trajectory points, a correspondence between the thinned driving trajectory points and the thinned planning trajectory points is obtained to obtain a plurality of thinned point pairs, and a number of thinned point pairs are calculated for each thinned driving trajectory segment. The angle and distance between the trace points and the corresponding thinning planning trajectory points are retained, and the thinning point pairs with a distance below the fifth set threshold are retained, and all the thinning point pairs are divided into multiple point sets according to their angle information. The point pairs with a distance between the thinning point pairs less than the sixth set threshold in each point set are obtained as similar thinning point pairs, and the point set with the largest number of similar thinning point pairs is obtained. If the proportion of similar thinning point pairs in the point set to all similar thinning point pairs reaches the seventh set threshold, and the number of thinning point pairs is greater than the eighth set threshold, and the average drift distance of the thinning point pairs in the point set is greater than the ninth set threshold, the driving trajectory segment corresponding to the thinning point pairs in the point set is considered to be an abnormal driving trajectory.
6. A bus track deviation degree detection method according to claim 5, characterized in that: In the step of "thinning the candidate drift trajectory segments and the planned trajectory to obtain thinned driving trajectory points and thinned planned trajectory points", preliminary thinned driving trajectory points and preliminary thinned planned trajectory points are obtained after thinning the candidate drift trajectory segments and the planned trajectory segments, and the angles of every three points in the preliminary thinned driving trajectory points and the preliminary thinned planned trajectory points are calculated sequentially, and the points whose angles are within the first set interval are saved as thinned driving trajectory points and thinned planned trajectory points.
7. A bus track deviation degree detection device, characterized in that: include: Acquisition module: acquires the driving trajectory points and planned trajectory points of a bus, acquires the driving trajectory according to the driving trajectory points, acquires the planned trajectory according to the planned trajectory points, and eliminates abnormal driving trajectory segments from the driving trajectory to obtain a normal driving trajectory; Calculation module: Project the normal driving trajectory and the planned trajectory into a grid, traverse the grid where the planned trajectory is located, and obtain the driving trajectory in the grid, project the starting point and the ending point of the driving trajectory segment of the current grid into the corresponding planned trajectory segment to obtain the driving projection point, project the starting point and the ending point of the planned trajectory segment of the current grid into the corresponding driving trajectory segment to obtain the planning projection point, calculate the closest distance from the driving projection point of the current grid to the planned trajectory and obtain the corresponding point pair as the planned trajectory segmentation point pair, calculate the closest distance from the planned projection point of the current grid to the driving trajectory and obtain the corresponding point pair as the planned trajectory segmentation point pair The driving trajectory segmentation point pair is used to segment the planned trajectory in the current grid to obtain a segmented planned trajectory. The driving trajectory segmentation point pair is used to segment the driving trajectory in the current grid to obtain a segmented driving trajectory. The Flamenche distance between the segmented driving trajectory and the segmented planned trajectory in each grid is calculated. If the Flamenche distance is less than a first set threshold, it is considered that the driving trajectory segment in the grid is successfully matched. The number of grids where the planned trajectory is located is obtained, and the degree of bus trajectory deviation is calculated by dividing the number of grids where the driving trajectory segment is successfully matched by the number of grids where the planned trajectory is located.
8. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the method for detecting the degree of bus track deviation according to any one of claims 1 to 6.
9. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which includes a program code for controlling a process to execute a process, wherein the process includes a bus track deviation degree detection method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Route deviation detection method and device and electronic equipment
CN110749319A
Online hailed car yaw detection method and device, electronic equipment and storage medium
CN113902210A