Method and device for identifying grid copper sheet in PCB graphic file, computer equipment and storage medium
Through the method of selecting, preprocessing and identifying and verifying graphic elements of PCB graphics files, the problem of inaccurate identification of grid copper skins in the existing technology is solved, and efficient and accurate grid copper skin recognition is achieved, and production efficiency is improved.
Patent Information
- Application Number
- CN202510269815.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-06-24
AI Technical Summary
The existing technology cannot accurately identify the grid copper skin in PCB graphics files, resulting in subsequent graphics optimization processing errors, increasing waste of computing resources and processing time, and reducing production efficiency.
By obtaining PCB graphics files, selecting and preprocessing graphic elements, obtaining graphic types, searching for grid copper skin according to graphic types, and identifying and verifying, including connecting ring search, deduplication, and ring verification.
It realizes accurate identification of grid copper skin in complex PCB graphics files, improves the accuracy of recognition, reduces misjudgment, shortens processing time, improves processing efficiency, and accelerates product design and production cycle.
Smart Images

Figure CN120198932A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of printed circuit board design, and more specifically to a method, device, computer device, and storage medium for identifying grid copper clads in a PCB graphic file. Background Art
[0002] In the modern electronic manufacturing field, the design and manufacturing of printed circuit boards (PCBs) have become increasingly complex and precise. File formats such as Gerber and ODB++ are important carriers of PCB design data and are widely used in industrial production. However, in these files, both grid copper clads and circuits are presented in the form of lines, lacking direct distinguishing identifiers, making it difficult for machines to accurately identify them like the human eye.
[0003] In the process of automated processing of PCB graphic files, the inability to accurately identify copper clads, especially grid copper clads, will cause a series of problems. On the one hand, subsequent graphic optimization processing work is difficult to carry out smoothly. For example, when performing wiring optimization and circuit performance analysis, due to the inability to accurately distinguish grid copper clads and circuits, incorrect optimization decisions may be made, affecting the overall performance of the PCB. On the other hand, due to the complex and diverse structures of copper clads, misidentified or unrecognized grid copper clads will cause the computer graphics processing system to waste a large amount of computing resources when processing relevant data, increase the processing time, cause processing delays, reduce production efficiency, and thus affect the production cycle of products and the economic benefits of enterprises. Therefore, it is urgent to develop a method for accurately identifying grid copper clads in PCB graphic files. Summary of the Invention
[0004] The purpose of the present invention is to overcome the defects of the prior art and provide a method, device, computer device, and storage medium for identifying grid copper clads in a PCB graphic file, aiming to solve the technical problem that grid copper clads cannot be accurately identified in the existing PCB graphic file processing process.
[0005] To achieve the above purpose, the present invention adopts the following technical solutions:
[0006] A method for identifying grid copper clads in a PCB graphic file, comprising the following steps:
[0007] Obtain a PCB graphic file and select graphic elements from the graphic file;
[0008] Preprocess the graphic elements to obtain the graphic types;
[0009] Search for grid copper clads according to the graphic types;
[0010] Identify and verify the search results.
[0011] In one embodiment, the step of preprocessing the graphic element to obtain the graphic type includes:
[0012] Convert the description structure of the graphic element into a custom description structure and record the graphic information;
[0013] According to the custom description structure, perform relationship linking and sorting on the graphic element;
[0014] Classify the graphic elements based on the sorting result to obtain the graphic type.
[0015] In one embodiment, the step of searching for grid copper cladding according to the graphic type includes:
[0016] According to the graphic type, screen the copper cladding contour line based on the median line base number, define the contour line with a large median line base number as the initial contour line, and identify the contour line with a small median line base number as the alternative contour line;
[0017] Perform post-processing operations on the initial contour line and the alternative contour line respectively.
[0018] In one embodiment, the step of performing post-processing operations on the initial contour line includes:
[0019] Search for connection loops for the initial contour line in the defined priority order;
[0020] Perform duplicate removal operations on the initial contour line after the search is completed;
[0021] Perform a loop verification operation on the initial contour line after duplicate removal to determine whether the initial contour line is a copper cladding contour line;
[0022] If not, set a no flag for the corresponding initial contour line;
[0023] If so, perform a sorting operation on the corresponding initial contour line according to the ID and mark it as a qualified contour line.
[0024] In one embodiment, the step of performing post-processing operations on the alternative contour line includes:
[0025] Search for connection loops for the alternative initial contour line in the defined priority order;
[0026] Perform duplicate removal operations on the alternative contour line after the search is completed;
[0027] Perform a loop verification operation on the alternative contour line after duplicate removal to determine whether the alternative contour line is a copper cladding contour line;
[0028] If not, set a no flag for the corresponding alternative contour line;
[0029] If so, perform a sorting operation on the corresponding alternative contour lines according to the ID;
[0030] Based on the operation result, perform an inner hole verification on the alternative contour lines from small to large.
[0031] In one embodiment, the step of performing an inner hole verification on the alternative contour lines based on the operation result includes:
[0032] Obtain all the center lines of the alternative contour lines and filter out the center lines that are completely contained within the connection ring;
[0033] Obtain the midpoints of the center lines that are completely contained within the connection ring, and use the ray method to determine whether they are inside or outside the connection ring;
[0034] If half of them are inside, it indicates that it is not an inner hole, and set a negative flag for the corresponding alternative contour line;
[0035] If half of them are outside, it indicates that it is an inner hole, and then judge the mounting conditions at both ends of the center line of the corresponding alternative contour line;
[0036] If one end of the center line is not mounted on the contour line or inner hole line to which it belongs, or it is mounted on other center lines, then determine that this center line does not meet the requirements of the center line, and set a negative flag for the corresponding alternative contour line;
[0037] If both ends of the center line are normally mounted on the contour line or inner hole line to which it belongs, then this center line meets the requirements for grid copper skin determination, and mark the corresponding alternative contour line as a qualified contour line.
[0038] In one embodiment, the step of identifying and verifying the search result includes:
[0039] Extract the qualified contour lines and their center lines, and statistically classify the center lines to which the qualified contour lines belong;
[0040] Based on the classification result, delete the center line types with the number of single-type center lines less than 10% of the total number of center lines;
[0041] Judge the grid copper skin type according to the remaining center line types, and filter out the grid line groups and suspected grid line groups;
[0042] Verify and perform data calculation on the suspected grid line groups, and filter out the grid line groups;
[0043] Based on the grid line groups, in the case of the same aperture and the same network, search for the remaining center lines that have a strong connection relationship with the grid line groups and have not been determined as the grid composition lines, and determine them as grid line groups.
[0044] An identification device for grid copper skin in a PCB graphic file, the device includes:
[0045] A graphic element selection module for obtaining a PCB graphic file and selecting graphic elements from the graphic file;
[0046] A graphic preprocessing module for preprocessing the graphic elements to obtain the graphic types;
[0047] A grid copper foil search module for searching for grid copper foil according to the graphic types;
[0048] An identification and verification module for identifying and verifying the search results.
[0049] A computer device comprising a memory and a processor, wherein a computer program is stored on the memory, and the processor implements the above method when executing the computer program.
[0050] A computer-readable storage medium storing a computer program, the computer program comprising program instructions which, when executed by a processor, can implement the above method.
[0051] The beneficial effects of the present invention compared with the prior art are as follows: (1) Through the fine selection, comprehensive preprocessing, targeted search and strict identification and verification of graphic elements, grid copper foil can be accurately identified from complex PCB graphic files. Whether it is normal grid copper foil or special cases caused by non-standard PCBs, it can be accurately judged, greatly improving the recognition accuracy and reducing the possibility of misjudgment. (2) In the automated processing flow, the amount of unnecessary data processing is reduced, enabling the computer graphic processing system to operate more efficiently, significantly shortening the processing time, improving the processing efficiency of PCB graphic files, accelerating the product design and production cycle, and enhancing the competitiveness of enterprises in the market.
[0052] The above description is only an overview of the technical solution of the present invention. In order to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other objects, features and advantages of the present invention more obvious and understandable, the following preferred embodiments are specifically described in detail as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a schematic flowchart of a method for identifying grid copper foil in a PCB graphic file provided by an embodiment of the present invention;
[0054] Figure 2 It is a schematic block diagram of a device for identifying grid copper foil in a PCB graphic file provided by an embodiment of the present invention;
[0055] Figure 3 It is a schematic block diagram of a computer device provided by an embodiment of the present invention. Detailed implementation manners
[0056] In order to make the objectives, technical solutions and advantages of the present invention more clear and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation manners.
[0057] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part rather than all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0058] It should be understood that when used in this specification and the appended claims, the terms "comprises" and "comprising" indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not preclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations.
[0059] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in this specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.
[0060] It should be further understood that the term " / and" used in this specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0061] See Figure 1 As shown, an identification method for grid copper clads in a PCB graphic file is disclosed in an embodiment of the present invention, including the following steps:
[0062] S100. Obtain a PCB graphic file and select graphic elements from the graphic file;
[0063] Specifically, the PCB graphic file is a digital representation of the printed circuit board design, which contains numerous complex graphic elements. After obtaining this file, a graphic element selection operation needs to be performed. This step includes extracting elements of the same network block, that is, grabbing the connected graphics in the PCB graphic as a whole. Because in a single-layer PCB graphic, the seemingly integral elements are actually composed of irregular polygons. In this way, related graphic elements can be grouped together. At the same time, line elements under the same network block need to be removed. In the PCB line layer, there are copper clad blocks, line elements, pad elements, and other graphic elements. The constituent sub-elements of the line elements are line segments and arcs, which are the same as the constituent elements of the grid copper clad. When the two are superimposed, combined, or in contact with each other, it is easy to affect the judgment of the grid copper clad. Therefore, the lines need to be identified first, and such elements need to be removed first, and then the grid copper clad elements can be identified. According to the recognition feature that both ends of the line are usually covered by the center of the pad, first find the end of the line under the center of the pad, query the continuous line, and the other end of the line is also under the center of the pad, then identify and remove the line elements. Finally, select the line arc elements under the same network block, and only select the elements composed of line segments and arc segments. These elements will be used as the basis for subsequent processing to accurately identify the grid copper clad.
[0064] S200. Preprocess the graphic elements to obtain the graphic types;
[0065] Specifically, after obtaining specific graphic elements, these elements need to be preprocessed. The purpose of the preprocessing is to obtain the graphic types, label these graphic elements with different tags, which is convenient for subsequent classification processing. This step is to process and analyze the graphic elements, interpret these elements from multiple perspectives, so as to divide them into different types, making the subsequent search for grid copper clad more targeted.
[0066] S300. Search for grid copper clad according to the graphic types;
[0067] Specifically, when the types of graphic elements are known, the grid copper clad can be searched according to these types. This step is to search for the grid copper clad according to the label information. By analyzing and screening different types of graphic elements, the graphics that may be the grid copper clad can be gradually locked, providing a screening basis for accurately identifying the grid copper clad subsequently.
[0068] S400. Identify and verify the search results.
[0069] Specifically, after searching for the graphics that may be the grid copper clad, these search results need to be identified and verified to ensure that the finally identified grid copper clad is accurate and reliable, avoiding misjudgment.
[0070] Furthermore, through a multi-step and refined processing flow, grid copper clads are accurately screened and judged from complex PCB graphic files. In the graphic element selection stage, interfering elements are removed and valid elements are selected; in the preprocessing stage, rich graphic information and relationships are obtained to provide a basis for subsequent judgment; in the search and recognition verification stage, operations are carried out according to strict rules and priorities, which can accurately distinguish grid copper clads from other graphic elements, reduce misjudgment, and even in the case of non-standard PCB graphics, the grid copper clads can be identified as accurately as possible.
[0071] In one embodiment, the step of preprocessing the graphic elements to obtain the graphic type includes:
[0072] Convert the description structure of the graphic elements into a custom description structure and record the graphic information;
[0073] Specifically, there is no mutual position relationship between the original graphic elements in the PCB graphic file, and its description structure may be relatively complex and does not meet the subsequent processing requirements. Therefore, it is necessary to convert it into a custom description structure. The custom structure is used to describe the mutual relationship description components between each element in the structure and fill the mutual relationship between elements by searching and judging the position characteristics of nearby position elements during preprocessing, which is convenient for searching during algorithm judgment. In this process, various information of the graphics will be comprehensively recorded, including but not limited to attribute information such as the shape, size, and position of the graphics, and a unique ID information will be assigned to each graphic element. At the same time, the characteristic information of the graphics, such as the angle of the line and the curvature of the curve, will be accurately calculated, providing a rich data basis for subsequent processing, facilitating the quick search and use of key information, and greatly improving the efficiency and accuracy of data processing.
[0074] According to the custom description structure, perform relationship linking and sorting on the graphic elements;
[0075] Specifically, after establishing the custom description structure and recording information, it is necessary to sort out the relationships between graphic elements. Graphic elements do not exist in isolation in the PCB graphic; there are connection relationships and spatial position relationships between them. By relying on the custom description structure, these relationships can be clearly presented, which helps to better understand the overall structure and function of the graphic in subsequent processing, avoid misjudgment and incorrect processing caused by unclear relationships, and provide an important guarantee for accurately identifying grid copper. For example, when dealing with zero-length lines and near-zero-length line mounts, this is because overly short lines (zero-length lines and near-zero-length lines) need to be associated with other relevant lines during processing to keep them consistent in subsequent processing. At the same time, reasonably arrange the priorities of precise connection and non-precise connection of the head and tail connection segments to avoid incorrect judgments due to unclear connection relationships. Also, carefully check whether the lines with both head and tail segments are the same line, and process the incorrect entry situations of mutually median lines and the lines to which the median lines belong to ensure the accuracy and integrity of the relationships between graphic elements.
[0076] Classify the graphic elements based on the sorting results to obtain the graphic types.
[0077] Specifically, after completing the linking and sorting of the relationships between graphic elements, classify the graphic elements according to these sorting results. The basis for classification can be the difference in the types of graphics, such as distinguishing whether it is copper, a circuit, or other component graphics; it can also be classified according to the aperture size, and different aperture sizes may represent different graphic attributes. Through multi-dimensional classification methods, the graphic elements can be divided into different types, thereby clarifying the category to which each graphic element belongs and obtaining the graphic types. When searching for and identifying grid copper in the subsequent process, targeted operations can be carried out according to the graphic types, narrowing the search scope, improving the identification efficiency, and reducing unnecessary waste of computing resources.
[0078] In one embodiment, the step of searching for grid copper according to the graphic type includes:
[0079] According to the graphic type, screen the copper outline lines based on the median line base number. Define the outline lines with a large base number of median lines as the initial outline lines, and identify the outline lines with a small base number of median lines as alternative outline lines;
[0080] Specifically, based on the acquired graphic type, the processing is further focused on the copper foil contour line. As an important feature of the copper foil contour line, the number of center lines becomes the key basis for screening. By counting and analyzing the number of center lines contained in each copper foil contour line, those contour lines with a larger number of center lines (i.e., large-cardinality center lines) are selected and defined as the initial contour lines. These contour lines are considered more likely to be an important part of the grid copper foil due to their rich center line information during the subsequent grid copper foil recognition process, so they are the objects to be processed preferentially. For those contour lines with a smaller number of center lines (small-cardinality center lines), they are marked as alternative contour lines. Although these alternative contour lines do not have an advantage in terms of the number of center lines, they still have the possibility of becoming part of the grid copper foil, so they are also retained for further processing later.
[0081] Screening the copper foil contour lines based on the center line cardinality can quickly preliminarily determine the contour lines with a relatively high correlation with the grid copper foil from a large number of graphic elements, namely the initial contour lines and the alternative contour lines. This screening method greatly reduces the scope of subsequent processing, avoids the indiscriminate processing of all graphic elements, saves computing resources and processing time, and improves the efficiency of grid copper foil recognition.
[0082] Post-processing operations are performed on the initial contour lines and the alternative contour lines respectively.
[0083] Specifically, performing post-processing operations on the initial contour lines and the alternative contour lines is to further explore and verify their relevance to the grid copper foil. For the initial contour lines, the post-processing operations aim to optimize and confirm them. Due to the characteristics of the initial contour lines having large-cardinality center lines, their subsequent processing will focus on these center lines and the characteristics of the contour lines themselves to further clarify whether they truly belong to the grid copper foil and their position and role in the grid copper foil. For the alternative contour lines, post-processing operations are also required. Although their center line cardinality is small, different methods will be used in the post-processing process to judge their relationship with the grid copper foil, such as checking their connection relationship and spatial position relationship with surrounding graphic elements, so as to determine their role in the grid copper foil recognition.
[0084] In one embodiment, the steps of performing post-processing operations on the initial contour lines include:
[0085] Search for connection loops for the initial contour lines in the defined priority order;
[0086] Specifically, after the initial contour line is determined, the connection loop search is carried out in the preset priority order. In this embodiment, the priority order is set as the order of the maximum outward angle, similar ID, initial contour line, alternative contour line, and undefined line. Starting from the initial contour line, first, search for the connected contour line according to the principle of the maximum outward angle, because it is likely that the maximum outward angle is more conducive to constructing a complete connection loop and is closer to the true structure of the grid copper foil. If there is no contour line meeting the condition of the maximum outward angle, search in the order of similar ID, and use the ID information to judge the relevance between contour lines. And so on. Through this ordered search method, continuously expand the connection loop, obtain the set of contour lines that may belong to the same grid copper foil, reduce the situation of false search and missed search, and improve the accuracy of the search results.
[0087] Perform deduplication operations on the initial contour lines after the search is completed in sequence;
[0088] Specifically, during the connection loop search, it is possible to repeatedly search for the same contour line, which will interfere with subsequent judgments and increase the processing burden. The deduplication operation removes the repeated parts by comparing various features of the contour lines, such as shape, position, ID, etc., and only retains one copy of the exactly same contour line to ensure that the subsequent processed contour line data is unique and non-redundant.
[0089] Perform a loop verification operation on the initial contour lines after deduplication to judge whether the initial contour lines are copper foil contour lines;
[0090] Specifically, after the deduplication operation, perform a loop verification operation on the initial contour lines to check the integrity and rationality of the connection loop. For example, check whether the connection loop is closed and whether the connection between contour lines conforms to the characteristics of the grid copper foil. If there are obvious situations where the connection loop does not conform to the characteristics of the copper foil contour line, such as disconnection, abnormal connection angle, etc., then judge that the initial contour line is not a qualified copper foil contour line; on the contrary, if the connection loop conforms to the relevant characteristics, it is considered a qualified copper foil contour line.
[0091] If not, set a no flag for the corresponding initial contour line;
[0092] Specifically, when it is judged that a certain initial contour line is not a copper foil contour line, set a no flag for it to mark that this contour line does not meet the requirements of the copper foil contour line at the current stage. In subsequent processing, the system can quickly identify the status of this contour line, avoid unnecessary repeated processing of it, and improve the processing efficiency.
[0093] If so, perform a sorting operation on the corresponding initial contour lines according to the ID and mark them as qualified contour lines.
[0094] Specifically, if the initial contour line passes the loop verification and is determined to be a copper skin contour line, it is sorted according to the ID. The ID sorting can give these qualified contour lines a clear order, facilitating subsequent search and processing. At the same time, the initial contour line determined to be a copper skin contour line is marked as a qualified contour line, indicating that this contour line has passed the verification at the current stage and is a valid part that may form the grid copper skin, providing a reliable data basis for subsequent grid copper skin identification and construction. The system can quickly distinguish and process contour lines in different states based on these marks and sorting, reducing processing time and resource waste, improving processing efficiency, and optimizing the entire grid copper skin identification process.
[0095] In one embodiment, the step of performing post-processing operations on the alternative contour lines includes:
[0096] Performing a connection loop search on the alternative initial contour lines in the defined priority order;
[0097] Specifically, during the process of identifying the grid copper skin, for the parts marked as alternative contour lines, a connection loop search also needs to be carried out in the defined priority order. In this embodiment, the priority order is set as the order of the maximum outward angle, similar ID, initial contour line, alternative contour line, and undefined line. Through this order, starting from the alternative contour line, other contour lines connected to it are gradually searched for to construct possible connection loops, so as to explore its position and role in the grid copper skin structure.
[0098] Performing a duplicate removal operation on the alternative contour lines after the search is completed in sequence;
[0099] Specifically, during the connection loop search process, duplicate search situations may also occur for the alternative contour lines. The duplicate removal operation removes duplicate alternative contour lines by comparing various attributes of the contour lines, such as shape, position, ID, etc. This ensures the data accuracy of subsequent processing, avoids interference from duplicate data in judging the relationship between the alternative contour lines and the grid copper skin, and also reduces the computational burden of subsequent processing.
[0100] Performing a loop verification operation on the alternative contour lines after the duplicate removal is completed to determine whether the alternative contour line is a copper skin contour line;
[0101] Specifically, after the duplicate removal operation, a specific algorithm and rules are used to perform loop verification on the alternative contour lines, so as to check aspects such as the integrity of the connection loop and the rationality of the connection between the contour lines. If there are situations where the connection loop does not conform to the characteristics of the copper skin contour line, such as the connection loop is not closed or the connection angle is abnormal, it is determined that the alternative contour line is not a copper skin contour line; on the contrary, if the connection loop meets the relevant characteristic requirements, it is considered that it may be a copper skin contour line.
[0102] If not, a no flag is set for the corresponding alternative contour line;
[0103] Specifically, when it is determined through loop verification that a certain alternative contour line is not a copper clad contour line, a negative flag is set for it. The setting of this flag facilitates quickly identifying the status of the contour line in subsequent processing. The system can skip unnecessary repeated processing based on this flag, improving the overall processing efficiency.
[0104] If so, perform a sorting operation on the corresponding alternative contour lines according to their IDs;
[0105] Specifically, if an alternative contour line is determined to be possibly a copper clad contour line through loop verification, then sort it according to its ID. ID sorting can make these potential copper clad contour lines have a clear order, facilitating subsequent searching, management, and further processing, providing an ordered data basis for accurately identifying grid copper clads.
[0106] Based on the operation result, perform inner hole verification on the alternative contour lines from small to large according to their IDs.
[0107] Specifically, after the above processing of the alternative contour lines, since the alternative contour lines are usually considered possibly inner holes under the same aperture and the same network, inner hole verification is required. Inner hole verification is a more in-depth analysis of the alternative contour lines. By specific methods and steps, it is determined whether it is really an inner hole, further clarifying its role in the grid copper clad structure. This is crucial for accurately identifying grid copper clads. ID is the unique identifier of each alternative contour line. Sorting according to ID can ensure the orderliness of the inner hole verification process. Since in the actual PCB graphic processing, the number of alternative contour lines may be numerous and their distribution is relatively complex, through this ordered arrangement method, the system can verify each contour line methodically, avoiding omission or repeated verification, and improving the efficiency and accuracy of verification.
[0108] In one embodiment, the step of performing inner hole verification on the alternative contour lines based on the operation result includes:
[0109] Obtain all the center lines of the alternative contour lines and filter out the center lines that are completely contained within the connection loop;
[0110] Specifically, when performing inner hole verification on the alternative contour lines, first comprehensively obtain all their center lines. The center lines are important judgment bases, recording the key information inside the contour lines. Among the numerous center lines, filter out the center lines that are completely contained within the connection loop. This is because the connection loop is an important structure for defining the range and shape of the contour line. The center lines completely within the connection loop can better reflect the characteristics of the internal area of the alternative contour line, which is crucial for judging whether it is an inner hole. Through this step, focus on the center line data that has a direct effect on judging the inner hole.
[0111] Obtain the midpoint of the center line that is completely contained within the connection ring, and use the ray method to determine whether it is inside or outside the connection ring;
[0112] Specifically, after obtaining the filtered center lines, take the midpoint of each center line and use the ray method for position judgment. The ray method is a commonly used method in graphics processing to determine the position relationship between a point and a polygon. Draw a ray from this midpoint and count information such as the number of intersections of the ray with the connection ring to determine whether the midpoint is inside or outside the connection ring. This method can accurately judge the position relationship between the midpoint of the center line and the connection ring, providing key data support for subsequent judgment of whether the alternative contour line is an inner hole.
[0113] If half of them are inside, it indicates that it is not an inner hole, and then set a no flag for the corresponding alternative contour line;
[0114] Specifically, when half of the midpoints of the center lines are inside the connection ring, according to the pre-set judgment rules, it can be concluded that the alternative contour line is not an inner hole. In order to quickly identify this attribute of the contour line in subsequent processing, set a no flag for it. This flag is like a special label, reminding the subsequent process that the contour line does not conform to the characteristics of an inner hole and reducing unnecessary processing operations on it.
[0115] If half of them are outside, it indicates that it is an inner hole, and then judge the mounting conditions at both ends of the center line of the corresponding alternative contour line;
[0116] Specifically, if half of the midpoints of the center lines are outside the connection ring, it is initially judged that the alternative contour line is an inner hole. At this time, further check the mounting conditions at both ends of its center line. Because for a real inner hole in the grid copper foil, there are specific requirements for the mounting conditions at both ends of its center line, which is related to the integrity and rationality of the entire grid copper foil structure.
[0117] If one end of the center line is not mounted on the contour line or inner hole line to which it belongs, or it is mounted on other center lines, then it is determined that this center line does not meet the requirements of the center line, and a no flag is set for the corresponding alternative contour line;
[0118] Specifically, when the mounting condition of the center line does not meet the requirements, such as one end is not mounted on the contour line or inner hole line to which it belongs, or it is wrongly mounted on other center lines, it indicates that there may be abnormalities in the alternative contour line where this center line is located, and it does not meet the standard of the inner hole in the grid copper foil. Therefore, a no flag is set for the corresponding alternative contour line to exclude it from the contour lines that meet the requirements.
[0119] If both ends of the center line are normally mounted on the contour line or inner hole line to which they belong, then this center line meets the requirements for grid copper foil judgment, and the corresponding alternative contour line is marked as a qualified contour line.
[0120] Specifically, when both ends of the center line are normally mounted on the corresponding contour line or inner hole line, it indicates that the center line and the corresponding alternative contour line meet the determination conditions for the inner hole of the grid copper foil. Marking it as a qualified contour line means that after a series of strict judgments, the alternative contour line is recognized as an effective part of the grid copper foil structure, providing a reliable element for accurately constructing and identifying the grid copper foil in the subsequent process.
[0121] In one embodiment, the step of identifying and verifying the search results includes:
[0122] Extract the qualified contour lines and their center lines, and statistically classify the center lines to which the qualified contour lines belong;
[0123] Specifically, after a series of processes (such as connection loop search, duplicate removal, verification, etc.) on the initial contour lines and alternative contour lines are completed, a batch of contour lines marked as qualified will be obtained. At this time, the center lines contained in these qualified contour lines are extracted, which are key data for further analyzing the type of grid copper foil. Then, these center lines are statistically classified according to different characteristics. For example, they can be classified according to attributes such as the direction (horizontal, vertical, diagonal, etc.), length, and connected contour lines of the center lines. Through such classification, the distribution of different types of center lines in the qualified contour lines can be understood more clearly, providing strong data support for subsequent judgment of the grid copper foil type.
[0124] Based on the classification results, delete the center line types with the number of single-type center lines less than 10% of the total number of center lines;
[0125] Specifically, after the statistical classification is completed, the number of each type of center line will be analyzed. If the number of a certain type of center line accounts for less than 10% of the total number of center lines, then this type of center line is determined as an interference item and deleted. This is because in the actual PCB graphics, these single-type center lines with extremely small numbers may be caused by data errors, irregular graphic drawing, etc. They have little effect on accurately judging the grid copper foil type, but instead increase the calculation amount and the complexity of judgment. Deleting the interference items with fewer single-type center lines simplifies the subsequent judgment process, reduces the unnecessary data processing amount, and improves the calculation efficiency. At the same time, classifying and statistically analyzing the center lines and verifying and calculating the grid line groups make the data processing more scientific and reasonable, which helps to quickly and accurately obtain the relevant information of the grid copper foil.
[0126] Judge the grid copper foil type according to the remaining center line types, and screen the grid line groups and suspected grid line groups;
[0127] Specifically, after removing the interference items, the type of the grid copper foil is determined according to the type of the remaining center lines. If the remaining center lines consist only of simple horizontal or vertical lines, then it can be determined that the line group is a parallel line group and does not belong to the grid copper foil; if the remaining center lines are a combination of horizontal and vertical lines, then it can be determined that the line group is a grid line group. When the remaining center lines contain combinations such as horizontal and oblique lines, vertical and oblique lines, etc., these line groups are regarded as suspected grid line groups because their compositions are relatively complex and further verification is required to determine whether they are grid copper foils. Through such preliminary judgment and screening, different types of line groups are distinguished, preparing for more accurate verification and processing in the follow-up.
[0128] Verify the suspected grid line group and perform data calculation to screen the grid line group;
[0129] Specifically, for the part determined to be a suspected grid line group, the contour line with a large center line base number will be selected, and it will be checked whether there are two different types of center lines carried on the contour line and presented in an orderly interval arrangement, such as an alternating arrangement of a horizontal line and an oblique line, or an alternating arrangement of a vertical line and an oblique line. If it meets this characteristic, it is determined that the suspected grid line group is a grid line group; if it does not meet, it will be excluded. After determining it as a grid line group, relevant grid data calculations will also be performed, such as the grid gap value, etc. These data are of great significance for further analyzing the characteristics and performance of the grid copper foil.
[0130] Based on the grid line group, under the same aperture and the same network, search for the remaining center lines that have a strong connection relationship with the grid line group and have not been determined as the grid component lines, and determine them as the grid line group.
[0131] Specifically, after obtaining the preliminarily determined grid line group, considering the non-standardization of some PCB graphics, there may be some remaining center lines that have a strong connection relationship with the identified grid line group but have not been determined as the grid component lines before. Under the condition of the same aperture and the same network, search for these remaining center lines and incorporate them into the grid line group. By searching for the remaining center lines that have a strong connection relationship with the determined grid line group and incorporating them into the grid line group, considering the non-standardization of the PCB graphics, those grid components that are easily overlooked can be identified, making the identification of the grid copper foil more complete and more comprehensively reflecting the true situation of the grid copper foil in the PCB graphics.
[0132] Through a multi-step identification and verification process, gradually screen and judge the type of the grid copper foil, effectively exclude interference factors, deeply verify the suspected grid line group, can accurately identify the true grid copper foil, reduce the situation of misjudgment, improve the accuracy of the identification result, and provide a reliable data basis for subsequent PCB design and manufacturing.
[0133] Figure 2It is a schematic block diagram of an identification device for grid copper clads in a PCB graphic file provided by an embodiment of the present application. As Figure 2 shown, corresponding to the above method for identifying grid copper clads in a PCB graphic file, the present application also provides an identification device 500 for grid copper clads in a PCB graphic file. The identification device 500 for grid copper clads in a PCB graphic file includes a unit for executing the above method for identifying grid copper clads in a PCB graphic file, and this device can be configured in terminals such as desktop computers, tablet computers, laptop computers, etc.
[0134] An identification device 500 for grid copper clads in a PCB graphic file, the device includes:
[0135] A graphic element selection module 510, configured to obtain a PCB graphic file and perform graphic element selection on the graphic file;
[0136] Specifically, the primary task of the graphic element selection module 510 is to obtain a PCB graphic file, which contains various graphic information of the circuit board design. After obtaining the file, the graphic element selection module 510 will screen the graphic elements therein, perform extraction of elements in the same network block, and extract the interconnected graphic parts on the circuit board as a whole, because these interconnected graphics may be relevant in subsequent processing. At the same time, it will also perform elimination of line elements under the same network block. Since line elements and grid copper clads have similarities in composition (both contain line segments and arcs), they are likely to cause interference in the subsequent identification process. Therefore, this module will identify and eliminate them based on the characteristics of line elements (for example, both ends of a line are usually covered under the center of a pad). In addition, it will also perform selection of line-arc elements under the same network block, and only select elements composed of line segments and arc segments, and these elements will be used as the basic data for subsequent identification of grid copper clads.
[0137] A graphic preprocessing module 520, configured to perform preprocessing on the graphic elements to obtain the graphic types;
[0138] Specifically, after being processed by the graphic element selection module 510, the obtained graphic elements need to be further processed. The graphic preprocessing module 520 first converts the description structure of the graphic elements into a custom description structure. During this conversion process, various information of the graphics will be recorded in detail, such as the attribute information of the graphics (e.g., the thickness and color of the lines), ID information (used to uniquely identify each graphic element for convenient subsequent search and processing), and the accurate calculation of the feature information of the graphics (such as the shape features and position features of the graphics). Then, based on the custom description structure, the relationship linking and sorting of the graphic elements are carried out. This includes processing the hanging of zero-length lines and near-zero-length lines, associating overly short lines with other nearby lines; arranging the priorities of the precise connection and non-precise connection of the head and tail connection segments to ensure the accuracy of the connection relationship; checking whether the lines with both head and tail segments are the same line to avoid incorrect judgment; and processing the incorrect entry situations of the mutually midlines and the lines to which the midlines belong. Finally, based on the sorted results, the graphic elements are classified from multiple perspectives such as the type of the graphics, the aperture size, and the graphic type attributes, so as to obtain the type of the graphics and provide a classification basis for the subsequent search of the grid copper foil.
[0139] The grid copper foil search module 530 is used to search for grid copper foil according to the graphic type;
[0140] Specifically, after obtaining the graphic type, the grid copper foil search module 530 starts to work. It filters the copper foil contour lines according to the midline base number according to the graphic type, defines the contour lines with a large midline base number as the initial contour lines, and such contour lines are more likely to be the key parts of the grid copper foil; marks the contour lines with a small midline base number as alternative contour lines, and they also have the possibility of becoming part of the grid copper foil. Then, this module processes the initial contour lines and alternative contour lines respectively. For the initial contour lines, the connection loop search will be carried out in a specific priority order, and after the search is completed, operations such as deduplication and sorting will be performed to ensure the accuracy and orderliness of the data; for the alternative contour lines, the connection loop search, deduplication, sorting and other operations will also be carried out, and the inner hole verification will be performed to judge whether it is an inner hole and further determine its relationship with the grid copper foil.
[0141] The recognition and verification module 540 is used to recognize and verify the search results.
[0142] Specifically, the recognition and verification module 540 receives the results of the grid copper skin search module and conducts recognition and verification. First, the qualified contour lines and their center lines obtained after the previous processing are extracted, and then these center lines are statistically classified. By counting the number of center lines of each type, the center line types with the number of single-type center lines less than 10% of the total number of center lines are deleted because these small amounts of center line types may be interference factors. Then, the type of the grid copper skin is determined according to the types of the remaining center lines, the line groups that meet specific conditions are determined as grid line groups, and the suspected grid line groups with doubts are further verified and data calculations are performed to determine whether they really belong to the grid copper skin. Finally, based on the determined grid line groups, in the case of the same aperture and the same network, the remaining center lines that have a strong connection relationship with the grid line groups but were not previously determined as the grid component lines are searched and incorporated into the grid line groups to make the recognition result more complete.
[0143] Please refer to Figure 3 , Figure 3 FIG. is a schematic block diagram of a computer device provided by an embodiment of the present application. The computer device 600 may be a terminal or a server. Among them, the terminal may be an electronic device with a communication function such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of multiple servers.
[0144] See Figure 3 As shown in FIG., the computer device 600 includes a processor 620, a memory, and a network interface 650 connected through a system bus 610. Among them, the memory may include a non-volatile storage medium 630 and an internal memory 640.
[0145] The non-volatile storage medium 630 may store an operating system 631 and a computer program 632. The computer program 632 includes program instructions. When the program instructions are executed, the processor 320 may be caused to execute a method for recognizing grid copper skin in a PCB graphic file.
[0146] The processor 620 is used to provide computing and control capabilities to support the operation of the entire computer device 600.
[0147] The internal memory 640 provides an environment for the operation of the computer program 632 in the non-volatile storage medium 630. When the computer program 632 is executed by the processor 620, the processor 620 may be caused to execute a method for recognizing grid copper skin in a PCB graphic file.
[0148] The network interface 650 is used for network communication with other devices. Those skilled in the art can understand, Figure 3The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device 600 to which the solution of this application is applied. Specifically, the computer device 600 may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0149] It should be understood that in the embodiments of this application, the processor 620 may be a central processing unit (CPU), and this processor 320 may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or this processor may also be any conventional processor, etc.
[0150] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. This computer program includes program instructions, and the computer program can be stored in a storage medium, and this storage medium is a computer-readable storage medium. These program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0151] Therefore, this application also provides a storage medium. This storage medium may be a computer-readable storage medium. This storage medium stores a computer program, where the computer program includes program instructions. When these program instructions are executed by a processor, the processor is caused to execute the following steps:
[0152] S100. Obtain a PCB graphic file and select graphic elements from the graphic file;
[0153] S200. Preprocess the graphic elements to obtain a graphic type;
[0154] S300. Search for grid copper cladding according to the graphic type;
[0155] S400. Identify and verify the search results.
[0156] The storage medium may be a variety of computer-readable storage media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disc, etc., which can store program codes.
[0157] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0158] The non-company software tools or components appearing in the embodiments of this application are only introduced by way of example and do not represent actual use.
[0159] In several embodiments provided by this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0160] The steps in the method embodiments of this application can be adjusted, combined, and deleted according to actual needs. The units in the device embodiments of this application can be combined, divided, and deleted according to actual needs. In addition, the functional units in each embodiment of this application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0161] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of this application.
[0162] The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A method for identifying mesh copper in a PCB graphic file, characterized in that: The following steps are involved: Obtaining a PCB graphic file and selecting graphic elements from the graphic file; Preprocessing the graphic element to obtain a graphic type; Searching for mesh copper skin according to the graphic type; The search results are identified and verified.
2. The method for identifying mesh copper in a PCB graphic file according to claim 1, characterized in that: The step of preprocessing the graphic element to obtain the graphic type comprises: Converting the description structure of the graphic element into a custom description structure and recording the graphic information; According to the custom description structure, the relationship between the graphic elements is linked and sorted; The graphic elements are classified based on the combing results to obtain the graphic types.
3. The method for identifying mesh copper in a PCB graphic file according to claim 1, characterized in that: The step of searching for a mesh copper sheet according to the graphic type comprises: According to the graphic type, the copper contour lines are screened according to the centerline cardinality, and the contour lines with large centerline cardinality are defined as initial contour lines, and the contour lines with small centerline cardinality are marked as candidate contour lines; Post-processing operations are performed on the initial contour line and the alternative contour line respectively.
4. The method for identifying mesh copper in a PCB graphic file according to claim 3, characterized in that: The step of post-processing the initial contour line comprises: Search the initial contour line for connected rings according to the defined priority order; After the search is completed, the initial contour lines are deduplicated one by one; Perform a ring verification operation on the initial contour line after deduplication to determine whether the initial contour line is a copper contour line; If not, a no flag is set for the corresponding initial contour line; If so, the corresponding initial contour lines are sorted according to their IDs and marked as qualified contour lines.
5. The method for identifying mesh copper in a PCB graphic file according to claim 4, characterized in that: The step of post-processing the candidate contour line comprises: Searching for connection loops for candidate starting contours according to a defined priority order; After the search is completed, the candidate contour lines are deduplicated one by one; Perform a ring verification operation on the candidate contour line after deduplication is completed to determine whether the candidate contour line is a copper contour line; If not, a no flag is set for the corresponding candidate contour line; If so, the corresponding candidate contour lines are sorted according to their IDs; Based on the operation results, the inner holes of the candidate contour lines are verified from small to large.
6. The method for identifying mesh copper in a PCB graphic file according to claim 5, characterized in that: The step of performing inner hole verification on the candidate contour line based on the operation result comprises: Get all the middle lines of the candidate contours and select the middle lines that are completely contained in the connection rings; Obtain the midpoint of the midline completely contained in the connecting ring, and use the ray method to determine whether it is inside or outside the connecting ring; If half of them are inside, it means it is not an inner hole, and a no flag is set for the corresponding candidate contour line; If half of them are outside, it indicates an inner hole, and the loading conditions at both ends of the center line of the corresponding alternative contour line are determined; If one end of the center line is not mounted on the corresponding contour line or inner hole line, or it is mounted on other center lines, it is determined that the center line does not meet the requirements of the center line, and a negative flag is set for the corresponding candidate contour line; If both ends of the center line are normally mounted on the corresponding contour line or inner hole line, the center line meets the grid copper skin judgment requirements, and the corresponding alternative contour line is marked as a qualified contour line.
7. The method for identifying mesh copper in a PCB graphic file according to claim 6, characterized in that: The step of identifying and verifying the search results includes: Extract qualified contour lines and their midlines, and statistically classify the midlines to which the qualified contour lines belong; Based on the classification results, the types of center lines whose number of single types of center lines is less than 10% of the total number of center lines are deleted; Determine the type of mesh copper skin according to the type of remaining center lines, and filter mesh line groups and suspected mesh line groups; Verifying and calculating data on the suspected grid line group to screen the grid line group; Based on the grid line group, under the same aperture and the same network conditions, the remaining center lines that have a strong connection with the grid line group and are not determined as grid component lines are searched and determined as the grid line group.
8. A device for identifying grid copper in a PCB graphic file, characterized in that: The device comprises: A graphic element selection module is used to obtain a PCB graphic file and select graphic elements from the graphic file; A graphic preprocessing module, used for preprocessing the graphic element to obtain a graphic type; A mesh copper skin search module, used to search for mesh copper skin according to the graphic type; The identification and verification module is used to identify and verify the search results.
9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method according to any one of claims 1 to 7 can be implemented.