Road optimization method and device, computer device and storage medium
By constructing an initial road network and identifying risky curves, generating circular curves, and automatically replacing risky curves, the problem of low efficiency in road curve optimization in existing technologies is solved, and efficient road network optimization is achieved.
Patent Information
- Application Number
- CN202610320056.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-17
- Publication Date
- 2026-05-15
- Estimated Expiration
- 2046-03-17
AI Technical Summary
In existing technologies, road curve optimization is inefficient and requires manual adjustments, resulting in low efficiency.
By acquiring site planning drawings, an initial road network is constructed, and concave and convex points are detected on the outer and inner boundaries to identify risky curves. Based on multi-level arc generation rules, arc curves are generated and risky curves are automatically replaced to optimize the road network.
It reduces the computational load of risk detection, automatically identifies and reconstructs risky curves in the road network, improves the efficiency of road curve optimization, and reduces the need for manual adjustments.
Smart Images

Figure CN121859416B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to road optimization methods, apparatus, computer equipment, and storage media. Background Technology
[0002] In the field of road design, compliance testing and optimization of turning radius is a core requirement for fire lane design. In construction scenarios such as large residential areas, shopping malls, and exhibition halls, road design needs to be carried out in advance to ensure road compliance.
[0003] In existing technologies, engineers typically plan road networks manually based on pre-planned architectural drawings, and then manually optimize the curves of the road network. However, manually adjusting curves results in low efficiency for road curve optimization. Summary of the Invention
[0004] This application provides a road optimization method, apparatus, computer equipment, and storage medium, which can improve the efficiency of road curve optimization.
[0005] In a first aspect, embodiments of this application provide a road optimization method, which includes:
[0006] Obtain construction site planning drawings, which include road outer boundary data and internal obstacle boundary data;
[0007] An initial road network is constructed based on the road outer boundary data and the internal obstacle boundary data, the initial road network including the outer boundary and the inner circle boundary;
[0008] The outer boundary is subjected to concave point detection to determine at least one concave bend in the outer boundary, and the inner boundary is subjected to convex point detection to determine at least one convex bend in the inner boundary.
[0009] A turning radius risk detection is performed on the concave curve and the convex curve to identify the risky curves among the concave curve and the convex curve.
[0010] The circular arc curves corresponding to the risk curves are generated based on preset multi-level circular arc generation rules;
[0011] Based on the corresponding circular curves, each risk curve in the initial road network is replaced with a circular curve to obtain the target road network.
[0012] Secondly, embodiments of this application also provide a road optimization device, which includes:
[0013] The transceiver unit is used to acquire construction site planning drawings, which include road outer boundary data and internal obstacle boundary data.
[0014] The processing unit is configured to construct an initial road network based on the road outer boundary data and the internal obstacle boundary data, the initial road network including an outer boundary and an inner boundary; perform concave point detection on the outer boundary to identify at least one concave curve in the outer boundary, and perform convex point detection on the inner boundary to identify at least one convex curve in the inner boundary; perform turning radius risk detection on the concave curve and the convex curve to identify risk curves among the concave curve and the convex curve; generate arc curves corresponding to the risk curves based on preset multi-level arc generation rules; and perform arc curve replacement processing on each risk curve in the initial road network according to the corresponding arc curve to obtain the target road network.
[0015] Thirdly, embodiments of this application also provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0016] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, can implement the above-described method.
[0017] This application provides a road optimization method, apparatus, computer equipment, and storage medium. The method includes: acquiring a construction site planning drawing, the drawing including road outer boundary data and internal obstacle boundary data; constructing an initial road network based on the road outer boundary data and the internal obstacle boundary data, the initial road network including an outer boundary and an inner boundary; performing concave point detection on the outer boundary to identify at least one concave curve within the outer boundary, and performing convex point detection on the inner boundary to identify at least one convex curve within the inner boundary; performing turning radius risk detection on the concave and convex curves to identify risky curves among the concave and convex curves; generating arc curves corresponding to the risky curves based on preset multi-level arc generation rules; and performing arc curve replacement processing on each risky curve in the initial road network according to the corresponding arc curve to obtain a target road network. On the one hand, this solution only needs to perform risk detection on concave curves in the outer boundary and convex curves in the inner boundary, without needing to perform risk detection on convex curves in the outer boundary and concave curves in the inner boundary, thus reducing the computational load of risk detection. On the other hand, this solution automatically generates a road network based on the site planning map, automatically identifies risk curves in the road network, and intelligently reconstructs the arc curves of risk curves in the road network, eliminating the need for manual adjustment of curves and improving the efficiency of road curve optimization. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A schematic flowchart illustrating the road optimization method provided in this application embodiment;
[0020] Figure 2 A schematic diagram of a sub-process of the road optimization method provided in the embodiments of this application;
[0021] Figure 3 A schematic diagram of the road network in the road optimization method provided in the embodiments of this application;
[0022] Figure 4 This is another schematic diagram of a sub-process of the road optimization method provided in the embodiments of this application;
[0023] Figure 5 This is another schematic diagram of a sub-process of the road optimization method provided in the embodiments of this application;
[0024] Figure 6 A schematic block diagram of a road optimization device provided in an embodiment of this application;
[0025] Figure 7 A schematic block diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0027] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0028] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0029] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0030] This application provides road optimization methods, apparatus, computer equipment, and storage media.
[0031] The entity executing the road optimization method can be the road optimization device provided in the embodiments of this application, or a computer device integrating the road optimization device. The road optimization device can be implemented in hardware or software, and the computer device can be a terminal or a server. The terminal can be a smartphone, tablet computer, handheld computer, or laptop computer, etc.
[0032] Figure 1 This is a schematic flowchart of the road optimization method provided in an embodiment of this application. Figure 1 As shown, the method includes the following steps S110-S160.
[0033] S110. Obtain the construction site planning drawings, which include road outer boundary data and internal obstacle boundary data.
[0034] In this embodiment, the construction site planning drawing can specifically be a CAD drawing, the outer boundary data of the road is the outermost boundary of the construction site planning drawing, and the boundary data of the internal obstacles can specifically be the boundary of the building foundation pit, the building boundary, etc.
[0035] In some embodiments, the road perimeter boundary data and internal obstacle boundary data in the site planning drawings are identified by the following steps: a boundary separator is provided, which automatically identifies the road perimeter boundary data (maximum area polygon) and internal obstacle boundary data based on the polygon area.
[0036] S120. Construct an initial road network based on the outer boundary data of the road and the inner obstacle boundary data. The initial road network includes an outer boundary and an inner boundary.
[0037] In some embodiments, please refer to Figure 2 Step S120 includes the following steps:
[0038] S1201. Sample the straight line segments in the outer boundary data of the road and the inner obstacle boundary data according to the preset first interval to obtain multiple first sampling points;
[0039] S1202. Sampling is performed on the arc segments in the outer boundary data of the road and the inner obstacle boundary data according to a preset second interval to obtain multiple second sampling points, wherein the second interval is smaller than the first interval;
[0040] S1203. Construct the initial road network based on the first sampling point and the second sampling point.
[0041] Specifically, an adaptive sampler is provided to automatically identify straight line segments and curved line segments. The identified straight line segments are sampled at a first interval (e.g., 1 meter), and the identified curved line segments are sampled at a second interval (e.g., 0.3 meters). The first interval can also be set to other values as needed, such as 0.5 meters. This embodiment does not limit the specific value of the first interval. The second interval can also be set to other values as needed, such as 0.1 meters. This embodiment does not limit the specific value of the second interval.
[0042] Furthermore, during the sampling calculation process, due to the precision limitations of floating-point numbers, very close or duplicate points may appear, which can lead to errors in subsequent calculations (such as curvature calculation). Therefore, this example also requires vertex optimization of the initial road network. Specifically, a vertex optimizer is provided, which eliminates floating-point errors and improves the accuracy of subsequent calculations by standardizing the vertex coordinates to millimeter level (retaining 3 decimal places) and filtering duplicate points.
[0043] In some embodiments, the road network can be as follows: Figure 3 As shown, in Figure 3 In the diagram, the boundary labeled 1 is the outer boundary, and the boundaries labeled 2, 3, and 4 are the inner boundaries.
[0044] In some embodiments, adaptive sampling can be performed using the following code: "def adaptive_sampling(polyline):"
[0045] if is_straight_segment(polyline):
[0046] return sample_at_interval(polyline, 1.0) # Sample 1 meter of a straight line segment
[0047] else:
[0048] return sample_at_interval(polyline, 0.1) # Encrypt sample of the arc segment by 0.1 meters.
[0049] S130. Perform concave point detection on the outer boundary to determine at least one concave bend in the outer boundary, and perform convex point detection on the inner boundary to determine at least one convex bend in the inner boundary.
[0050] In this embodiment, a dual-track risk detection mechanism is provided, which only needs to detect concave points on the outer boundary and convex points on the inner boundary, without needing to perform risk detection on all curves of the initial road network.
[0051] Traditional methods indiscriminately detect all bumps and concave points, leading to false detections of convex points on the periphery and false detections of concave points on the inner circle, thus affecting computational efficiency.
[0052] The boundary characteristic detection rules provided in this embodiment are as follows:
[0053] For the outer boundary: only concave points are detected (the turning radius at the concave corner is insufficient);
[0054] For the inner boundary: only detect the outer convex points (the lane squeezed at the convex corners).
[0055] In addition, it provides a special right-angle detection service, which specifically detects corners of 80-100° to avoid missing right-angle bends. It identifies concave right angles in the outer boundary as concave bends and convex right angles in the inner boundary as convex bends.
[0056] S140. Perform a turning radius risk detection on the concave curve and the convex curve to identify the risk curves among the concave curve and the convex curve.
[0057] In some embodiments, both the concave curve and the convex curve include a sequence of road edge vertices, and the sequence of road edge vertices includes multiple road edge vertices, such as... Figure 4 As shown, step S140 includes:
[0058] S1401. For each road edge vertex in each road edge vertex sequence, obtain multiple associated vertices of the road edge vertex in the corresponding road edge vertex sequence according to a preset sliding window size.
[0059] For example, the road edge vertex sequence includes P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P 10 There are a total of 11 road edge vertices. The road edge vertex currently being calculated for curvature radius is P5. The preset sliding window size is 3. At this time, the three road edge vertices before P5 (P2, P3, P4) and the three road edge vertices after P5 (P6, P7, P8) are determined as associated vertices of P5.
[0060] Since the vertices at both ends of a curve are generally non-risk points, when performing turning radius risk detection on the concave curve and the convex curve, the curvature radius values of the vertices at both ends of the road edge vertex sequence do not need to be calculated (e.g., P0, P1, P2 are not required). 2、 P8, P9, P 10 (the radius of curvature value), to reduce the amount of computation.
[0061] S1402. Calculate the radius of curvature values of the road edge vertices and each of the associated vertices respectively;
[0062] In this embodiment, the radius of curvature value is calculated through the following steps:
[0063] Obtain a first vertex and the second and third vertices on either side of the corresponding road edge vertex sequence. The first vertex is the vertex currently used for radius of curvature calculation among the road edge vertices and the associated vertices. Determine a first vector based on the second and first vertices, and determine a second vector based on the first and third vertices. Determine the chord length between the second and third vertices. Determine the radius of curvature value corresponding to the first vertex based on the first vector, the second vector, and the chord length. Through this step, the radius of curvature values of each road edge vertex and each associated vertex can be calculated.
[0064] For example, the first vertex is P i The second vertex is P. i-1 The third vertex is P. i+1 The first vector is V1(P) i-1 →P i The second vector is V2 (P) i →P i+1 ), with chord length P i-1 To P i+1 The distance between them.
[0065] Specifically, determining the radius of curvature value corresponding to the first vertex based on the first vector, the second vector, and the chord length includes:
[0066] Calculate the turning angle between the first vector and the second vector, and then calculate the radius of curvature of the first vertex according to the preset radius of curvature calculation formula.
[0067] The formula for calculating the radius of curvature is:
[0068] R = chord length / (2 × sin(θ / 2)), where θ is the turning angle and R is the corresponding radius of curvature.
[0069] S1403. Perform median filtering on the curvature radius values of the road edge vertex and the corresponding multiple associated vertices to obtain the target radius values corresponding to the road edge vertex respectively.
[0070] Specifically, after calculating the curvature radius values of the current road edge vertex and the multiple associated vertices, the median value (median) among the curvature radius values of the road edge vertex and the multiple associated vertices is determined as the target radius value of the current road edge vertex.
[0071] For example, among P2, P3, P4, P5, P6, P7, and P8, P5 is the current road edge vertex, and the others are associated vertices of P5. The radius values of P2, P3, P4, P5, P6, P7, and P8 are [11, 14, 8, 12, 12, 0.9, 11], which are sorted into [0.9, 8, 11, 11, 12, 12, 14]. The middle value after sorting is taken as the target radius value of P5, that is, the target radius value of P5 is 11.
[0072] As can be seen, this embodiment avoids treating occasional noise (such as 0.9 above) as risk points, and the accuracy of risk point identification can be improved by median filtering.
[0073] In some embodiments, the code for determining the target radius value of the road edge vertex is as follows:
[0074] “def moving_chord_radius(points, center_index):
[0075] window = 3 # Slide window size
[0076] radii = []
[0077] for i in range(center_index-window, center_index+window):
[0078] p1, p2, p3 = points[i-1], points[i], points[i+1]
[0079] v1 = vector(p1, p2) # Vector P1-P2
[0080] v2 = vector(p2, p3) # Vector P2-P3
[0081] theta = angle_between(v1, v2) # Calculate the steering angle
[0082] chord = distance(p1, p3) # chord length
[0083] radius = chord / (2 * math.sin(theta / 2))
[0084] radii.append(radius)
[0085] `return median(radii) # Median filtering for noise reduction`
[0086] S1404. The vertex of the road edge line whose target radius value is less than the preset risk radius threshold is determined as a risk point;
[0087] For example, if the preset risk radius threshold is 10 and the target radius is 11, then the current road edge vertex P5 is a non-risk point.
[0088] S1405. The concave bend and the convex bend containing the risk point are identified as the risk bend.
[0089] In this embodiment, curves containing risk points in concave curves and convex curves are defined as risk curves. A risk curve includes a target risk point, a first boundary line located before the target risk point, and a second boundary line located after the risk point. The target risk point is a single risk point or a group of risk points including multiple consecutive risk points.
[0090] S150. Generate the circular arc curve corresponding to the risk curve based on the preset multi-level circular arc generation rules.
[0091] In this embodiment, each vertex in the circular arc curve corresponding to the risk curve meets the requirement of the preset risk radius threshold.
[0092] In some embodiments, the multi-level arc generation rules include double-tangent-constrained arc generation sub-rules, single-sided-constrained arc generation rules, and straight-line-connected arc generation rules. The risk curve includes a target risk point, a first boundary line preceding the target risk point, and a second boundary line following the risk point. (See also...) Figure 5 Step S150 includes:
[0093] S1501. Determine the first normal line corresponding to the first boundary line and the second normal line corresponding to the second boundary line;
[0094] S1502. Based on the double-tangent constraint arc generation sub-rule, the risk curve is solved by double-tangent arc calculation according to the first normal, the second normal and the preset minimum arc radius value to obtain the first result;
[0095] The minimum arc radius value can be the aforementioned preset risk radius threshold, or it can be a preset value larger than the preset risk radius threshold, which is a shorter length.
[0096] In some embodiments, step S1502 includes the following steps:
[0097] Traverse all directions of the first normal and the second normal, and offset the first boundary line and the second boundary line along the corresponding normal direction by the minimum arc radius value; find the intersection point between the offset first boundary line and the offset second boundary line, and determine the intersection point as the first circle center; determine whether the first circle center meets the preset first verification condition, the first verification condition being: the circle constructed by the first circle center with the minimum arc radius value as the radius is tangent to both the first boundary line and the second boundary line; if there is a first circle center that meets the first verification condition, then the arc between the tangent points of the corresponding circle and the first boundary line and the second boundary line is determined as the double tangent arc, and the double tangent arc of the successfully obtained risk curve is determined as the first result; if there is no first circle center that meets the first verification condition, then the double tangent arc of the unsuccessfully obtained curve is determined as the first result.
[0098] Among them, the double tangent arc obtained by offsetting the minimum arc radius value can achieve the most compact optimization of the turning arc and occupy the least space. It can be seen that the arc curve generated by this embodiment can ensure the minimum space occupation and meet the requirements of the curve radius.
[0099] Specifically, a typical risk curve includes a normal line, and each normal line has two directions. In this embodiment, the first boundary line and the second boundary line are offset by the minimum arc radius value along the corresponding normal direction to obtain multiple offset combinations. Then, the intersection point of each offset combination (some offset combinations have no intersection point) is used as the center of the circle. Then, a circle is constructed based on the center of the circle and the minimum arc radius value. It is determined whether the constructed circle is tangent to both the first boundary line and the second boundary line. If so, the arc between the tangent points is determined as a double tangent arc connecting the two sides. Otherwise, the single tangent arc is solved by generating a single-sided constrained arc sub-rule.
[0100] S1503. If the first result is that the double tangent arc of the risk curve is successfully obtained, then the double tangent arc is determined as the arc curve.
[0101] S1504. If the first result is that the double tangent arc is not successfully obtained, then based on the single-sided constraint arc generation sub-rule, the risk curve is solved by single tangent arc according to the target normal and the minimum arc radius value to obtain the second result. The target normal is the normal corresponding to the target boundary line, and the target boundary line is the shorter boundary line between the first boundary line and the second boundary line.
[0102] In some embodiments, step S1504 includes the following steps:
[0103] Determine the farthest endpoint of the first boundary line and the second boundary line that is farthest from the target risk point; take the boundary line opposite to the farthest endpoint of the first boundary line and the second boundary line as the target edge; traverse all directions of the normal corresponding to the target edge, and offset the target edge along the corresponding normal direction by the minimum arc radius value to obtain the offset target edge; determine whether there is a second circle center on the offset target edge that satisfies a preset second verification condition, the second verification condition being that the distance from the second circle center to the target edge and the farthest endpoint is the minimum arc radius value; if there is a second circle center that satisfies the second verification condition, then the arc between the tangent point of the corresponding circle and the target edge and the farthest endpoint is determined as the single tangent arc, and the single tangent arc of the successfully obtained risk curve is determined as the second result; if there is no second circle center that satisfies the second verification condition, then the single tangent arc of the unsuccessfully obtained curve is determined as the second result.
[0104] Specifically, a typical risk curve includes a normal line, and each normal line has two directions. In this embodiment, it is necessary to traverse all normal directions of the target edge, move the target edge, and perform single-tangent arc calculation on the offset target edge obtained after the movement. Specifically, it is determined whether there is a target edge and the center of the circle whose distance from the far end point is the minimum arc radius value in the offset edge. If there is, the corresponding single-tangent arc is taken as the corresponding arc curve. Otherwise, the straight line connection arc generation sub-rule is executed to determine the arc curve by connecting straight lines, so as to ensure that the corresponding arc curve can be solved 100%.
[0105] S1505. If the second result is that the single tangent arc of the risk curve is successfully obtained, then the single tangent arc is determined as the arc curve.
[0106] S1506. If the second result is that the single tangent arc was not successfully obtained, then based on the straight line connecting arc generation sub-rule, the end of the first boundary line away from the target risk point and the end of the second boundary line away from the target risk point are connected by a straight line to obtain a curve connecting line, and the curve connecting line is determined as the arc curve.
[0107] In some embodiments, the code for generating the arc curve corresponding to the risk curve based on a preset multi-level arc generation rule is as follows: "def generate_arc(prev_edge, next_edge, min_radius):"
[0108] # Standard Solution: Double Tangent Constraint
[0109] for n1 in get_normals(prev_edge):
[0110] for n2 in get_normals(next_edge):
[0111] offset_prev = offset_segment(prev_edge, n1, min_radius)
[0112] offset_next = offset_segment(next_edge, n2, min_radius)
[0113] center = line_intersection(offset_prev, offset_next)
[0114] if center and validate_center(center, prev_edge, next_edge, min_radius):
[0115] return create_arc(center, min_radius, prev_edge[1],next_edge[0])
[0116] # Degeneration strategy 1: Unilateral constraint
[0117] far_point = get_farthest_endpoint(prev_edge, next_edge)
[0118] target_edge = next_edge if far_point in prev_edge else prev_edge
[0119] for n in get_normals(target_edge):
[0120] offset_target = offset_segment(target_edge, n, min_radius)
[0121] centers = circle_line_intersection(offset_target, far_point,min_radius)
[0122] for center in centers:
[0123] if validate_center(center, target_edge, [far_point], min_radius):
[0124] return create_arc(center, min_radius, far_point, ...)
[0125] # Degeneracy Strategy 2: Straight Line Connection
[0126] return [get_farthest_endpoint(prev_edge, next_edge),
[0127] get_farthest_endpoint(next_edge, prev_edge)]".
[0128] In this embodiment, the multi-level arc generation rule is a three-level arc degradation strategy. It uses a double-tangent constraint arc generation sub-rule (double tangent constraint), a single-sided constraint arc generation sub-rule (single-sided constraint), and a straight-line connection arc generation sub-rule (straight-line connection). The double-tangent constraint arc generation sub-rule can obtain the ideal arc. The single-sided constraint arc generation sub-rule can generate a suboptimal arc with priority given to the far endpoint. The straight-line connection arc generation sub-rule can perform a minimum guarantee process for arc optimization, generating 100% arc curves.
[0129] S160. Based on the corresponding circular curves, perform circular curve replacement processing on each of the risk curves in the initial road network to obtain the target road network.
[0130] In this embodiment, the corresponding risk curves in the initial road network are replaced with the corresponding circular curves to obtain the target road network.
[0131] Specifically, based on the topology reconstruction rules, each of the risk curves in the initial road network is replaced with a circular curve according to the corresponding circular curve, to obtain the target road network.
[0132] The topology reconstruction rules include risk segment location sub-rules, adaptive direction adjustment sub-rules, and topology preservation replacement sub-rules. Risk segment location sub-rules are used to locate the start and end points of the arc curve in the initial road network (precisely matching and replacing intervals). Adaptive direction adjustment sub-rules are used to ensure that the connection direction of the new arc is consistent with the corresponding road boundary in the initial road network (dynamically adjusting the arc direction). Topology preservation replacement sub-rules are used to keep the overall topology of the road network unchanged (automatically maintaining the polygon closure attribute).
[0133] Specifically, the code for determining the target road network based on topology reconstruction rules is as follows:
[0134] "def replace_risk_segment(original_poly, risk_start, risk_end, new_arc):
[0135] # Locating risk data
[0136] start_idx = find_index(original_poly, risk_start)
[0137] end_idx = find_index(original_poly, risk_end)
[0138] # Direction adaptive adjustment
[0139] if distance(new_arc[0], original_poly[end_idx]) < distance(new_arc[0], original_poly[start_idx]):
[0140] new_arc = new_arc[::-1] # Reverse the flow direction
[0141] # Topology Preservation Replacement
[0142] return (original_poly[:start_idx] +
[0143] new_arc +
[0144] original_poly[end_idx+1:])".
[0145] In summary, on the one hand, this solution only needs to perform risk detection on concave curves in the outer boundary and convex curves in the inner boundary, without needing to perform risk detection on convex curves in the outer boundary and concave curves in the inner boundary, thus reducing the computational load of risk detection. On the other hand, this solution automatically generates a road network based on the site planning map, automatically identifies risk curves in the road network, and intelligently reconstructs the arc curves of the risk curves in the road network, eliminating the need for manual adjustment of curves and improving the efficiency of road curve optimization.
[0146] Figure 6 This is a schematic block diagram of a road optimization device provided in an embodiment of this application. Figure 6As shown, corresponding to the above road optimization method, this application also provides a road optimization device 600. The road optimization device 600 includes a unit for performing the above road optimization method, and the road optimization device 600 can be configured in a desktop computer, tablet computer, laptop computer, or other terminal. Specifically, please refer to... Figure 6 The road optimization device 600 includes a transceiver unit 601 and a processing unit 602, wherein:
[0147] The transceiver unit 601 is used to acquire construction site planning drawings, which include road outer boundary data and internal obstacle boundary data.
[0148] Processing unit 602 is configured to construct an initial road network based on the road outer boundary data and the internal obstacle boundary data, the initial road network including an outer boundary and an inner boundary; perform concave point detection on the outer boundary to identify at least one concave curve in the outer boundary, and perform convex point detection on the inner boundary to identify at least one convex curve in the inner boundary; perform turning radius risk detection on the concave curve and the convex curve to identify risk curves among the concave curve and the convex curve; generate arc curves corresponding to the risk curves based on preset multi-level arc generation rules; and perform arc curve replacement processing on each risk curve in the initial road network according to the corresponding arc curve to obtain a target road network.
[0149] In some embodiments, the multi-level arc generation rules include a double-tangent-constrained arc generation sub-rule, a single-sided-constrained arc generation sub-rule, and a straight-line-connected arc generation sub-rule. The risk curve includes a target risk point, a first boundary line located before the target risk point, and a second boundary line located after the risk point. When the processing unit 602 executes the step of generating the arc curve corresponding to the risk curve based on the preset multi-level arc generation rules, it is specifically used for:
[0150] Determine the first normal line corresponding to the first boundary line and the second normal line corresponding to the second boundary line;
[0151] Based on the aforementioned double-tangent constraint arc generation sub-rule, the risk curve is solved by double-tangent arc calculation according to the first normal, the second normal, and the preset minimum arc radius value, to obtain the first result;
[0152] If the first result is that the double tangent arc of the risk curve is successfully obtained, then the double tangent arc is determined as the arc curve.
[0153] If the first result is that the double tangent arc is not successfully obtained, then based on the single-sided constraint arc generation sub-rule, the risk curve is solved by single tangent arc according to the target normal and the minimum arc radius value to obtain the second result. The target normal is the normal corresponding to the target boundary line, and the target boundary line is the shorter boundary line between the first boundary line and the second boundary line.
[0154] If the second result is that the single tangent arc of the risk curve is successfully obtained, then the single tangent arc is determined as the arc curve.
[0155] If the second result is that the single tangent arc is not successfully obtained, then based on the straight line connecting arc generation sub-rule, the end of the first boundary line away from the target risk point and the end of the second boundary line away from the target risk point are connected by a straight line to obtain a curve connecting line, and the curve connecting line is determined as the arc curve.
[0156] In some embodiments, when the processing unit 602 executes the step of solving the risk curve using double tangent circular arcs based on the double tangent constraint circular arc generation sub-rule, according to the first normal, the second normal, and a preset minimum circular arc radius value, to obtain a first result, it is specifically used for:
[0157] Traverse all directions of the first normal and the second normal, and offset the first boundary line and the second boundary line along the corresponding normal direction by the minimum arc radius value;
[0158] Find the intersection point between the offset first boundary line and the offset second boundary line, and determine the intersection point as the center of the first circle;
[0159] Determine whether the first circle center meets the preset first verification condition. The first verification condition is: the circle constructed by the first circle center with the minimum arc radius value as the radius is tangent to both the first boundary line and the second boundary line.
[0160] If there exists a first circle center that meets the first verification condition, then the arc between the tangent points of the corresponding circle and the first boundary line and the second boundary line is determined as the double tangent arc, and the double tangent arc of the successfully obtained risk curve is determined as the first result.
[0161] If there is no first center that meets the first verification condition, then the failure to obtain the double tangent arc is determined as the first result.
[0162] In some embodiments, when the processing unit 602 executes the step of solving the risk curve using a single-tangent arc based on the single-sided constraint arc generation sub-rule, according to the target normal and the minimum arc radius value, to obtain a second result, it is specifically used for:
[0163] Determine the farthest endpoint of the first boundary line and the second boundary line that is farthest from the target risk point;
[0164] The first boundary line and the boundary line of the second boundary line that are opposite to the far endpoint are taken as the target edge;
[0165] Traverse all directions of the normal corresponding to the target edge, and offset the target edge along the corresponding normal direction by the minimum arc radius value to obtain the offset target edge;
[0166] Determine whether there is a second circle center on the offset target edge that satisfies a preset second verification condition. The second verification condition is that the distance from the second circle center to the target edge and the far end point are both the minimum arc radius value.
[0167] If there exists a second circle center that satisfies the second verification condition, then the arc between the tangent point of the corresponding circle and the target edge and the far endpoint is determined as the single tangent arc, and the single tangent arc of the successfully obtained risk curve is determined as the second result.
[0168] If there is no second center that satisfies the second verification condition, then the unsuccessful determination of the single tangent arc is determined as the second result.
[0169] In some embodiments, both the concave curve and the convex curve include a sequence of road edge vertices, and the sequence of road edge vertices includes multiple road edge vertices; when the processing unit 602 performs the step of performing turning radius risk detection on the concave curve and the convex curve to determine the risk curves among the concave curve and the convex curve, it is specifically used for:
[0170] For each road edge vertex in each road edge vertex sequence, multiple associated vertices of the road edge vertex are obtained in the corresponding road edge vertex sequence according to a preset sliding window size;
[0171] Calculate the radius of curvature values of the road edge vertices and each of the associated vertices respectively;
[0172] The curvature radius values of the road edge vertex and the corresponding multiple associated vertices are subjected to median filtering to obtain the target radius values corresponding to the road edge vertex respectively;
[0173] The vertices of road edges whose target radius values are less than a preset risk radius threshold are identified as risk points.
[0174] The concave bends and the convex bends containing the risk points are identified as the risk bends.
[0175] In some embodiments, when performing the step of calculating the radius of curvature values of the road edge vertices and each of the associated vertices, the processing unit 602 is specifically used for:
[0176] Obtain the first vertex and the second and third vertices on both sides of the corresponding road edge vertex sequence, wherein the first vertex is the vertex currently performing the radius of curvature calculation among the road edge vertices and the associated vertices;
[0177] A first vector is determined based on the second vertex and the first vertex, and a second vector is determined based on the first vertex and the third vertex;
[0178] Determine the chord length between the second vertex and the third vertex;
[0179] The radius of curvature value corresponding to the first vertex is determined based on the first vector, the second vector, and the chord length.
[0180] In some embodiments, when the processing unit 602 performs the step of constructing an initial road network based on the road perimeter boundary data and the internal obstacle boundary data, it is specifically used for:
[0181] According to a preset first interval, straight segments in the outer boundary data of the road and the inner obstacle boundary data are sampled to obtain multiple first sampling points;
[0182] According to a preset second interval, the arc segments in the outer boundary data of the road and the inner obstacle boundary data are sampled to obtain multiple second sampling points, where the second interval is smaller than the first interval.
[0183] The initial road network is constructed based on the first sampling point and the second sampling point.
[0184] In summary, on the one hand, this solution only needs to perform risk detection on concave curves in the outer boundary and convex curves in the inner boundary, without needing to perform risk detection on convex curves in the outer boundary and concave curves in the inner boundary, thus reducing the computational load of risk detection. On the other hand, this solution automatically generates a road network based on the site planning map, automatically identifies risk curves in the road network, and intelligently reconstructs the arc curves of the risk curves in the road network, eliminating the need for manual adjustment of curves and improving the efficiency of road curve optimization.
[0185] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned road optimization device and each unit can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.
[0186] The aforementioned road optimization device can be implemented as a computer program, which can, for example... Figure 7 It runs on the computer device shown.
[0187] Please see Figure 7 , Figure 7 This is a schematic block diagram of a computer device 700 provided in an embodiment of this application. The computer device 700 can be a terminal or a server. The terminal can be an electronic device with communication functions, such as a smartphone, tablet, laptop, desktop computer, personal digital assistant, or wearable device. The server can be a standalone server or a server cluster composed of multiple servers.
[0188] See Figure 7 The computer device 700 includes a processor 702, a memory, and a network interface 705 connected via a system bus 701. The memory may include a non-volatile storage medium 703 and internal memory 704.
[0189] The non-volatile storage medium 703 may store an operating system 7031 and a computer program 7032. The computer program 7032 includes program instructions that, when executed, cause the processor 702 to perform a road optimization method.
[0190] The processor 702 provides computing and control capabilities to support the operation of the entire computer device 700.
[0191] The internal memory 704 provides an environment for the execution of the computer program 7032 in the non-volatile storage medium 703. When the computer program 7032 is executed by the processor 702, the processor 702 can execute a road optimization method.
[0192] This network interface 705 is used for network communication with other devices. Those skilled in the art will understand that... Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 700 to which the present application is applied. The specific computer device 700 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0193] The processor 702 is used to run a computer program 7032 stored in the memory to perform the following steps:
[0194] Obtain construction site planning drawings, which include road outer boundary data and internal obstacle boundary data;
[0195] An initial road network is constructed based on the road outer boundary data and the internal obstacle boundary data, the initial road network including the outer boundary and the inner circle boundary;
[0196] The outer boundary is subjected to concave point detection to determine at least one concave bend in the outer boundary, and the inner boundary is subjected to convex point detection to determine at least one convex bend in the inner boundary.
[0197] A turning radius risk detection is performed on the concave curve and the convex curve to identify the risky curves among the concave curve and the convex curve.
[0198] The circular arc curves corresponding to the risk curves are generated based on preset multi-level circular arc generation rules;
[0199] Based on the corresponding circular curves, each risk curve in the initial road network is replaced with a circular curve to obtain the target road network.
[0200] It should be understood that in the embodiments of this application, the processor 702 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0201] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0202] Therefore, this application also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When executed by a processor, the program instructions cause the processor to perform the following steps:
[0203] Obtain construction site planning drawings, which include road outer boundary data and internal obstacle boundary data;
[0204] An initial road network is constructed based on the road outer boundary data and the internal obstacle boundary data, the initial road network including the outer boundary and the inner circle boundary;
[0205] The outer boundary is subjected to concave point detection to determine at least one concave bend in the outer boundary, and the inner boundary is subjected to convex point detection to determine at least one convex bend in the inner boundary.
[0206] A turning radius risk detection is performed on the concave curve and the convex curve to identify the risky curves among the concave curve and the convex curve.
[0207] The circular arc curves corresponding to the risk curves are generated based on preset multi-level circular arc generation rules;
[0208] Based on the corresponding circular curves, each risk curve in the initial road network is replaced with a circular curve to obtain the target road network.
[0209] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0210] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0211] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0212] The steps in the methods of this application embodiment can be adjusted, merged, or deleted according to actual needs. The units in the apparatus of this application embodiment can be merged, divided, or deleted according to actual needs. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0213] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0214] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered 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 road optimization method, characterized in that, include: Obtain construction site planning drawings, which include road outer boundary data and internal obstacle boundary data; An initial road network is constructed based on the road outer boundary data and the internal obstacle boundary data, the initial road network including the outer boundary and the inner circle boundary; The outer boundary is subjected to concave point detection to determine at least one concave bend in the outer boundary, and the inner boundary is subjected to convex point detection to determine at least one convex bend in the inner boundary. A turning radius risk detection is performed on the concave curve and the convex curve to identify the risky curves among the concave curve and the convex curve. The circular arc curves corresponding to the risk curves are generated based on preset multi-level circular arc generation rules; Based on the corresponding circular curves, each risk curve in the initial road network is replaced with a circular curve to obtain the target road network.
2. The method according to claim 1, characterized in that, The multi-level arc generation rules include double-tangent constrained arc generation sub-rules, single-sided constrained arc generation rules, and straight-line connected arc generation rules. The risk curve includes a target risk point, a first boundary line located before the target risk point, and a second boundary line located after the risk point. The generation of the circular arc curve corresponding to the risk curve based on the preset multi-level circular arc generation rules includes: Determine the first normal line corresponding to the first boundary line and the second normal line corresponding to the second boundary line; Based on the aforementioned double-tangent constraint arc generation sub-rule, the risk curve is solved by double-tangent arc calculation according to the first normal, the second normal, and the preset minimum arc radius value, to obtain the first result; If the first result is that the double tangent arc of the risk curve is successfully obtained, then the double tangent arc is determined as the arc curve. If the first result is that the double tangent arc is not successfully obtained, then based on the single-sided constraint arc generation sub-rule, the risk curve is solved by single tangent arc according to the target normal and the minimum arc radius value to obtain the second result. The target normal is the normal corresponding to the target boundary line, and the target boundary line is the shorter boundary line between the first boundary line and the second boundary line. If the second result is that the single tangent arc of the risk curve is successfully obtained, then the single tangent arc is determined as the arc curve. If the second result is that the single tangent arc is not successfully obtained, then based on the straight line connecting arc generation sub-rule, the end of the first boundary line away from the target risk point and the end of the second boundary line away from the target risk point are connected by a straight line to obtain a curve connecting line, and the curve connecting line is determined as the arc curve.
3. The method according to claim 2, characterized in that, The sub-rule for generating circular arcs based on the dual-tangent constraint, according to the first normal, the second normal, and the preset minimum circular arc radius value, performs dual-tangent circular arc solving on the risk curve to obtain a first result, including: Traverse all directions of the first normal and the second normal, and offset the first boundary line and the second boundary line along the corresponding normal direction by the minimum arc radius value; Find the intersection point between the offset first boundary line and the offset second boundary line, and determine the intersection point as the center of the first circle; Determine whether the first circle center meets the preset first verification condition. The first verification condition is: the circle constructed by the first circle center with the minimum arc radius value as the radius is tangent to both the first boundary line and the second boundary line. If there exists a first circle center that meets the first verification condition, then the arc between the tangent points of the corresponding circle and the first boundary line and the second boundary line is determined as the double tangent arc, and the double tangent arc of the successfully obtained risk curve is determined as the first result. If there is no first center that meets the first verification condition, then the failure to obtain the double tangent arc is determined as the first result.
4. The method according to claim 2, characterized in that, The sub-rule for generating the single-sided constrained arc, based on the target normal and the minimum arc radius value, performs a single-tangent arc solution on the risk curve to obtain a second result, including: Determine the farthest endpoint of the first boundary line and the second boundary line that is farthest from the target risk point; The first boundary line and the boundary line of the second boundary line that are opposite to the far endpoint are taken as the target edge; Traverse all directions of the normal corresponding to the target edge, and offset the target edge along the corresponding normal direction by the minimum arc radius value to obtain the offset target edge; Determine whether there is a second circle center on the offset target edge that satisfies a preset second verification condition. The second verification condition is that the distance from the second circle center to the target edge and the far end point are both the minimum arc radius value. If there exists a second circle center that satisfies the second verification condition, then the arc between the tangent point of the corresponding circle and the target edge and the far endpoint is determined as the single tangent arc, and the single tangent arc of the successfully obtained risk curve is determined as the second result. If there is no second center that satisfies the second verification condition, then the unsuccessful determination of the single tangent arc is determined as the second result.
5. The method according to claim 1, characterized in that, Both the concave curve and the convex curve include a sequence of road edge vertices, and the sequence of road edge vertices includes multiple road edge vertices; the step of performing turning radius risk detection on the concave curve and the convex curve to determine the risky curves among the concave curve and the convex curve includes: For each road edge vertex in each road edge vertex sequence, multiple associated vertices of the road edge vertex are obtained in the corresponding road edge vertex sequence according to a preset sliding window size; Calculate the radius of curvature values of the road edge vertices and each of the associated vertices respectively; The curvature radius values of the road edge vertex and the corresponding multiple associated vertices are subjected to median filtering to obtain the target radius values corresponding to the road edge vertex respectively; The vertices of road edges whose target radius values are less than a preset risk radius threshold are identified as risk points. The concave bends and the convex bends containing the risk points are identified as the risk bends.
6. The method according to claim 5, characterized in that, The calculation of the radius of curvature values of the road edge vertices and each of the associated vertices includes: Obtain the first vertex and the second and third vertices on both sides of the corresponding road edge vertex sequence, wherein the first vertex is the vertex currently performing the radius of curvature calculation among the road edge vertices and the associated vertices; A first vector is determined based on the second vertex and the first vertex, and a second vector is determined based on the first vertex and the third vertex; Determine the chord length between the second vertex and the third vertex; The radius of curvature value corresponding to the first vertex is determined based on the first vector, the second vector, and the chord length.
7. The method according to any one of claims 1 to 6, characterized in that, The step of constructing an initial road network based on the road perimeter boundary data and the internal obstacle boundary data includes: According to a preset first interval, straight segments in the outer boundary data of the road and the inner obstacle boundary data are sampled to obtain multiple first sampling points; According to a preset second interval, the arc segments in the outer boundary data of the road and the inner obstacle boundary data are sampled to obtain multiple second sampling points, where the second interval is smaller than the first interval. The initial road network is constructed based on the first sampling point and the second sampling point.
8. A road optimization device, characterized in that, include: The transceiver unit is used to acquire construction site planning drawings, which include road outer boundary data and internal obstacle boundary data. The processing unit is configured to construct an initial road network based on the road outer boundary data and the internal obstacle boundary data, the initial road network including an outer boundary and an inner boundary; perform concave point detection on the outer boundary to identify at least one concave curve in the outer boundary, and perform convex point detection on the inner boundary to identify at least one convex curve in the inner boundary; and perform turning radius risk detection on the concave curve and the convex curve to identify risky curves among the concave curve and the convex curve. Based on preset multi-level circular arc generation rules, the circular arc curves corresponding to the risk curves are generated; according to the corresponding circular arc curves, the risk curves in the initial road network are replaced by circular arc curves to obtain the target road network.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the road optimization method as described in any one of claims 1-7.
10. A storage medium, characterized in that, The storage medium stores a computer program, which includes program instructions that, when executed by a processor, cause the processor to perform the road optimization method as described in any one of claims 1-7.