Mountain rural road track linear smoothing method and device and electronic equipment
通过对山区农村公路轨迹数据进行圆滑处理,包括判断轨迹点间距和夹角,进行插值和删除操作,解决了卫星信号弱导致的数据偏移问题,实现了轨迹数据的高精度和可信度。
Patent Information
- Application Number
- CN202510018830.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-02-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Due to the complex terrain and weak satellite signals in rural roads in mountainous areas, it is difficult to obtain high-precision spatial position data, resulting in offsets and errors in trajectory data, affecting the credibility of the data.
By obtaining the trajectory data of the preset highway, extracting adjacent preset number of trajectory points to determine whether they meet the smooth conditions. If not, adjust the trajectory points according to the preconfigured adjustment rules, including interpolation and deletion of trajectory points. To ensure that the track point spacing and angle meet the preset threshold.
It effectively corrects the data offset caused by weak satellite signals, improves the accuracy and credibility of rural road trajectory data, and ensures that the trajectory line shape is smooth and conforms to the actual road shape.
Smart Images

Figure CN119441208A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of trajectory correction, and in particular to a method, device and electronic equipment for smoothing the linear shape of a mountainous rural highway trajectory. Background Art
[0002] Due to geographical constraints, more than 1.9 million kilometers of rural roads are located in mountainous areas, of which about 530,000 kilometers are complex terrain, many bends, and the minimum bending radius is less than 45 degrees, which brings great challenges to traffic management and facility maintenance. In addition, the mountainous area has a harsh geographical environment and unstable communication signals, especially weak satellite signals or local lack of satellite signals, which leads to offsets or errors in the spatial location information of rural road facilities.
[0003] Among them, due to factors such as the undulating terrain and dense vegetation in mountainous areas, satellite signals are easily interfered with or blocked, resulting in insufficient signal strength. The speed of vehicles on mountain roads is uneven, especially when slowing down or accelerating at bends, which further increases the difficulty of obtaining high-precision data. The above factors work together to make the credibility interval value of the spatial position data of rural roads obtained larger, resulting in the spatial position offset of local rural road facilities. Specifically, the satellite position data has no track signal and inertial drift, which affects the data accuracy.
[0004] To solve the above problems, a technical solution is needed that can effectively correct the data deviation caused by weak satellite signals and ensure the accuracy of rural road alignment. Summary of the invention
[0005] In view of this, the object of the present invention is to provide a method, device and electronic equipment for smoothing the trajectory of rural roads in mountainous areas.
[0006] In a first aspect, an implementation example of the present invention provides a method for smoothing the trajectory of a rural road in a mountainous area, wherein the method comprises: obtaining trajectory data of a preset road, wherein the trajectory data comprises a plurality of trajectory points, and the trajectory points are obtained based on satellite position data; extracting a preset number of adjacent trajectory points in sequence from the trajectory data, and judging whether the trajectory points meet a pre-configured smoothing condition based on the satellite position data of the trajectory points; wherein the satellite position data of each trajectory point comprises the longitude and latitude and time value of the trajectory point; the smoothing condition is determined based on the spacing and angle information of a preset number of trajectory points; if the smoothing condition is not met, adjusting the trajectory points according to a pre-configured adjustment rule, wherein the adjustment rule is used to smooth the trajectory points.
[0007] In combination with the first aspect, an implementation example of the present invention provides a first implementation of the first aspect, wherein the step of determining whether the trajectory point satisfies a pre-configured smoothing condition based on the satellite position data of the trajectory point comprises: calculating the trajectory point spacing between the trajectory points based on the longitude and latitude of a preset number of trajectory points; determining whether the trajectory point spacing exceeds a preset first spacing threshold; and if so, determining that the preset number of trajectory points do not satisfy the preset smoothing condition.
[0008] In combination with the first aspect, an implementation example of the present invention provides a second implementation of the first aspect, wherein the step of adjusting the trajectory points according to a pre-configured adjustment rule includes: calculating the interpolation position corresponding to the trajectory point based on the trajectory point spacing of a preset number of trajectory points and the longitude and latitude of the trajectory point; determining the target time value corresponding to the interpolation position based on the time value of the trajectory point and a preset time threshold; inserting the target trajectory point at the interpolation position, and setting the target time value to the satellite position time of the target trajectory point to adjust the trajectory point of the trajectory data.
[0009] In combination with the first aspect, an implementation example of the present invention provides a third implementation of the first aspect, wherein the step of sequentially extracting a preset number of adjacent trajectory points from the trajectory data includes: extracting two adjacent trajectory points from the trajectory data, or extracting two interval trajectory points from the trajectory data.
[0010] In combination with the first aspect, an implementation example of the present invention provides a fourth implementation of the first aspect, wherein the step of determining whether the trajectory point satisfies a pre-configured smoothing condition based on the collected information of the trajectory point further includes: determining whether the trajectory point spacing is less than a preset second spacing threshold; the second spacing threshold is less than the first spacing threshold; if so, determining that a preset number of trajectory points do not satisfy the preset smoothing condition; the step of adjusting the trajectory points according to a pre-configured adjustment rule includes: deleting the preset trajectory points among the preset number of trajectory points.
[0011] In combination with the first aspect, an implementation example of the present invention provides a fifth implementation of the first aspect, wherein the step of sequentially extracting a preset number of adjacent trajectory points from the trajectory data includes: extracting three consecutive trajectory points from the trajectory data, or extracting three interval trajectory points from the trajectory data.
[0012] In combination with the first aspect, an implementation example of the present invention provides a sixth implementation of the first aspect, wherein the step of determining whether the trajectory point satisfies a pre-configured smoothing condition based on the collected information of the trajectory point comprises: calculating the trajectory point angle formed by the connecting lines of the three trajectory points according to the longitude and latitude of each trajectory point; determining whether the trajectory point angle is less than a preset first angle threshold; if so, determining that a preset number of trajectory points do not satisfy the preset smoothing condition.
[0013] In combination with the first aspect, an implementation example of the present invention provides a seventh implementation of the first aspect, wherein the step of adjusting the trajectory points according to a preconfigured adjustment rule includes: adjusting the vertex position of the trajectory point angle based on the internal difference method so that the trajectory point angle satisfies a preset second angle threshold; wherein the second angle threshold is greater than the first angle threshold.
[0014] In a second aspect, an example implementation of the present invention provides a device for smoothing the trajectory of a rural road in a mountainous area, wherein the device includes: a data acquisition module, used to acquire trajectory data of a preset road, wherein the trajectory data includes multiple trajectory points, and the trajectory points are obtained based on satellite position data; a data processing module, used to extract a preset number of adjacent trajectory points from the trajectory data in sequence, and determine whether the trajectory point meets a pre-configured smoothing condition based on the satellite position data of the trajectory point; wherein the satellite position data of each trajectory point includes the longitude and latitude and time value of the trajectory point; the smoothing condition is determined based on the spacing and angle information of a preset number of trajectory points; an execution module, used to adjust the trajectory point according to a pre-configured adjustment rule if the smoothing condition is not met, wherein the adjustment rule is used to smooth the trajectory point.
[0015] In a third aspect, an implementation example of the present invention provides an electronic device, wherein the electronic device includes a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the method for smoothing the trajectory of a rural road in a mountainous area according to any of the above embodiments.
[0016] The embodiments of the present invention bring the following beneficial effects: The embodiments of the present invention provide a method, device and electronic device for smoothing the trajectory of rural roads in mountainous areas, which adjusts the trajectory points based on the angle and spacing of the trajectory points, corrects the position data with a large satellite signal credibility interval value caused by weak satellite signals, solves the current situation of satellite position data drifting forward due to inertia in mountainous areas, and ensures that the trajectory points conform to the actual road shape. The embodiments of the present invention can improve the credibility of satellite position data, achieve the goal of smoothing the trajectory of rural roads, and ensure the accuracy of the trajectory line shape.
[0017] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0018] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 A flow chart of a method for smoothing the trajectory of a rural road in a mountainous area provided by an embodiment of the present invention; Figure 2 A flow chart corresponding to a smooth trajectory provided by an embodiment of the present invention; Figure 3 A flow chart corresponding to a smooth trajectory provided by an embodiment of the present invention; Figure 4 A logical schematic diagram of a smooth trajectory provided by an embodiment of the present invention; Figure 5 A schematic diagram of a trajectory correction effect provided by an embodiment of the present invention; Figure 6 A schematic diagram of the structure of a device for smoothing the trajectory of a rural road in a mountainous area provided by an embodiment of the present invention; Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described in combination with the embodiments below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] The embodiments of the present invention provide a method, device and electronic device for smoothing the trajectory of rural roads in mountainous areas, which can solve the problem of satellite trajectory correction in mountainous areas where satellite information is weak and satellite signal deviation is large. The data accuracy when collecting data on rural roads in mountainous areas, especially rural roads with a small bending radius, can be improved. Moreover, the problem of obtaining satellite positioning information when the satellite positioning is poor due to being blocked by surrounding vegetation, buildings, etc. is solved.
[0023] For ease of understanding, a method for smoothing the trajectory of a rural road in a mountainous area provided by an embodiment of the present invention is first described. Figure 1 FIG. 1 is a flow chart showing a method for smoothing the trajectory of a rural road in a mountainous area provided by an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps: Step S102, obtaining trajectory data of a preset highway.
[0024] The trajectory data includes multiple trajectory points, and the trajectory points are obtained based on satellite position data. The satellite position data of each trajectory point includes the latitude and longitude and time value of the trajectory point. The longitude and latitude represent the geographic coordinates of the vehicle's location, and the time value records the timestamp of each trajectory point, accurate to seconds or milliseconds. During the highway trajectory data collection process, the vehicle uploads data through the network according to the speed. The speed corresponding to each trajectory point is different, resulting in differences in the spacing and time intervals of the trajectory points.
[0025] Step S104: extracting a preset number of adjacent trajectory points from the trajectory data in sequence, and judging whether the trajectory points meet a pre-configured smoothing condition based on the satellite position data of the trajectory points.
[0026] Step S106: If the smoothing condition is not met, the trajectory points are adjusted according to pre-configured adjustment rules.
[0027] Due to factors such as weak satellite signals and non-uniform driving speed, data offset may occur. Correspondingly, the spacing between consecutive trajectory points may not be uniform, and there may also be a situation where the angle of the trajectory points is offset. In this regard, the embodiment of the present invention determines the smoothing condition based on the spacing and angle information of a preset number of trajectory points, and sets adjustment rules accordingly to perform smoothing on the trajectory points.
[0028] Among them, due to the different speeds of vehicles on different road sections, the distance between adjacent trajectory points will vary. For example, on a highway, the speed is faster and the distance between adjacent trajectory points is larger; while on urban roads or mountain roads, the speed is slower and the distance between adjacent trajectory points is smaller. When a vehicle accelerates, decelerates or stops during driving, the time interval between adjacent trajectory points will change. There may be network delays during data upload, further affecting the consistency of the time intervals of the trajectory points. When the above situation occurs, even if a fixed sampling frequency is set (such as collecting once every 100 milliseconds), the actual trajectory point spacing will be different. In this regard, the embodiment of the present invention smoothes the spacing of the trajectory points so that there are trajectory points at the preset distance, fills the data gaps, and ensures path continuity.
[0029] In addition, in mountainous areas, tunnels or densely vegetated areas, satellite signals are easily interfered with or blocked, causing position data drift or increased errors. When a vehicle is traveling on a curve or slope, the position data may drift forward or backward due to inertia. In a highly dynamic environment (such as sudden braking, rapid turns), the vehicle-mounted GPS device may also have certain measurement errors. In this regard, an embodiment of the present invention analyzes the angle formed by multiple trajectory points. If the angle is too small, the angle is increased to make the trajectory data relatively smooth, ensuring that the trajectory points conform to the actual road shape.
[0030] Furthermore, based on the above-mentioned embodiments, the embodiments of the present invention also provide another method for smoothing the trajectory line shape of rural roads in mountainous areas. In order to solve the above-mentioned technical problems, the embodiments of the present invention apply the principle based on the Lagrange interpolation algorithm model to correct the position data of the satellite signal credibility interval value that is too large due to the weak satellite signal when collecting rural roads in mountainous areas, solve the current situation that the satellite position data in mountainous areas drifts forward due to inertia, and improve the credibility of the satellite position data to achieve the accuracy of the rural road line shape. At the same time, the angle between three consecutive points is determined to adjust the position of the middle point and the interpolation algorithm is used to insert new trajectory points to achieve the goal of smoothing the linear shape of rural roads.
[0031] In specific implementation, the embodiments of the present invention mainly include smoothing trajectories, rounding trajectories, and smoothing and rounding of overall trajectory points.
[0032] First, let's explain the smooth trajectory. Figure 2 The flowchart corresponding to the smooth trajectory is shown, refer to Figure 2 The trajectory point line smoothing method of the embodiment of the present invention comprises the following steps: Step S202, obtaining trajectory data of a preset highway.
[0033] Step S204, sequentially extracting a preset number of adjacent trajectory points from the trajectory data, and calculating the trajectory point spacing between the trajectory points according to the latitude and longitude of the preset number of trajectory points.
[0034] In one implementation, the embodiment of the present invention can first extract a preset amount of data from the trajectory data for processing to reduce the global calculation amount and improve processing efficiency. For example, first calculate the data of 10 trajectory points to determine whether the 10 trajectory points meet the preset smoothing conditions. If not, adjust this set of data, and so on, until the trajectory data of the highway is adjusted.
[0035] In a specific implementation, a preset number of trajectory points can be obtained from the above 10 trajectory point data, the spacing between these trajectory points can be calculated, and the smoothness of the trajectory data can be determined based on the spacing. This method can quickly identify and handle abnormal situations in a local range to avoid overall data deviation. In one embodiment, 3 trajectory points can be first obtained from the 10 trajectory point data, and two trajectory points of the three trajectory points can be calculated in turn. When the trajectory data is initially processed, two adjacent trajectory points can be extracted and the spacing between the two can be calculated. When a set of data (such as 10 trajectory points) is processed, two interval trajectory points can be extracted and their spacing can be calculated. For example, the steps of calculating the spacing and adjusting the 1st, 3rd, 5th, 7th, 9th points and the 2nd, 4th, 6th, 8th, and 10th points in chronological order are looped respectively.
[0036] In one embodiment, the L of the currently collected rural roads can be obtained in chronological order. i Inner track point P i A set of latitude, longitude and time values (L long , L lat , T), if L long or L lat When the value of is 0 or empty, it means that the current satellite signal is weak and the trajectory information at this time point is discarded. Further, three consecutive trajectory points (P i , P i+1 , P i+2 ) i To P i+1 Distance D1, P i+1 To P i+2 The distance D2 is used to determine the trajectory point spacing.
[0037] Step S206, determining whether the track point spacing exceeds a preset first spacing threshold, and if so, determining that a preset number of track points do not satisfy a preset rounding condition.
[0038] Step S208, determining whether the track point spacing is less than a preset second spacing threshold, and if so, determining that a preset number of track points do not satisfy a preset smoothing condition.
[0039] Step S210: adjusting the track points according to pre-configured adjustment rules.
[0040] Among them, when the trajectory point spacing exceeds a preset first spacing threshold, the implementation example of the present invention calculates the interpolation position corresponding to the trajectory point based on the trajectory point spacing of a preset number of trajectory points and the longitude and latitude of the trajectory point. In one embodiment, interpolation can be performed at the middle position of the trajectory point spacing. According to the time value of the trajectory point and the preset time threshold, the target time value corresponding to the interpolation position is determined. The target trajectory point is inserted at the interpolation position, and the target time value is set to the satellite position time of the target trajectory point to adjust the trajectory point of the trajectory data. Furthermore, the second spacing threshold is less than the first spacing threshold. When the trajectory point spacing is less than the preset second spacing threshold, the embodiment of the present invention deletes the preset trajectory points among the preset number of trajectory points.
[0041] In the embodiment of the present invention, the first spacing threshold can be set according to the requirements. For example, in the first cycle, the first spacing threshold θ of the data in the set is 10 meters, otherwise it is 20 meters. If D1 is greater than θ, the current speed is fast. In the embodiment of the present invention, P i , P i+1 Insert a trajectory point P i+补 The time of the interpolated trajectory point can be based on P i The time of the point plus the preset time parameter. In one embodiment, a trajectory point can be collected every 1 second, and correspondingly, the preset time parameter can be 100 milliseconds. The time interval of 100 milliseconds can provide a high enough sampling frequency to capture subtle changes in the vehicle's driving process. A higher sampling frequency can record more details, especially in complex sections such as curves and ramps, to ensure the accuracy of the trajectory points. By using a fixed time interval (such as 100 milliseconds) as the time value of the interpolated trajectory point, it can be ensured that the time interval between adjacent trajectory points is relatively uniform, which helps to generate a smoother trajectory line and reduce data mutations or abnormal fluctuations caused by inconsistent time intervals. Furthermore, the embodiment of the present invention processes the trajectory data in a loop. If a trajectory point is inserted into the spacing of the trajectory points, the inserted trajectory point can be used as the first trajectory point for the next calculation (i.e., P i ), and the trajectory data is gradually smoothed in this cycle. If the D1 value is less than 1 meter, the current position is a traffic light or a position with a small turning radius, and P should be deleted. i+1 Track point. For the second track point P i+1 and the third trajectory point P i+2 The smoothing process of the trajectory point spacing (ie, D2) is similar to that of D1, and the first spacing threshold corresponding to D2 can be determined as 20 meters.
[0042] Furthermore, in order to ensure the geometric characteristics and linear quality of the overall path, trajectory points can be added when the distance between three consecutive trajectory points is greater than a preset distance (such as 10 meters), and when it is less than a preset distance (such as 1 meter), the trajectory points (such as the middle point of three consecutive trajectory points) are discarded. This process can perform global optimization and make the line smoother by considering the relative positions of multiple points. Avoid path mutations caused by single interpolation to ensure a smooth transition of the entire trajectory line. After smoothing a group of data (such as 10 trajectory points), the group of data can be smoothed as a whole to extract a preset number of trajectory points at intervals. For example, the above steps are repeated for the 1st, 3rd, 5th, 7th, 9th points and the 2nd, 4th, 6th, 8th, and 10th points in chronological order. Further, the smooth trajectory is explained. Figure 3 The flowchart corresponding to the smooth trajectory is shown, refer to Figure 3 The trajectory point line smoothing method of the embodiment of the present invention comprises the following steps: Step S302, obtaining trajectory data of a preset highway.
[0043] Step S304, sequentially extracting a preset number of adjacent trajectory points from the trajectory data, and calculating the trajectory point angle formed by the lines connecting the three trajectory points according to the longitude and latitude of each trajectory point.
[0044] In combination with the above embodiments, the embodiment of the present invention calculates the angle A1 formed by N consecutive trajectory points, thereby processing the trajectory data smoothly. When the trajectory data is first processed smoothly, three consecutive trajectory points (such as P i , P i+1 , P i+2 ). When a set of data is smoothed, three interval trajectory points can be extracted from the trajectory data, such as the 1st, 3rd, 5th, 7th, 9th trajectory points and the 2nd, 4th, 6th, 8th, 10th trajectory points in chronological order in the set are processed in a cyclic manner according to the smoothing process.
[0045] Step S306, determining whether the trajectory point angle is less than a preset first angle threshold; if so, determining that a preset number of trajectory points do not satisfy a preset smoothing condition.
[0046] Step S308: adjusting the vertex position of the trajectory point angle based on the internal difference method so that the trajectory point angle meets a preset second angle threshold.
[0047] In one embodiment, the first angle threshold may be 90°, and the second angle threshold may be 120°. The specific angles may be determined according to the requirements. If A1 is less than 90°, the position of the trajectory point at the vertex of the angle is adjusted. In the specific implementation, P is adjusted in the direction of increasing the angle. i+1 The latitude and longitude values (L longi+1 , Llat+1i ), so that the new angle (P i , P i+1 , P i+2 ) is equal to 120°. In one embodiment, the calculation can be performed by using the internal difference method, and the angle vertex is moved a certain distance along the angle bisector direction so that the trajectory point angle meets the second angle threshold. Correspondingly, Figure 4 A logical schematic diagram of a smooth trajectory provided by an embodiment of the present invention is shown. Figure 5 FIG. 1 shows a schematic diagram of the trajectory correction effect corresponding to an embodiment of the present invention. Figure 5 In the embodiment of the present invention, the trajectory data after correction is collected by satellite positioning, thereby improving the quality of highway infrastructure data collection and enriching the trajectory points of geographic space data.
[0048] Another method for smoothing the trajectory of rural roads in mountainous areas provided by an embodiment of the present invention performs interpolation processing on trajectory points with too large spacing, retains key data points, and removes duplicate or useless information. It can not only improve the accuracy of the linear shape of rural roads, but also ensure the continuity and integrity between trajectory points, and effectively deal with the data drift problem caused by weak signals or non-uniform speed driving. In addition, the embodiment of the present invention also introduces geometric constraints through angle adjustment to ensure that the trajectory points conform to the actual road shape, effectively reduce the impact caused by measurement errors or data noise, and improve the overall quality of the trajectory points. Furthermore, the embodiment of the present invention calculates the spacing and angle of a small amount of data, can quickly identify and handle abnormal situations in a local range, adjust the position of the trajectory points in time, and avoid overall data deviation. Even in the case of weak signals, high-precision location data can be provided to make the path smoother, reduce mutations, and ensure that the position of the trajectory points is more accurate.
[0049] Furthermore, based on the above method embodiment, the embodiment of the present invention also provides a device for smoothing the track line of rural roads in mountainous areas. Figure 6 The schematic diagram of the structure of a device for smoothing the track line of a mountainous rural road provided by an embodiment of the present invention is shown. Figure 6 The device includes: a data acquisition module 100, used to acquire trajectory data of a preset highway, wherein the trajectory data includes a plurality of trajectory points, and the trajectory points are obtained based on satellite position data; a data processing module 200, used to sequentially extract a preset number of adjacent trajectory points from the trajectory data, and determine whether the trajectory point meets a pre-configured smoothing condition based on the collected information of the trajectory point; wherein the collected information of each trajectory point includes the longitude and latitude and time value of the trajectory point; the smoothing condition is determined based on the spacing and angle information of the preset number of trajectory points; an execution module 300, used to adjust the trajectory point according to a pre-configured adjustment rule if the smoothing condition is not met, wherein the adjustment rule is used to perform smoothing processing on the trajectory point.
[0050] An embodiment of the present invention provides a device for smoothing the trajectory of rural roads in mountainous areas. Its implementation principle and technical effects are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference can be made to the corresponding contents in the aforementioned method embodiment.
[0051] Furthermore, based on the above-mentioned device embodiment, the embodiment of the present invention also provides another device for smoothing the trajectory line of rural roads in mountainous areas, wherein the above-mentioned data processing module 200 is also used to calculate the trajectory point spacing between trajectory points based on the longitude and latitude of a preset number of trajectory points; determine whether the trajectory point spacing exceeds a preset first spacing threshold; if so, determine that the preset number of trajectory points do not meet the preset smoothing conditions.
[0052] The execution module 300 is also used to calculate the interpolation position corresponding to the trajectory point according to the trajectory point spacing of a preset number of trajectory points and the longitude and latitude of the trajectory point; determine the target time value corresponding to the interpolation position according to the time value of the trajectory point and the preset time threshold; insert the target trajectory point at the interpolation position, and set the target time value as the acquisition time of the target trajectory point to adjust the trajectory point of the trajectory data. The data acquisition module 100 is also used to extract two adjacent trajectory points from the trajectory data, or to extract two interval trajectory points from the trajectory data. The data processing module 200 is also used to determine whether the trajectory point spacing is less than a preset second spacing threshold; the second spacing threshold is less than the first spacing threshold; if so, determine that the preset number of trajectory points does not meet the preset smoothing condition; the execution module 300 is also used to delete the preset trajectory points among the preset number of trajectory points.
[0053] The data acquisition module 100 is also used to extract three consecutive trajectory points from the trajectory data, or to extract three interval trajectory points from the trajectory data. The data processing module 200 is also used to calculate the trajectory point angle formed by the connection line of the three trajectory points according to the longitude and latitude of each trajectory point; determine whether the trajectory point angle is less than a preset first angle threshold; if so, determine that a preset number of trajectory points do not meet the preset smoothing condition. The execution module 300 is also used to adjust the vertex position of the trajectory point angle based on the internal difference method so that the trajectory point angle meets the preset second angle threshold; wherein the second angle threshold is greater than the first angle threshold.
[0054] An embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above Figures 1 to 3The embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to perform the above Figures 1 to 3 Any of the steps of the method shown.
[0055] The embodiment of the present invention also provides a schematic diagram of the structure of an electronic device, such as Figure 7 FIG. 1 is a schematic diagram of the structure of the electronic device, wherein the electronic device includes a processor 71 and a memory 70, the memory 70 stores computer executable instructions that can be executed by the processor 71, and the processor 71 executes the computer executable instructions to implement the above Figures 1 to 3 Any of the methods shown. Figure 7 In the illustrated embodiment, the electronic device further includes a bus 72 and a communication interface 73, wherein the processor 71, the communication interface 73 and the memory 70 are connected via the bus 72. The memory 70 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 73 (which may be wired or wireless), and the Internet, a wide area network, a local area network, a metropolitan area network, etc. may be used. The bus 72 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. It may also be an AMBA (Advanced Microcontroller Bus Architecture) bus, where AMBA defines three types of buses, including an APB (Advanced Peripheral Bus) bus, an AHB (Advanced High-performance Bus) bus, and an AXI (Advanced eXtensible Interface) bus. The bus 72 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0056] The processor 71 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 71. The above processor 71 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor 71 reads the information in the memory and combines its hardware to complete the above Figures 1 to 3 Any of the methods shown.
[0057] A computer program product of a method, device and electronic device for smoothing the trajectory of a rural road in a mountainous area provided by an embodiment of the present invention includes a computer-readable storage medium storing a program code, and the instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can refer to the method embodiment, which will not be repeated here. A person skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system described above can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here. In addition, in the description of the embodiment of the present invention, unless otherwise clearly specified and limited, the terms "installation", "connection" and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected, or it can be indirectly connected through an intermediate medium, or it can be the internal connection of two components. For those skilled in the art, the specific meaning of the above terms in the present invention can be understood in specific circumstances. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes. In the description of the present invention, it should be noted that the terms: center, top, bottom, left, right, vertical, horizontal, inside, outside, etc. indicate the orientation or position relationship based on the orientation or position relationship shown in the accompanying drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for smoothing the trajectory of rural roads in mountainous areas, characterized in that: The method comprises: Acquire trajectory data of a preset highway, wherein the trajectory data includes a plurality of trajectory points, and the trajectory points are obtained based on satellite position data; A preset number of adjacent trajectory points are sequentially extracted from the trajectory data, and based on the satellite position data of the trajectory points, it is determined whether the trajectory points meet a pre-configured smoothing condition; wherein the satellite position data of each of the trajectory points includes the longitude and latitude and time value of the trajectory point; and the smoothing condition is determined based on the spacing and angle information of the preset number of trajectory points; If the smoothing condition is not met, the trajectory point is adjusted according to a pre-configured adjustment rule, wherein the adjustment rule is used to perform smoothing on the trajectory point.
2. The method according to claim 1, characterized in that The step of judging whether the trajectory point satisfies a pre-configured smoothing condition based on the collected information of the trajectory point comprises: Calculating the track point spacing between the track points according to the latitude and longitude of a preset number of the track points; Determining whether the track point spacing exceeds a preset first spacing threshold; If yes, it is determined that a preset number of the trajectory points do not satisfy a preset rounding condition.
3. The method according to claim 2, characterized in that The step of adjusting the track points according to a pre-configured adjustment rule comprises: Calculating the interpolation position corresponding to the trajectory point according to the trajectory point spacing of a preset number of the trajectory points and the longitude and latitude of the trajectory point; Determining a target time value corresponding to the interpolation position according to the time value of the trajectory point and a preset time threshold; A target trajectory point is inserted at the interpolation position, and the target time value is set to the satellite position time of the target trajectory point to adjust the trajectory point of the trajectory data.
4. The method according to claim 2, characterized in that: The step of sequentially extracting a preset number of adjacent trajectory points from the trajectory data comprises: Two adjacent trajectory points are extracted from the trajectory data, or two interval trajectory points are extracted from the trajectory data.
5. The method according to claim 2, characterized in that: The step of judging whether the trajectory point satisfies a pre-configured smoothing condition based on the satellite position data of the trajectory point also includes: Determine whether the track point spacing is less than a preset second spacing threshold; the second spacing threshold is less than the first spacing threshold; if so, determine that a preset number of track points do not meet a preset smoothing condition; The step of adjusting the track points according to a pre-configured adjustment rule comprises: Deleting preset track points from the preset number of track points.
6. The method according to claim 1, characterized in that The step of sequentially extracting a preset number of adjacent trajectory points from the trajectory data comprises: Three consecutive trajectory points are extracted from the trajectory data, or three interval trajectory points are extracted from the trajectory data.
7. The method according to claim 6, characterized in that The step of judging whether the trajectory point satisfies a pre-configured smoothing condition based on the satellite position data of the trajectory point comprises: According to the longitude and latitude of each of the trajectory points, calculating the trajectory point angle formed by the connecting lines of the three trajectory points; Determining whether the trajectory point angle is less than a preset first angle threshold; If yes, it is determined that a preset number of the trajectory points do not satisfy a preset rounding condition.
8. The method according to claim 7, characterized in that The step of adjusting the track points according to a pre-configured adjustment rule comprises: The vertex position of the trajectory point angle is adjusted based on the internal difference method so that the trajectory point angle meets a preset second angle threshold; wherein the second angle threshold is greater than the first angle threshold.
9. A device for smoothing the track line of rural roads in mountainous areas, characterized in that: The device comprises: A data acquisition module, used to acquire trajectory data of a preset highway, wherein the trajectory data includes a plurality of trajectory points, and the trajectory points are obtained based on satellite position data; A data processing module, used to sequentially extract a preset number of adjacent trajectory points from the trajectory data, and determine whether the trajectory point meets a pre-configured smoothing condition based on the collected information of the trajectory point; wherein the collected information of each trajectory point includes the longitude and latitude and time value of the trajectory point; the smoothing condition is determined based on the spacing and angle information of the preset number of trajectory points; An execution module is used to adjust the trajectory point according to a pre-configured adjustment rule if the smoothing condition is not met, wherein the adjustment rule is used to perform smoothing on the trajectory point.
10. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the method for smoothing the trajectory of a rural road in a mountainous area as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Satellite positioning trajectory optimization method
CN106483537A
Satellite positioning trajectory drift correction method based on trajectory smoothing algorithm
CN109917430A
Trajectory fitting method and device, electronic equipment and storage medium
CN112270833A
Terminal positioning track determination method and device and storage medium
CN117750495A
Vehicle driving behavior detection method and apparatus, and device and storage medium
WO2023019936A1