Method, device, equipment, medium and program for modifying a road profile of a road segment

CN122597548APending Publication Date: 2026-08-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510161655.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

目前,主要在数据编译阶段使用算法根据普通精度地图的数据生成道路元素,例如根据路段的路形线生成道路,该路形线可以为中心线,可以对中心线并进行拓宽生成道路,然而,路形线本身的形状不准确,从而导致生成的道路的形状与道路实际形状相差较大

Benefits of technology

[0024] The technical solution provided in this application involves segmenting the road profile, obtaining the actual heading data of reference points in each segment, constructing spline curves for each segment, and determining a first objective function and its constraints based on the spline curves of n segments and the actual heading data of the reference points. The first objective function represents the sum of the differences between the actual and predicted heading data of the n segments. The first objective function is solved according to its constraints to obtain the parameters of the spline curves of the n segments. Based on these parameters, the target sequence of the road profile is determined. This method obtains the parameters of the spline curves of the n segments by integrating the shape of each segment with the actual heading data, thus making the corrected road profile closer to the actual road shape.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122597548A_ABST
    Figure CN122597548A_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, device, medium, and program for correcting the road alignment of a road segment, relating to the field of mapping. The method includes: segmenting the road alignment of a road segment into n segments; acquiring the actual heading data of reference points on each segment; constructing spline curves for each segment; determining a first objective function and constraints on the first objective function based on the spline curves of the n segments and the actual heading data of the reference points; the first objective function characterizing the sum of the differences between the actual heading data and the predicted heading data of the n segments; solving the first objective function according to the constraints to obtain the parameters of the spline curves of the n segments; and determining a target sequence of the road alignment based on the parameters of the spline curves of the n segments. This method obtains the parameters of the spline curves of the n segments by integrating the shape of each segment and the actual heading data, thereby making the corrected road alignment closer to the actual road shape.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of map technology, and in particular to a method, apparatus, device, medium, and program for correcting the road alignment of a road segment. Background Technology

[0002] Electronic maps play a vital role in daily life, having a wide-ranging impact on our lives and activities. With the rapid development of computer and internet technologies, a plethora of map products have emerged, including lane-level high-precision maps, standard maps, and urban road models, bringing convenience to people's daily travel.

[0003] In some cases, it is necessary to generate road elements (e.g., road edges) using road network data from standard-precision maps, especially in areas where high-precision map data is lacking. This allows for the generation of road elements based on standard-precision maps, achieving a near-high-precision map effect even in areas without such data. Currently, algorithms are primarily used during the data compilation stage to generate road elements from standard-precision map data. For example, roads are generated from road lines, which can be centerlines. These centerlines can be widened to generate roads. However, the shape of the road lines themselves is inaccurate, resulting in a significant difference between the generated road shape and the actual road shape. Summary of the Invention

[0004] This application provides a method, apparatus, device, medium, and program for correcting the road alignment of a road segment. By correcting the road alignment of the road segment, the shape of the generated road is made to be less different from the actual shape of the road.

[0005] In a first aspect, embodiments of this application provide a method for correcting the road alignment of a road segment. The method includes: segmenting the road alignment according to an original sequence of the road alignment to obtain n segments, where n is an integer greater than or equal to 2, and the original sequence includes the original coordinates of each original point on the road alignment; obtaining actual heading data of a reference point on each segment, wherein the actual heading data is used to characterize the actual heading angle between the vehicle's travel direction at the reference point and a specified direction; constructing a spline curve for each segment; and determining a first objective function and a second objective function based on the spline curves of the n segments and the actual heading data of the reference point. The constraints of an objective function are defined, wherein the first objective function characterizes the sum of differences between the actual heading data and the predicted heading data of the n segments, the predicted heading data being determined based on the spline curves of the segments, and the constraints of the first objective function include: continuity constraints between the segments and adjacent segments and endpoint offset constraints of the segments; the first objective function is solved based on the constraints of the first objective function and the original coordinates of the reference points of the n segments to obtain the parameters of the spline curves of the n segments; and the target sequence of the road shape is determined based on the parameters of the spline curves of the n segments.

[0006] In some exemplary embodiments, the predicted heading data is determined based on the tangent direction of the segmented spline curve at the reference point, and the predicted heading data is used to represent the predicted heading angle between the vehicle's travel direction at the reference point and a specified direction.

[0007] In some exemplary embodiments, the first objective function is the sum of the absolute values ​​of the vector products of the actual heading vectors and the predicted heading vectors of the n segments, wherein the actual heading vector of each segment is the vector corresponding to the actual heading data of the reference point of the segment, and the predicted heading vector is the tangential direction vector of the spline curve of the segment at the reference point.

[0008] In some exemplary embodiments, the actual heading data is the actual heading angle between the vehicle's travel direction at the reference point and the specified direction. The method further includes: setting the specified direction as a target coordinate axis in an orthogonal coordinate system; converting the actual heading angle into a unit vector in the orthogonal coordinate system, wherein the converted unit vector is the actual heading vector.

[0009] In some exemplary embodiments, the constraints of the first objective function further include constraints of a first intermediate variable, wherein the first intermediate variable is an equivalent form of the first objective function.

[0010] In some exemplary embodiments, the continuity constraint is used to constrain the continuity of the connection points between the segment and adjacent segments, as well as the continuity of the higher-order derivatives of the connection points;

[0011] The endpoint offset constraint is used to ensure that the offset of the starting point of each segment and the offset of the ending point of the last segment are within a preset offset range.

[0012] In some exemplary embodiments, the method further includes: determining a second objective function and constraints on the second objective function based on the n segmented spline curves, wherein the second objective function is the sum of the absolute values ​​of the coefficients of the higher-order terms of the n segmented spline curves, the constraints on the second objective function are constraints on a second intermediate variable, and the second intermediate variable is an equivalent form of the second objective function; performing a weighted operation on the first objective function and the second objective function to obtain a total objective function; and solving the first objective function based on the constraints of the first objective function and the original coordinates of the reference point to obtain the parameters of the segmented spline curves, including: solving the total objective function based on the constraints of the first objective function, the constraints of the second objective function, and the original coordinates of the reference point to obtain the parameters of the segmented spline curves.

[0013] In some exemplary embodiments, the method further includes: determining a third objective function based on the original coordinates of the start and end points of the n segments, wherein the third objective function is the sum of the shape loss corresponding to the start point of the n segments and the shape loss corresponding to the end point of the last segment, wherein the shape loss corresponding to the start point is the square of the distance between the original coordinates of the start point and the coordinates of the start point on the spline curve, and the shape loss corresponding to the end point is the distance between the original coordinates of the end point and the coordinates of the end point on the spline curve; the step of weighting the first objective function and the second objective function to obtain a total objective function includes: weighting the first objective function, the second objective function, and the third objective function to obtain the total objective function.

[0014] In some exemplary embodiments, the road shape is segmented to obtain multiple segments, including: starting from the starting point of the road shape, determining the road between any two adjacent original points as a segment, wherein the any two adjacent original points are the starting point and the ending point of the segment.

[0015] In some exemplary embodiments, the road shape is segmented to obtain multiple segments, including: sampling the road shape at equal intervals according to the sampling interval of the actual heading data, and determining the road between any two adjacent sampling points as a segment, wherein the any two adjacent sampling points are the start and end points of the segment.

[0016] In some exemplary embodiments, the reference point on the segment is the start point or end point of the segment.

[0017] In some exemplary embodiments, the segmented spline curve is a cubic polynomial; the continuity constraints between the segment and adjacent segments include the following constraints: the end point of the segment is continuous with the start point of the adjacent segment; the first derivative of the end point of the segment is continuous with the first derivative of the start point of the adjacent segment; the second derivative of the end point of the segment is continuous with the second derivative of the start point of the adjacent segment.

[0018] In some exemplary embodiments, determining the target sequence of the road shape based on the parameters of the spline curves of the n segments includes: for each segment, interpolating to obtain the preset number of target points on the segment based on the parameters and preset number of the spline curves of the segment, adding the coordinates of the target points to the positions corresponding to the segments in the original sequence, and obtaining the target sequence of the road shape.

[0019] In some exemplary embodiments, target points on the n segments are obtained by interpolation in a parallel manner.

[0020] Secondly, embodiments of this application provide a road alignment correction device for a road segment. The device includes: a segmentation module, used to segment the road alignment according to the original sequence of the road alignment to obtain n segments, where n is an integer greater than or equal to 2, and the original sequence includes the original coordinates of each original point on the road alignment; an acquisition module, used to acquire the actual heading data of a reference point on each segment, the actual heading data being used to characterize the actual heading angle between the vehicle's travel direction at the reference point and a specified direction; and a first determination module, used to construct a spline curve for each segment and determine a first objective function based on the spline curves of the n segments and the actual heading data of the reference point. The constraints of the first objective function, wherein the first objective function characterizes the sum of differences between the actual heading data and the predicted heading data of the n segments, the predicted heading data being determined based on the spline curves of the segments, and the constraints of the first objective function include: continuity constraints between the segments and adjacent segments and endpoint offset constraints of the segments; a solution module, used to solve the first objective function based on the constraints of the first objective function and the original coordinates of the reference points of the n segments, to obtain the parameters of the spline curves of the n segments; and a second determination module, used to determine the target sequence of the road shape based on the parameters of the spline curves of the n segments.

[0021] Thirdly, embodiments of this application provide an electronic device, the electronic device comprising: a processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to perform the method as described in the first aspect above.

[0022] Fourthly, embodiments of this application provide a computer-readable storage medium for storing a computer program that causes a computer to perform the method described in the first aspect above.

[0023] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect above.

[0024] The technical solution provided in this application involves segmenting the road profile, obtaining the actual heading data of reference points in each segment, constructing spline curves for each segment, and determining a first objective function and its constraints based on the spline curves of n segments and the actual heading data of the reference points. The first objective function represents the sum of the differences between the actual and predicted heading data of the n segments. The first objective function is solved according to its constraints to obtain the parameters of the spline curves of the n segments. Based on these parameters, the target sequence of the road profile is determined. This method obtains the parameters of the spline curves of the n segments by integrating the shape of each segment with the actual heading data, thus making the corrected road profile closer to the actual road shape. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 A schematic diagram illustrating an application scenario provided in an embodiment of this application;

[0027] Figure 2A A schematic diagram of a high-precision map provided in an embodiment of this application;

[0028] Figure 2B A schematic diagram of a high-precision map provided in an embodiment of this application;

[0029] Figure 3 A flowchart illustrating the method for correcting the road alignment of a road segment as provided in Embodiment 1 of this application;

[0030] Figure 4 A flowchart illustrating the method for correcting the road alignment of a road segment as provided in Embodiment 2 of this application;

[0031] Figure 5 A flowchart illustrating the method for correcting the road alignment of a road segment as provided in Embodiment 3 of this application;

[0032] Figure 6 A schematic diagram of the structure of the road alignment correction device for a road segment provided in Embodiment 4 of this application;

[0033] Figure 7 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of this application. Detailed Implementation

[0034] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0035] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or electronic device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0036] To facilitate understanding of the embodiments of this application, before describing the various embodiments of this application, some concepts involved in all embodiments of this application will be appropriately explained.

[0037] SD maps, or Standard Definition Maps, are generally two-dimensional and do not contain elevation information.

[0038] HD maps, or High Definition Maps, accurately and comprehensively represent road features. HD maps have higher accuracy and more content than SD maps, but their production cycle and cost are higher, making it difficult to cover large areas.

[0039] Link (road segment): In SD maps, a road is represented by a polyline segment with no width, abbreviated as link. A link records several attributes of the road, such as road class and number of lanes. A link can be the smallest geometric unit used to express the geometric information of a road. Links can be manually labeled or automatically generated through image analysis technology; there are no restrictions on this.

[0040] Shape points, also known as line points, are discrete points that describe the geometry of a road. They are a series of coordinate points on a link segment used to define the curve shape of the link.

[0041] Data compilation: Raw map data is typically provided in text files, with common formats including GeoJSON. Data compilation involves processing and refining the raw map data to generate more compact and user-friendly binary files, which are then provided to upper-layer applications (such as navigation, positioning, guidance, and rendering). Therefore, data compilation is a crucial step that bridges the gap between these processes.

[0042] Currently, lane-level navigation primarily uses high-precision map data. In some scenarios, due to the limited coverage of high-precision maps, to achieve a near-high-precision map effect in areas without available data, algorithms can be used during the data compilation stage to generate road elements from the original SD map data. These road elements are then added to the map, such as intersection surfaces and road lines, to improve the visualization of the navigation interface. However, when using links as centerlines to widen and generate roads, the inaccurate shape of the links themselves leads to a significant difference between the generated road shape and the actual road shape.

[0043] To address this technical problem, this application provides a method for correcting the road alignment of a road segment. The method corrects the road alignment of the road segment using the heading data of the road segment, and uses the corrected road alignment to generate a road, making the shape of the generated road closer to the actual shape of the road.

[0044] The following combination Figure 1 The application scenarios of the technical solutions in the embodiments of this application are described. (See also...) Figure 1 As shown, it is a schematic diagram of an application scenario provided by an embodiment of this application, which includes: terminal device 101 and server 102.

[0045] In one embodiment, the terminal device 101 is equipped with an electronic map application, and the vehicle can drive according to the lane line instructions in the electronic map. The electronic map application can be a software client, or a webpage, mini-program, or other client.

[0046] Terminal device 101 can be a mobile phone, tablet computer, laptop computer, desktop computer, smart TV, smart wearable device, smart voice interaction device, smart home appliance, vehicle terminal, aircraft, etc. When terminal device 101 is a vehicle terminal, the vehicle can drive based on the lane line indication in the electronic map installed in the vehicle terminal, such as performing autonomous driving or assisted driving.

[0047] Server 102 can be the backend server corresponding to the electronic map application installed on terminal device 101, and it can provide electronic map display functions. Server 102 can be, for example, a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, i.e., Content Delivery Network (CDN), and big data and artificial intelligence platforms, but it is not limited to these.

[0048] Terminal device 101 and server 102 can communicate directly or indirectly through one or more networks. The network can be a wired network or a wireless network. For example, the wireless network can be a mobile cellular network or a Wireless-Fidelity (WIFI) network, or other possible networks. This application embodiment does not limit this.

[0049] It should be noted that in this embodiment of the application, the number of terminal devices 101 can be one or more, and similarly, the number of servers 102 can also be one or more. That is to say, there is no limitation on the number of terminal devices 101 or servers 102.

[0050] In one possible implementation, the electronic map may contain both high-precision and standard-precision maps. For example, some areas may use standard-precision maps while others use high-precision maps. To achieve a near-high-precision map effect in areas without high-precision maps, road elements can be generated during the map data compilation stage. Figure 2A The map shown only contains the centerlines of road segments without width, and is processed as follows: Figure 2B The map shown includes the road centerline and road width.

[0051] In one possible application scenario, the relevant data involved in the embodiments of this application (such as standard-precision map data, high-precision map data, etc.) can be stored using cloud storage technology. Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to aggregate a large number of storage devices (or storage nodes) of various types in the network through application software or application interfaces to work together and jointly provide data storage and business access functions to the outside world.

[0052] Of course, the methods provided in the embodiments of this application are not limited to... Figure 1 The application scenarios shown can also be used in other possible scenarios, such as cloud technology, artificial intelligence, intelligent vehicle infrastructure cooperative systems (IVICS), assisted driving, and various other scenarios. This application's embodiments do not impose limitations. Figure 1 The functions that each device in the application scenario shown can achieve will be described in subsequent method embodiments, and will not be elaborated on here.

[0053] Example 1

[0054] Figure 3 This is a flowchart illustrating a method for correcting the road alignment of a road segment according to Embodiment 1 of this application. This method is applied to an electronic device, which can be a terminal device or a server, or other device with computing capabilities. Figure 3 As shown, the method provided in this embodiment includes the following steps:

[0055] S101. Based on the original sequence of the road shape, the road shape is segmented to obtain n segments, where n is an integer greater than or equal to 2. The original sequence includes the original coordinates of each original point on the road shape.

[0056] A link can be the smallest geometric unit used to represent the geometric information of a road. Electronic devices acquire the original sequence of the road lines of the link to be corrected and perform segmentation processing on the road lines, dividing a link into multiple segments, which are also called sub-links.

[0057] Road markings are used to indicate the shape of a road segment. Optionally, road markings can be the road centerline, lane lines, road boundary lines, etc., and are not limited thereto. In this embodiment, the road centerline is used as an example for illustration.

[0058] In this embodiment, the original sequence can also be called the original shape point sequence, and the target sequence can also be called the target shape point sequence. A shape point sequence refers to a sequence composed of multiple position points (position points can also be called shape points) on the road shape line of the corresponding road. Position points can be used to delineate the road shape of the corresponding road. For example, the shape point sequence of a road segment can reflect the changes in the planar position of the road segment (such as position coordinates), the changes in straightness and curvature (such as straight roads, curves, etc.), and the changes in undulation (such as uphill and downhill slopes).

[0059] In this embodiment, the original point represents the position point before the road alignment is corrected, and the target point represents the position point after the road alignment is corrected.

[0060] The road alignment of a road segment is usually a curve. For example, the road alignment can be segmented in the following two ways:

[0061] The first segmentation method starts from the starting point of the road shape and defines the road between any two adjacent original points as a segment, with these two adjacent original points being the starting and ending points of the segment.

[0062] The second segmentation method involves sampling the road shape at equal intervals according to the actual heading data, and defining the road between any two adjacent sampling points as a segment, with these two adjacent sampling points serving as the start and end points of the segment.

[0063] Method 2 is equivalent to a low-pass filter, which filters out the high-frequency spikes on the original curve corresponding to the road shape, thus achieving preliminary smoothing.

[0064] In Method 2, the sampling interval for each segment is the same as the sampling interval for the actual heading data. This method ensures that the sampled points are also points from the actual heading data. For example, if the sampling interval for the actual heading data is one point every 1 meter, then when using Method 2 for segmentation, the length of each segment is also 1 meter.

[0065] S102. Obtain the actual heading data of the reference point on each segment. This actual heading data is used to characterize the actual heading angle between the vehicle's driving direction at the reference point and the specified direction.

[0066] The actual heading data of points on a road segment can be stored in Advanced Driver Assistance Systems (ADAS) maps, typically collected by high-precision equipment. ADAS maps are a type of map data between in-vehicle maps and high-precision maps, with an accuracy generally between 1 and 5 meters. ADAS maps are mainly used to provide the environmental information needed for vehicle perception and driving decisions, thereby improving driving safety and the driving experience.

[0067] ADAS maps include data about the road itself, such as slope, curvature, and flight path angle. This information helps vehicles better understand road conditions and make more accurate driving decisions.

[0068] This actual heading data is used to characterize the angle between the vehicle's direction of travel at the reference point and the actual heading of the specified direction. For example, the specified direction can be due north.

[0069] In one example, the actual heading data is an angle, namely the actual heading angle, which can be, for example, the clockwise angle between the vehicle's direction of travel at the reference point and due north.

[0070] In another example, the actual heading data is a vector, which can be called the actual heading vector. It's understandable that angles and vectors are interchangeable; therefore, the actual heading angle from the previous example can be converted into a vector as the actual heading data.

[0071] For example, the specified direction can be set as the target coordinate axis in an orthogonal coordinate system, and the actual heading angle can be converted into a unit vector in the orthogonal coordinate system. The converted unit vector is the actual heading vector. Taking the specified direction as true north, true north can be set as the Y-axis in the orthogonal coordinate system, and the heading angle (which can also be simply called the heading angle) can be easily converted into a unit vector in the orthogonal coordinate system.

[0072] When a road segment uses the first segmentation method, the reference point on the segment can be located anywhere on the segment; that is, the reference point of the segment can be the start point, the end point, or any original point between the start and end points. When a road segment uses the second segmentation method, the reference point on the segment is either the start point or the end point of the segment.

[0073] In one implementation, actual heading data is collected for all road shapes of the road segment, that is, the center line, lane lines or road boundary lines of the road segment all correspond to actual heading data and are stored in the map.

[0074] In another implementation, the centerline of the road segment has actual heading data, which is stored in the map. However, other types of road lines, such as lane lines and road boundary lines, do not have actual heading data. When correcting other types of road lines, it can be assumed that the heading data of other types of road lines is the same as the heading data of the corresponding projection position on the centerline. Therefore, the actual heading data of the centerline of the road segment can also be used to correct other types of road lines in the same road segment.

[0075] S103. Construct spline curves for each segment. Based on the spline curves of the n segments and the actual heading data of the reference point, determine the first objective function and the constraints of the first objective function. The first objective function is used to characterize the sum of the differences between the actual heading data and the predicted heading data of the n segments.

[0076] A spline is a special function defined piecewise by a polynomial. Low-order spline interpolation can produce similar effects to high-order polynomial interpolation. A polynomial parametric curve defined by a spline function is also called a spline curve.

[0077] Each polynomial segment is defined on a subinterval. At the endpoints of the subinterval, the polynomial segments of the spline function are connected in a smooth manner, ensuring that the function has continuous derivatives at these points. The spline function can flexibly adapt to changes in data while maintaining the smoothness of the function.

[0078] Spline functions include, but are not limited to, linear splines, cubic splines, natural splines, and B-splines. Among them, cubic splines are one of the most commonly used spline functions, consisting of cubic polynomials, and exhibit good numerical stability and convergence in interpolation problems.

[0079] In this embodiment, any existing spline function can be used, and the appropriate spline function type can be selected according to actual needs.

[0080] Taking a spline curve using a cubic polynomial as an example, the coordinates of any point in each segment are expressed in the form of the following formula (or parametric method): (1)

[0081]

[0082] Where 0≤t≤1, These are polynomial coefficients, meaning each segment has 8 parameters. These parameters uniquely determine the shape of the curve and are a concentrated representation of the original road shape and heading data. Therefore, these are the parameters that this application ultimately aims to solve.

[0083] The value of i is 1 ≤ i ≤ n, where n is the number of road segments, and x i,t Let y represent the x-coordinate of the t-th point on the i-th segment. i,t This represents the Y-axis coordinate of the t-th point on the i-th segment.

[0084] Given any point t0, 0 ≤ t0 ≤ 1, the coordinates of that point can be calculated. Where t = 0 corresponds to the starting coordinate of the segment. Substituting t = 0 into the above formula (1), we obtain the starting coordinate of the i-th segment as:

[0085]

[0086] t=1 corresponds to the coordinates of the end point of the segment. Substituting t=1 into the above formula (1), we obtain the coordinates of the end point of the i-th segment as follows:

[0087]

[0088] After constructing the spline curve for each segment, the first objective function and its constraints are determined based on the actual heading data of the n segment spline curves and the reference point. The first objective function is used to characterize the sum of the differences between the actual heading data and the predicted heading data of the n segments.

[0089] The predicted heading data is determined based on a segmented spline curve and is used to represent the predicted heading angle between the vehicle's direction of travel at the reference point and the specified direction.

[0090] Optionally, the predicted heading data is determined based on the tangent direction of the segmented spline curve at the reference point.

[0091] At a point on a curve, the tangential direction refers to the direction in which the tangent line to the curve points. It is key information describing how the curve "turns" or "extends" near that point.

[0092] For a function y = f(x), its first derivative represents the slope of the tangent line at that point. Geometrically, this slope is the inclination of the tangent line, i.e., a quantitative representation of the tangential direction. Therefore, the first derivative of a spline curve can be obtained from the spline curve, and the tangential direction at a reference point can be obtained from the first derivative of the spline curve.

[0093] The tangential direction of the reference point of the segment is a direction vector, called the predicted heading vector. As described above, the actual heading data can be represented by the heading angle or the heading vector. Similarly, the predicted heading data can also be represented by the heading angle or the heading vector.

[0094] Therefore, the difference between the actual and predicted heading data for each segment can be represented by the difference between the actual and predicted heading angles, or by the difference between the actual and predicted heading vectors. Specifically, the actual heading vector for each segment is the vector corresponding to the actual heading data of the reference point for that segment, and the predicted heading vector is the tangential direction vector of the spline curve for that segment at the reference point. The predicted heading angle can be obtained by converting the predicted heading vector.

[0095] After determining the difference between the actual and predicted heading data for each segment, the differences between the actual and predicted heading data for n segments are summed to obtain the first objective function.

[0096] When the difference between the actual and predicted heading data for each segment is represented by the difference between the actual and predicted heading vectors, the first objective function is the sum of the absolute values ​​of the vector products of the actual and predicted heading vectors for the n segments.

[0097] Taking a spline curve using a cubic polynomial as an example, the first derivative at each point on the piecewise curve is:

[0098]

[0099]

[0100] The tangent direction vector at any point on the spline curve (i.e., the predicted heading vector at that point) is:

[0101]

[0102] The actual heading vector at any point on the spline curve is:

[0103]

[0104] The predicted heading vector and the actual heading vector at the reference point should be in the same direction as much as possible. To ensure that the two vectors are in the same direction, the angle between them should be as close to zero as possible. The angle can be represented using trigonometric functions or by two vectors. When using two vectors to represent the angle, the first objective function can be expressed as:

[0105]

[0106] The constraints of the first objective function include:

[0107]

[0108] The value of i is 1 ≤ i ≤ n. It is the cross product (or vector product) of two vectors, and its magnitude is equal to... Here, θ is the angle between the two vectors. If the two vectors are in the same direction, the angle is zero, so we want the objective function V1 to be as small as possible, which means we want the sine of the angle to be as small as possible. However, if the angle is 180 degrees, the sine of the angle is also 0, so we need to use the constraint equation that the inner product (or dot product, dot product) of the two vectors is greater than 0 to avoid the case where the angle is 180 degrees.

[0109] The constraints of the first objective function include: continuity constraints between each segment and adjacent segments, and endpoint offset constraints for that segment.

[0110] This continuity constraint is used to ensure the continuity of the connection points between the segment and its adjacent segments, as well as the continuity of the higher-order derivatives at these connection points. The continuity of the higher-order derivatives at these connection points means that all or some of the higher-order derivatives at these connection points are continuous. For example, for a fifth-degree polynomial, this continuity constraint can require the continuity of the fourth, third, second, and first derivatives; it can also require only the continuity of the fourth and first derivatives; or it can require only the continuity of the fourth, second, and first derivatives.

[0111] When the piecewise spline curve is a cubic polynomial, the continuity constraints between each piece and its adjacent pieces include the following constraints: the end point of the piece is continuous with the start point of the adjacent piece; the first derivative of the end point of the piece is continuous with the first derivative of the start point of the adjacent piece; and the second derivative of the end point of the piece is continuous with the second derivative of the start point of the adjacent piece.

[0112] Taking a spline curve using a cubic polynomial as an example, the first derivative at each point on the spline curve is:

[0113]

[0114] The second derivative at each point on the spline curve is:

[0115]

[0116] To ensure the fitted road shape is sufficiently smooth, the piecewise spline curves must be continuous at the junctions of consecutive segments and also have continuous higher-order derivatives. Optionally, continuity to the second derivative is required. Therefore, the following three types of geometric constraint equations can be listed:

[0117]

[0118] Where, x i,1 The x-coordinate of the endpoint of the i-th segment is given by x. i+1,0 Let y be the starting point of the i-th segment. Based on the above formula (1), the three constraint equations are expanded to obtain the following constraint method:

[0119] The geometric continuity constraint is:

[0120]

[0121] The first derivative continuity constraint is:

[0122]

[0123] The continuity constraint for the second derivative is:

[0124]

[0125] Endpoint offset constraints are used to ensure that the offset of the start point of each segment and the offset of the end point of the last segment are within a preset offset range. Due to the geometric continuity constraint between consecutive segments (i.e., the end point of each segment is the start point of the next segment), the offset does not need to be constrained repeatedly. Therefore, it is only necessary to constrain the offset of the start point of each segment and the offset of the end point of the last segment. The offset of the start point refers to the deviation between the original coordinates of the start point and the corrected target coordinates, and the offset of the end point refers to the deviation between the original coordinates of the end point and the corrected target coordinates. Here, the corrected target coordinates of the start point and end point refer to the coordinates on the spline curve of the segment.

[0126] Endpoint offset constraints can include the following n+1 sets of offset constraint equations:

[0127] -L≤x i,0 -X i,0 ≤L(i=1,…,n)

[0128] -L≤y i,0 -Y i,0 ≤L(i=1,…,n)

[0129] -L≤x i,1 -X i,1 ≤L

[0130] -L≤y i,1 -Y i,1 ≤L

[0131] Among them, X i,0 Y i,0 The original coordinates of the segment starting point, X i,1 Y i,1 The original coordinates of the segment endpoints are given. The original coordinates of the start and end points can be obtained from the original sequence. L is the maximum allowable offset of a certain coordinate component, which is a hyperparameter of the optimization model. The maximum allowable movement distance before and after fitting can be set in different scenarios. The smaller the value of L, the closer the corrected road shape is to the original road shape, but the effect of fusing heading data will be worse. Therefore, it is necessary to weigh both factors to determine the value. For example, L is set to 3 meters.

[0132] Taking the spline curve using a cubic polynomial as an example, and Substituting the above offset constraint equations, we obtain the following offset constraint equations:

[0133]

[0134] S104. Based on the constraints of the first objective function and the original coordinates of the reference points of the n segments, solve the first objective function to obtain the parameters of the spline curves of the n segments.

[0135] Based on the above first objective function form, it can be seen that the optimization objective is to minimize the value of the first objective function. Solving with the goal of minimizing the value of the first objective function can yield the parameters of the piecewise spline curve.

[0136] Taking a spline curve using a cubic polynomial, where the first objective function is the sum of the absolute values ​​of the vector products of the actual and predicted heading vectors of n segments, as an example, since the first objective function V1 contains absolute values, its derivative is discontinuous, making it inconvenient for optimization. Therefore, transforming the first objective function V1 results in a relaxation problem of the first objective function V1.

[0137] When dealing with optimization problems, the absolute value in the objective function can indeed cause difficulties in differentiation because the absolute value function is not differentiable at zero. To address this issue, a common approach is to transform the absolute value problem into a relaxation problem (also known as the "relaxed form" or "equivalent form"), which makes the problem much easier to handle.

[0138] The transformed form of the first objective function V1 is as follows:

[0139]

[0140] in, i = 1, ..., n.

[0141] After transforming the first objective function into its equivalent form, the constraints of the first objective function also include constraints on the first intermediate variable. The first intermediate variable is the equivalent form of the first objective function, where p... i It's just a first intermediate variable, p i It is a non-negative intermediate variable. It refers to the constraint condition of the first intermediate variable.

[0142] Using the constraints of the first objective function, we solve for the transformed form of the first objective function to obtain the parameters of the spline curves in n segments. It is understandable that if the first objective function is not in absolute value form, then there is no need to transform the first objective function; we can solve for it directly.

[0143] The optimization model established in this embodiment is a linear programming model, which is mainly used to maximize or minimize a linear objective function under given constraints.

[0144] Currently, there are very mature algorithms (such as the simplex method and the interior-point method) that can solve these types of problems, and there are also mature solvers (such as CPLEX and Gurobi) that can be directly called. Linear programming models have the following three advantages:

[0145] (1) Linear programming models are highly efficient and can solve large-scale linear programming problems in polynomial time.

[0146] (2) Linear programming is a special type of convex optimization model. It has both local and global optimal solutions, thus ensuring the stability of the calculation results.

[0147] (3) The theory of linear programming is very mature, including its properties, solution algorithms, sensitivity analysis, etc., which have been studied in depth.

[0148] S105. Determine the target sequence of the road shape based on the parameters of the n segmented spline curves.

[0149] The target sequence of the road alignment is a modified sequence that contains more location points than the original sequence.

[0150] For example, for each segment, based on the parameters and preset quantity of the spline curve of that segment, a preset number of target points are interpolated to obtain that segment, and the coordinates of the preset number of target points are added to the corresponding position of that segment in the original sequence to obtain the target sequence of the road shape.

[0151] Taking the spline curve using a cubic polynomial as an example, the coefficients of each segment obtained from the solution... Where i = 1, ..., n, any number of coordinate points can be dynamically interpolated according to the requirements for the smoothness of the road shape, so as to achieve the purpose of correcting the road shape and smoothing it with the heading data, because the corresponding coordinate points can be calculated by giving any t.

[0152] Suppose we want to interpolate m points within a segment, then Therefore, the segment corresponding to this can be... Substituting the values ​​of the eight parameters and the value of t into the following formula (1), we obtain m+2 coordinate points:

[0153]

[0154] in,

[0155] After calculating the coordinates of all points in these n segments, and then arranging them in order, the corrected road shape can be obtained.

[0156] Optionally, interpolation can be performed in parallel to obtain the target points on n segments. For example, multi-threaded parallel computation can be used with a Central Processing Unit (CPU), or parallel computation can be performed using the client's Graphics Processing Unit (GPU) to improve computation speed. Alternatively, big data distributed computing frameworks such as Hadoop and Spark can be used for multi-machine distributed computation.

[0157] After correcting the route characteristics of a road segment using the method described in the embodiment, the corresponding road can be generated using the corrected road lines (i.e., the road lines corresponding to the target sequence). For example, when the road line is the centerline of a link, a road with a centerline and width is generated based on the corrected centerline of the link. Because the shape of the corrected road lines is more accurate, the generated road shape is closer to that of a real road.

[0158] In this embodiment, the road shape is segmented according to the original sequence of the road shape, resulting in n segments. The actual heading data of the reference point on each segment is obtained. This actual heading data represents the actual heading angle between the vehicle's travel direction at the reference point and the specified direction. A spline curve for each segment is constructed. Based on the spline curves of the n segments and the actual heading data of the reference point, a first objective function and its constraints are determined. The first objective function represents the sum of the differences between the actual heading data and the predicted heading data of the n segments. The predicted heading data is determined based on the spline curves of the segments. The first objective function is solved according to its constraints to obtain the parameters of the spline curves of the n segments. Based on the parameters of the spline curves of the n segments, the target sequence of the road shape is determined. This method integrates the shape and actual heading data of each segment when constructing the objective function. The parameters of the spline curves of the n segments obtained are a concentrated representation of the original shape and heading data of the road shape after fusion, thus making the fused road shape closer to the actual road shape.

[0159] Example 2

[0160] Based on Embodiment 1, Embodiment 2 of this application provides a method for correcting the road alignment of a road segment. The method described in Embodiment 1 establishes a single-objective optimization problem with only one objective function; the method described in Embodiment 2 establishes a multi-objective optimization problem with two objective functions.

[0161] Figure 4 This is a flowchart of the method for correcting the road alignment of a road segment provided in Embodiment 2 of this application, as follows: Figure 4 As shown, the method provided in this embodiment includes the following steps.

[0162] S201. Based on the original sequence of the road alignment, the road alignment is segmented to obtain n segments.

[0163] N is an integer greater than or equal to 2, and the original sequence includes the original coordinates of each original point on the road.

[0164] S202. Obtain the actual heading data of the reference points on each segment.

[0165] This actual heading data is used to characterize the actual heading angle between the vehicle's direction of travel at the reference point and the specified direction.

[0166] S203. Construct spline curves for each segment. Based on the spline curves of the n segments and the actual heading data of the reference point, determine the first objective function and its constraints. The first objective function is used to characterize the sum of the differences between the actual heading data and the predicted heading data of the n segments.

[0167] The predicted heading data is determined based on segmented spline curves. The constraints of the first objective function include: continuity constraints between segments and adjacent segments, and endpoint offset constraints of segments.

[0168] The specific implementation of steps S201-S203 is described in the relevant description of steps S101-S103 in Embodiment 1, and will not be repeated here.

[0169] S204. Determine the second objective function and the constraints of the second objective function based on the spline curves of n segments, wherein the second objective function is the sum of the absolute values ​​of the coefficients of the higher-order terms of the spline curves of n segments.

[0170] The higher-order terms of a spline curve refer to terms greater than the first-order terms. For example, when a spline curve uses a cubic polynomial, the higher-order terms are the trinomial term and the quadratic term; when a spline curve uses a quartic polynomial, the higher-order terms are the quartic term, the trinomial term, and the quadratic term.

[0171] Because the second objective function contains absolute values, it cannot be differentiated and is difficult to handle. Therefore, it needs to be transformed into its equivalent form, which is denoted as the second intermediate variable. Correspondingly, the constraints on the second objective function are the constraints on the second intermediate variable.

[0172] S205. Perform a weighted operation on the first objective function and the second objective function to obtain the overall objective function.

[0173] This embodiment establishes a multi-objective optimization problem with two objective functions: a first objective function and a second objective function. These two objective functions are linearly weighted, thus transforming the multi-objective optimization problem into a single-objective optimization problem, i.e., introducing a new overall objective function. The overall objective function can be expressed as:

[0174] V = K1V1 + K2V2

[0175] Here, V1 represents the first objective function, V2 represents the second objective function, and K1 and K2 are weighting coefficients, both fixed constants. These two values ​​represent the proportions of V1 and V2 in the overall objective. In actual implementation, priority is given to fitting the heading angle; therefore, K1 is set to be greater than K2. Typically, K1 is much larger than K2, meaning the second objective function has a smaller impact on the fitting result. For example, K1 is set to 100, and K2 is set to 1.

[0176] In Example 1, the heading angle was mainly fitted using the first objective function. In this example, in addition to fitting the heading angle, it is also desirable for the fitted curve to be as smooth as possible. Therefore, L1 loss (i.e., the second objective function) of some polynomial coefficients is introduced.

[0177] The purpose of smoothing a shape line is to minimize the curvature of each point on the smoothed shape line. Obviously, the curvature is minimized if each segment is a straight line.

[0178] In order to make the smoothed segmented curves as close to straight lines as possible, it is desirable that the coefficients of the higher-order terms (greater than first-order terms) in each segment be as close to 0 as possible.

[0179] Taking a spline curve using a cubic polynomial as an example, as mentioned earlier, the coordinates of any point are represented in the following way:

[0180]

[0181] Therefore, it is desirable that the parameters in each segment... Ideally, it should be equal to 0, that is, we hope it will be equal to 0. As small as possible.

[0182] Therefore, this embodiment establishes the following second objective function V2:

[0183]

[0184] Since the second objective function V2 contains absolute values, it cannot be differentiated and is difficult to handle. Therefore, it is necessary to transform the second objective function V2 into a relaxation problem of the second objective function V2.

[0185] For each weight that we want to minimize, we introduce an intermediate variable, transforming the second objective function into:

[0186]

[0187] Meanwhile, the transformed second objective function needs to satisfy the following constraints:

[0188]

[0189] The following example illustrates the construction of the overall objective function in this embodiment by segmenting the road shape using the second segmentation method (i.e., the reference point on the segment is the start or end point of the segment). The spline curve is segmented using a cubic polynomial as an example.

[0190] Based on the above, the tangent direction vector at a point on the spline curve can be expressed as:

[0191]

[0192] Substituting t=0 into the formula for the tangent direction vector, we can obtain the tangent direction vector at the starting point of any segment:

[0193]

[0194] Correspondingly, the heading vector at the starting point of any segment can be expressed as:

[0195]

[0196] Since the heading data is located at the starting point of each segment, it is necessary to ensure that the tangent direction vector at the starting point of each segment is... and the heading vector at the corresponding point Try to be in the same direction.

[0197] To ensure that the two vectors are in the same direction as much as possible, the angle between them should be as close to zero as possible. Therefore, the following first objective function and constraints are obtained:

[0198]

[0199] Its constraints include: i = 1, ..., n-1.

[0200] The derivative of V1 is discontinuous, which is not convenient for optimization. Therefore, V1 is transformed as follows:

[0201]

[0202] The constraints of the transformed V1 include: i = 1, ..., n.

[0203] By weighting the first objective function and the second objective function, the overall objective function is obtained as follows:

[0204]

[0205] K1 and K2 are the coefficients for the weighted operation, and both are fixed constants.

[0206] In summary, the optimization model established in this embodiment is as follows:

[0207]

[0208] The following three types of parameters need to be solved:

[0209] (1) i = 1, ..., n;

[0210] (2) i = 1, ..., n;

[0211] (3)p i , i = 1, ..., n.

[0212] The constraints on the overall objective function include the following conditions:

[0213] Geometric continuity constraints:

[0214]

[0215] First derivative continuity constraint:

[0216]

[0217] Second derivative continuity constraint:

[0218]

[0219] Endpoint offset constraint:

[0220]

[0221] Intermediate variable constraints:

[0222]

[0223] S206. Based on the constraints of the first objective function, the constraints of the second objective function, and the original coordinates of the reference point, solve the overall objective function to obtain the parameters of the piecewise spline curve.

[0224] The optimization model established in this embodiment can be solved using existing mature solvers. The solution process will not be described in detail here.

[0225] S207. Determine the target sequence of the road shape based on the parameters of the n segmented spline curves.

[0226] After correcting the route characteristics of a road segment using the method described in the embodiment, the corresponding road can be generated using the corrected road lines (i.e., the road lines corresponding to the target sequence). For example, when the road line is the centerline of a link, a road with a centerline and width is generated based on the corrected centerline of the link. Because the shape of the corrected road lines is more accurate, the generated road shape is closer to that of a real road.

[0227] In this embodiment, when constructing the objective function, in addition to constructing the first objective function based on the heading data, a second objective function and its constraints are determined based on the spline curves of n segments. The second objective function is the sum of the absolute values ​​of the coefficients of the higher-order terms of the spline curves of the n segments. A weighted operation is performed on the first and second objective functions to obtain the overall objective function. Solving the overall objective function yields the parameters of the spline curves for each segment. This method introduces L1 loss for some polynomial coefficients of the spline curves, making the fitted curve smoother.

[0228] Example 3

[0229] Based on Embodiment 2, Embodiment 3 of this application provides a method for correcting the road alignment of a road segment. The method described in this embodiment is a multi-objective optimization problem with three objective functions. In addition to the first and second objective functions described in Embodiment 2, a third objective function is also introduced.

[0230] Figure 5 The flowchart is for the method of correcting the road alignment of a road segment provided in Embodiment 3 of this application, as follows: Figure 5 As shown, the method provided in this embodiment includes the following steps.

[0231] S301. Based on the original sequence of the road alignment, the road alignment is segmented to obtain n segments.

[0232] N is an integer greater than or equal to 2, and the original sequence includes the original coordinates of each original point on the road.

[0233] S302. Obtain the actual heading data of the reference points on each segment.

[0234] This actual heading data is used to characterize the actual heading angle between the vehicle's direction of travel at the reference point and the specified direction.

[0235] S303. Construct spline curves for each segment. Based on the spline curves of the n segments and the actual heading data of the reference point, determine the first objective function and the constraints of the first objective function. The first objective function is used to characterize the sum of the differences between the actual heading data and the predicted heading data of the n segments.

[0236] The predicted heading data is determined based on segmented spline curves. The constraints of the first objective function include: continuity constraints between segments and adjacent segments, and endpoint offset constraints of segments.

[0237] S304. Determine the second objective function and the constraints of the second objective function based on the spline curves of n segments, wherein the second objective function is the sum of the absolute values ​​of the coefficients of the higher-order terms of the spline curves of n segments.

[0238] The constraints of the second objective function are the constraints of the second intermediate variable, and the second intermediate variable is the equivalent form of the second objective function.

[0239] The specific implementation methods of steps S301-S304 are described in accordance with the relevant descriptions in Embodiment 1 and Embodiment 2, and will not be repeated here.

[0240] S305. Determine the third objective function based on the original coordinates of the start and end points of the n segments. The third objective function is the sum of the shape loss corresponding to the start point of the n segments and the shape loss corresponding to the end point of the last segment.

[0241] The shape loss corresponding to the starting point is the square of the distance between the original coordinates of the starting point and the coordinates of the starting point on the spline curve, and the shape loss corresponding to the ending point is the distance between the original coordinates of the ending point and the coordinates of the ending point on the spline curve.

[0242] The endpoints of all segments, i.e. (X) i,0 Y i,0 ) and (x i,0 y i,0 The square of the distance plus (X) i,1 Y i,1 ) and (x i,1 y i,1 The squared distance from () is used as the total shape loss (i.e., the third objective function):

[0243]

[0244] Among them, (X) i,0 Y i,0 (x) represents the original coordinates of the starting point of the i-th segment. i,0 y i,0 Let (X) be the coordinates of the starting point of the i-th segment on the spline curve. i,1 Y i,1 Let (x) be the original coordinates of the endpoints of the i segments. i,1 y i,1 Let be the coordinates of the endpoints of the i segments on the spline curve.

[0245] Due to the constraints of the geometric constraints of the two segments (i.e., the C0 constraint), the shape loss does not need to be calculated repeatedly. Therefore, it is only necessary to calculate the shape loss corresponding to the start point of each segment and the shape loss corresponding to the end point of the last segment, thus simplifying the third objective function V3 to:

[0246]

[0247] Taking a spline curve segmented using a cubic polynomial as an example, substituting the coordinates of the starting point of the i-th segment and the coordinates of the ending point of the last segment into V3 yields the following V3 form:

[0248]

[0249] S306. Perform a weighted operation on the first objective function, the second objective function, and the third objective function to obtain the overall objective function.

[0250] By weighting the three objective functions, the multi-objective optimization problem can be transformed into a single-objective optimization problem, and the overall objective function can be expressed as:

[0251] V = K1V1 + K2V2 + K3V3

[0252] In this calculation, K1, K2, and K3 are weighted coefficients, all fixed constants. Larger coefficients indicate a more important objective function. In practice, prioritizing the fitting of the heading angle is usually crucial. Therefore, K1 is set to be greater than both K2 and K3. K2 and K3 can be the same or different, but typically K3 is less than K2. For example, K1 is set to 100, K2 to 1, and K3 to 0.5.

[0253] S307. Based on the constraints of the first objective function, the constraints of the second objective function, and the original coordinates of the reference point, solve the overall objective function to obtain the parameters of the piecewise spline curve.

[0254] In this embodiment, the overall objective function is a quadratic programming model, which currently has good solution efficiency and mature third-party libraries available. Therefore, this embodiment will not provide a detailed explanation of the solution process for the overall objective function.

[0255] S308. Determine the target sequence of the road shape based on the parameters of the n segmented spline curves.

[0256] After correcting the route characteristics of a road segment using the method described in the embodiment, the corresponding road can be generated using the corrected road lines (i.e., the road lines corresponding to the target sequence). For example, when the road line is the centerline of a link, a road with a centerline and width is generated based on the corrected centerline of the link. Because the shape of the corrected road lines is more accurate, the generated road shape is closer to that of a real road.

[0257] In this embodiment, when constructing the objective function, in addition to constructing a first objective function based on the heading data, a second objective function and its constraints are determined based on the spline curves of n segments. The second objective function is the sum of the absolute values ​​of the coefficients of the higher-order terms of the spline curves of the n segments. A third objective function is also determined based on the original coordinates of the start and end points of the n segments. The third objective function is the sum of the shape loss corresponding to the start point of the n segments and the shape loss corresponding to the end point of the last segment. The first, second, and third objective functions are weighted to obtain the overall objective function. Solving the overall objective function yields the parameters of the spline curves for each segment. This method, by introducing shape loss, makes the shape of the fitted curve closer to the real road.

[0258] To facilitate better implementation of the road alignment correction method of the present application embodiments, the present application embodiments also provide a road alignment correction device. Figure 6 This is a schematic diagram of the structure of the road alignment correction device for the road segment provided in Embodiment 4 of this application, as shown below. Figure 6 As shown, the road alignment correction device 100 for this road section may include:

[0259] Segmentation module 11 is used to segment the road shape according to the original sequence of the road shape to obtain n segments, where n is an integer greater than or equal to 2, and the original sequence includes the original coordinates of each original point on the road shape.

[0260] The acquisition module 12 is used to acquire the actual heading data of the reference point on each segment. The actual heading data is used to characterize the actual heading angle between the vehicle's driving direction at the reference point and the specified direction.

[0261] The first determining module 13 is used to construct the spline curve of each segment, and determine the first objective function and the constraints of the first objective function based on the spline curves of the n segments and the actual heading data of the reference point. The first objective function is used to characterize the sum of the differences between the actual heading data and the predicted heading data of the n segments. The predicted heading data is determined based on the spline curves of the segments. The constraints of the first objective function include: the continuity constraint between the segment and the adjacent segment and the endpoint offset constraint of the segment.

[0262] The solution module 14 is used to solve the first objective function according to the constraints of the first objective function and the original coordinates of the reference points of the n segments, so as to obtain the parameters of the spline curves of the n segments;

[0263] The second determining module 15 is used to determine the target sequence of the road shape based on the parameters of the n segmented spline curves.

[0264] In some implementations, the predicted heading data is determined based on the tangent direction of the segmented spline curve at the reference point, and the predicted heading data is used to represent the predicted heading angle between the vehicle's travel direction at the reference point and a specified direction.

[0265] In some implementations, the first objective function is the sum of the absolute values ​​of the vector products of the actual heading vectors and the predicted heading vectors of the n segments, wherein the actual heading vector of each segment is the vector corresponding to the actual heading data of the reference point of the segment, and the predicted heading vector is the tangential direction vector of the spline curve of the segment at the reference point.

[0266] In some implementations, the actual heading data is the actual heading angle between the vehicle's direction of travel at the reference point and the specified direction. The acquisition module 12 is further used for:

[0267] Set the specified direction as the target coordinate axis in an orthogonal coordinate system;

[0268] The actual heading angle is converted into a unit vector in the orthogonal coordinate system, and the converted unit vector is the actual heading vector.

[0269] In some implementations, the constraints of the first objective function also include constraints of a first intermediate variable, which is an equivalent form of the first objective function.

[0270] In some implementations, the continuity constraint is used to constrain the continuity of the connection points between the segment and adjacent segments, as well as the continuity of the higher-order derivatives of the connection points;

[0271] The endpoint offset constraint is used to ensure that the offset of the starting point of each segment and the offset of the ending point of the last segment are within a preset offset range.

[0272] In some implementations, the first determining module 13 is further configured to:

[0273] The second objective function and its constraints are determined based on the spline curves of the n segments, wherein the second objective function is the sum of the absolute values ​​of the coefficients of the higher-order terms of the spline curves of the n segments, and the constraints of the second objective function are the constraints of the second intermediate variable, which is an equivalent form of the second objective function.

[0274] The first objective function and the second objective function are weighted to obtain the overall objective function.

[0275] The solution module 14 is specifically used for:

[0276] Based on the constraints of the first objective function, the constraints of the second objective function, and the original coordinates of the reference point, the overall objective function is solved to obtain the parameters of the piecewise spline curve.

[0277] In some implementations, the first determining module 13 is further configured to:

[0278] The third objective function is determined based on the original coordinates of the start and end points of the n segments. The third objective function is the sum of the shape loss corresponding to the start point of the n segments and the shape loss corresponding to the end point of the last segment. The shape loss corresponding to the start point is the square of the distance between the original coordinates of the start point and the coordinates of the start point on the spline curve, and the shape loss corresponding to the end point is the distance between the original coordinates of the end point and the coordinates of the end point on the spline curve.

[0279] The first objective function, the second objective function, and the third objective function are weighted and calculated to obtain the overall objective function.

[0280] In some implementations, the segmentation module 11 is specifically used to: starting from the starting point of the road shape, determine the road between any two adjacent original points as a segment, wherein the any two adjacent original points are the starting point and the ending point of the segment.

[0281] In some implementations, the segmentation module 11 is specifically used to: sample the road shape at equal intervals according to the sampling interval of the actual heading data, and determine the road between any two adjacent sampling points as a segment, wherein the any two adjacent sampling points are the start and end points of the segment.

[0282] In some implementations, the reference point on the segment is the start or end point of the segment.

[0283] In some implementations, the segmented spline curve is a cubic polynomial;

[0284] The continuity constraints between the segment and adjacent segments include the following constraints:

[0285] The end point of the segment is continuous with the start point of the adjacent segment;

[0286] The first derivative of the end point of the segment is continuous with the first derivative of the beginning point of the adjacent segment;

[0287] The second derivative of the end point of the segment is continuous with the second derivative of the start point of the adjacent segment.

[0288] In some implementations, the second determining module 15 is specifically used to: for each segment, interpolate to obtain the preset number of target points on the segment based on the parameters and preset number of the spline curve of the segment, add the coordinates of the target points to the corresponding positions of the segments in the original sequence, and obtain the target sequence of the road shape.

[0289] In some implementations, parallel interpolation is used to obtain the target points on the n segments.

[0290] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details will not be provided here.

[0291] The apparatus 100 of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly manifested as execution by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.

[0292] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0293] This application also provides an electronic device. Figure 7 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of this application, as shown below. Figure 7 As shown, the electronic device 200 may include: a processor 21 with one or more processing cores, a memory 22 with one or more computer-readable storage media, and a computer program stored on the memory 22 and executable on the processor. The processor 21 and the memory 22 are electrically connected. Those skilled in the art will understand that the computer device structure shown in the figures does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0294] The processor 21 is the control center of the electronic device 200. It connects various parts of the electronic device 200 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 22, and calling data stored in the memory 22, it executes various functions of the electronic device 200 and processes data, thereby performing overall processing of the electronic device 200.

[0295] In this embodiment, the processor 21 in the electronic device 200 loads the instructions corresponding to the processes of one or more applications into the memory 22 according to the following steps, and the processor 21 runs the applications stored in the memory 22 to achieve the following functions:

[0296] The road shape is segmented according to the original sequence of the road shape, resulting in n segments, where n is an integer greater than or equal to 2. The original sequence includes the original coordinates of each original point on the road shape. Actual heading data of a reference point on each segment is obtained, whereby the actual heading data characterizes the actual heading angle between the vehicle's travel direction at the reference point and a specified direction. A spline curve for each segment is constructed. Based on the spline curves of the n segments and the actual heading data of the reference points, a first objective function and its constraints are determined. An objective function is used to characterize the sum of differences between the actual heading data and the predicted heading data of the n segments, wherein the predicted heading data is determined based on the spline curves of the segments. The constraints of the first objective function include: continuity constraints between the segments and adjacent segments and endpoint offset constraints of the segments. Based on the constraints of the first objective function and the original coordinates of the reference points of the n segments, the first objective function is solved to obtain the parameters of the spline curves of the n segments. Based on the parameters of the spline curves of the n segments, the target sequence of the route is determined.

[0297] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0298] In some embodiments, the processor 21 may include, but is not limited to: a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0299] In some embodiments of this application, the memory 22 includes, but is not limited to, volatile memory and / or non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).

[0300] Optional, such as Figure 7 As shown, the electronic device 20 also includes a display screen 23, a radio frequency circuit 24, an audio circuit 25, an input unit 26, and a power supply 27. The processor 21 is electrically connected to the display screen 23, the radio frequency circuit 24, the audio circuit 25, the input unit 26, and the power supply 27. Those skilled in the art will understand that... Figure 7 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0301] The display screen 23 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The display screen 23 can be a touch screen, which may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the computer device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 21. It can also receive and execute commands from the processor 21. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 21 to determine the type of touch event. Subsequently, the processor 21 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into a touch display screen to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen can be implemented as two independent components to achieve input and output functions. That is, the touch display screen can also be used as part of the input unit 26 to achieve input functions.

[0302] The radio frequency circuit 24 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other computer devices, and to transmit and receive signals with network devices or other computer devices.

[0303] Audio circuitry 25 can be used to provide an audio interface between a user and a computer device via a speaker and a microphone. Audio circuitry 25 can convert received audio data into electrical signals and transmit them to the speaker, where the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 25, converted back into audio data, and then processed by processor 21 before being transmitted via radio frequency circuitry 24 to, for example, another computer device, or output to memory 22 for further processing. Audio circuitry 25 may also include an earphone jack to facilitate communication between peripheral headphones and the computer device.

[0304] The input unit 26 can be used to receive input numbers, characters, or object feature information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.

[0305] Power supply 27 is used to supply power to various components of electronic device 200. Optionally, power supply 27 can be logically connected to processor 21 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 27 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0306] although Figure 7 As not shown in the diagram, the electronic device 200 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.

[0307] It should be understood that the various components in the electronic device are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.

[0308] This application also provides a computer storage medium storing a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of this application also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.

[0309] This application also provides a computer program product comprising a computer program stored in a computer-readable storage medium. The processor of an electronic device reads the computer program from the computer-readable storage medium and executes the computer program, causing the electronic device to perform the corresponding processes in the above method embodiments; for brevity, these will not be elaborated further here.

[0310] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0311] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0312] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for correcting the alignment of a road segment, characterized in that, The method includes: The road shape is segmented according to the original sequence of the road shape to obtain n segments, where n is an integer greater than or equal to 2. The original sequence includes the original coordinates of each original point on the road shape. Acquire the actual heading data of the reference point on each segment, wherein the actual heading data is used to characterize the actual heading angle between the vehicle's travel direction at the reference point and the specified direction; Construct spline curves for each segment, and determine a first objective function and its constraints based on the spline curves of the n segments and the actual heading data of the reference point. The first objective function is used to characterize the sum of the differences between the actual heading data and the predicted heading data of the n segments. The predicted heading data is determined based on the spline curves of the segments. The constraints of the first objective function include: continuity constraints between the segment and adjacent segments and endpoint offset constraints of the segment. Based on the constraints of the first objective function and the original coordinates of the reference points of the n segments, the first objective function is solved to obtain the parameters of the spline curves of the n segments; The target sequence of the road shape is determined based on the parameters of the spline curves of the n segments.

2. The method according to claim 1, characterized in that, The predicted heading data is determined based on the tangent direction of the segmented spline curve at the reference point, and the predicted heading data is used to represent the predicted heading angle between the vehicle's travel direction at the reference point and the specified direction.

3. The method according to claim 2, characterized in that, The first objective function is the sum of the absolute values ​​of the vector products of the actual heading vectors and the predicted heading vectors of the n segments, wherein the actual heading vector of each segment is the vector corresponding to the actual heading data of the reference point of the segment, and the predicted heading vector is the tangential direction vector of the spline curve of the segment at the reference point.

4. The method according to claim 3, characterized in that, The actual heading data is the angle between the vehicle's direction of travel at the reference point and the specified direction. The method further includes: Set the specified direction as the target coordinate axis in an orthogonal coordinate system; The actual heading angle is converted into a unit vector in the orthogonal coordinate system, and the converted unit vector is the actual heading vector.

5. The method according to claim 3, characterized in that, The constraints of the first objective function also include constraints of the first intermediate variable, which is an equivalent form of the first objective function.

6. The method according to claim 1, characterized in that, The continuity constraint is used to constrain the continuity of the connection points between the segment and adjacent segments, as well as the continuity of the higher-order derivatives of the connection points. The endpoint offset constraint is used to ensure that the offset of the starting point of each segment and the offset of the ending point of the last segment are within a preset offset range.

7. The method according to claim 1, characterized in that, Also includes: The second objective function and its constraints are determined based on the spline curves of the n segments, wherein the second objective function is the sum of the absolute values ​​of the coefficients of the higher-order terms of the spline curves of the n segments, and the constraints of the second objective function are the constraints of the second intermediate variable, which is an equivalent form of the second objective function. The first objective function and the second objective function are weighted to obtain the overall objective function. The step of solving the first objective function based on the constraints of the first objective function and the original coordinates of the reference point to obtain the parameters of the piecewise spline curve includes: Based on the constraints of the first objective function, the constraints of the second objective function, and the original coordinates of the reference point, the overall objective function is solved to obtain the parameters of the piecewise spline curve.

8. The method according to claim 7, characterized in that, Also includes: The third objective function is determined based on the original coordinates of the start and end points of the n segments. The third objective function is the sum of the shape loss corresponding to the start point of the n segments and the shape loss corresponding to the end point of the last segment. The shape loss corresponding to the start point is the square of the distance between the original coordinates of the start point and the coordinates of the start point on the spline curve, and the shape loss corresponding to the end point is the distance between the original coordinates of the end point and the coordinates of the end point on the spline curve. The step of weighting the first objective function and the second objective function to obtain the overall objective function includes: The first objective function, the second objective function, and the third objective function are weighted and calculated to obtain the overall objective function.

9. The method according to any one of claims 1-8, characterized in that, The road shape is segmented to obtain multiple segments, including: Starting from the starting point of the road shape, the road between any two adjacent original points is defined as a segment, and the any two adjacent original points are the starting point and the ending point of the segment.

10. The method according to any one of claims 1-8, characterized in that, The road shape is segmented to obtain multiple segments, including: The road shape is sampled at equal intervals according to the sampling interval of the actual heading data. The road between any two adjacent sampling points is defined as a segment. The two adjacent sampling points are the start and end points of the segment. The reference point on the segment is the start or end point of the segment.

11. The method according to any one of claims 1-8, characterized in that, Determining the target sequence of the road shape based on the parameters of the n segmented spline curves includes: For each segment, based on the parameters and preset number of the spline curve of the segment, the preset number of target points on the segment are interpolated, and the coordinates of the target points are added to the corresponding positions of the segments in the original sequence to obtain the target sequence of the road shape.

12. A road alignment correction device for a road section, characterized in that, include: The segmentation module is used to segment the road shape according to the original sequence of the road shape to obtain n segments, where n is an integer greater than or equal to 2. The original sequence includes the original coordinates of each original point on the road shape. The acquisition module is used to acquire the actual heading data of the reference point on each segment. The actual heading data is used to characterize the actual heading angle between the vehicle's travel direction at the reference point and the specified direction. The first determining module is used to construct the spline curve for each segment, and determine a first objective function and its constraints based on the spline curves of the n segments and the actual heading data of the reference point. The first objective function is used to characterize the sum of the differences between the actual heading data and the predicted heading data of the n segments. The predicted heading data is determined based on the spline curves of the segments. The constraints of the first objective function include: continuity constraints between the segment and adjacent segments and endpoint offset constraints of the segment. The solution module is used to solve the first objective function based on the constraints of the first objective function and the original coordinates of the reference points of the n segments, so as to obtain the parameters of the spline curves of the n segments; The second determining module is used to determine the target sequence of the road shape based on the parameters of the n segmented spline curves.

13. An electronic device, characterized in that, include: A processor and a memory, the memory being used to store a computer program, the processor being used to invoke and run the computer program stored in the memory to perform the method of any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that, Used to store a computer program that causes a computer to perform the method as described in any one of claims 1 to 11.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 11.