SMT steel mesh trepanning design intelligent detection method and related equipment
By geometrically standardizing the graphic files of PCB stencil openings and pad matching detection and implementing a three-stage detection process, the problem of balancing detection accuracy and efficiency in existing technologies has been solved. This enables automated detection in high-density, complex PCB production, improving both detection accuracy and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN MENGRUI ELECTRONICS CO LTD
- Filing Date
- 2026-03-09
- Publication Date
- 2026-05-05
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In existing SMT stencil opening design inspection technologies, it is difficult to balance inspection accuracy and efficiency, which cannot meet the automated inspection needs of high-density and complex PCB production. Manual inspection is inefficient and has a high error rate, while automatic inspection systems are insufficient in handling complex geometric shapes, have a high false alarm rate, and have a simple inspection process.
The intelligent detection method includes reading the PCB stencil opening and pad matching detection graphic file, performing geometric standardization processing, converting complex polylines and arcs into bounding boxes, constructing a drilling data spatial index, executing a three-stage detection process, and combining adaptive tolerance filtering of the neighborhood difference results of the positioning markers to generate a layered graphic report.
It significantly improves the accuracy and efficiency of stencil aperture and pad matching detection, enhances the verifiability of detection results, meets the automated detection needs of high-density and complex PCB production, and balances detection accuracy with ease of operation.
Smart Images

Figure CN121985487A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of printed circuit board manufacturing technology, and in particular to an intelligent detection method and related equipment for SMT stencil aperture design. Background Technology
[0002] In the printed circuit board (PCB) manufacturing process, the accuracy of the surface mount technology (SMT) directly determines the quality and reliability of the PCB product. Precise matching between the stencil aperture design and the PCB pads is a core prerequisite for ensuring the stability of the SMT process. As electronic devices become increasingly miniaturized and denser, PCB circuit layouts are becoming more complex, and the dimensional accuracy requirements for pads and apertures are constantly increasing, placing higher demands on the inspection efficiency and accuracy of the stencil aperture design.
[0003] In existing technologies, the detection methods for matching stencil openings and pads are mainly divided into two categories: one is based on manual visual comparison, where operators manually check the design drawings against the stencil opening data. This method is not only extremely inefficient and cannot meet the detection needs of large-scale mass production, but it is also prone to errors due to human fatigue, inconsistent judgment standards, and other factors, resulting in a large number of misjudgments. The other category uses simple automatic detection systems or basic algorithms for preliminary screening. These systems lack the ability to standardize the processing of complex geometric shapes (such as polylines and arcs) and do not effectively filter special structures such as through-hole pads. At the same time, the detection process is simple and cannot achieve layered detection from coarse to fine, resulting in a high false alarm rate and insufficient detection accuracy, making it difficult to accurately identify the matching differences between stencil openings and pads.
[0004] In summary, existing SMT stencil opening design inspection technologies suffer from a trade-off between inspection accuracy and efficiency, failing to meet the automated inspection needs of high-density, complex PCB production, and urgently requiring improvement. Summary of the Invention
[0005] The purpose of this application is to provide an intelligent detection method and related equipment for SMT stencil opening design.
[0006] The purpose of this application is to provide an intelligent detection method for SMT stencil aperture design, including: Read the relevant graphic files of PCB stencil opening and pad matching detection, and extract the relevant entity data of pads, openings, drill holes and positioning marks in the target layer; The extracted entity data is geometrically standardized to convert complex polylines and arcs into bounding box representations, generating intermediate graphic files and rereading the intermediate graphic files as a unified geometric expression. Construct a spatial index for the drilling data, identify the entity data corresponding to the through hole pads based on a preset hole diameter threshold, and exclude the entity data corresponding to the through hole pads from the subsequent matching and detection process. A three-stage inspection process is executed, which sequentially performs center inclusion detection, bounding box intersection detection, and center distance tolerance detection, and outputs the difference results of mismatched pads for openings and the difference results of mismatched openings for pads. The difference results of the location marker neighborhood are filtered by a combination of center nearest neighbor matching and adaptive tolerance. Generate a layered graphical report, which includes a hole mismatch pad difference layer, a pad mismatch hole difference layer, a through-hole pad corresponding data layer, a positioning mark neighborhood difference layer, and a bounding box layer, and configure a default display strategy to adapt to review requirements.
[0007] By adopting the above technical solution, the target entity data in the relevant graphic files of PCB stencil opening and pad matching detection are extracted and geometrically standardized. Complex polylines and arcs are uniformly converted into bounding boxes to achieve a unified geometric expression. At the same time, the entity data corresponding to through-hole pads is excluded in advance by drilling data spatial index and preset hole diameter threshold. Then, the matching difference is accurately identified through a three-stage detection process of center inclusion, bounding box intersection, and center distance tolerance. Combined with the center nearest neighbor matching of the positioning mark neighborhood and adaptive tolerance linkage filtering, false alarms are further reduced. Finally, a graphic report with clear layers and adapted to the verification requirements is generated. The above technical solutions work together to effectively solve the problems of insufficient handling of complex geometric shapes, high false alarm rate and single detection process in existing detection technologies. It significantly improves the accuracy and efficiency of stencil opening and pad matching detection, while enhancing the verifiability of the detection results. It can meet the automated detection needs of high-density and complex PCB production scenarios, and takes into account both detection accuracy and ease of operation in practical applications.
[0008] In one possible implementation of this application, the step of geometrically normalizing the extracted entity data includes: Calculate the precise extreme boundary values of complex polylines and circular arcs; A bounding box layer is generated based on the precise extreme value boundary; The intermediate graphics file containing the bounding box layer is persistently stored. The persistent intermediate graphics file is reread to achieve a unified geometric representation of each entity.
[0009] By adopting the above technical solution, the problem of inconsistent representation of complex geometric shapes is effectively solved, and a unified geometric expression of each entity is realized. This provides a standardized comparison benchmark for the subsequent three-stage detection process, avoids detection deviations caused by differences in geometric shapes such as polylines and arcs, and the persistent intermediate graphic files can serve as intermediate traceability basis in the detection process, facilitating subsequent verification and problem localization. This further improves the traceability and reliability of the detection process and lays a solid foundation for improving the overall detection accuracy.
[0010] In one possible implementation of this application, the steps of constructing a spatial index for the drilling data, identifying the entity data corresponding to the through-hole pads based on a preset hole diameter threshold, and excluding the entity data corresponding to the through-hole pads from the subsequent matching and detection process include: Configure an adjustable preset aperture threshold; The constructed borehole data spatial index can be used to quickly locate the entity data corresponding to all boreholes. Determine whether the diameter of each drill hole is greater than or equal to the preset diameter threshold, and determine the pad data corresponding to the drill hole that meets the condition as the entity data corresponding to the through hole pad; The physical data corresponding to the determined through-hole pads are marked as non-detection objects and excluded from the subsequent hole and pad matching detection process.
[0011] By adopting the above technical solution, efficient and accurate identification and pre-filtering of physical data corresponding to through-hole pads are achieved. This can flexibly adapt to the identification needs of different PCB products for through-hole pads. At the same time, the construction of the drilling data spatial index greatly improves the positioning efficiency of drilling physical data, avoids interference of invalid data with subsequent inspection processes, significantly reduces the sources of false alarms in the inspection process, reduces the computational load of subsequent inspection processes, and improves the overall inspection efficiency. Meanwhile, accurate pre-filtering also provides a guarantee for the subsequent three-stage inspection process to focus on valid inspection objects, further contributing to the improvement of overall inspection accuracy.
[0012] In one possible implementation of this application, the step of performing a three-stage detection process, sequentially performing center inclusion detection, bounding box intersection detection, and center distance tolerance detection, and outputting the difference results of mismatched pads and mismatched holes includes: When performing center inclusion detection, determine whether the center of the opening is located within the bounding box of the corresponding pad and record the preliminary matching result; When performing bounding box intersection detection, for the aforementioned entity data that did not match in the center containment detection, it is determined whether there is an intersection relationship between the aperture bounding box and the pad bounding box, and the intersecting entity data is corrected to a matching state; When performing center distance tolerance detection, for the entity data that still does not match in the aforementioned bounding box intersection detection, the actual distance between the hole center and the pad center is calculated, and the entity data whose actual distance is less than or equal to the preset tolerance is corrected to a matching state. The preset tolerance has a default value of 0.10mm and supports configuration or adaptive adjustment. When accelerating the process, small entity data and large entity data are divided according to the maximum boundary length or area of the entity, and the nearest neighbor fast matching algorithm based on the spatial distribution of the entity is used to optimize the matching efficiency.
[0013] By adopting the above technical solution, a layered detection from coarse to fine is achieved, effectively solving the problem of difficulty in balancing recall and accuracy caused by the single detection process in the past: center inclusion detection quickly completes the initial matching and screening, bounding box intersection detection performs secondary correction on unmatched entities, and center distance tolerance detection achieves accurate judgment with a configurable or adaptively adjustable preset tolerance (default 0.10mm). The three-level process is progressive, which avoids missed detections and reduces false detections. At the same time, the entity grouping and nearest neighbor fast matching algorithm greatly optimizes the matching efficiency, reduces the computational load of large-scale entity detection, and improves the overall detection throughput. The flexible configuration of the preset tolerance can be adapted to PCB detection scenarios with different accuracy requirements, making the detection method both universal and accurate. It can efficiently and accurately identify the difference between unmatched pads and unmatched openings, fully meeting the automated detection needs of high-density and complex PCB production.
[0014] In one possible implementation of this application, the step of performing linked filtering on the difference results of the location marker neighborhood using a central nearest neighbor matching combined with adaptive tolerance includes: Ignore character case and identify the entity data corresponding to the positioning markers in the relevant graphic files; Determine the neighborhood range corresponding to each of the positioning markers; Extract the difference results within the neighborhood range; The tolerance coefficient is dynamically adjusted based on the type of positioning marker. The difference results within the neighborhood are filtered by combining the central nearest neighbor matching with the adjusted tolerance coefficient.
[0015] By adopting the above technical solution, the entity data corresponding to the positioning markers in relevant graphic files is identified by ignoring character case, ensuring the comprehensiveness and compatibility of positioning marker recognition and avoiding omissions caused by differences in the capitalization of marker characters. Furthermore, by determining the neighborhood range corresponding to each positioning marker and extracting the difference results within that range, the target objects to be filtered are accurately located. Combined with a flexible adaptation mechanism that dynamically adjusts the tolerance coefficient according to the positioning marker type, the difference results within the neighborhood range are finally filtered through a combination of center nearest neighbor matching and the adjusted tolerance coefficient. This effectively solves the problem of false alarms due to neighborhood differences in positioning markers in existing technologies, significantly reduces invalid false alarms during the detection process, and improves the accuracy of the difference results. At the same time, the dynamically adjusted tolerance coefficient can adapt to the characteristic requirements of different types of positioning markers, and the case-ignoring recognition method enhances the versatility of the method, avoiding filtering failures caused by differences in the representation form of positioning markers. This makes the detection results more consistent with actual application scenarios, reduces the amount of invalid work in the subsequent review process, and further improves the practicality and reliability of the detection process.
[0016] In one possible implementation of this application, the method further includes: Listen to a specified directory or task queue to obtain graphic files related to the matching detection of PCB stencil openings and pads; By using file fingerprints and configuration fingerprints, it is determined whether the obtained graphic file related to the PCB stencil opening and pad matching detection is an incremental file. The file fingerprint consists of a content hash and a modification time, and the configuration fingerprint consists of a tolerance parameter, a threshold parameter, and a layer mapping signature. For the PCB stencil aperture and pad matching detection related graphic files that are determined to be incremental files, detection tasks are allocated through a concurrent pool, and current limiting control is performed to avoid resource overload. For detection tasks that fail, an exponential backoff strategy is used for retrying. After all the aforementioned detection tasks are completed, corresponding detection results are generated, and the detection results are summarized and archived.
[0017] By adopting the above technical solution, this method automatically acquires graphic files related to the matching and detection of PCB stencil openings and pads by monitoring a specified directory or task queue. It accurately identifies incremental files using file fingerprints composed of content hashes and modification times, and configuration fingerprints composed of tolerance parameters, threshold parameters, and layer mapping signatures. Incremental files are assigned detection tasks through a concurrent pool and rate limiting is implemented. Failed detection tasks are retried using an exponential backoff strategy. Finally, the detection results are aggregated and archived. This technical solution achieves fully automated batch scheduling for SMT stencil opening design detection, effectively solving the problems of existing technologies lacking batch automatic detection scheduling capabilities and being unable to achieve unattended operation and stable throughput. The incremental file judgment mechanism avoids resource waste caused by repeated detection, significantly improving the utilization rate of detection resources. The combination of concurrent pool and rate limiting control ensures detection efficiency while preventing system resource overload, ensuring a stable and reliable detection process. The exponential backoff retry strategy reduces the task failure rate and improves the integrity of batch detection. The aggregation and archiving of detection results facilitates subsequent traceability and management. The overall solution significantly improves the detection throughput in large-scale PCB production scenarios, achieving stable unattended detection and fully adapting to the high-efficiency detection needs of industrial mass production.
[0018] In one possible implementation of this application, the method further includes: Set "file path + modification time" as the cache key; For the first read of the PCB stencil opening and pad matching detection related graphic file, the target layer entity data is extracted in one traversal, and the extracted entity data is associated with and stored with the cache key; When examining the same file, determine whether the file's modification time has changed; If the modification time remains unchanged, directly retrieve the cached entity data; If the modification time changes, causing the original cache to become invalid, the entity data extraction and caching process will be re-executed.
[0019] By adopting the above technical solution, and setting "file path + modification time" as the cache key, the system extracts and caches the target layer entity data in a single pass for the first read of the PCB stencil aperture and pad matching detection graphic file. When detecting the same file, the system determines whether to call the cache or re-extract based on the modification time. This effectively solves the problems of high I / O cost and low detection efficiency caused by repeated parsing of graphic files in the existing technology. The single pass extraction mode significantly reduces the time spent on entity data acquisition, and cache reuse avoids repeated parsing of unmodified files, significantly reducing system resource consumption. The cache validity judgment mechanism based on modification time ensures that the cached data called is consistent with the actual state of the file, and avoids interference from old data with the detection results through the automatic cache invalidation mechanism, thus ensuring the accuracy of the detection data. The overall solution further improves the running efficiency of the detection process without affecting the detection accuracy. In particular, it can significantly shorten the overall detection time in batch detection scenarios, and enhance the throughput and practicality of automated detection in large-scale PCB production.
[0020] The second objective of this application is to provide an intelligent detection system for SMT stencil aperture design, the system comprising: The parsing and preprocessing module is used to read the graphic files related to the matching detection of PCB stencil openings and pads, and extract the entity data related to pads, openings, drill holes and positioning marks in the target layer; Geometric normalization module: used to perform geometric normalization processing on the extracted entity data, convert complex polylines and arcs into bounding box representations, generate intermediate graphic files, and reread the intermediate graphic files as a unified geometric expression; Data filtering module: used to construct a spatial index of drilling data, identify the entity data corresponding to the through hole pad based on a preset hole diameter threshold, and exclude the entity data corresponding to the through hole pad from the subsequent matching and detection process; Multi-stage inspection module: Used to execute a three-stage inspection process, sequentially performing center inclusion detection, bounding box intersection detection, and center distance tolerance detection, and outputting the difference results of mismatched pads for openings and the difference results of mismatched openings for pads; Location marker linkage filtering module: used to perform linkage filtering on the difference results of the location marker neighborhood using a combination of center nearest neighbor matching and adaptive tolerance; Report generation module: used to generate a layered graphical report, which includes a hole mismatch pad difference layer, a pad mismatch hole difference layer, a through hole pad corresponding data layer, a positioning mark neighborhood difference layer and a bounding box layer, and is configured with a default display strategy to adapt to review requirements.
[0021] By adopting the above technical solution, the target entity data in the relevant graphic files of PCB stencil opening and pad matching detection are extracted and geometrically standardized. Complex polylines and arcs are uniformly converted into bounding boxes to achieve a unified geometric expression. At the same time, the entity data corresponding to through-hole pads is excluded in advance by drilling data spatial index and preset hole diameter threshold. Then, the matching difference is accurately identified through a three-stage detection process of center inclusion, bounding box intersection, and center distance tolerance. Combined with the center nearest neighbor matching of the positioning mark neighborhood and adaptive tolerance linkage filtering, false alarms are further reduced. Finally, a graphic report with clear layers and adapted to the verification requirements is generated. The above technical solutions work together to effectively solve the problems of insufficient handling of complex geometric shapes, high false alarm rate and single detection process in existing detection technologies. It significantly improves the accuracy and efficiency of stencil opening and pad matching detection, while enhancing the verifiability of the detection results. It can meet the automated detection needs of high-density and complex PCB production scenarios, and takes into account both detection accuracy and ease of operation in practical applications.
[0022] The third objective of this application is to provide an intelligent inspection device for SMT stencil aperture design, the device comprising: The system includes a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed to perform the aforementioned intelligent detection method for SMT stencil opening design.
[0023] The fourth objective of this application is to provide a storage medium.
[0024] The fourth objective of this application is achieved through the following technical solution: A storage medium storing a computer program capable of being loaded by a processor and executing the above-described intelligent detection method for SMT stencil aperture design.
[0025] In summary, this application includes at least one of the following beneficial technical effects: 1. By extracting and geometrically standardizing the target entity data in the graphic files related to PCB stencil aperture and pad matching detection, complex polylines and arcs are uniformly converted into bounding boxes to achieve a unified geometric expression. Simultaneously, entity data corresponding to through-hole pads is pre-excluded using drill data spatial indexing and preset hole diameter thresholds. A three-stage detection process—center inclusion, bounding box intersection, and center distance tolerance—accurately identifies matching differences. Furthermore, center nearest neighbor matching of the positioning marker neighborhood and adaptive tolerance-based filtering further reduce false alarms. Finally, a clearly layered graphic report suitable for verification is generated. The synergistic effect of these technologies effectively solves the problems of insufficient handling of complex geometric shapes, high false alarm rates, and simplistic detection processes in existing detection technologies. It significantly improves the accuracy and efficiency of stencil aperture and pad matching detection, while enhancing the verifiability of the detection results. This meets the automated detection needs of high-density, complex PCB production scenarios, balancing detection accuracy with ease of operation in practical applications.
[0026] 2. This technical solution automatically acquires graphic files related to PCB stencil aperture and pad matching detection by monitoring a specified directory or task queue. It accurately identifies incremental files using file fingerprints (composed of content hash and modification time) and configuration fingerprints (composed of tolerance parameters, threshold parameters, and layer mapping signatures). Incremental files are assigned detection tasks through a concurrent pool and rate limiting is implemented. Failed detection tasks are retried using an exponential backoff strategy. Finally, the detection results are aggregated and archived. This solution achieves fully automated batch scheduling for SMT stencil aperture design detection, effectively solving the problems of existing technologies lacking batch automatic detection scheduling capabilities and failing to achieve unattended operation and stable throughput. The incremental file judgment mechanism avoids resource waste caused by repeated detection, significantly improving detection resource utilization. The combination of concurrent pool and rate limiting control ensures detection efficiency while preventing system resource overload, ensuring a stable and reliable detection process. The exponential backoff retry strategy reduces task failure rate and improves the integrity of batch detection. The aggregation and archiving of detection results facilitates subsequent traceability and management. The overall solution significantly improves detection throughput in large-scale PCB production scenarios, achieving stable unattended detection and fully adapting to the high-efficiency detection needs of industrial batch production.
[0027] 3. By setting "file path + modification time" as the cache key, the system employs a single traversal to extract and cache the target layer entity data for the first read of PCB stencil aperture and pad matching detection graphic files. When detecting the same file, the modification time determines whether to call the cache or re-extract the data. This effectively solves the problems of high I / O costs and low detection efficiency caused by repeated parsing of graphic files in existing technologies. The single-traversal extraction mode significantly reduces the time spent acquiring entity data, and cache reuse avoids repeated parsing of unmodified files, significantly reducing system resource consumption. The cache validity judgment mechanism based on modification time ensures that the cached data called is consistent with the actual file state, and the automatic cache invalidation mechanism avoids interference from old data with the detection results, ensuring the accuracy of the detection data. The overall solution further improves the operating efficiency of the detection process without affecting the detection accuracy, especially in batch detection scenarios, which can significantly shorten the overall detection time and enhance the throughput and practicality of automated detection in large-scale PCB production. Attached Figure Description
[0028] Figure 1 This is a flowchart illustrating the intelligent detection method for SMT stencil opening design provided in this application embodiment; Figure 2 This is a virtual structural diagram of the intelligent detection system for SMT stencil opening design provided in this application embodiment. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0030] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0031] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.
[0032] This application provides an intelligent detection method for SMT stencil aperture design, referring to... Figure 1 The main process of the method is described as follows: S1: Read the relevant graphic files of PCB stencil opening and pad matching detection, and extract the relevant entity data of pads, openings, drill holes and positioning marks in the target layer; The computer first acquires graphic files (such as DXF format files, a commonly used graphic data storage format in PCB design, containing key data such as geometric information and layer attributes) for PCB stencil aperture and pad matching detection. These graphic files contain geometric information and attribute data related to pads, apertures, drill holes, and positioning marks during the PCB design process. The computer reads the file content through a graphic file parsing algorithm, filters out target layers based on preset target layer identifiers (such as the layer number corresponding to the pad, the exclusive layer name of the aperture, etc.), and then extracts the position coordinates and size parameters of the pads, the shape parameters and layout information of the apertures, the diameter and coordinate data of the drill holes, and the identification information and spatial position of the positioning marks from the target layers. Irrelevant layers and redundant data are excluded to provide accurate basic data support for subsequent detection processes.
[0033] S2: Perform geometric standardization processing on the extracted entity data, convert complex polylines and arcs into bounding box representations, generate intermediate graphic files, and reread the intermediate graphic files as a unified geometric expression; In this process, since some pads and openings in the extracted entity data may be presented in the form of complex polylines or arcs, the different geometric data will lead to a lack of a unified benchmark for subsequent matching and detection. The computer first performs vertex traversal on the complex polylines and calculates their minimum and maximum coordinate values in the X and Y axes. For the arcs, it calculates the extreme boundary covered by the arc in the planar space based on its center, radius, and central angle. Then, based on these precise extreme boundaries, it generates a rectangular bounding box that can completely wrap the corresponding entity, and converts the geometry of all entities into a unified bounding box representation. Subsequently, the computer generates an intermediate graphic file containing the bounding box data of all entities. By rereading this intermediate graphic file, all subsequent detection steps are carried out based on a unified bounding box geometric expression, eliminating the detection bias caused by different original geometric shapes.
[0034] S3: Construct a spatial index for the drilling data, identify the entity data corresponding to the through-hole pads based on a preset hole diameter threshold, and exclude the entity data corresponding to the through-hole pads from the subsequent matching and detection process. The computer employs a spatial indexing algorithm (such as grid-based or R-tree-based indexing) to build a spatial index on the extracted drill hole entity data. This index allows for rapid location of drill hole data within any region, significantly improving drill hole search efficiency. Simultaneously, the computer loads a preset hole diameter threshold (pre-set based on PCB product design specifications and testing requirements). It then traverses all drill hole entities using the spatial index, obtaining the hole diameter parameters for each hole and comparing them with the preset threshold. Drill holes with a diameter greater than or equal to the threshold are identified as through-holes, and the corresponding pad data is then associated with these holes, confirming them as through-hole pad entity data. Finally, the computer marks these through-hole pad entity data as non-detection objects, preventing further processing in subsequent hole-pad matching detection processes and avoiding interference from through-hole pad-related data with the detection results.
[0035] S4: Execute the three-stage detection process, sequentially perform center inclusion detection, bounding box intersection detection, and center distance tolerance detection, and output the difference results of mismatched pads and mismatched holes; In the center inclusion detection phase, the computer first calculates the center coordinates of each opening (based on the extreme coordinates of the opening bounding box, i.e., the midpoint coordinate in the X direction is (maximum opening X + minimum opening X) / 2, and the midpoint coordinate in the Y direction is (maximum opening Y + minimum opening Y) / 2). Simultaneously, it acquires the extreme coordinates of each pad bounding box and determines whether the opening center coordinates fall within the extreme ranges of the X-axis (minimum pad X ≤ center opening X ≤ maximum pad X) and Y-axis (minimum pad Y ≤ center opening Y ≤ maximum pad Y) of the pad bounding box. If so, it is considered a preliminary match, and the matching result is recorded. In the bounding box intersection detection phase, for the unmatched openings and pads in the center inclusion detection, the computer determines whether their bounding boxes have a spatial intersection relationship, i.e., the maximum X coordinate of the opening bounding box is greater than the minimum X coordinate of the pad bounding box. If the following conditions are met, the unmatched entities in the group are corrected to a matched state: First, the minimum X-coordinate of the aperture bounding box is less than the maximum X-coordinate of the pad bounding box; second, the maximum Y-coordinate of the aperture bounding box is greater than the minimum Y-coordinate of the pad bounding box. Third, in the center distance tolerance detection stage, for entities that still do not match after bounding box intersection detection, the computer calculates the Euclidean distance between the aperture center and the pad center and compares this actual distance with a preset tolerance. If the actual distance is less than or equal to the preset tolerance, it is corrected to a matched state. After these three stages of detection, the computer categorizes aperture data that still lacks a matching object into "aperture-unmatched pad difference results" and pad data that still lacks a matching object into "pad-unmatched aperture difference results," and outputs both types of difference results.
[0036] S5: The difference results of the location marker neighborhood are filtered by a combination of center nearest neighbor matching and adaptive tolerance. The computer first identifies the entity data corresponding to the positioning markers from the entity data, determines the center coordinates of each positioning marker and the preset neighborhood range (such as a circular area with the center of the positioning marker as the center and a fixed length as the radius, or a rectangular area with a fixed length and width). Next, the computer extracts the difference data from the difference results output by S4, where the spatial location falls within this neighborhood range. Subsequently, the computer dynamically adjusts the tolerance coefficient according to the type of positioning marker (such as the main marker used for global positioning and the auxiliary marker used for local positioning), thereby determining the adaptive tolerance range within this neighborhood range. Finally, the computer calculates the distance between the center of the difference results within the neighborhood and the center of the positioning marker, and determines whether this distance is within the adaptive tolerance range. If it is within the range, it is determined to be a false difference caused by normal deviation near the positioning marker, and it is filtered out, retaining only the true difference results that are not within the neighborhood range or exceed the adaptive tolerance.
[0037] S6: Generate a layered graphic report, which includes a hole mismatch pad difference layer, a pad mismatch hole difference layer, a through hole pad corresponding data layer, a positioning mark neighborhood difference layer, and a bounding box layer, and configure a default display strategy to adapt to the review requirements.
[0038] Specifically, the computer stores the two types of difference results output by S4, the entity data corresponding to the via pads identified by S3, the location marker neighborhood difference results retained after filtering by S5, and all entity bounding box data generated by S2 into different layers of the layered graphic report, forming the via mismatched pad difference layer, the pad mismatched via difference layer, the via pad corresponding data layer, the location marker neighborhood difference layer, and the bounding box layer. At the same time, the computer is configured with a default display strategy, that is, by default only the core difference layers such as the via mismatched pad difference layer, the pad mismatched via difference layer, and the location marker neighborhood difference layer are displayed, while the via pad corresponding data layer and the bounding box layer are hidden by default. This allows reviewers to directly focus on key difference information without having to manually filter irrelevant layers, significantly improving review efficiency. All layers are also retained in the report and can be retrieved and viewed at any time according to review needs.
[0039] Specifically, in some possible embodiments, the step of geometrically normalizing the extracted entity data includes: Calculate the precise extreme boundary values of complex polylines and circular arcs; A bounding box layer is generated based on the precise extreme value boundary; The intermediate graphics file containing the bounding box layer is persistently stored. The persistent intermediate graphics file is reread to achieve a unified geometric representation of each entity.
[0040] In the geometric standardization process for the extracted entity data, the computer first calculates the minimum and maximum coordinate values in the X and Y axes for pads and holes that exist in the form of complex polylines by traversing the coordinates of all vertices of the polyline, thus forming the precise extreme value boundaries of the polyline. For entities that exist in the form of arcs, the computer calculates the extreme value boundaries of the arc in the planar space based on the center coordinates, radius parameters, and central angle range of the arc through geometric calculations, ensuring that the extreme value boundaries can completely and accurately wrap the corresponding arcs. Then, based on the precise extreme value boundaries of each entity, a system is generated that corresponds to the entity's... A rectangular bounding box with fully adapted geometry converts all entities with different original geometries (polylines, arcs, etc.) into a unified bounding box representation, forming a bounding box layer containing bounding box data for all entities. Subsequently, the computer persistently stores the intermediate graphic file containing this bounding box layer in a standard graphic file format (such as DXF, Gerber, etc.) to ensure the stability and traceability of the bounding box data. Finally, by rereading the persistent intermediate graphic file, all subsequent matching and detection steps are based on the unified bounding box geometric representation, completely eliminating the problem of inconsistent detection benchmarks caused by different original geometries.
[0041] In the precise extreme value boundary calculation stage, for complex polylines, straight segments and curved segments (such as Bézier curve segments) can be further distinguished and processed separately: For polylines composed of straight segments, the X / Y axis extreme values are directly solved by traversing all vertex coordinates; for polylines containing curved segments, key points on the curved segments are sampled with an adaptive step size (the sampling step size is dynamically adjusted according to the curvature of the curve, and the larger the curvature, the smaller the step size), and the extreme points are calculated by combining the derivative information of the curve, so as to avoid the extreme value boundary deviation caused by insufficient sampling of the curved segments; for arcs, in addition to calculating the basic extreme values based on the center, radius and central angle, the tangent direction of the arc is additionally introduced for verification. When the tangent direction of the arc is parallel to the coordinate axis, the endpoint of the arc is directly used as the extreme point. When the tangent direction is inclined, the projection extreme values of the arc on the X / Y axis are solved by geometric calculation to ensure that the extreme value boundary completely fits the actual coverage of the arc. During the bounding box layer generation process, a unique mapping identifier between the bounding box and the original entity is established simultaneously (e.g., using a triple identifier of "entity ID - bounding box coordinates - original geometric parameter hash"). The type attributes (pads, holes, positioning marks, etc.) and precision level labels of the original entity are embedded in the bounding box layer to provide basic data support for the differentiated detection of different entity types. When persistently storing intermediate graphics files, a block-based storage architecture is adopted. The bounding box layer data is divided into multiple data blocks according to the spatial distribution area of the entities (e.g., quadrant division of a PCB board). Each data block is configured with an independent index header (containing the coordinate range covered by the data block, the number of entities, and the checksum). Incremental storage is also supported (updating only the bounding box data blocks corresponding to entities whose geometric parameters have changed), reducing storage redundancy and IO overhead. When rereading intermediate graphic files, a data consistency verification mechanism is added: the integrity of the data block is verified by the check code in the index header, and the accuracy of the bounding box generation is verified by the reverse calculation of the bounding box coordinates and the extreme boundary of the original entity (based on the original geometric parameters retrieved by the mapping identifier). If the data block is found to be damaged or the bounding box deviation exceeds the preset threshold, the geometric standardization process of the entity is automatically triggered for recalculation to ensure the reliability and accuracy of the unified geometric expression.
[0042] Specifically, in some possible embodiments, the steps of constructing a spatial index for the drilling data, identifying the entity data corresponding to the through-hole pads based on a preset hole diameter threshold, and excluding the entity data corresponding to the through-hole pads from the subsequent matching and detection process include: Configure an adjustable preset aperture threshold; The constructed borehole data spatial index can be used to quickly locate the entity data corresponding to all boreholes. Determine whether the diameter of each drill hole is greater than or equal to the preset diameter threshold, and determine the pad data corresponding to the drill hole that meets the condition as the entity data corresponding to the through hole pad; The physical data corresponding to the determined through-hole pads are marked as non-detection objects and excluded from the subsequent hole and pad matching detection process.
[0043] In the process of constructing a spatial index for the drill data and filtering out entity data corresponding to through-hole pads, the computer first provides an adjustable preset hole diameter threshold parameter input through the system configuration interface or preset configuration file. Users can flexibly set this threshold according to the design specifications of different PCB products (such as the minimum hole diameter standard for through-hole pads) and SMT assembly process requirements. Subsequently, an R-tree indexing or mesh indexing algorithm is used to construct a spatial index for the extracted drill entity data (including hole diameter, coordinate position, associated pad ID, etc.). Utilizing the spatial query characteristics of this index, all entity data corresponding to drill holes are quickly traversed and located, avoiding the need for full data scanning. The process is inefficient. Next, the computer reads the borehole diameter parameters for each borehole one by one and compares them with a preset borehole diameter threshold. If the borehole diameter is greater than or equal to the threshold, the corresponding pad entity data (including pad coordinates, dimensions, layer information, etc.) is retrieved by matching the pad ID associated with the borehole data. This set of pad data is then identified as the entity data corresponding to the through-hole pad. Finally, the computer adds a "non-detection object" mark to the entity data corresponding to the identified through-hole pads. In subsequent borehole and pad matching detection processes, the data with this mark is automatically skipped through the data filtering logic and is not included in the matching calculation, difference judgment, and other stages, thus achieving accurate exclusion of through-hole pad data.
[0044] In the preset aperture threshold configuration stage, in addition to supporting manual adjustment, a new adaptive threshold recommendation function has been added. The computer analyzes the board parameters (such as board thickness and number of layers), pad distribution density, and total number of drill holes in the input PCB graphic file, and combines this with the built-in process database (which stores through-hole aperture standards for different industries and PCB types) to automatically recommend a suitable aperture threshold range. Users can also fine-tune the values based on the recommendations, balancing flexibility and professionalism. Regarding spatial index construction, a hierarchical index architecture is adopted, dividing the data into partitions according to the coordinate quadrants or functional areas (such as power and signal areas) of the PCB board. Each partition independently builds a sub-space index, and a dynamic update mechanism is added to the index. When drill data is added or modified, only the corresponding partition's sub-index is updated, without rebuilding the global index, significantly improving index maintenance efficiency. In the through-hole pad determination stage, multi-dimensional verification logic is added, combining the aperture threshold comparison with the external data, and additionally considering the drill hole and the corresponding pad. The system comprehensively judges the data based on the following factors: pad position offset (to determine if the offset between the drill center and the pad center is within a preset range), pad shape characteristics (through-hole pads are usually circular or annular, excluding misjudgments of irregularly shaped pads), and the metallization properties of the drill (to determine whether it is a metallized through-hole ...
[0045] Specifically, in some possible embodiments, the step of performing the three-stage detection process, sequentially performing center inclusion detection, bounding box intersection detection, and center distance tolerance detection, and outputting the difference results of mismatched pads and mismatched holes includes: When performing center inclusion detection, determine whether the center of the opening is located within the bounding box of the corresponding pad and record the preliminary matching result; When performing bounding box intersection detection, for the aforementioned entity data that did not match in the center containment detection, it is determined whether there is an intersection relationship between the aperture bounding box and the pad bounding box, and the intersecting entity data is corrected to a matching state; When performing center distance tolerance detection, for the entity data that still does not match in the aforementioned bounding box intersection detection, the actual distance between the hole center and the pad center is calculated, and the entity data whose actual distance is less than or equal to the preset tolerance is corrected to a matching state. The preset tolerance has a default value of 0.10mm and supports configuration or adaptive adjustment. When accelerating the process, small entity data and large entity data are divided according to the maximum boundary length or area of the entity, and the nearest neighbor fast matching algorithm based on the spatial distribution of the entity is used to optimize the matching efficiency.
[0046] In the three-stage detection process, the first step is center inclusion detection: Based on the minimum / maximum X-axis and Y-axis coordinates of the aperture bounding box, the computer calculates the center coordinates of each aperture using the formulas (Xmax+Xmin) / 2 and (Ymax+Ymin) / 2. Simultaneously, it obtains the extreme value ranges of the X-axis and Y-axis for each pad bounding box and checks whether the center coordinates of each aperture simultaneously fall within the X-axis (pad Xmin ≤ aperture center X ≤ pad Xmax) and Y-axis (pad Ymin ≤ aperture center Y ≤ pad Ymax) of the corresponding pad bounding box. Within the extreme value range, if the conditions are met, it is considered a preliminary match, and the association and matching status of the group of openings and pads are recorded simultaneously. Next, boundary box intersection detection is performed: for the center containing the unmatched opening and pad entity data detected, the computer uses geometric logic to determine whether their boundary boxes intersect spatially, i.e., opening boundary box Xmax > pad boundary box Xmin, opening boundary box Xmin < pad boundary box Xmax, and opening boundary box Ymax > pad boundary box Ymin, opening boundary box Ymin < pad boundary box Ymax. If the intersection condition is met, the group of unmatched openings is considered a preliminary match. The entity's status is corrected to match; then, center distance tolerance detection is performed: for entities that still do not match after boundary box intersection detection, the actual straight-line distance between the aperture center and the pad center is calculated using the Euclidean distance formula. The default tolerance in this step is set to 0.10mm, but users can manually adjust it through the system configuration interface, or the computer can adaptively adjust it based on PCB board precision and surface mount technology requirements. If the actual distance is less than or equal to the default tolerance, the corresponding entity is corrected to match; finally, accelerated processing is performed: the computer pre-sets a threshold for the maximum boundary length of the entity (e.g., 5mm) or area... A threshold (e.g., 20mm²) is used to classify entities with a maximum boundary length ≤ the threshold or an area ≤ the threshold as small entity data, and the rest as large entity data. A quadtree index is used to construct a spatial distribution model for small entity data, and a KD-tree index is used to optimize query efficiency for large entity data. A nearest neighbor fast matching algorithm based on the spatial distribution of entities is used to ensure that each entity is only compared with candidate entities within its spatial proximity range, avoiding full entity traversal and greatly optimizing matching efficiency. Finally, the results of the difference between unmatched openings and unmatched pads after three-stage detection are output.
[0047] In the center detection stage, a solid type weighting factor is introduced. Different weights are assigned to different types of pads (e.g., BGA pads, QFP pads) and openings based on their process priority. During matching, higher-weighted solids are checked first. A center offset correction mechanism is also added. Using PCB board positioning mark deviation data, the center coordinates of the openings and pads are globally offset to avoid matching failures caused by board-level positioning errors. In the boundary box intersection detection stage, a new intersection overlap rate threshold configuration is added. Besides determining whether there is an intersection, the overlap area ratio (overlap area / pad boundary box area) of the opening boundary box and the pad boundary box is further calculated. Matching is only corrected when the overlap rate is ≥ a preset threshold (e.g., 30%), avoiding mismatches caused by minor edge overlaps. In the center distance tolerance detection stage, breaking through fixed tolerance or single adaptive logic, a dual-dimensional dynamic tolerance mechanism of "solid size + process parameters" is adopted: small solids (e.g., 0402 package pads) are reduced by 50% of the basic tolerance, and large solids are reduced by 50% of the basic tolerance. Entities (such as power device pads) are adapted to a tolerance of 1.2-1.5 times the basic tolerance. Simultaneously, the tolerance range is adjusted in real-time based on the PCB material's thermal expansion coefficient and the positioning accuracy parameters of the placement equipment, ensuring the tolerance adapts to actual production scenarios. In the accelerated processing stage, a three-level optimization approach of "spatial partitioning + hierarchical indexing + parallel computing" is adopted: First, spatial partitioning is performed according to the functional areas of the PCB (such as the core area and interface area), with each partition independently indexed. Then, entities within each partition are hierarchically indexed using "small entity-quadtree" and "large entity-KD tree" methods. Finally, a concurrent pool distributes the detection tasks of different partitions to multiple threads for parallel execution, while a load balancing mechanism is introduced to dynamically adjust the thread resource ratio based on the number of entities in each partition. Furthermore, a new matching conflict resolution mechanism is added. When multiple openings simultaneously match the same pad, they are sorted by center distance from smallest to largest, retaining only the closest matching relationship, and the remaining openings are judged as unmatched differences, avoiding detection chaos caused by one-to-many matching.
[0048] Specifically, in some possible embodiments, the step of performing linked filtering on the difference results of the location marker neighborhood using a combination of center nearest neighbor matching and adaptive tolerance includes: Ignore character case and identify the entity data corresponding to the positioning markers in the relevant graphic files; Determine the neighborhood range corresponding to each of the positioning markers; Extract the difference results within the neighborhood range; The tolerance coefficient is dynamically adjusted based on the type of positioning marker. The difference results within the neighborhood are filtered by combining the central nearest neighbor matching with the adjusted tolerance coefficient.
[0049] In the process of filtering differences in the neighborhood of a location marker, the computer first uses a character standardization method to convert all the identification information (such as name and number) of the location markers in the graphic file to lowercase (or uppercase) format. Then, it compares this information with a pre-set location marker feature library (containing standard identifiers of common location markers, such as "FIDUCIAL", "MARK", and "location point"), ignoring case differences to achieve accurate identification of the entity data corresponding to the location marker. Subsequently, the neighborhood range is determined based on the bounding box size of the location marker. Using the center of the location marker's bounding box as a reference point, the length and width of the rectangular neighborhood are set according to a pre-set ratio (e.g., 1.2-1.5 times the maximum side length of the location marker's bounding box), or the radius of the circular neighborhood is set to 1.5 times the radius of the location marker's circumcircle. This ensures that the neighborhood range covers the normal deviation area that may occur around the location marker without excessively expanding it to include irrelevant differences. Then… By comparing spatial coordinates, the difference data in the difference results output by S4 that fall completely within the neighborhood range are extracted to form a subset of the location marker neighborhood differences. Then, the tolerance coefficient is dynamically adjusted according to the identified location marker type (such as the main marker for global positioning and the auxiliary marker for local positioning). For example, the tolerance coefficient of the main location marker is set to 1.0-1.2, and the tolerance coefficient of the auxiliary location marker is set to 0.8-1.0. Combined with the basic tolerance (such as 0.10mm), the adaptive tolerance range is calculated. Finally, the center nearest neighbor matching is performed to calculate the Euclidean distance between the center coordinates of each difference result in the neighborhood difference subset and the center coordinates of the corresponding location marker. The actual distance is compared with the adjusted adaptive tolerance. If the actual distance is less than or equal to the adaptive tolerance, the difference is determined to be a normal deviation around the location marker and is filtered out. Only the real difference results that exceed the neighborhood range or whose actual distance is greater than the adaptive tolerance are retained.
[0050] In the location marker recognition stage, a new marker morphology feature verification mechanism is added to overcome the limitations of single-character comparison. This mechanism combines the geometric shape (e.g., circle, cross, rectangle), size range (e.g., circular markers with a diameter of 0.8-1.2mm), edge smoothness, and other morphological parameters of the location marker with the character identifier for dual verification. Even if the marker characters in the graphic file are incomplete, deformed, or have spelling errors, accurate recognition can still be achieved through morphological features, solving the problem of missed or false judgments in pure character recognition. Regarding the determination of the neighborhood range, a dual-factor dynamic adjustment strategy of "marker size + spatial density" is adopted. The baseline ratio of the neighborhood range adaptively scales with the size of the location marker itself (e.g., the ratio is set to 1.5 times for small-sized markers and 1.2 times for large-sized markers). Simultaneously, it combines the distribution density of entities around the location marker (calculated by the number of entities per unit area). Higher density results in a smaller neighborhood range, avoiding the misfiltering of irrelevant differences due to entity crowding. In the tolerance coefficient adjustment stage, a dual-dimensional adaptation logic of "marker accuracy level + difference type" is introduced. A basic tolerance coefficient is pre-assigned for location markers of different accuracy levels (e.g., high-precision FIDUCIAL markers and ordinary reference markers). The system then fine-tunes the results based on the type of discrepancy (mismatched pad / mismatched pad). For example, the tolerance coefficient for mismatched pad discrepancies is 0.1-0.2 higher than that for mismatched hole discrepancies, adapting to the actual deviation characteristics of different discrepancy types. Regarding filtering logic optimization, a new discrepancy rationality verification step is added to determine whether the discrepancy result within the neighborhood is an auxiliary entity of the positioning mark (such as a protective ring or auxiliary baseline around the positioning mark). Invalid discrepancies are directly filtered by comparing them with the feature library of auxiliary entities (which stores the geometric parameters of common auxiliary entities). A multi-marker linkage filtering mechanism is also added. When the neighborhoods of multiple location markers overlap, the minimum adaptive tolerance value corresponding to each marker is taken as the filtering threshold for the overlapping area to avoid duplicate filtering or missed filtering. In addition, a new custom configuration interface for filtering parameters has been added, which allows users to manually adjust parameters such as neighborhood ratio, tolerance coefficient adjustment range, and auxiliary entity feature library to adapt to the detection needs of special PCB products (such as high-density micro-package PCBs and irregularly shaped boards). At the same time, detailed logs of each filtering operation are recorded (including location marker information, tolerance parameters, difference coordinates, and filtering basis) to provide complete data support for subsequent review and traceability.
[0051] Specifically, in some possible embodiments, the method further includes: Listen to a specified directory or task queue to obtain graphic files related to the matching detection of PCB stencil openings and pads; By using file fingerprints and configuration fingerprints, it is determined whether the obtained graphic file related to the PCB stencil opening and pad matching detection is an incremental file. The file fingerprint consists of a content hash and a modification time, and the configuration fingerprint consists of a tolerance parameter, a threshold parameter, and a layer mapping signature. For the PCB stencil aperture and pad matching detection related graphic files that are determined to be incremental files, detection tasks are allocated through a concurrent pool, and current limiting control is performed to avoid resource overload. For detection tasks that fail, an exponential backoff strategy is used for retrying. After all the aforementioned detection tasks are completed, corresponding detection results are generated, and the detection results are summarized and archived.
[0052] The computer first uses a file system monitoring component (such as Java's Watch Service or Python's watchdog) or a message queue client (such as RabbitMQ or Kafka) to monitor a specified local directory, network shared folder, or task queue in real time, capturing newly added or modified PCB stencil aperture and pad matching detection related graphic files (such as Gerber, DXF, and ODB++ formats). Next, it calculates file fingerprints and configuration fingerprints to determine incremental files: the acquired files are hashed using the SHA-256 algorithm, and combined with the file's last modification time (accurate to the second) to form a file fingerprint. Simultaneously, it extracts the tolerance parameters, threshold parameters (such as aperture threshold and center distance tolerance), and layer mapping relationships (target layer and detection layer) required for detection. The system calculates an MD5 hash for each layer mapping relationship as the layer mapping signature. This hash, along with the first two parameters, forms the configuration fingerprint. The current fingerprint is compared with historically stored fingerprints; if the file fingerprint or configuration fingerprint is inconsistent, it is determined to be an incremental file. For the incremental file, the computer initializes a pre-defined concurrent pool (configurable core thread count and maximum thread count, e.g., 8-16 core threads, 32 maximum threads). Each incremental file is encapsulated as an independent detection task and submitted to the concurrent pool. The pool allocates tasks to idle threads for execution according to the task submission order, while simultaneously implementing a rate limiting controller. The system monitors CPU utilization, memory usage, and disk I / O load in real time. When any of these metrics exceeds a preset threshold (e.g., CPU utilization 80%, memory usage 75%), new task allocation is paused or the task submission rate is reduced to avoid overloading system resources. For failed detection tasks due to network fluctuations, abnormal file reads, or momentary resource shortages, an exponential backoff strategy is used for retrying: the initial retry interval is set to 1 second, and the interval doubles after each retry (1s, 2s, 4s, 8s…), with a maximum number of retries set (e.g., 5 times). If the maximum number of retries is exceeded, the task is marked as failed and the failure is recorded. Reasons (such as file corruption, invalid parameters); After all testing tasks (successful or ultimately failed) are completed, the computer generates a test report (supporting HTML, PDF, JSON and other formats) containing details of the difference results, testing time, task status, and reasons for failure (if any). The test report, original graphic files, fingerprint information and test parameter configurations are archived and stored in a hierarchical directory structure of "test date-PCB model-file name". At the same time, an archive index (associated file fingerprint, PCB model, test result summary, archive path) is established to facilitate quick subsequent query and traceability.
[0053] In the file acquisition stage, it breaks through the limitations of single-source monitoring and supports multi-source heterogeneous monitoring (simultaneously compatible with local directories, network shared drives, cloud storage buckets, and multiple types of message queues). A new task priority marking function has been added, allowing users to set high / medium / low priorities for detection tasks via file naming prefixes and queue tags. The concurrency pool adopts a "priority queue + fair scheduling" mechanism, prioritizing thread resources for high-priority tasks, adapting to mixed scenario requirements such as emergency trial production board testing and batch regular board testing. In the incremental judgment stage, new file version fingerprinting (recording the number of file modifications and version number) and fine-grained recognition of configuration changes have been added, dividing configuration parameters into critical parameters (such as aperture thresholds and tolerance standards) and non-critical parameters (such as those displayed in reports). The system implements a new approach (format), where incremental detection is triggered only by changes in critical parameters, while historical detection results are reused for changes in non-critical parameters. It also introduces a fingerprint cache expiration mechanism to periodically clean up historical fingerprints that have not been reused for a preset period (e.g., 90 days), optimizing storage resource usage and resolving the issue of potential misjudgments of incremental changes due to minor configuration changes in the original solution. Regarding concurrency and rate limiting optimization, it employs intelligent dynamic thread pool technology, automatically adjusting the number of core threads and the maximum number of threads based on real-time system load (CPU, memory, I / O) and task type (large file detection, small file batch detection). Large file detection tasks are allocated to independent thread groups to avoid resource contention. The rate limiting control adds a "pre-allocated resource verification" mechanism, checking whether remaining system resources are full before task allocation. If the detection requirements are met, the task will be placed in a waiting queue and a resource release reminder will be triggered if they are not. Regarding the retry strategy, it breaks through the single exponential backoff logic and adds a failure reason-based retry mechanism: failure types are divided into transient failures (network jitter, temporary resource occupation), recoverable failures (file locking, temporary insufficient permissions), and unrecoverable failures (file corruption, invalid parameters). Transient failures are retried using conventional exponential backoff; recoverable failures are retried with a delayed retry (waiting for resource release signals); and unrecoverable failures are not retried and an alarm is pushed immediately (SMS, WeChat notification). User-defined retry rules (number of retries and maximum interval for specific failure types) are also supported. In the summary and archiving stage, a correlation analysis of detection results has been added. The system automatically analyzes historical variation trends and high-frequency variation types for the same PCB model (e.g., mismatched pads in holes are a common issue with certain PCB models), generates quality analysis reports to assist in process optimization, and supports cross-system synchronization of archived data (automatically synchronized to enterprise-level data platforms and SMT production execution systems, MES). It also adds a task interruption recovery function; after a system interruption, restarting allows for accurate recovery of incomplete testing tasks through fingerprint comparison and task status recording, avoiding duplicate testing. Furthermore, it adds archived data lifecycle management, supporting different archiving durations based on file type (raw files, reports, logs), automatically triggering cleanup or cold storage upon expiration, and providing archived data encryption to ensure the security of testing data.
[0054] Specifically, in some possible embodiments, the method further includes: Set "file path + modification time" as the cache key; For the first read of the PCB stencil opening and pad matching detection related graphic file, the target layer entity data is extracted in one traversal, and the extracted entity data is associated with and stored with the cache key; When examining the same file, determine whether the file's modification time has changed; If the modification time remains unchanged, directly retrieve the cached entity data; If the modification time changes, causing the original cache to become invalid, the entity data extraction and caching process will be re-executed.
[0055] The computer first sets "file path + modification time" as the unique cache key. The file path is the absolute path of the graphic file in the storage system (local or network path), and the modification time is accurate to the millisecond level (to avoid misjudgments due to second-level precision in file modification with the same name). For the first read of the PCB stencil aperture and pad matching detection graphic file, the computer uses a one-pass parsing algorithm. While parsing the file structure, it simultaneously extracts the relevant entity data of pads, apertures, drill holes, and positioning marks according to the preset target layer identifiers (such as layer name and number), eliminating the need for multiple file traversals. After extraction, the entity data (including coordinates, dimensions, attributes, etc.) is associated with the corresponding cache key, employing a dual storage mode of "memory cache + disk persistent cache" (memory cache is used for...). The system uses a fast cache (with disk cache for reuse after system restart) for storage. When detecting the same file, the computer first obtains the file's current modification time and compares it precisely with the modification time recorded in the cache key to determine if the file has been changed. If the comparison results are consistent (modification time unchanged), the associated entity data is retrieved directly from the memory cache or disk cache, skipping the repeated file parsing and data extraction steps. If the comparison results are inconsistent (modification time changed), the original cache invalidation mechanism is automatically triggered, clearing the memory cache and disk cache data corresponding to the cache key, re-executing the process of traversing and extracting entity data, and associating the newly extracted entity data with the updated cache key (file path + new modification time) for storage, ensuring that the cache data is consistent with the actual file content.
[0056] In the cache key design, the limitations of the binary combination of "path + modification time" are overcome by adding an auxiliary verification factor of "file size + simplified content hash". The file size is accurate to the byte, and the simplified content hash uses the CRC32 algorithm (balancing efficiency and lightweightness), forming a four-dimensional cache key of "file path + modification time + file size + CRC32 hash". This completely avoids cache mis-calls caused by abnormal scenarios such as modification time tampering or file content changes without updated modification time, and solves the problem of insufficient cache accuracy that may exist in the original solution. In the entity data extraction stage, the single-pass algorithm is optimized, and an "on-demand extraction + parallel parsing" mechanism is introduced, based on subsequent... The detection process prioritizes extracting core entity data (such as solder pads and vias) in a single pass, while non-core data (such as auxiliary markers) is parsed asynchronously in parallel. For extremely large files (such as image files exceeding 100MB), a fragmented traversal strategy is employed, splitting the data into blocks based on file size. Multiple threads then traverse each data block in parallel and aggregate the entity data, significantly improving the extraction efficiency for large files. Regarding cache management, a "tiered caching + intelligent eviction" strategy is adopted, dividing the cache into hot data cache (file data frequently accessed within the last 24 hours) and cold data cache. Hot data cache resides in memory, while cold data cache is stored on disk. An LRU (Least Recently Used) cache is also implemented. The Least Recently Used (LRU) eviction algorithm automatically evicts the least recently used cold data cache when the memory cache reaches a preset threshold (e.g., 30% of memory usage), balancing cache hit rate and system resource consumption. A new cache data consistency verification mechanism is added. Each time cached data is accessed, the total number of entity data entries and the hash value of key fields (e.g., the combined hash of the center coordinates of all pads) are checked to verify that the cached data has not been corrupted or tampered with. If the verification fails, a re-extraction process is automatically triggered. In terms of scenario adaptation, custom configuration of cache parameters (e.g., cache expiration time, memory cache threshold, fragment size, etc.) is supported to adapt to different hardware configurations and detection scenarios. A new multi-version caching function has been added, retaining the entity data corresponding to the most recent 3-5 modifications of a file, allowing users to trace back historical version data for comparison and analysis. For distributed detection scenarios, a new cache synchronization mechanism has been added, using a distributed cache middleware (such as Redis) to achieve cache data sharing and consistency maintenance among multiple nodes, avoiding multiple nodes repeatedly extracting the same file and improving detection efficiency in a distributed environment. In addition, a new cache preloading function has been added, allowing users to specify the graphic files corresponding to frequently detected PCB models through configuration files. The system automatically extracts and caches the entity data of these files when it starts up, further shortening the response time of subsequent detections.
[0057] Another embodiment of this application provides an intelligent detection system for SMT stencil opening design, wherein, see reference Figure 2 An intelligent detection system for SMT stencil opening design, comprising: Parsing and preprocessing module 100: used to read graphic files related to the matching detection of PCB stencil openings and pads, and extract entity data related to pads, openings, drill holes and positioning marks in the target layer; Geometric standardization module 200: used to perform geometric standardization processing on the extracted entity data, convert complex polylines and arcs into bounding box representations, generate intermediate graphic files, and reread the intermediate graphic files as a unified geometric expression; Data filtering module 300: used to construct a spatial index of drilling data, identify the entity data corresponding to the through hole pad based on a preset hole diameter threshold, and exclude the entity data corresponding to the through hole pad from the subsequent matching and detection process; Multi-stage inspection module 400: Used to execute a three-stage inspection process, sequentially performing center inclusion detection, bounding box intersection detection, and center distance tolerance detection, and outputting the difference results of mismatched pads and mismatched holes; Location marker linkage filtering module 500: Used to perform linkage filtering on the difference results of the location marker neighborhood using a combination of center nearest neighbor matching and adaptive tolerance; Report generation module 600: Used to generate a layered graphical report, which includes a hole mismatch pad difference layer, a pad mismatch hole difference layer, a through hole pad corresponding data layer, a positioning mark neighborhood difference layer and a bounding box layer, and is configured with a default display strategy to adapt to the review requirements.
[0058] The intelligent detection system for SMT stencil opening design provided in this embodiment can achieve the steps of the aforementioned embodiments due to the functions of each module and the logical connections between them. Therefore, it can achieve the same technical effect as the aforementioned embodiments. For the principle analysis, please refer to the relevant description of the steps of the aforementioned intelligent detection method for SMT stencil opening design, which will not be repeated here.
[0059] This application embodiment also provides an intelligent detection device for SMT stencil opening design, including a memory and a processor. The memory stores a computer program that can be loaded by the processor and executed by the above-described intelligent detection method for SMT stencil opening design.
[0060] This application embodiment also provides a storage medium storing a computer program that can be loaded by a processor and executed by the above-described intelligent detection method for SMT stencil opening design.
[0061] The storage medium provided in this embodiment can achieve the same technical effect as the aforementioned embodiments because the computer program therein, after being loaded and run on the processor, will implement the various steps of the aforementioned embodiments. For the principle analysis, please refer to the relevant description of the aforementioned method steps, which will not be repeated here.
[0062] The storage medium includes, for example, various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0063] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0064] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0065] Furthermore, features defined by the terms "first" and "second" may explicitly or implicitly include at least one of those features. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., and unless otherwise explicitly specified, is used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features.
[0066] Therefore, any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.
[0067] The embodiments described in this specific implementation are preferred embodiments of this application and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. A smart detection method for SMT stencil opening design, characterized in that, include: Read the relevant graphic files of PCB stencil opening and pad matching detection, and extract the relevant entity data of pads, openings, drill holes and positioning marks in the target layer; The extracted entity data is geometrically standardized to convert complex polylines and arcs into bounding box representations, generating intermediate graphic files and rereading the intermediate graphic files as a unified geometric expression. Construct a spatial index for the drilling data, identify the entity data corresponding to the through hole pads based on a preset hole diameter threshold, and exclude the entity data corresponding to the through hole pads from the subsequent matching and detection process. A three-stage inspection process is executed, which sequentially performs center inclusion detection, bounding box intersection detection, and center distance tolerance detection, and outputs the difference results of mismatched pads for openings and the difference results of mismatched openings for pads. The difference results of the location marker neighborhood are filtered by a combination of center nearest neighbor matching and adaptive tolerance. Generate a layered graphical report, which includes a hole mismatch pad difference layer, a pad mismatch hole difference layer, a through-hole pad corresponding data layer, a positioning mark neighborhood difference layer, and a bounding box layer, and configure a default display strategy to adapt to review requirements.
2. The intelligent detection method for SMT stencil opening design according to claim 1, characterized in that, The step of performing geometric normalization on the extracted entity data includes: Calculate the precise extreme boundary values of complex polylines and circular arcs; A bounding box layer is generated based on the precise extreme value boundary; The intermediate graphics file containing the bounding box layer is persistently stored. The persistent intermediate graphics file is reread to achieve a unified geometric representation of each entity.
3. The intelligent detection method for SMT stencil opening design according to claim 1, characterized in that, The steps of constructing a spatial index for the drilling data, identifying the entity data corresponding to the through-hole pads based on a preset hole diameter threshold, and excluding the entity data corresponding to the through-hole pads from the subsequent matching and detection process include: Configure an adjustable preset aperture threshold; The constructed borehole data spatial index can be used to quickly locate the entity data corresponding to all boreholes. Determine whether the diameter of each drill hole is greater than or equal to the preset diameter threshold, and determine the pad data corresponding to the drill hole that meets the condition as the entity data corresponding to the through hole pad; The physical data corresponding to the determined through-hole pads are marked as non-detection objects and excluded from the subsequent hole and pad matching detection process.
4. The intelligent detection method for SMT stencil opening design according to claim 1, characterized in that, The steps of executing the three-stage detection process, which sequentially performs center inclusion detection, bounding box intersection detection, and center distance tolerance detection, and outputs the difference results of mismatched pads and mismatched holes, include: When performing center inclusion detection, determine whether the center of the opening is located within the bounding box of the corresponding pad and record the preliminary matching result; When performing bounding box intersection detection, for the aforementioned entity data that did not match in the center containment detection, it is determined whether there is an intersection relationship between the aperture bounding box and the pad bounding box, and the intersecting entity data is corrected to a matching state; When performing center distance tolerance detection, for the entity data that still does not match in the aforementioned bounding box intersection detection, the actual distance between the hole center and the pad center is calculated, and the entity data whose actual distance is less than or equal to the preset tolerance is corrected to a matching state. The preset tolerance has a default value of 0.10mm and supports configuration or adaptive adjustment. When accelerating the process, small entity data and large entity data are divided according to the maximum boundary length or area of the entity, and the nearest neighbor fast matching algorithm based on the spatial distribution of the entity is used to optimize the matching efficiency.
5. The intelligent detection method for SMT stencil opening design according to claim 1, characterized in that, The step of performing linked filtering on the difference results of the location marker neighborhood using a combination of central nearest neighbor matching and adaptive tolerance includes: Ignore character case and identify the entity data corresponding to the positioning markers in the relevant graphic files; Determine the neighborhood range corresponding to each of the positioning markers; Extract the difference results within the neighborhood range; The tolerance coefficient is dynamically adjusted based on the type of positioning marker. The difference results within the neighborhood are filtered by combining the central nearest neighbor matching with the adjusted tolerance coefficient.
6. The intelligent detection method for SMT stencil opening design according to claim 1, characterized in that, The method further includes: Listen to a specified directory or task queue to obtain graphic files related to the matching detection of PCB stencil openings and pads; By using file fingerprints and configuration fingerprints, it is determined whether the obtained graphic file related to the PCB stencil opening and pad matching detection is an incremental file. The file fingerprint consists of a content hash and a modification time, and the configuration fingerprint consists of a tolerance parameter, a threshold parameter, and a layer mapping signature. For the PCB stencil aperture and pad matching detection related graphic files that are determined to be incremental files, detection tasks are allocated through a concurrent pool, and current limiting control is performed to avoid resource overload. For detection tasks that fail, an exponential backoff strategy is used for retrying. After all the aforementioned detection tasks are completed, corresponding detection results are generated, and the detection results are summarized and archived.
7. The intelligent detection method for SMT stencil opening design according to claim 1, characterized in that, The method further includes: Set "file path + modification time" as the cache key; For the first read of the PCB stencil opening and pad matching detection related graphic file, the target layer entity data is extracted in one traversal, and the extracted entity data is associated with and stored with the cache key; When examining the same file, determine whether the file's modification time has changed; If the modification time remains unchanged, directly retrieve the cached entity data; If the modification time changes, causing the original cache to become invalid, the entity data extraction and caching process will be re-executed.
8. An intelligent detection system for SMT stencil opening design, characterized in that, include: The parsing and preprocessing module is used to read the graphic files related to the matching detection of PCB stencil openings and pads, and extract the entity data related to pads, openings, drill holes and positioning marks in the target layer; Geometric normalization module: used to perform geometric normalization processing on the extracted entity data, convert complex polylines and arcs into bounding box representations, generate intermediate graphic files, and reread the intermediate graphic files as a unified geometric expression; Data filtering module: used to construct a spatial index of drilling data, identify the entity data corresponding to the through hole pad based on a preset hole diameter threshold, and exclude the entity data corresponding to the through hole pad from the subsequent matching and detection process; Multi-stage inspection module: Used to execute a three-stage inspection process, sequentially performing center inclusion detection, bounding box intersection detection, and center distance tolerance detection, and outputting the difference results of mismatched pads for openings and the difference results of mismatched openings for pads; Location marker linkage filtering module: used to perform linkage filtering on the difference results of the location marker neighborhood using a combination of center nearest neighbor matching and adaptive tolerance; Report generation module: used to generate a layered graphical report, which includes a hole mismatch pad difference layer, a pad mismatch hole difference layer, a through hole pad corresponding data layer, a positioning mark neighborhood difference layer and a bounding box layer, and is configured with a default display strategy to adapt to review requirements.
9. An intelligent inspection device for SMT stencil opening design, characterized in that, include: The memory and processor, wherein the memory stores a computer program that can be loaded by the processor and executed as described in any one of claims 1-7 for intelligent detection of SMT stencil opening design.
10. A storage medium, characterized in that, It stores a computer program that can be loaded by a processor and executed as described in any one of claims 1-7 for intelligent detection of SMT stencil opening design.