Multilayer PCB wiring search algorithm based on millimeter wave image
By using a multi-layer PCB routing search algorithm based on millimeter-wave images, the contradiction between accuracy and efficiency in multi-layer PCB routing is resolved. This ensures the effectiveness of connection points and the connectivity of paths, optimizes the feasibility of routing paths, and achieves high-quality multi-layer routing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- UNIV OF SHANGHAI FOR SCI & TECH
- Filing Date
- 2026-04-10
- Publication Date
- 2026-05-08
AI Technical Summary
Existing PCB automatic routing methods suffer from problems such as a trade-off between accuracy and efficiency, difficulty in ensuring the effectiveness of connection points, difficulty in ensuring path connectivity, easy sharp-angle bends in routing paths, and failure of multi-pin network connections, especially under high-density and multi-constraint conditions, making it difficult to meet the needs of complex multi-layer routing.
A multilayer PCB routing search algorithm based on millimeter-wave images is adopted. Obstacle boundaries and routing areas are located by pixel coordinates. Cross-layer connection points are generated by using the pixel coordinate obstacle avoidance heuristic algorithm of the image. Combined with the Euclidean distance priority strategy and multi-pin network repair method, efficient routing of meshless design is achieved.
It enables multi-layer cabling with a gridless design in continuous space, avoiding the contradiction between accuracy and efficiency caused by grid resolution, ensuring the effectiveness and connectivity of connection points, optimizing the feasibility of cabling paths and signal integrity, and improving cabling quality.
Smart Images

Figure CN121997880A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of millimeter-wave imaging technology and electronic circuit design, specifically to an automatic routing method applicable to multilayer printed circuit boards (PCBs), and particularly to the processing of image segmentation and obstacle avoidance position selection for multilayer PCBs by millimeter-wave imaging, applicable to geometric routing scenarios of multilayer PCBs under high density and multiple constraints. Background Technology
[0002] With the rapid development of millimeter-wave imaging and electronic technologies, the complexity of integrated circuit design is constantly increasing. As the core carrier for interconnecting components in electronic systems, the PCB's wiring quality directly determines the circuit's function and performance. Multilayer PCBs, due to their higher integration and wiring flexibility, have become the mainstream choice for high-end electronic devices. However, the automatic routing technology for multilayer PCBs faces many challenges.
[0003] Existing automatic PCB routing methods are mainly divided into two categories: mesh routing and meshless methods. Mesh routing's A* algorithm relies on a fixed-resolution mesh for path searching. When the mesh resolution does not match the component size or routing specifications, accuracy errors are easily introduced. Using a fine mesh to ensure high routing success rates leads to a surge in computational costs, severely impacting routing efficiency. Meshless methods, while free from mesh resolution constraints and offering greater flexibility, struggle to support inter-layer transition optimization in multi-layer PCBs and cannot meet the demands of complex multi-layer routing.
[0004] In addition, existing routing methods have the following drawbacks: First, in meshless multilayer routing, the effectiveness of connection points is difficult to guarantee. Too sparse a routing method will lead to insufficient solution space, while too dense a method will degenerate into a quasi-mesh method. Second, there may be obstacles between connection points, making it difficult to ensure path connectivity. Third, the routing path is prone to sharp bends, which will affect signal integrity and reliability. Fourth, connection failures are prone to occur when routing multi-pin networks, and existing repair mechanisms are inefficient.
[0005] In summary, there is currently a lack of an obstacle avoidance heuristic algorithm for meshless wiring methods to solve or partially solve the aforementioned problems. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of existing technologies by providing a multi-layer PCB routing search algorithm based on millimeter-wave images, thereby solving or partially solving the problem of fixed grid constraints. This algorithm enables multi-layer PCB routing in continuous space, avoiding the accuracy-efficiency trade-off caused by grid resolution. Existing routing models suffer from high routing costs, unreliable information transmission, and rigid, inflexible routing.
[0007] The objective of this invention can be achieved through the following technical solutions:
[0008] One aspect of the present invention provides a multilayer PCB routing search algorithm based on millimeter-wave images, comprising the following steps:
[0009] Acquire a composite image of millimeter-wave multilayer PCB component arrangement, and use the pixel coordinates of the image to locate the boundary coordinates of obstacle points and the boundary coordinates of the wireable area, in order to [A x min, A y min, A x max, A y [max] represents a rectangular region, and [x,y,k] represents the coordinates of the obstacle boundary points, where x and y represent the pixel coordinates of the two-dimensional surface, and k represents the position of the layer. Obstacle distribution information includes component package coordinates, coordinates of the no-route area, and via position coordinates. For obstacles without clear vertices, such as circles and ellipses, quadrilateral approximations are used.
[0010] Based on the aforementioned obstacle avoidance heuristic algorithm using millimeter-wave images of PCBs, each network to be routed has a starting point q and an ending point p. The candidate point set A and the connectable point set T are initialized to be empty. The coordinates of the starting point q are (x...). q ,y q ,k q The coordinates of the endpoint p are (x p ,y p ,k p ), where k q k p Given the respective PCB layers, based on the layer affiliation of the starting point q and the ending point p, generate cross-layer connection points q' and p', where q' is the projection point of the starting point q on other layers, and p' is the projection point of the ending point p on the layer to which the starting point q belongs. Add the starting point q directly to the set of connectable points T. If k q With k p If they are the same, add the endpoint p to the candidate point set A; if they are not the same, add p' to the candidate point set A.
[0011] Extract all obstacles within the local neighborhood of the current wiring and add the vertex coordinates of each obstacle to the candidate point set A. The local neighborhood is dynamically constructed based on the positions of the starting point q and the ending point p. If no valid connection point is found in the local neighborhood, the neighborhood range is gradually expanded until the entire PCB board is reached.
[0012] As a preferred technical solution, the pixel coordinate obstacle avoidance heuristic algorithm logic of the image is as follows: for each candidate point a in the candidate point set A, a pre-exploration line is constructed from the starting point q to the candidate point a. The intersection detection of line segments determines whether the pre-exploration line intersects with the obstacle. If they do not intersect, the candidate point a is a valid connection point and is added to the set of connectable points T. If they intersect, the candidate point is discarded.
[0013] As a preferred technical solution, the specific implementation process of the line segment intersection detection includes the following steps:
[0014] For the two line segments to be detected, L1 (P1,P2) and L2 (Q1,Q2), with pixel coordinates P1(x1,y1), P2(x2,y2) and Q1(x3,y3), Q2(x4,y4):
[0015] The equation of the support line of line segment L1 is: A1x + B1y = C1, where A1 = P2.y − P1.y, B1 = P1.x − P2.x, and C1 = A1 × P1.x + B1 × P1.y.
[0016] The equation of the support line of line segment L2 is: A2x + B2y = C2, where A2 = Q2.y − Q1.y, B2 = Q1.x − Q2.x, and C2 = A2 × Q1.x + B2 × Q1.y;
[0017] Calculate the determinant det = A1 × B2 − A2 × B1. If det = 0, then the two line segments are parallel or collinear, and are determined to be non-intersecting.
[0018] The x-coordinate of the intersection point must be within the x-coordinate range of the first line segment:
[0019] min(p1.x,p2.x) ≤ x ≤ max(p1.x,p2.x)
[0020] The y-coordinate of the intersection point must be within the y-coordinate range of the first line segment:
[0021] min(p1.y,p2.y) ≤ y ≤ max(p1.y,p2.y)
[0022] The x-coordinate of the intersection point must be within the x-coordinate range of the second line segment:
[0023] min(q1.x,q2.x) ≤ x ≤ max(q1.x,q2.x)
[0024] The y-coordinate of the intersection point must be within the y-coordinate range of the second line segment:
[0025] min(q1.y,q2.y) ≤ y ≤ max(q1.y,q2.y)
[0026] If det≠0, find the intersection point (x,y) of the two support lines and determine whether the intersection point is simultaneously within the coordinate range of line segments L1 and L2. If both are within the range, they are considered to intersect; otherwise, they are considered not to intersect.
[0027] As a preferred technical solution, the pixel coordinate obstacle avoidance heuristic algorithm for the image uses the following cost function to evaluate the path priority of each connecting point:
[0028] f(neighbor) = g(current) + d(current,neighbor) + v·δ layer + h(neighbor,goal)
[0029] Where g(current) is the actual path cost from the starting point q to the current point, d(current,neighbor) is the Euclidean distance from the current point to its neighboring points, v is the via cost weight, and δ layer Here, is the inter-layer switching indicator function (1 for inter-layer switching, 0 otherwise), and h(neighbor,goal) is the heuristic estimated cost from the neighbor point to the destination p.
[0030] Another aspect of the present invention provides a multilayer PCB routing search algorithm based on millimeter-wave images, used to realize the aforementioned automatic obstacle avoidance routing search between layers of a multilayer PCB, wherein the iterative optimal path search algorithm includes:
[0031] Initialize the priority queue open_set, the actual cost set g_score, the total cost set f_score, and the record set came_from. Add the starting point q to open_set, set g_score[start]=0, and f_score[start]=h(start,goal);
[0032] If open_set is empty, it means there is no feasible path, and the multi-pin network repair process is entered; otherwise, the current point with the smallest f_score is retrieved from open_set.
[0033] If current is the endpoint p, the initial routing path is obtained by tracing back from the endpoint p to the starting point q using came_from;
[0034] If current is already in the explored set closed_set, skip this node; otherwise, add current to closed_set.
[0035] The system iterates through the priority queue open_set to extract the current point with the minimum total cost. If the current point is the destination p, the system backtracks through the record set came_from to generate the initial wiring path. If the current point is already in the explored complete set closed_set, the system skips it; otherwise, it adds it to closed_set.
[0036] Another aspect of the present invention provides a method for repairing multi-pin networks in multi-layer PCBs based on millimeter-wave images, comprising repairing connection failures of three or more pin networks, for executing the aforementioned multi-layer PCB routing search algorithm based on millimeter-wave images:
[0037] For multi-pin networks with three or more pins, first select the initial pin, and then connect the nearest unconnected pins in sequence. If a routing failure occurs, calculate the Euclidean distance between the failed pin and all pins in the set of connected pins. Prioritize connecting the failed pin to the nearest connected pin to restore network integrity.
[0038] Compared with the prior art, the present invention has at least one of the following beneficial effects:
[0039] (1) This invention uses millimeter-wave imaging to enable the meshless design of the wiring search algorithm for multi-layer PCBs. Multi-layer wiring is carried out in continuous space, which completely gets rid of the constraints of grid resolution. It avoids the accuracy error caused by coarse grids and solves the problem of increased computing cost caused by fine grids, thus achieving a balance between accuracy and efficiency.
[0040] (2) The pixel coordinate obstacle avoidance heuristic algorithm of the image ensures the effectiveness and connectivity of the connection points by dynamically constructing local neighborhoods, generating cross-layer connection points, and filtering effective points based on line segment intersection detection. It provides a high-quality search basis for multi-layer PCB routing. Compared with existing methods, the redundancy of connection points is significantly reduced.
[0041] (3) The multi-pin network repair method is based on the Euclidean distance priority strategy to quickly restore failed connections. The linear optimization ensures that sharp angle connections are avoided through parallelogram reconstruction technology, which improves the feasibility of wiring and signal integrity. Attached Figure Description
[0042] Figure 1 This is a schematic diagram of pixel coordinates of a millimeter-wave image used to segment a multi-layer PCB region in an embodiment.
[0043] Figure 2 This is a schematic diagram of the pixel coordinate obstacle avoidance heuristic algorithm routing in a multilayer PCB based on millimeter-wave images in an embodiment.
[0044] Figure 3This is a structural diagram of the pixel coordinate obstacle avoidance heuristic algorithm for the image in the embodiment.
[0045] Figure 4 This is a schematic diagram of the multi-pin network repair method in the embodiment. Detailed Implementation
[0046] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0047] Example 1
[0048] To address the problems of the aforementioned existing technologies, this embodiment provides a multilayer PCB routing search algorithm based on millimeter-wave images. It fully considers the unique properties of millimeter-wave imaging and relies on the A* heuristic algorithm of the grid method. In a gridless approach, it segments the coordinates of obstacles and routable boundaries of the multilayer PCB using the pixel coordinates of the millimeter-wave image, thus overcoming the fixed grid constraints of multilayer PCB routing in continuous space and avoiding the accuracy-efficiency contradiction caused by grid resolution. The specific task is divided into three key sub-tasks: millimeter-wave imaging of the multilayer PCB and mapping it to the same dimension; marking the coordinates of obstacles and routable boundary points using pixel-segmented coordinates; pre-calculating routing paths based on obstacle coordinates using a pixel coordinate obstacle avoidance heuristic algorithm; and handling paths with sharp angles caused by unsuccessful routing using a multi-pin network repair method.
[0049] See Figure 1 This is a schematic diagram of pixel coordinate segmentation of a multi-layer PCB region for a millimeter-wave image provided in this embodiment. The processing procedure is as follows:
[0050] Step S1: Perform millimeter-wave imaging on the multilayer PCB and extract the positional features of the boundary between the components and the obstacle target using the pixel coordinates of the image.
[0051] In this embodiment, [A] x min, A y min, A x max, A y [max] represents a rectangular region, and [x,y,k] represents the coordinates of the obstacle boundary points, where x and y represent the pixel coordinates of the two-dimensional surface, and k represents the position of the layer board. The obstacle distribution information includes the coordinates of the component package, the boundary vertices of the obstacle, and the prohibited wiring area. For obstacles without clear vertices, such as circles and ellipses, quadrilateral approximation is used.
[0052] Step S2: Based on the pixel coordinate obstacle avoidance heuristic algorithm of the image, each network to be wired has a starting point q and an ending point p. Initialize the candidate point set A and the connectable point set T to be empty. The coordinates of the starting point q (x, y, p) are... q ,y q ,k q ), the coordinates of the endpoint p (x p ,y p ,k p ), where k q k p Given the respective PCB layers, based on the layer affiliation of the starting point q and the ending point p, generate cross-layer connection points q' and p', where q' is the projection point of the starting point q on other layers, and p' is the projection point of the ending point p on the layer to which the starting point q belongs. Add the starting point q directly to the set of connectable points T. If k q With k p If they are the same, add the endpoint p to the candidate point set A; if they are not the same, add p' to the candidate point set A.
[0053] See Figure 1 Extract all obstacles within the local neighborhood of the current wiring and add the vertex coordinates of each obstacle to the candidate point set A. The local neighborhood is dynamically constructed based on the positions of the starting point q and the ending point p. If no valid connection point is found in the local neighborhood, the neighborhood range is gradually expanded until the entire PCB board is reached.
[0054] Example 2
[0055] Based on Example 1, this example provides an algorithm logic for cross-board routing between multi-layer PCBs and a cost function for evaluating the path priority of each connection point:
[0056] f(neighbor) = g(current) + d(current,neighbor) + v·δ layer + h(neighbor,goal)
[0057] Where g(current) is the actual path cost from the starting point q to the current point, d(current,neighbor) is the Euclidean distance from the current point to its neighboring points, v is the via cost weight, and δ layer Here, is the inter-layer switching indicator function (1 for inter-layer switching, 0 otherwise), and h(neighbor,goal) is the heuristic estimated cost from the neighbor point to the destination p.
[0058] See Figure 2 The pixel coordinate obstacle avoidance heuristic algorithm logic for multi-layer PCB cross-board routing images includes:
[0059] Initialize the priority queue open_set, the actual cost set g_score, the total cost set f_score, and the record set came_from. Add the starting point q to open_set, set g_score[start]=0, and f_score[start]=h(start,goal);
[0060] If open_set is empty, it means there is no feasible path, and the multi-pin network repair process is entered; otherwise, the current point with the smallest f_score is retrieved from open_set.
[0061] If current is the endpoint p, the initial routing path is obtained by tracing back from the endpoint p to the starting point q using came_from;
[0062] If current is already in the explored set closed_set, skip this node; otherwise, add current to closed_set.
[0063] The system iterates through the priority queue open_set to extract the current point with the minimum total cost. If the current point is the destination p, the system backtracks through the record set came_from to generate the initial wiring path. If the current point is already in the explored complete set closed_set, the system skips it; otherwise, it adds it to closed_set.
[0064] Example 3
[0065] Based on Example 2, this example provides a heuristic algorithm for obstacle avoidance in a multilayer PCB using millimeter-wave image coordinates. This algorithm implements a multilayer PCB routing search algorithm based on millimeter-wave images, as described in Example 1. For each candidate point a in the candidate point set A, a pre-exploration line is constructed from the starting point q to candidate point a. Intersection detection is used to determine whether the pre-exploration line intersects with an obstacle. If they do not intersect, candidate point a is a valid connection point and is added to the set of connectable points T. If they intersect, the candidate point is discarded. The steps include:
[0066] (1) For the two line segments to be detected, L1 (P1,P2) and L2 (Q1,Q2), with pixel coordinates P1(x1,y1), P2(x2,y2) and Q1(x3,y3), Q2(x4,y4):
[0067] The equation of the support line of line segment L1 is: A1x + B1y = C1, where A1 = P2.y − P1.y, B1 = P1.x − P2.x, and C1 = A1 × P1.x + B1 × P1.y.
[0068] The equation of the support line of line segment L2 is: A2x + B2y = C2, where A2 = Q2.y − Q1.y, B2 = Q1.x − Q2.x, and C2 = A2 × Q1.x + B2 × Q1.y;
[0069] Calculate the determinant det = A1 × B2 − A2 × B1. If det = 0, then the two line segments are parallel or collinear, and are determined to be non-intersecting.
[0070] (2) Determine whether the intersecting coordinates are within the PCB area:
[0071] The x-coordinate of the intersection point must be within the x-coordinate range of the first line segment:
[0072] min(p1.x,p2.x) ≤ x ≤ max(p1.x,p2.x)
[0073] The y-coordinate of the intersection point must be within the y-coordinate range of the first line segment:
[0074] min(p1.y,p2.y) ≤ y ≤ max(p1.y,p2.y)
[0075] The x-coordinate of the intersection point must be within the x-coordinate range of the second line segment:
[0076] min(q1.x,q2.x) ≤ x ≤ max(q1.x,q2.x)
[0077] The y-coordinate of the intersection point must be within the y-coordinate range of the second line segment:
[0078] min(q1.y,q2.y) ≤ y ≤ max(q1.y,q2.y)
[0079] (3) If det≠0, solve for the intersection point (x,y) of the two support lines and determine whether the intersection point is simultaneously within the coordinate range of line segments L1 and L2. If both are within the range, they are considered to intersect; otherwise, they are considered not to intersect.
[0080] Example 4
[0081] This embodiment provides a multi-pin network repair method, characterized by including multi-pin network repair for millimeter-wave imaging images of multi-layer PCBs, including repair of connection failures of three or more pin networks, for executing a multi-layer PCB routing search algorithm based on millimeter-wave images in Example 1.
[0082] For multi-pin networks with three or more pins, first select the initial pin, and then connect the nearest unconnected pins in sequence. If a routing failure occurs, calculate the Euclidean distance between the failed pin and each pin in the set of connected pins. Prioritize connecting the failed pin to the nearest connected pin to restore network integrity.
[0083] See Figure 4 By employing parallelogram geometry reconstruction technology, non-compliant bends and diagonal lines appearing in the initial meshless routing are optimized. While strictly locking the path start and end points to ensure connections remain unchanged, all angles are corrected to compliant bends. The original obstacle avoidance detection logic is deeply reused, ensuring that the optimized path does not touch obstacles, does not significantly increase routing length, and does not change via positions or existing effective routing paths. This solves the angle compliance issue of meshless routing, improving PCB feasibility and signal integrity.
[0084] In summary, this invention proposes a multi-layer PCB routing search algorithm based on millimeter-wave images. By imaging multi-layer PCB images with millimeter-wave technology and marking obstacle boundary points, an efficient multi-layer path search is achieved using a pixel coordinate obstacle avoidance heuristic algorithm. Path priority is determined by the cost function of connection points. Combined with the reference of the A* heuristic network routing algorithm based on mesh methods, the accuracy of routing is determined by limiting the coordinate range of the PCB area boundary using the pixel coordinates of the image, generating a pre-routing path network. Multi-pin network repair and line shape optimization further ensure routing quality and compliance. This method overcomes the constraints of fixed meshes, natively supports multi-layer routing, and exhibits excellent performance in terms of routing success rate, routing length, and operating efficiency. It can meet the automatic routing needs of high-density, complex multi-layer PCBs and has significant industrial application value and promising prospects for widespread adoption.
[0085] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention 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 the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A multilayer PCB routing search algorithm based on millimeter-wave images, characterized in that, Includes the following steps: A composite image of millimeter-wave component arrangement on a multi-layer PCB is acquired. The pixel coordinates of the millimeter-wave image are used to segment and locate the boundary coordinates of obstacle points and the boundary coordinates of the routable area. The design data includes the routable area, obstacle distribution, routing constraints, pin positions and connection relationships of each PCB layer. The routing constraints include obtuse angle rules, line spacing thresholds, via positions and the range of the routable area. For the start and end points of each network to be routed, an obstacle avoidance heuristic algorithm based on image processing is used to generate the set points of the obstacle vertex coordinate module. Based on the characteristics of the pixel coordinates corresponding to the image processing, an obstacle avoidance heuristic algorithm is used to generate the via positions and obstacle vertices between multi-layer PCBs, thereby improving the high-frequency signal transmission efficiency and reducing signal distortion in multi-layer PCB routing.
2. The multilayer PCB routing search algorithm based on millimeter-wave images according to claim 1, characterized in that, For each network to be wired, the starting point q and ending point p are used to generate a set T of connectable points using an obstacle avoidance heuristic algorithm based on image segmentation pixel coordinates. Specifically, this includes: Initialize the candidate point set A and the connectable point set T to be empty, and set the starting point q, the ending point p and their respective PCB layers; Based on the layer affiliation of the starting point q and the ending point p, generate cross-layer connection points q' and p', add the starting point q to the set of connectable points T, and if the starting point q and the ending point p are located in the same layer, add the ending point p to the candidate point set A. If the starting point q and the ending point p are located on different layers, then the projection point of the ending point p on the layer to which the starting point q belongs is taken as the inter-layer connection point p' and added to the candidate point set A; Extract all obstacles within the current wiring area and add the vertex of each obstacle to the candidate point set A; For each candidate point a in the candidate point set A, the pre-exploration line from the starting point q to the candidate point a is checked for intersection by line segment intersection detection. If they do not intersect, the candidate point a is added to the set of connectable points T.
3. The multilayer PCB routing search algorithm based on millimeter-wave images according to claim 1, characterized in that, The method of using an obstacle avoidance heuristic path optimization algorithm to plan the optimal wiring path includes the following: Heuristic cost function: f(neighbor) = g(current) + d(current,neighbor) + v·δ layer + h(neighbor,goal) Where g(current) is the actual path cost from the starting point q to the current point, d(current,neighbor) is the Euclidean distance from the current point to its neighboring points, v is the via cost weight, and δ layer Here, is the inter-layer switching indicator function (1 for inter-layer switching, 0 otherwise), and h(neighbor,goal) is the heuristic estimated cost from the neighbor point to the destination p. Initialize the priority queue open_set, the actual cost set g_score, the total cost set f_score, and the record set came_from. Add the starting point q to open_set, set g_score[start]=0, and f_score[start]=h(start,goal); The current point with the minimum total cost is extracted from the priority queue open_set in a loop. If the current point is the destination p, the initial wiring path is generated by backtracking through the record set came_from. If the current point is already in the explored complete set closed_set, it is skipped; otherwise, it is added to closed_set. Output the final routing path that satisfies all routing constraints of a multilayer PCB board. The final routing path includes the direction of conductors in each layer and the location of vias for interlayer transitions.
4. The multilayer PCB routing search algorithm based on millimeter-wave images according to claim 1, characterized in that, The specific implementation of line segment intersection detection includes: For the two line segments to be detected, L1 (P1,P2) and L2 (Q1,Q2), with pixel coordinates P1(x1,y1), P2(x2,y2) and Q1(x3,y3), Q2(x4,y4): The equation of the support line of line segment L1 is: A1x + B1y = C1, where A1 = P2.y − P1.y, B1 = P1.x − P2.x, and C1 = A1 × P1.x + B1 × P1.y. The equation of the support line of line segment L2 is: A2x + B2y = C2, where A2 = Q2.y − Q1.y, B2 = Q1.x − Q2.x, and C2 = A2 × Q1.x + B2 × Q1.y; Calculate the determinant det = A1 × B2 − A2 × B1. If det = 0, then the two line segments are parallel or collinear, and are determined to be non-intersecting. If det≠0, find the intersection point (x,y) of the two support lines, and determine whether the intersection point is simultaneously within the coordinate range of line segments L1 and L2. If both are within the range, they are considered to intersect; otherwise, they are considered not to intersect.
5. The multilayer PCB routing search algorithm based on millimeter-wave images according to claim 4, characterized in that, The coordinate range of the intersection point (x, y) of the support lines is: The x-coordinate of the intersection point must be within the x-coordinate range of the first line segment: min(p1.x,p2.x) ≤ x ≤ max(p1.x,p2.x) The y-coordinate of the intersection point must be within the y-coordinate range of the first line segment: min(p1.y,p2.y) ≤ y ≤ max(p1.y,p2.y) The x-coordinate of the intersection point must be within the x-coordinate range of the second line segment: min(q1.x,q2.x) ≤ x ≤ max(q1.x,q2.x) The y-coordinate of the intersection point must be within the y-coordinate range of the second line segment: min(q1.y,q2.y) ≤ y ≤ max(q1.y,q2.y).
6. The multilayer PCB routing search algorithm based on millimeter-wave images according to claim 1, characterized in that, The aforementioned regional constraints are calculated using the following formula: Let the PCB routing area be a rectangular region A, with its lower left corner at coordinates (0, 0), width W, and height H. All routing traces and vias must be completely contained within the physical boundaries of the PCB: (x,y) e or (x,y)v ∈ [0,W] × [0,H] Where, for any line segment e∈E and via v∈V, Obstacle Avoidance Constraints: Let O be the set of obstacles on the PCB, and Bo represent the region occupied by obstacle o∈O. Each conductor segment e∈E and via v∈V must avoid all such obstacle regions. Specifically, the following conditions must be met: (x,y,k) e or (x,y,k) v Bo Line spacing threshold S w−w And the threshold S for the distance between the pin and the wire w−pin Each unit is no less than one length unit, and the multilayer PCB supports bandwidth configurations of 0-2GHz, 0-4GHz, or 0-8GHz.
7. The multilayer PCB routing search algorithm based on millimeter-wave images according to claim 1, characterized in that, The obstacle avoidance heuristic path optimization algorithm also includes a destination layer guidance mechanism: if the layer to which the neighbor point belongs is different from the layer to which the destination point belongs, then an additional via cost weight v is added to the total cost f(neighbor) to guide the path toward the destination layer.
8. The multilayer PCB routing search algorithm based on millimeter-wave images according to claim 1, characterized in that, In the pixel coordinate segmentation heuristic algorithm of the image, for obstacles without clear vertices such as circles and ellipses, quadrilateral approximation is used to extract the vertices of the approximate quadrilateral as candidate point sources.
9. The multilayer PCB routing search algorithm based on millimeter-wave images according to claim 1, characterized in that, include: The data input module is used to acquire design data for multilayer PCBs. The design data includes routable areas, obstacle distribution, pin positions and connection relationships, and routing constraints. The connection point generation module is used to execute the pixel coordinate segmentation heuristic algorithm of the image as described in claim 2 to generate a set of connectable points T; The path planning module is used to execute the obstacle avoidance heuristic path optimization algorithm as described in claim 2, and to plan the initial wiring path based on the set of connectable points T. The path optimization module is used to perform the post-processing optimization as described in claim 7, including multi-pin network repair and line shape optimization, and output the final routing path; The output module is used to output the coordinate data of the final routing path, via positions, and routing layer allocation information.
10. The multilayer PCB routing search algorithm based on millimeter-wave images according to claim 9, characterized in that, It also includes a parameter configuration module for configuring parameters such as via cost weight v, line spacing threshold, pin and wire spacing threshold, and obtuse angle rule tolerance. The via cost weight v ranges from 0 to 50.