Branch cable automatic layout method of given topological structure based on dynamic programming algorithm

Through the automatic branch cable layout method based on dynamic programming algorithm, the problems of uncontrollable branch cable layout time and unstable results in the prior art are solved, and efficient and repeatable cable layout design is achieved.

CN119720441AInactive Publication Date: 2025-03-28EAST CHINA NORMAL UNIV

Patent Information

Application Number
CN202411776811.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the existing automatic cable layout technology, branch cable related work adopts random algorithms, which has problems such as uncontrollable running time and difficult to reproduce results, and it is difficult to provide a satisfactory wiring solution within a limited time.

Method used

The automatic layout method of branch cables with a given topological structure based on dynamic programming algorithm is adopted. By determining the wiring constraints and optimization goals, spatial preprocessing and path search are performed, and the cable layout is optimized in combination with dynamic programming recursive formulas.

Benefits of technology

It realizes automatic layout of branch cables in polynomial time, stable running time, strong repeatability, and can provide satisfactory wiring solutions within a limited time, improving wiring accuracy and space utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119720441A_ABST
    Figure CN119720441A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of cable layout design, in particular to a branch cable automatic layout method of a given topological structure based on a dynamic programming algorithm. Comprising the following steps: determining an optimization target of automatic cable layout design according to engineering requirements of wiring, giving a three-dimensional model and a wiring harness electrical definition of a product to be wired, constructing a path search map on sampling points on the surface of the model, and executing an automatic cable layout algorithm based on dynamic planning in the path search map, solving a cable path and the position of a branch point which meet the constraint condition and enable the wiring objective function to be optimal, and finally obtaining a geometric model of the cable through curve fitting and profile endowing. The method has the advantages of being simple in algorithm and high in solving efficiency, the accuracy of wiring and optimal path selection can be improved, complex connection requirements can be met, the automatic layout efficiency and quality of branch cables can be effectively improved, and the method has high practical application potential in cable layout design of complex mechanical and electrical products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of cable layout design, and in particular to an automatic layout method for branch cables of a given topological structure based on a dynamic programming algorithm. Background Art

[0002] Cables, as a medium for transmitting energy and signals, are widely used in various complex electromechanical products. Cable layout design accounts for a considerable proportion in the research and development process of complex electromechanical products and is one of the important links. As the functions and structures of electromechanical products become increasingly complex, cable layout design has gradually become a research focus in recent years. The wiring schemes currently proposed are divided into two categories: human-computer interactive cable layout design and automatic cable layout design.

[0003] Human-computer interactive cable layout design uses computer-aided design technology and combines human experience and design capabilities to design cable layouts. However, existing design software has limited functions and can only provide one feasible path. It lacks the optimal path selection under the conditions of spatial structure, product wiring design requirements, cable bending radius, and thermal constraints, thus failing to ensure wiring accuracy and optimal length. Automatic cable layout design is based on the endpoint information of a given cable. It uses intelligent algorithms (such as genetic algorithms, particle swarm algorithms, ant colony algorithms, etc.) in the wiring space to find cable paths that connect these endpoints and meet certain engineering constraints, thereby improving wiring efficiency.

[0004] However, these random algorithms used in the branch cable related work in the cable automatic layout technology have the problems of uncontrollable running time and difficult to reproduce results. In addition, when dealing with complex connection requirements, this type of technology is difficult to provide a satisfactory wiring solution within a limited time. Therefore, designing a polynomial time fixed topology branch cable automatic layout technology that takes into account various engineering constraints and shows good performance in both time efficiency and quality of cable automatic layout has important practical application significance for the development of cable layout of complex electromechanical products. In view of this, we propose a branch cable automatic layout method for a given topology structure based on a dynamic programming algorithm. Summary of the invention

[0005] The object of the present invention is to provide a method for automatically laying out branch cables of a given topology structure based on a dynamic programming algorithm, so as to solve the problems raised in the above background technology.

[0006] In order to solve the above technical problems, the present invention aims to provide a method for automatically laying out branch cables of a given topology structure based on a dynamic programming algorithm, comprising the following steps:

[0007] S1. Determine the constraints that need to be met by wiring, input the 3D model of the product to be wired and the electrical definition of the wire harness; and determine the optimization target of the automatic cable layout design according to the engineering requirements of the wiring;

[0008] S2, spatial preprocessing: read the three-dimensional model of the product to be wired, generate a dot matrix on the model surface according to a certain sampling distance; read the environmental information description file to remove the points in the gray area; construct a discrete cable path search map with the remaining points;

[0009] S3, path search: according to the electrical definition of the wiring harness and the bending radius constraint, the cable automatic layout algorithm based on dynamic programming is executed in the path search map generated in step S2 to solve the cable path and the location of the branch point that satisfies the constraint conditions and makes the wiring objective function determined in step S1 optimal;

[0010] S4, post-processing: curve fitting is performed according to the path control points of each cable obtained in step S3, and a profile is assigned to it in the CAD software; finally, a product model file and wiring result data of the assembled cables are output.

[0011] As a further improvement of the technical solution, in step S1, the wiring constraints include the following:

[0012] (1) Obstacle avoidance: The cables do not interfere with the equipment in the wiring environment;

[0013] (2) Adhesion to the wall: The cables need to be close to the surface of the model to avoid hanging in the air so that they can be bundled and fixed;

[0014] (3) Meet the minimum allowable bending radius: The curvature radius of the cable centerline shall not be less than the minimum allowable bending radius of the cable; the minimum allowable bending radius of the cable is determined by the wire material and diameter;

[0015] (4) Avoid gray areas such as high temperature, strong electromagnetic field, and flammable materials.

[0016] As a further improvement of the technical solution, in step S1, the electrical definition of the wiring harness mainly consists of three parts, including:

[0017] The first is the topological structure of the branch cable, which represents the logical connection between the harness segments and the branch points, and can be abstracted into a tree, where the leaf nodes of the tree represent the terminals and the non-leaf nodes of the tree represent the branch points;

[0018] The second is the wiring diagram of the electrical connection and the spatial coordinate information of the terminals;

[0019] The third is the radius information of all the wires that make up the branch cable.

[0020] As a further improvement of the technical solution, in step S1, the optimization target is the total wiring cost, which is the sum of the cable cost and the manual laying cost, expressed as:

[0021] f(x)=c1·l w +c2·l b

[0022] Where f(x) is the cost objective function, c1 represents the unit length cost of the cable, l w represents the total length of the cable, c2 represents the unit cost of manual laying, l b Indicates the total length of the harness segment;

[0023] Considering that cables of different materials or specifications may be used in actual wiring, the unit length cost of each cable may be different. At the same time, according to some characteristics of different cables (such as temperature resistance, conductivity, etc.), the cost coefficient is introduced to optimize the above formula to make the cost calculation more accurate; let k i is the cost coefficient associated with the i-th cable characteristic, the formula can be expanded to:

[0024]

[0025] In complex wiring environments (such as narrow spaces, high-temperature areas, etc.), the cost of manual laying may increase; if the wiring area is also divided into different parts, the manual laying cost of each part is also different; then the cost function that further considers the wiring difficulty coefficient and regional differentiation cost is:

[0026]

[0027] The actual length of the cable will increase when it is bent. A bending loss coefficient λ is introduced to correct the calculation of the cable length. The cost function that comprehensively considers multiple factors is optimized as follows:

[0028]

[0029] Among them, f1(x) is the cost objective function considering different cable costs and characteristics, f2(x) is the cost objective function considering different wiring environments and environmental regional differences, and f3(x) is the cost function that comprehensively considers multiple factors; n is the number of different cable types, i∈[1,n], c 1i represents the unit length cost of the i-th cable, l wi represents the length of the i-th cable; m is the number of regions, j∈[1,m], c 2j is the unit cost of manual laying in the jth area, l bj is the length of the harness segment in the jth area, d is the difficulty coefficient related to the wiring environment, and d jis the difficulty coefficient related to the wiring environment in the jth area; i is the bending loss coefficient of the i-th cable.

[0030] As a further improvement of the present technical solution, in step S2, the environmental information description file defines the spatial coordinate range of gray areas such as high temperature, strong electromagnetic, and flammable, and the path search map is an undirected weighted graph in which the weight of the edge is the length.

[0031] As a further improvement of the technical solution, in step S3, the specific process of optimizing the cable layout by the branch cable layout algorithm based on dynamic programming is as follows:

[0032] S3.1, initialization;

[0033] S3.2, dynamic programming to solve the optimal target: using the recursive formula of dynamic programming to solve the wiring harness path that satisfies the constraints and makes the wiring objective function determined in step S1 optimal;

[0034] The minimum mapping cost of each tree node is calculated in turn in a bottom-up manner, and some necessary information is maintained; when the minimum mapping cost of the root node is calculated, the optimal mapping position of all non-leaf nodes is also determined, and then the path control point of each harness segment is obtained;

[0035] S3.3, processing the minimum bending radius at the branch point: for the wire harness path obtained in step S3.2, the wire harness segment radius is processed in descending order;

[0036] Select a bundled harness segment and identify all the harness segments branching out from it;

[0037] For each forked harness segment, check whether the curvature radius at the branch point meets the minimum bending radius of the harness segment. If not, find the shortest path that meets the minimum bending radius with the predecessor node of the branch point on the bundle segment as the starting point and the other end point of the forked harness segment as the end point. Use this shortest path as the new path of the forked harness segment.

[0038] S3.4. Output and save the location information of the path control points and branch points of the cable.

[0039] As a further improvement of the technical solution, in step S3.1, the specific process of initialization includes the following steps:

[0040] S3.1.1. Calculate the radius of each harness segment and its corresponding minimum bending radius based on the harness electrical definition;

[0041] S3.1.2. For each minimum bending radius value, solve the shortest path for all points in the path search map G(V,E,S) generated in step S3, where V represents the vertex set, E represents the edge set, and S represents the node set corresponding to the terminal position; execute the Dijkstra algorithm for each vertex, and add a judgment in the relaxation operation of the edge to satisfy the minimum bending radius; the specific judgment method is as follows:

[0042] If the curvature radius of the fitting curve of three adjacent points is less than the minimum bending radius value during the relaxation of the edge, the relaxation operation is skipped. The shortest path of all points that meets each minimum bending radius value is obtained through the above processing;

[0043] S3.1.3. Select a non-leaf node as the root from the tree T = (U, F, L) given by the wiring harness electrical definition to obtain a rooted tree, where U represents the node set of the tree, F represents the edge set of the tree, and L represents the leaf node set;

[0044] S3.1.4. Determine the weights c1 and c2 of the routing objective function.

[0045] As a further improvement of the technical solution, in step S3.2, the recursive formula of dynamic programming is as follows:

[0046]

[0047] Where c[u][v] represents the minimum cost of the subtree with u as the root node when the tree node u is mapped to the graph node v, where u∈U, v∈V;

[0048] The minimum mapping cost of a leaf node is fixed at 0, and the mapping cost of a non-leaf node is calculated based on its child nodes; Δ(u) in the above formula represents the set of child nodes of u, u' represents the child node of u; v' represents the mapping node of u'; S represents all terminal nodes, \ represents the minus set, and V\S represents the set of all terminal nodes excluding the vertex set; C[u'][v'] represents the minimum mapping cost from u' to v'; δ(v',v) represents the harness segment cost, δ(v',v)=c1·q·l+c2·l, where c1 represents the unit length cost of the cable, q represents the number of cables contained in the harness segment, c2 represents the unit cost of manual laying, and l represents the shortest path length between node v' and node v, that is, the length of the harness segment; the shortest path between nodes is calculated by step S3.1.2.

[0049] As a further improvement of the present technical solution, in step S4, the cable path control point information obtained in step S3 is read, and curve fitting is performed in the CAD software according to these path control points to generate a continuous path of the wire harness, and then the fitting curve is assigned corresponding physical properties, including radius and material, to obtain a geometric model of the wire harness; finally, a three-dimensional model of the product containing the wire harness information is output.

[0050] Compared with the prior art, the present invention has the following beneficial effects:

[0051] 1. Compared with the human-computer interactive cable layout design, this branch cable automatic layout method with a given topology structure based on the dynamic programming algorithm can not only provide feasible paths, but also select the optimal path under the conditions of considering the space structure, product wiring design requirements, cable bending radius, thermal constraints, etc., effectively ensuring the wiring accuracy, making the cable layout more reasonable, reducing the cable length redundancy, and improving the space utilization;

[0052] 2. In the method for automatic layout of branch cables of a given topological structure based on the dynamic programming algorithm, the problem of uncontrollable running time and difficult to reproduce results of the random algorithm used in the branch cable related work in the cable automatic layout technology is solved by the dynamic programming algorithm, which is simple and efficient, can complete the automatic layout of branch cables in polynomial time, has relatively stable running time and strong repeatability of results;

[0053] 3. This automatic layout method for branch cables of a given topology structure based on a dynamic programming algorithm can provide a satisfactory wiring solution within a limited time when dealing with complex connection requirements. Through reasonable spatial preprocessing and path search algorithms, combined with dynamic programming recursive formulas, and comprehensive consideration of various constraints and optimization goals, the path and branch point location of the branch cable can be efficiently determined to meet the requirements of cable layout of complex electromechanical products.

[0054] 4. The implementation of the automatic layout method of branch cables with a given topological structure based on the dynamic programming algorithm effectively improves the efficiency and quality of the automatic layout of branch cables, accurately converts the logical connection relationship of the wire harness into the actual cable geometry model, and obtains high-quality cable layout results. It has high practical application potential in the cable layout design of complex electromechanical products, and helps to improve the efficiency and accuracy of the cable layout design link in the research and development process of complex electromechanical products. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 A flowchart for implementing an exemplary method in the present invention;

[0056] Figure 2 A three-dimensional model diagram of a simple part exemplified in the present invention;

[0057] Figure 3For example, Figure 2 The wiring harness electrical definition diagram of a simple part in the figure;

[0058] Figure 4 For example, Figure 3 Schematic diagram of a rooted tree with B1 as the root node;

[0059] Figure 5 This is a physical picture of the wiring effect of a simple part in the present invention;

[0060] Figure 6 The following is a perspective view illustrating the wiring effect of a simple component in the present invention. DETAILED DESCRIPTION

[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0062] Example 1

[0063] like Figure 1 As shown, this embodiment provides a method for automatically laying out branch cables of a given topology structure based on a dynamic programming algorithm, comprising the following steps:

[0064] S1. Determine the constraints that need to be met by wiring, input the 3D model of the product to be wired and the electrical definition of the wire harness; and determine the optimization target of the automatic cable layout design according to the engineering requirements of the wiring;

[0065] The routing constraints considered in this step include the following:

[0066] (1) Obstacle avoidance: The cables do not interfere with the equipment in the wiring environment;

[0067] (2) Adhesion to the wall: The cables need to be close to the surface of the model to avoid hanging in the air so that they can be bundled and fixed;

[0068] (3) Meet the minimum allowable bending radius: The curvature radius of the cable centerline shall not be less than the minimum allowable bending radius of the cable; the minimum allowable bending radius of the cable is determined by the wire material and diameter;

[0069] (4) Avoid gray areas such as high temperature, strong electromagnetic field, and flammable materials.

[0070] Furthermore, the electrical definition of the wiring harness consists of three main parts, including:

[0071] The first is the topological structure of the branch cable, which represents the logical connection between the harness segments and the branch points, and can be abstracted into a tree, where the leaf nodes of the tree represent the terminals and the non-leaf nodes of the tree represent the branch points;

[0072] The second is the wiring diagram of the electrical connection and the spatial coordinate information of the terminals;

[0073] The third is the radius information of all the wires that make up the branch cable.

[0074] Furthermore, the optimization target considered in this step is the total wiring cost, which is the sum of the cable cost and the labor laying cost, expressed as:

[0075] f(x)=c1·l w +c2·l b

[0076] Where f(x) is the cost objective function, c1 represents the unit length cost of the cable, l w represents the total length of the cable, c2 represents the unit cost of manual laying, l b Indicates the total length of the harness segment;

[0077] Considering that cables of different materials or specifications may be used in actual wiring, the unit length cost of each cable may be different. At the same time, according to some characteristics of different cables (such as temperature resistance, conductivity, etc.), the cost coefficient is introduced to optimize the above formula to make the cost calculation more accurate; let k i is the cost coefficient associated with the i-th cable characteristic, the formula can be expanded to:

[0078]

[0079] In complex wiring environments (such as narrow spaces, high-temperature areas, etc.), the cost of manual laying may increase; if the wiring area is also divided into different parts, the manual laying cost of each part is also different; then the cost function that further considers the wiring difficulty coefficient and regional differentiation cost is:

[0080]

[0081] More accurate length measurement methods can also be used. If more advanced measurement techniques or algorithms are used to obtain the cable length, the accuracy of the cost calculation can be improved; for example, using curve integration in three-dimensional space to calculate the actual length of the cable instead of simply adding straight line segments;

[0082] The actual length of the cable will increase when it is bent. A bending loss coefficient λ is introduced to correct the calculation of the cable length. The cost function that comprehensively considers multiple factors is optimized as follows:

[0083]

[0084] Among them, f1(x) is the cost objective function considering different cable costs and characteristics, f2(x) is the cost objective function considering different wiring environments and environmental regional differences, and f3(x) is the cost function that comprehensively considers multiple factors; n is the number of different cable types, i∈[1,n], c 1i represents the unit length cost of the i-th cable, l wi represents the length of the i-th cable; m is the number of regions, j∈[1,m], c 2j is the unit cost of manual laying in the jth area, l bj is the length of the harness segment in the jth region, d is the difficulty coefficient related to the wiring environment (for example, the value may be 1.5 when wiring in a high temperature area, indicating a 50% increase in the labor laying cost), d j is the difficulty coefficient related to the wiring environment in the jth area; i is the bending loss coefficient of the i-th cable.

[0085] In addition, the calculation process of the total wiring cost can also dynamically adjust the coefficients in real time: that is, according to the real-time data of the actual wiring process, the coefficients in the formula can be dynamically adjusted. For example, as the wiring progresses, if it is found that the wiring difficulty of a certain area is greater than expected, the d of that area can be increased in real time. j value, so that the cost calculation is more in line with the actual situation.

[0086] S2, spatial preprocessing: read the three-dimensional model of the product to be wired, generate a dot matrix on the model surface according to a certain sampling distance; read the environmental information description file to remove the points in the gray area; construct a discrete cable path search map with the remaining points;

[0087] In this step, the environmental information description file defines the spatial coordinate range of gray areas such as high temperature, strong electromagnetic, and flammable. The path search map is an undirected weighted graph in which the weight of the edge is the length.

[0088] Step S2 is refined to include the following steps:

[0089] S2.1. Model reading and offset processing: Use professional computer-aided design (CAD) software (such as UG12.0) to load the 3D model of the product to be wired; perform an offset operation on the model surface, with the offset direction being outward and the offset distance set to the maximum radius of the cable. This step ensures that the generated path search map can fully consider the actual space occupied by the cable, avoiding interference between the cable and the model surface during the subsequent wiring process.

[0090] S2.2, Sampling point generation: Use the cross-section function in the CAD software to select a set of parallel planes to generate the cross-section curve;

[0091] The direction of the parallel plane can be along the main geometric feature direction of the model (such as along the longest side, the widest side or the symmetry axis direction, etc.) to ensure that the sampling points can evenly cover the surface of the model; set a suitable sampling distance, which should be determined according to the size of the model and the wiring accuracy requirements; for example, for a model with a small size and high accuracy requirements, the sampling distance can be set to a small value (such as 0.1 mm); for a model with a larger size, the sampling distance can be appropriately increased (such as 1 mm) while ensuring the rationality of the wiring;

[0092] Discretize the generated cross-section curve into sampling points according to the sampling distance to ensure that the sampling points can accurately reflect the shape information of the model surface;

[0093] To ensure the integrity of the sampling points, scanning is performed along at least two directions of the XYZ axes so that the sampling points can cover all surfaces of the three-dimensional model, including complex curved surfaces and concave parts.

[0094] S2.3, Gray area processing: read the environmental information description file, which should define in detail the spatial coordinate range of gray areas such as high temperature, strong electromagnetic, and flammable; geometric shapes such as polygons and cubes can be used to accurately describe the boundaries of gray areas;

[0095] Traverse all sampling points and determine whether each sampling point is within the gray area. This can be achieved using a point and polygon or cube position determination algorithm.

[0096] The sampling points located in the gray area are eliminated to obtain a set of sampling points after preliminary screening.

[0097] S2.4, Path search map construction: Set the distance conditions for connecting sampling points, including the upper and lower distance limits; the upper distance limit is used to avoid generating too long edges, which will reduce the efficiency of path search; the lower distance limit is used to prevent generating too many short edges, which will make the path search map too complicated; for example, the upper distance limit can be set to a certain proportion of the model diagonal length (such as 0.5 times), and the lower distance limit can be set to a certain multiple of the minimum bending radius of the cable (such as 2 times);

[0098] According to the distance condition, the remaining sampling points are connected to generate an undirected weighted graph; the weight of the edge can be determined based on the Euclidean distance between the sampling points, that is, the straight-line distance between the two points;

[0099] The generated undirected weighted graph is marked as a path search map G(V,E,S), where V represents the vertex set (i.e., the sampling point set), E represents the edge set (i.e., the line segment set connecting the sampling points), and S represents the node set corresponding to the terminal position.

[0100] Specifically, this step can achieve the following advantages through the above optimization:

[0101] A. Improve wiring accuracy: Through precise model offset and detailed sampling point generation, it can better adapt to the shape of the model surface, making the generated path more suitable for the actual product, thereby improving wiring accuracy and reducing the gap or interference between the cable and the model surface;

[0102] B. Enhance algorithm adaptability: Rationally set the sampling distance and connection conditions so that the path search map is neither too complex (resulting in low algorithm efficiency) nor too simple (resulting in failure to find the optimal path), thus enhancing the adaptability of the algorithm in models of different scales and complexities;

[0103] C. Better meet the constraints: Accurately identify and eliminate sampling points in the gray area to ensure that the generated cable path can effectively avoid high temperature, strong electromagnetic, flammable and other dangerous areas, and better meet the constraints in the wiring project;

[0104] D. Improve algorithm efficiency: The optimized path search map structure is more reasonable. In the subsequent path search algorithm based on dynamic programming, it can reduce unnecessary calculations and improve the overall efficiency of the algorithm.

[0105] S3, path search: according to the electrical definition of the wiring harness and the bending radius constraint, the cable automatic layout algorithm based on dynamic programming is executed in the path search map generated in step S2 to solve the cable path and the location of the branch point that satisfies the constraint conditions and makes the wiring objective function determined in step S1 optimal;

[0106] In this step, the specific process of optimizing the cable layout by the branch cable layout algorithm based on dynamic programming is as follows:

[0107] S3.1. Initialization; specifically including:

[0108] S3.1.1. Calculate the radius of each harness segment and its corresponding minimum bending radius based on the harness electrical definition;

[0109] S3.1.2. For each minimum bending radius value, solve the shortest path for all points in the path search map G(V,E,S) generated in step S3, where V represents the vertex set, E represents the edge set, and S represents the node set corresponding to the terminal position; execute the Dijkstra algorithm for each vertex, and add a judgment in the relaxation operation of the edge to satisfy the minimum bending radius; the specific judgment method is as follows:

[0110] If the curvature radius of the fitting curve of three adjacent points is less than the minimum bending radius value during the relaxation of the edge, the relaxation operation is skipped. The shortest path of all points that meets each minimum bending radius value is obtained through the above processing;

[0111] S3.1.3. Select a non-leaf node as the root from the tree T = (U, F, L) given by the wiring harness electrical definition to obtain a rooted tree, where U represents the node set of the tree, F represents the edge set of the tree, and L represents the leaf node set;

[0112] S3.1.4, determine the weights c1 and c2 of the routing objective function;

[0113] S3.2, dynamic programming to solve the optimal target: using the recursive formula of dynamic programming to solve the wiring harness path that satisfies the constraints and makes the wiring objective function determined in step S1 optimal;

[0114] The recursive formula for dynamic programming is as follows:

[0115]

[0116] Where C[u][v] represents the minimum cost of the subtree with u as the root node when the tree node u is mapped to the node v in the graph, which can also be referred to as the minimum mapping cost from u to v, where u∈U, v∈V;

[0117] The minimum mapping cost of a leaf node is fixed to 0, and the mapping cost of a non-leaf node is calculated based on its child nodes; Δ(u) in the above formula represents the set of child nodes of u, u' represents the child node of u; v' represents the mapping node of u'; S represents all terminal nodes, \ represents the minus set, and V\S represents the set of all terminal nodes excluding the vertex set; C[u'][v'] represents the minimum mapping cost from u' to v'; δ(v',v) represents the harness segment cost, δ(v',v)=c1·q·l+c2·l, where c1 represents the unit length cost of the cable, q represents the number of cables contained in the harness segment, c2 represents the unit cost of manual laying, and l represents the shortest path length between node v' and node v, that is, the length of the harness segment; the shortest path between nodes is calculated by step S3.1.2;

[0118] The minimum mapping cost of each tree node is calculated in turn in a bottom-up manner, and some necessary information is maintained; when the minimum mapping cost of the root node is calculated, the optimal mapping position of all non-leaf nodes is also determined, and then the path control point of each harness segment is obtained;

[0119] S3.3, processing the minimum bending radius at the branch point: for the wire harness path obtained in step S3.2, the wire harness segment radius is processed in descending order;

[0120] Select a bundled harness segment and identify all the harness segments branching out from it;

[0121] For each forked harness segment, check whether the curvature radius at the branch point meets the minimum bending radius of the harness segment. If not, find the shortest path that meets the minimum bending radius with the predecessor node of the branch point on the bundle segment as the starting point and the other end point of the forked harness segment as the end point. Use this shortest path as the new path of the forked harness segment.

[0122] S3.4. Output and save the location information of the path control points and branch points of the cable.

[0123] Furthermore, in step S3.2, when calculating the minimum mapping cost, the recursive formula of dynamic programming may also consider improving the calculation order and optimizing the data structure storage; specifically, the following steps are included:

[0124] First, improve the calculation order:

[0125] When calculating the minimum mapping cost C[u][v] of a non-leaf node u, the current formula needs to traverse all possible mapping positions v' of all its child nodes u', which requires a large amount of calculation. Especially when the tree structure is complex and the number of nodes is large, this calculation method may lead to low calculation efficiency.

[0126] The minimum mapping cost can be calculated in a certain order of child nodes (such as depth-first or breadth-first order), and the calculated partial results can be used for pruning during the calculation process. For example, in depth-first calculation, after calculating the minimum mapping cost C[u'][v'] of a child node u', if it is found that the mapping cost of other child nodes calculated subsequently plus the cost δ(v',v) from the current node to v' is greater than the currently known minimum cost, the calculation of the path can be stopped in advance.

[0127] The child nodes can be sorted according to their corresponding harness segment lengths, number of cables and other factors, and the child nodes that have a greater impact on the total cost can be calculated first to reduce unnecessary calculations.

[0128] Second, optimize data structure storage:

[0129] C[u][v] in the formula needs to store the mapping cost of all tree nodes u to all nodes v in the path search map. When the number of nodes is large, the storage space required is large. In addition, during the calculation process, frequent access and update of these two-dimensional array elements may lead to low cache hit rate, affecting the calculation efficiency.

[0130] Using sparse matrix storage to store C[u][v], only non-zero or meaningful elements (i.e., actual node mapping costs) are stored, which can greatly reduce storage space. At the same time, using the efficient storage and calculation algorithms of sparse matrices, data access and calculation speed can be improved.

[0131] You can also use data structures such as hash tables to store C[u][v], with node (u, v) pairs as keys and mapping costs as values. This allows for quick location and improved algorithm efficiency when searching and updating the mapping costs of specific node pairs. It also makes it easy to handle dynamic additions or deletions of nodes during the calculation process.

[0132] S4, post-processing: performing curve fitting according to the path control points of each cable obtained in step S3, and assigning profiles to them in the CAD software; finally, outputting the product model file and wiring result data of the assembled cables;

[0133] In this step, the cable path control point information obtained in step S3 is read, and curve fitting is performed in the CAD software based on these path control points to generate a continuous path for the wire harness. The fitting curve is then assigned corresponding physical properties, including radius and material, to obtain a geometric model of the wire harness. Finally, a three-dimensional model of the product containing the wire harness information is output.

[0134] Exemplary application implementation process

[0135] This solution is based on the given electrical definition of the wiring harness and adopts the idea of ​​tree-shaped dynamic programming to calculate the optimal position of the wiring harness branch point. While satisfying wiring engineering constraints such as obstacle avoidance, wall adhesion, minimum bending radius, and avoiding gray areas, the logical connection relationship of the wiring harness is converted into an actual cable geometric model to obtain the cable layout result.

[0136] Figure 1 This is a flow chart of the implementation of the branch cable automatic layout technology under a given topology based on dynamic programming of the present invention, and the specific steps include:

[0137] Step 1: Input the 3D model of the product to be wired and the electrical definition of the wiring harness, such as Figure 2-Figure 3 As shown in the figure, the optimization target of the automatic cable layout design is determined. Here, the unit length cost c1 of the cable and the unit cost c2 of the manual laying are both set to 1, so the total wiring cost f(x) = l w +l b , where l w Indicates the total length of the cable, l b Indicates the total segment length.

[0138] Step 2: In the spatial preprocessing stage, an undirected weighted graph is constructed for the subsequent branch cable automatic layout algorithm under fixed topology. The specific processing of spatial preprocessing is as follows:

[0139] 1) First, use the surface offset function in the computer-aided design software UG12.0 (hereinafter referred to as UG) to offset the model surface and extend the model surface outward by a certain distance. The offset distance can be selected as the maximum radius of the cable;

[0140] 2) After obtaining the offset surface of the 3D model, use the section function of the UG software to sample a series of points on the offset surface; the section function of the UG software generates a section curve through a set of parallel planes, and can output the section curve as discrete points according to a certain sampling distance; scan along any two directions of the XYZ axis, and the sampling points can cover all surfaces of the 3D model;

[0141] 3) Then read the environmental information description file, remove the points in the gray area, use the remaining sampling points to connect according to a certain distance condition, and generate an undirected weighted graph; in order not to generate too many edges, set the upper and lower distance limits respectively; the resulting path search map is denoted as G(V,E,S), where V represents the vertex set, E represents the edge set, and S represents the node set corresponding to the terminal position.

[0142] Step 3: The specific process of the path search phase is as follows:

[0143] (1) According to the logical connection relationship of the wiring harness in the electrical definition of the wiring harness and the radius of each cable, calculate the minimum bending radius corresponding to the radius of each wiring harness segment;

[0144] (2) For each minimum bending radius value, solve the shortest path for all pairs of points in the path search map G(V,E,S) generated in the second step; execute the Dijkstra algorithm for each vertex, and add a judgment in the relaxation operation of the edge to satisfy the minimum bending radius. The specific judgment method is as follows:

[0145] If the curvature radius of the fitting curve of three adjacent points is less than the minimum bending radius value during the relaxation of the edge, the relaxation operation is skipped. The shortest path of all points that meets each minimum bending radius value is obtained through the above processing;

[0146] (3) Randomly select a non-leaf node as the root from the tree T = (U, F, L) given by the wiring harness electrical definition to obtain a rooted tree, where U represents the node set of the tree, F represents the edge set of the tree, and L represents the leaf node set; here B1 is selected as the root node, and the rooted tree obtained is as follows Figure 4 As shown;

[0147] (4) Calculate the minimum mapping value of each non-leaf node from bottom to top according to the following dynamic programming recursive formula:

[0148]

[0149] Combination Figure 4Analyze the process: First, calculate the minimum mapping cost of node B0. The child nodes P0 and P1 of node B0 are both leaf nodes, which are fixedly mapped to a certain node in the graph. Therefore, the minimum mapping cost C[B0][v] of mapping to a certain node v in the graph only includes the sum of the distance from node v to the node mapped by node P0 and the distance from node v to the node mapped by node P1. The minimum mapping cost of nodes B2 and B3 is calculated in the same way.

[0150] Next, the minimum mapping cost of node B1 is calculated. Its child nodes B0, B2, and B3 are all non-leaf nodes. For non-leaf child node B0, it is necessary to select the minimum value of the sum of the minimum mapping cost of node B0 and the cost of wire harness segment B0B1 under the current mapping method from all mapping methods of node B0 (because wire harness segment B0B1 is composed of four cables, the cost calculation method of wire harness segment B0B1 is δ(v',v)=4·l B0B1 +l BOB1 ), and record the mapping method of node B0 when the minimum value is obtained; the cost calculation method for the other two non-leaf child nodes B2 and B3 corresponding to the harness segments B1B2 and B1B3 is the same;

[0151] After adding the three together, we get the minimum mapping cost when the root node B1 is mapped to the node v in the graph; after examining all mapping methods of the root node B1, select the one with the smallest mapping cost, and then find the best mapping method for each non-leaf node from top to bottom; in this way, we get the optimal position of all branch points.

[0152] (5) Minimum bending radius at the branch point:

[0153] Combination Figure 3 The process is analyzed by using the tree structure of the harness electrical definition; under the current harness structure, the radius of the bundled harness segment B0B1 is the largest, so the harness segment B0B1 is used as the main harness segment. At this time, the bifurcated harness segments include the harness segments B0P0 and B0P1 bifurcated at the branch point B0 and the harness segments B1B2 and B1B3 bifurcated at the branch point B1;

[0154] For the harness segment B1B2, check whether its curvature radius at the branch point B1 meets the minimum bending radius of the harness segment; if not, take the predecessor node of B1 on the harness segment B0B1 as the starting point and B2 as the end point, and solve the shortest path between the starting point and the end point that meets the minimum bending radius of the harness segment B1B2, and use this as the new path of the harness segment B1B2;

[0155] Next, the harness segments B1B3, B0P0, B0P1, B2P2, B2P3, B3P4, and B3P5 are processed in sequence;

[0156] After checking all harness segments, the entire harness meets the minimum bending radius.

[0157] Step 4: Use UG's electrical pipeline layout module to perform curve fitting using the cable path control points obtained in the third step to obtain the spline path of the cable, assign profiles, simulate the cable, obtain a product model that integrates the cable geometry model, and finally output the wiring result data. Figure 5-Figure 6 This is the wiring effect diagram of a simple part model.

[0158] It is worth noting that the system environment of this solution is an automatic branch cable layout system based on the UG platform for secondary development; it is a branch cable automatic layout system developed using the C / C++ language based on the Visual Studio 2022 development platform and combined with UG's secondary development tool UG / Open API.

[0159] Those skilled in the art will appreciate that the process of implementing all or part of the steps of the above embodiments may be completed by hardware, or may be completed by instructing related hardware through a program.

[0160] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A method for automatically laying out branch cables of a given topological structure based on a dynamic programming algorithm, characterized in that: The steps include: S1. Determine the constraints that need to be met by wiring, input the 3D model of the product to be wired and the electrical definition of the wire harness; and determine the optimization target of the automatic cable layout design according to the engineering requirements of the wiring; S2, spatial preprocessing: read the three-dimensional model of the product to be wired, and generate a dot matrix on the model surface according to a certain sampling distance; Read the environment information description file to remove the points in the gray area; Construct a discrete cable path search map with the remaining points; S3, path search: according to the electrical definition of the wiring harness and the bending radius constraint, the cable automatic layout algorithm based on dynamic programming is executed in the path search map generated in step S2 to solve the cable path and the location of the branch point that satisfies the constraint conditions and makes the wiring objective function determined in step S1 optimal; S4, post-processing: performing curve fitting according to the path control points of each cable obtained in step S3, and assigning a profile to it in the CAD software; Finally, the product model file with assembled cables and wiring result data are output.

2. The method for automatically laying out branch cables of a given topology structure based on a dynamic programming algorithm according to claim 1, characterized in that: In step S1, the wiring constraints include the following: (1) Obstacle avoidance: The cables do not interfere with the equipment in the wiring environment; (2) Adhesion to the wall: The cables need to be close to the surface of the model to avoid hanging in the air so that they can be bundled and fixed; (3) Meet the minimum allowable bending radius: The curvature radius of the cable centerline shall not be less than the minimum allowable bending radius of the cable; the minimum allowable bending radius of the cable is determined by the wire material and diameter; (4) Avoid high temperature, strong electromagnetic and flammable gray areas.

3. The method for automatically laying out branch cables of a given topology structure based on a dynamic programming algorithm according to claim 1, characterized in that: In step S1, the electrical definition of the wiring harness mainly consists of three parts, including: The first is the topological structure of the branch cable, which represents the logical connection between the harness segments and the branch points, and can be abstracted into a tree, where the leaf nodes of the tree represent the terminals and the non-leaf nodes of the tree represent the branch points; The second is the wiring diagram of the electrical connection and the spatial coordinate information of the terminals; The third is the radius information of all the wires that make up the branch cable.

4. The method for automatically laying out branch cables of a given topology structure based on a dynamic programming algorithm according to claim 1, characterized in that: In step S1, the optimization target is the total wiring cost, which is the sum of the cable cost and the manual laying cost, expressed as: f(x)=c1·l w +c2·l b Where f(x) is the cost objective function, c1 represents the unit length cost of the cable, l w represents the total length of the cable, c2 represents the unit cost of manual laying, l b Indicates the total length of the harness segment; Considering that cables of different materials or specifications are used in actual wiring, the unit length cost of each cable is different. At the same time, the cost coefficient is introduced according to some characteristics of different cables to optimize the above formula to make the cost calculation more accurate; let k i is the cost coefficient associated with the i-th cable characteristic, the formula can be expanded to: In a complex wiring environment, the manual laying cost will increase; if the wiring area is divided into different parts, the manual laying cost of each part is also different; then the cost function that further considers the wiring difficulty coefficient and regional differentiation cost is: The actual length of the cable will increase when it is bent. A bending loss coefficient λ is introduced to correct the calculation of the cable length. The cost function that comprehensively considers multiple factors is optimized as follows: Among them, f1(x) is the cost objective function considering different cable costs and characteristics, f2(x) is the cost objective function considering different wiring environments and environmental regional differences, and f3(x) is the cost function that comprehensively considers multiple factors; n is the number of different cable types, i∈[1,n], c 1i represents the unit length cost of the i-th cable, l wi represents the length of the i-th cable; m is the number of regions, j∈[1,m], c 2j is the unit cost of manual laying in the jth area, l bj is the length of the harness segment in the jth area, d is the difficulty coefficient related to the wiring environment, and d j is the difficulty coefficient related to the wiring environment in the jth area; i is the bending loss coefficient of the i-th cable.

5. The method for automatically laying out branch cables of a given topology structure based on a dynamic programming algorithm according to claim 1, characterized in that: In step S2, the environmental information description file defines the spatial coordinate range of the high temperature, strong electromagnetic, and flammable gray area, and the path search map is an undirected weighted graph, in which the weight of the edge is the length.

6. The method for automatically laying out branch cables of a given topology structure based on a dynamic programming algorithm according to claim 1, characterized in that: In step S3, the specific process of optimizing the cable layout by the branch cable layout algorithm based on dynamic programming is as follows: S3.1, initialization; S3.2, dynamic programming to solve the optimal target: using the recursive formula of dynamic programming to solve the wiring harness path that satisfies the constraints and makes the wiring objective function determined in step S1 optimal; The minimum mapping cost of each tree node is calculated in turn in a bottom-up manner, and some necessary information is maintained; when the minimum mapping cost of the root node is calculated, the optimal mapping position of all non-leaf nodes is also determined, and then the path control point of each harness segment is obtained; S3.3, processing the minimum bending radius at the branch point: for the wire harness path obtained in step S3.2, the wire harness segment radius is processed in descending order; Select a bundled harness segment and identify all the harness segments branching out from it; For each forked harness segment, check whether the curvature radius at the branch point meets the minimum bending radius of the harness segment. If not, find the shortest path that meets the minimum bending radius with the predecessor node of the branch point on the bundle segment as the starting point and the other end point of the forked harness segment as the end point. Use this shortest path as the new path of the forked harness segment. S3.

4. Output and save the location information of the path control points and branch points of the cable.

7. The method for automatically laying out branch cables of a given topology structure based on a dynamic programming algorithm according to claim 6, characterized in that: In step S3.1, the specific process of initialization includes the following steps: S3.1.

1. Calculate the radius of each harness segment and its corresponding minimum bending radius based on the harness electrical definition; S3.1.

2. For each minimum bending radius value, solve the shortest path for all points in the path search map G(V,E,S) generated in step S3, where V represents the vertex set, E represents the edge set, and S represents the node set corresponding to the terminal position; execute the Dijkstra algorithm for each vertex, and add a judgment in the relaxation operation of the edge to satisfy the minimum bending radius; the specific judgment method is as follows: If the curvature radius of the fitting curve of three adjacent points is less than the minimum bending radius value during the relaxation of the edge, the relaxation operation is skipped. The shortest path of all points that meets each minimum bending radius value is obtained through the above processing; S3.1.

3. Select a non-leaf node as the root from the tree T = (U, F, L) given by the wiring harness electrical definition to obtain a rooted tree, where U represents the node set of the tree, F represents the edge set of the tree, and L represents the leaf node set; S3.1.

4. Determine the weights c1 and c2 of the routing objective function.

8. The method for automatically laying out branch cables of a given topology structure based on a dynamic programming algorithm according to claim 6, characterized in that: In step S3.2, the recursive formula of dynamic programming is as follows: Where C[u][v] represents the minimum cost of the subtree with u as the root node when the tree node u is mapped to the graph node v, where u∈U, v∈V; The minimum mapping cost of a leaf node is fixed at 0, and the mapping cost of a non-leaf node is calculated based on its child nodes; Δ(u) in the above formula represents the set of child nodes of u, u' represents the child node of u; v' represents the mapping node of u'; S represents all terminal nodes, \ represents the minus set, and V\S represents the set of all terminal nodes excluding the vertex set; C[u'][v'] represents the minimum mapping cost from u' to v'; δ(v',v) represents the harness segment cost, δ(v',v)=c1·q·l+c2·l, where c1 represents the unit length cost of the cable, q represents the number of cables contained in the harness segment, c2 represents the unit cost of manual laying, and l represents the shortest path length between node v' and node v, that is, the length of the harness segment; the shortest path between nodes is calculated by step S3.1.

2.

9. The method for automatically laying out branch cables of a given topology structure based on a dynamic programming algorithm according to claim 1, characterized in that: In step S4, the cable path control point information obtained in step S3 is read, and curve fitting is performed in the CAD software according to these path control points to generate a continuous path of the wire harness, and then the fitting curve is assigned corresponding physical properties, including radius and material, to obtain a geometric model of the wire harness; finally, a three-dimensional model of the product containing the wire harness information is output.

Citation Information

Patent Citations

  • Method for realizing automatic layout of multi-branch cable assembly of mechanical and electrical product based on multi-objective optimization

    CN111274757A

Cited By

  • Straw chopping length detection method and system fusing neural network and image processing

    CN121074050A

  • Three-dimensional wire harness wiring method and system and medium

    CN121766258A

  • Flexible cable path layout geometric model construction method and device

    CN121960350A

  • Method and apparatus for constructing a flexible cable path layout geometry model

    CN121960350B