Printed circuit board production parameter acquisition method, optical detection device, electronic device, and storage medium

By acquiring production parameters and defect information of printed circuit boards through optical inspection equipment, and generating scores to adjust production parameters, the problems of defect detection and quality control in the production process of printed circuit boards are solved, thereby improving production quality and optimizing processes.

CN115272180BActive Publication Date: 2026-06-23OPTIMA OPTICAL TECH (SHEN ZHEN CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
OPTIMA OPTICAL TECH (SHEN ZHEN CO LTD
Filing Date
2022-06-21
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing technologies cannot effectively detect and adjust defects in the printed circuit board manufacturing process, resulting in unstable production quality and high consumption of human resources.

Method used

The production parameters and defect information in the inspection images of printed circuit boards are obtained by optical inspection equipment. A score is generated to characterize the production quality, and the production parameters are adjusted and the production process is optimized based on the score.

Benefits of technology

It improved the production quality of printed circuit boards, optimized the production process, reduced the consumption of human resources, and prevented production accidents caused by parameter errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115272180B_ABST
    Figure CN115272180B_ABST
Patent Text Reader

Abstract

The application discloses a printed circuit board production parameter acquisition method, an optical detection device, an electronic device and a storage medium. The printed circuit board production parameter acquisition method is applied to the optical detection device, and the method comprises the following steps: automatically acquiring current production parameters of a printed circuit board and defect information in a detection image of the printed circuit board; generating a score value based on the defect information; the score value is used for representing production quality, production conditions and whether the current production parameters are suitable for production; and the current production parameters of the optical detection device are adjusted based on the score value to obtain adjusted production parameters, and the printed circuit board is manufactured by using the adjusted production parameters. In the foregoing manner, the production parameters of the optical detection device for manufacturing the printed circuit board are adjusted by using the score value, so that the production quality of the printed circuit board can be improved, the production process of the printed circuit board can be optimized, the consumption of human resources can be reduced, and production accidents caused by parameter errors can be prevented.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method for obtaining printed circuit board production parameters, an optical inspection device, an electronic device, and a storage medium. Background Technology

[0002] Automated Optical Inspection (AOI) equipment is of great practical significance in the printed circuit board (PCB) industry. AOI refers to the process of using optical cameras to capture images of PCBs on the PCB production line and then using image processing, machine learning, and other methods to detect and locate defects on the PCBs.

[0003] PCB manufacturing inevitably involves numerous defects, and the quantity, type, and distribution of these defects directly impact PCB production quality. In actual production, PCBs produced can be manufactured under varying conditions, depending on their type, intended use, and customer preferences, resulting in PCBs with different defect profiles. Therefore, accurately understanding the defects on a PCB during production can significantly benefit subsequent production and repair processes. Summary of the Invention

[0004] To address the aforementioned problems in the existing technology, this application provides a method for obtaining printed circuit board production parameters, an optical inspection device, an electronic device, and a storage medium, which can improve the production quality of printed circuit boards, optimize the production process of printed circuit boards, and reduce the consumption of human resources.

[0005] One technical solution adopted in this application is: a method for obtaining production parameters of printed circuit boards, which is applied to an optical inspection device. The method includes: obtaining the current production parameters of the printed circuit board and defect information in the inspection image of the printed circuit board; generating a score value based on the defect information; using the score value to characterize the production quality of the printed circuit board; adjusting the current production parameters based on the score value to obtain adjusted production parameters; and using the adjusted production parameters to manufacture the printed circuit board.

[0006] Optionally, the current production parameters are adjusted based on the score value to obtain the adjusted production parameters, including: adjusting the current production parameters based on the score range and the type of printed circuit board to obtain the adjusted production parameters.

[0007] Optionally, the current production parameters are adjusted based on the score range and the type of printed circuit board, resulting in adjusted production parameters. This includes: determining the current production parameters of the printed circuit board based on its type and user settings; the current production parameters include at least one of the following: production area, production type, production precision, critical defect type, maximum number of defects, and production quantity; the current production parameters dynamically change within a preset range based on the error of the optical inspection equipment and the user's operational influence to form the actual production parameters used; and adjusting the actual production parameters based on the score range.

[0008] Optionally, generating a score based on defect information includes: determining the prediction type, prediction weight, and prediction quantity of defects corresponding to at least one defect region based on defect information; determining the predicted defect score of at least one defect region based on the prediction type; calculating the total defect score corresponding to the predicted defect score based on the prediction weight and prediction quantity; calculating the penalty total score corresponding to at least one defect region in response to the total defect score being greater than a preset threshold; and generating a score based on the difference between the total defect score and the penalty total score.

[0009] Optionally, calculating the total penalty score corresponding to at least one defective region includes: obtaining the penalty score of a single defect in at least one defective region; and determining the total penalty score corresponding to at least one defective region based on the predicted number of defects in at least one defective region and the penalty score.

[0010] Optionally, a score value is generated based on the defect information, including: extracting feature vectors of defects in the detection image based on the defect information; inputting the extracted feature vectors into a scoring model for score calculation, so as to output the score value of the printed circuit board applied to the current production parameters; wherein, the scoring model is trained based on the user-set scoring parameters and several training vectors.

[0011] Optionally, adjusting the current production parameters based on the score value to obtain adjusted production parameters includes: inputting the score value into a reinforcement learning network to predict and adjust the current production parameters to generate an adjustment strategy; wherein the adjustment strategy is used to improve the score value of the printed circuit board manufactured using the adjusted current production parameters; the reinforcement learning network is trained based on the user-set adjustment parameters and several training score values; the current production parameters are adjusted based on the adjustment strategy to obtain adjusted production parameters, and the adjusted production parameters are applied as the actual application production parameters.

[0012] To address the aforementioned issues, this application provides an optical inspection device, comprising: an information acquisition module for acquiring current production parameters of a printed circuit board and defect information in an inspection image of the printed circuit board; a scoring module for generating a score based on the defect information; the score being used to characterize the production quality of the printed circuit board; and a parameter adjustment module for adjusting the current production parameters based on the score to obtain adjusted production parameters; the adjusted production parameters are used to manufacture the printed circuit board.

[0013] To address the aforementioned issues, this application provides an electronic device comprising: a processor and a memory connected to the processor, wherein the memory stores program data, and the processor retrieves the program data stored in the memory to execute the printed circuit board production parameter acquisition method described above.

[0014] To address the aforementioned issues, embodiments of this application provide a computer-readable storage medium storing program data. When executed by a processor, the program data is used to implement the printed circuit board production parameter acquisition method described above.

[0015] Compared with existing technologies, the printed circuit board (PCB) production parameter acquisition method of this application is applied to optical inspection equipment. The method includes: automatically acquiring the current production parameters of the PCB and defect information in the PCB inspection image; generating a score value based on the defect information; the score value is used to characterize the PCB's production quality, production status, and whether the current production parameters are suitable for production; adjusting the current production parameters of the optical inspection equipment based on the score value to obtain adjusted production parameters; and manufacturing the PCB using the adjusted production parameters. Through the above implementation, the defect information corresponding to the PCB inspection image is used to generate a score value for the PCB, and the score value is then used to evaluate the PCB's production quality, thereby adjusting the production parameters of the optical inspection equipment for manufacturing the PCB. This improves the PCB's production quality, optimizes the PCB production process, reduces human resource consumption, and prevents production accidents caused by parameter errors.

[0016] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of the structure of an embodiment of the optical inspection equipment provided in this application;

[0019] Figure 2 This is a flowchart illustrating an embodiment of the printed circuit board production parameter acquisition method provided in this application;

[0020] Figure 3 This is a schematic diagram of a process for generating a score value in this application;

[0021] Figure 4 This is a flowchart illustrating an embodiment of calculating the total penalty score in this application;

[0022] Figure 5 This is a schematic diagram of another embodiment of the process for generating score values ​​in this application;

[0023] Figure 6 This is a flowchart illustrating an embodiment of calculating a score based on matching results in this application;

[0024] Figure 7 This is a schematic flowchart of an embodiment of adjusting production parameters based on score values ​​in this application;

[0025] Figure 8 This is a schematic diagram of another embodiment of the process for generating score values ​​in this application;

[0026] Figure 9 This is a schematic diagram of another embodiment of the process for generating score values ​​in this application;

[0027] Figure 10 This is a schematic diagram of the structure of an electronic device provided in this application;

[0028] Figure 11 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation

[0029] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It is understood that the specific embodiments described herein are only for explaining this application and not for limiting it. Furthermore, it should be noted that, for ease of description, only the parts related to this application are shown in the accompanying drawings, not all structures. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0030] The reference to "embodiment" in this application means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0031] The steps in the embodiments of this application are not necessarily processed in the order described. The steps can be rearranged, deleted, or added as needed. The step descriptions in the embodiments of this application are only optional combinations of sequences and do not represent all possible combinations of steps in the embodiments of this application. The order of steps in the embodiments should not be considered as a limitation of this application.

[0032] The term "and / or" in the embodiments of this application refers to any and all possible combinations including one or more of the associated listed items. It should also be noted that, when used in this specification, "including / comprising" specifies the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, and / or components and / or groups thereof.

[0033] The terms "first," "second," etc., used in this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0034] Furthermore, although the terms "first," "second," etc., are used repeatedly in this application to describe various operations (or various elements, or various applications, or various instructions, or various data), these operations (or elements, or applications, or instructions, or data) should not be limited by these terms. These terms are only used to distinguish one operation (or element, or application, or instruction, or data) from another operation (or element, or application, or instruction, or data). For example, a first defective region can be called a second defective region, and a second defective region can be called a first defective region; the only difference is the scope they encompass, but this does not depart from the scope of this application. Both the first defective region and the second defective region are collections of various defective regions, but they are not the same collection of defective regions.

[0035] See Figure 1 , Figure 1This is a schematic diagram of an embodiment of the optical inspection device provided in this application. The optical inspection device 10 includes: an information acquisition module 11, a scoring module 12, and a parameter adjustment module 13.

[0036] In one embodiment, the optical inspection device 10 is capable of Automated Optical Inspection (AOI), where AOI is a device that uses optical principles to detect common defects encountered in welding production. During AOI, the optical inspection device 10 automatically scans the PCB using a camera, acquires images, compares the tested solder joints with acceptable parameters in a database, processes the images, identifies defects on the PCB, and displays / marks these defects on a monitor or with automatic indicators for repair personnel to fix.

[0037] In one embodiment, the optical inspection device 10 is capable of running a computer program in user mode to perform one or more specific tasks (e.g., acquiring defect information in inspection images of printed circuit boards, adjusting production parameters of the optical inspection device). This program can interact with the user and has a visual user interface (UI). The optical inspection device 10 may also include two parts: a graphical user interface (GUI) and an engine, utilizing both to provide users with various application services in the form of a user interface—a digital customer system. Optionally, the optical inspection device 10 may be based on a Linux (GNU / Linux) system, a Mac (Macintosh) system, or a Microsoft system for program operation. The optical inspection device 10 may also be based on... platform, platform, platform or Platforms and other similar devices are used for program applications.

[0038] In one embodiment, a user can input corresponding code data or control parameters into the optical inspection device 10 via an input device to execute the special services of the optical inspection device 10 in user mode and display application services in the user interface. For example, if the user needs to acquire inspection images of the printed circuit board, or if the user needs to adjust the production parameters of the printed circuit board, the user operates through the input device and displays the results through the display device.

[0039] Specifically, the information acquisition module 11 is used to acquire the current production parameters of the printed circuit board and the defect information in the inspection image of the printed circuit board.

[0040] Optionally, the current production parameters of the printed circuit board are various indicator parameters for producing the current printed circuit board stored in the storage medium of the optical inspection equipment 10, including at least one of the following: the production type of the printed circuit board, the production area of ​​the circuit components, the production precision, the type of critical defect, the maximum number of defects, and the production quantity. The inspection image of the printed circuit board is the inspection image of the printed circuit board captured by the information acquisition module 11 through AOI. In this inspection image, defect information of each defect existing on the printed circuit board can be extracted. The defect information includes defect location, defect size, defect type, defect quantity, etc.

[0041] Optionally, the information acquisition module 11 may be equipped with an image acquisition device, such as a depth camera, a 3D camera, a monocular camera, or a binocular camera, which can generate corresponding control information based on user input to acquire the inspection image of the printed circuit board. Further, the defect information corresponding to the inspection image of the printed circuit board can be obtained by the information acquisition module 11 by comparing the inspection image of the printed circuit board with the design drawing of the printed circuit board. The design drawing of the printed circuit board can be obtained by importing the circuit diagram of the printed circuit board into the software, and then automatically generating the design drawing of the printed circuit board based on the circuit diagram.

[0042] Specifically, the scoring module 12 generates a score based on the defect information; the score is used to characterize the production quality of the printed circuit board.

[0043] Optionally, the scoring module 12 includes a score prediction model (e.g., a point-based convolutional neural network such as an attention-based RNN or LSTM, or a CNN network with a point-based convolutional layer and full connectivity). Defect information from the detected image of the printed circuit board is input into the score prediction model for score prediction, outputting a score value corresponding to the printed circuit board. This score value is used to characterize the production quality of the printed circuit board based on the defect score value in the detected image; that is, the higher the defect score value of the detected image, the lower the production quality of the printed circuit board; conversely, the lower the defect score value of the detected image, the higher the production quality of the printed circuit board.

[0044] Specifically, the parameter adjustment module 13 adjusts the current production parameters of the optical inspection equipment based on the score value to obtain the adjustment parameters, and uses the adjustment parameters to manufacture printed circuit boards.

[0045] Optionally, the parameter adjustment module 13 may include a parameter adjustment model (e.g., an autonomously adjusting neural network in a DQN (Deep Q Network)). The model inputs the score value of the detected image and the current production parameters for parameter identification and score-based optimization, outputting adjusted production parameters. The purpose of adjusting the production parameters is to increase the score value of the printed circuit board manufactured using the adjusted current production parameters, i.e., to reduce the defect score value in the detected image, thereby improving the production quality of the printed circuit board.

[0046] In another embodiment, the printed circuit board manufacturing module 13 can be manually adjusted by the development engineer based on the obtained score value to enhance the effectiveness of the parameter adjustment.

[0047] Unlike existing technologies, the optical inspection equipment provided in this embodiment includes: an information acquisition module for acquiring production parameters of the printed circuit board (PCB) and defect information in the inspection image of the PCB; a scoring module for generating a score based on the defect information, wherein the score is used to characterize the production quality of the PCB; and a parameter adjustment module for adjusting the current production parameters of the optical inspection equipment based on the score to obtain adjusted parameters for manufacturing the PCB using the adjusted production parameters. Through the aforementioned optical inspection equipment, a score is generated for the PCB using the defect information corresponding to the inspection image of the PCB. This score is then used to evaluate the production quality of the PCB, thereby adjusting the production parameters of the optical inspection equipment to manufacture the PCB. This improves the production quality of the PCB, optimizes the PCB production process, reduces human resource consumption, and prevents production accidents caused by parameter errors.

[0048] Optionally, by combining the above-mentioned optional embodiments and further optimizing and expanding upon the above technical solutions, one embodiment of the printed circuit board production parameter acquisition method provided in this application can be obtained.

[0049] See Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of the printed circuit board production parameter acquisition method provided in this application. The method is applied to the optical inspection equipment in the above embodiment for execution by the optical inspection equipment, and includes:

[0050] Step S11: Obtain the current production parameters of the printed circuit board and the defect information in the inspection image of the printed circuit board.

[0051] Optionally, the optical inspection equipment can obtain the current production parameters of the printed circuit board by extracting parameters stored in its own storage medium; or the optical inspection equipment can connect to a third-party organization (e.g., a cloud server, a big data processing center, etc.) to receive the current production parameters of the printed circuit board.

[0052] Optionally, the optical inspection equipment acquires the inspection image of the printed circuit board in real time based on AOI, or obtains the inspection image of the printed circuit board through other means (such as a third-party organization).

[0053] For example, the optical inspection equipment connects to an automated optical inspection device to scan the printed circuit board in real time. It then sends motion control commands to control the movement of the mechanical table and motor, transmitting the printed circuit board to the image acquisition area. The image acquisition module then acquires an image of the printed circuit board, ultimately obtaining the inspected image. During the image acquisition process, supplementary lighting can be applied to the image acquisition area, such as by controlling the switching and brightness of the light source through a light source control module.

[0054] Optionally, the defect information corresponding to the inspected image of the printed circuit board (PCB) can be obtained by optical inspection equipment comparing the inspected image of the PCB with the PCB design drawing. The PCB design drawing can be generated automatically by importing the PCB circuit diagram into software. After obtaining the PCB design drawing, a PCB identical to the design drawing can be generated. Then, an alignment algorithm is used to align the PCB image with the PCB design drawing to obtain the defect information of the inspected image. This defect information can include the location, type, and number of defects.

[0055] Optionally, the optical inspection equipment extracts the center point position of each defect in the inspection image based on the defect pixel coordinates, defect size, defect shape, and defect outer edge region in the defect information corresponding to the inspection image.

[0056] For example, in the UI interface of the optical inspection equipment, defect A is a schematic diagram of a first-type defect in a printed circuit board image. The optical inspection equipment marks the outer edge of defect A with a minimum circumscribed circle B based on the defect pixel coordinates, defect size, defect shape, and outer edge region of defect A. The coordinates B1 of the midpoint of the circumscribed circle B are the center point of defect A.

[0057] Optionally, the optical inspection equipment calculates the spacing information between all first-class defects in the corresponding defect region based on the center point positions between each pair of defects in the defect information corresponding to the inspection image and the defect region divided by the first-class defects.

[0058] Optionally, the optical inspection device inputs the defect pixel coordinates, defect size, defect shape, and defect outer edge region from the defect information into the image feature recognition model to extract the shape features of each defect in the first type of defect.

[0059] Optionally, the optical inspection equipment uses an image feature recognition model to identify the shape features that need to be extracted in terms of direction, position and angle of the corresponding image based on the printed circuit board image. Then, it uses a feature extraction network (such as CNN, VGG, ResNet, etc.) to perform feature segmentation on the printed circuit board image to segment out the shape features corresponding to each defect in the printed circuit board image.

[0060] Optionally, the optical inspection device inputs the shape features corresponding to each defect in the printed circuit board image into a convolutional neural network model (such as attention-based RNN, LSTM, etc.) to extract similarity information between several first-type defects.

[0061] Optionally, the optical inspection equipment retrieves several first-type defects that meet preset defect relationship conditions through the relationship information of first-type defects, and generates second-type defects through these several first-type defects, thereby reducing the number of identified defects in the printed circuit board and increasing the importance of retaining defects in the printed circuit board.

[0062] Optionally, the optical inspection equipment, based on defect relationship information, integrates first-type defects that at least partially meet preset defect relationship conditions to generate second-type defects.

[0063] Optionally, the optical inspection equipment determines at least one pair of defects with a spacing less than a preset spacing value based on the distance between the center points of each defect in the defect relationship information. Here, the at least one pair of defects refers to two defects in the same defect area on the printed circuit board. The distance between them being less than the preset spacing value is not specifically limited here; for example, it could be less than 2-20mm, 5mm, 10mm, or 15mm, etc.

[0064] Optionally, the optical inspection equipment, based on the shape of the defects in the defect relationship information, fuses at least one pair of defects with a spacing smaller than a preset spacing value into at least one corresponding second-type defect. The fusion of at least one pair of defects can be performed using an image fusion model, or it can be done manually by a development engineer within the UI interface of the optical inspection equipment.

[0065] Optionally, the optical inspection equipment determines the confidence value of the first type of defect based on the defect pixel coordinates, defect size, defect shape, and defect outer edge region in the defect information.

[0066] Optionally, the optical inspection equipment selects at least a portion of Class I defects that meet the defect center point spacing value condition and / or defect similarity threshold condition.

[0067] Optionally, the optical inspection equipment selects at least a portion of first-class defects whose spacing is less than a preset spacing value from all defects based on the distance between the center points of each defect in the defect relationship information. Here, the at least a portion of first-class defects refers to two defects in the same defect area on the printed circuit board. The distance between them being less than the preset spacing value is not specifically limited here; for example, it could be less than 2-20mm, 5mm, 10mm, or 15mm, etc.

[0068] Optionally, the optical inspection device selects at least a portion of the first-type defects from all defects based on the similarity information between defects in the defect relationship information. Specifically, the optical inspection device can input the shape features corresponding to each defect in the printed circuit board image into a convolutional neural network model (such as an attention-based RNN or LSTM) to extract similarity information between several first-type defects.

[0069] Optionally, the optical inspection equipment sorts at least some of the defects that meet the first condition from high to low according to their confidence level, and then selects the first type of defect with the highest confidence level as the second type of defect.

[0070] Optionally, the optical inspection equipment sorts at least some of the defects that meet the first condition from high to low according to their confidence level, and then selects the first type of defects with a confidence level higher than a preset confidence threshold as the second type of defects.

[0071] Step S12: Generate a score based on the defect information; wherein the score is used to characterize the production quality of the printed circuit board.

[0072] Optionally, the optical inspection equipment inputs the defect information of the printed circuit board into a score prediction model (e.g., a point convolutional neural network based on attention RNN, LSTM, etc., or a CNN network with point convolutional layers and full connections) to generate a score value for the printed circuit board; or, the development engineer manually inputs the corresponding parameter data based on the defect information displayed on the UI interface of the optical inspection equipment, and the optical inspection equipment obtains the score value of the printed circuit board.

[0073] Optionally, the scoring value of the printed circuit board is based on the defect score value in the inspection image of the printed circuit board to characterize the production quality of the printed circuit board. That is, the higher the defect score value of the inspection image, the lower the production quality of the printed circuit board; the lower the defect score value of the inspection image, the higher the production quality of the printed circuit board.

[0074] See Figure 3 , Figure 3 This is a schematic flowchart of an embodiment of generating a score value in this application. Specifically, step S12 may include the following steps:

[0075] Step S121: Based on the defect information, determine the prediction type, prediction weight, and prediction quantity of defects corresponding to at least one defect region.

[0076] Optionally, the optical inspection equipment inputs the defect information of the printed circuit board into a fractional prediction model for defect prediction. Specifically, the fractional prediction model divides the printed circuit board into at least one defect region, and in each defect region, the fractional prediction model predicts the type of defect, the number of defects, and the weight of the corresponding defects.

[0077] As an example, in defect region A, the score prediction model predicts three types of defects: A1, A2, and A3. The weight for correctly predicting A1 is 20%, the weight for correctly predicting A2 is 50%, and the weight for correctly predicting A3 is 30%. The number of predictions for A1 is 8, the number of predictions for A2 is 15, and the number of predictions for A3 is 5.

[0078] Step S122: Based on the prediction type, determine the predicted defect score for at least one defect region.

[0079] Optionally, the optical inspection equipment calculates a predicted defect score for the at least one defect area according to the area level of the at least one defect area in the printed circuit board and the predicted type of the defect in the at least one defect area, in accordance with the scoring rules.

[0080] Each defect area receives a score based on its area level, with different scores awarded according to the importance of the area. Similarly, the predicted defect type receives a score based on its importance. The scoring rules are as follows: first, the score for the corresponding area level of a defect area is calculated; then, the predicted defect types for all defects within that area are multiplied by their corresponding defect scores; finally, the defect scores for all predicted types are added to the overall score of the defect area to obtain its predicted defect score.

[0081] As an example, in defect area B, the optical inspection equipment predicts that the defect types are short circuit, notch, and protrusion. The area level of defect area B is level 2. The optical inspection equipment determines the area level of level 2 with a score of 2 points, short circuit defects with a score of 10 points, notch defects with a score of 8 points, and protrusion defects with a score of 6 points. Therefore, the predicted defect score for defect area B is 2 + 10 + 8 + 6 = 26 points.

[0082] Step S123: Calculate the total defect score corresponding to the predicted defect score based on the prediction weight and the number of predictions.

[0083] Optionally, the optical inspection device multiplies the predicted weight and predicted number of defects in at least one defect region by the corresponding predicted defect score to obtain the defect score for all defect regions. Then, the defect scores of all defect regions are added together to obtain the total defect score.

[0084] As an example, in defect area C, the optical inspection equipment predicts that the defect types in defect area C are short circuit (10 points), notch (8 points), and protrusion (6 points), and the area level of defect area C is level 1 (3 points); the prediction weight of defects is 30% for short circuit type defects, 30% for notch type defects, and 60% for protrusion type defects; and the predicted number of defects is 5 for short circuit type defects, 8 for notch type defects, and 3 for protrusion type defects. Then the defect score of defect area C is 10×30%×5+8×30%×8+6×60%×3+3 points; and then the sum of the defect scores of all defect areas is calculated in the same way to obtain the total defect score of the printed circuit board.

[0085] Step S124: In response to the total defect score being greater than a preset threshold, calculate the total penalty score corresponding to at least one defect area.

[0086] Specifically, if the total defect score calculated by the optical inspection device is greater than a preset threshold, the optical inspection device calculates the penalty score for the defect area whose defect score exceeds the preset threshold, so as to obtain the total penalty score of the printed circuit board.

[0087] See Figure 4 , Figure 4 This is a flowchart illustrating an embodiment of calculating the total penalty score in this application.

[0088] Specifically, step S124 may include the following steps:

[0089] Step S1241: Obtain the penalty score for a single defect in at least one defect region.

[0090] Optionally, the penalty score for a single defect in the defect area can be any constant, such as 2 points, 3 points, 5 points, etc., without any specific restrictions.

[0091] Step S1242: Based on the predicted number of defects in at least one defect region and the penalty score, determine the total penalty score corresponding to at least one defect region.

[0092] Optionally, the optical inspection device calculates the sum of the predicted number of defects in at least one defect region where the corresponding defect score exceeds a preset threshold, multiplied by the penalty score of the corresponding individual defect, to obtain the penalty score of the at least one defect region.

[0093] As an example, in defect area D, the optical inspection device calculates the total defect score of defect area D to be 100 points, which exceeds the preset threshold of 80 points. The number of defects predicted in defect area D is 20, and the penalty score for a single defect is 3 points. Therefore, the optical inspection device calculates the penalty score of defect area D to be 3 × 20 = 60 points.

[0094] Step S125: Generate a score based on the difference between the total defect score and the total penalty score.

[0095] Optionally, the optical inspection equipment sums the penalty scores for each defect area to obtain a total penalty score; the optical inspection equipment then subtracts the difference between the total penalty scores for all defect areas from the calculated total defect score for all defect areas to generate the score value for the printed circuit board.

[0096] See Figure 5 , Figure 5 This is a schematic diagram of another embodiment of the process for generating score values ​​in this application.

[0097] Specifically, step S12 may also include the following steps:

[0098] Step S126: Based on the defect information, extract the feature matrix and feature type of the defects in the detected image.

[0099] Optionally, the optical inspection device inputs the defect information of the inspected image into a scoring model for feature extraction. Specifically, the feature matrix and feature type of the defects in the inspected image can be extracted by the scoring model using the AlexNet deep convolutional network from the ImageNet image dataset.

[0100] Specifically, the scoring model can input the 256*256*3 RGB detection image of each image into the AlexNet deep convolutional network of the ImageNet image dataset using a three-channel data matrix to obtain the feature matrix and feature type of the trained defects. The dimension of the trained feature matrix is ​​not limited. Since the output dimension of the fifth layer of AlexNet is 6*6*256, it can be spanned into a 96*96 feature matrix. In one specific implementation, the 96*96 feature matrix can be used as the training feature matrix.

[0101] Step S127: Construct a feature tree structure based on the feature matrix and feature type.

[0102] Optionally, the scoring model divides the polar angle of the plane containing the detected image into Ns equal parts, each part being called a sector, resulting in Nr*Ns annular sector grids; then, a rectangular coordinate system is established with the polar angle as the horizontal axis and the polar radius as the vertical axis, generating an Nr×Ns matrix. Each position in the matrix stores the features of all points within the corresponding grid (i.e., stores the feature matrix and the corresponding feature type). The Nr×Ns matrices are then used to construct a k-dimensional feature tree structure in space through semantic distribution and semantic variance.

[0103] Step S128: Match the feature tree structure with the feature templates pre-stored on the printed circuit board to generate matching results.

[0104] Optionally, the scoring model matches the k-dimensional feature tree structure of the detected image with the pre-stored feature template of the corresponding printed circuit board to obtain the matching result of the printed circuit board. The pre-stored feature template of the printed circuit board is a reference k-dimensional feature tree structure template of the printed circuit board, and the printed circuit board corresponding to this template is a standard printed circuit board, which is a defect-free and ideal printed circuit board.

[0105] Optionally, the matching result is the difference between the feature tree structure corresponding to the printed circuit board in actual production and the feature tree structure corresponding to the printed circuit board in the ideal state.

[0106] In one embodiment, the matching result includes the difference region between the feature tree structure and the feature template and the corresponding difference information; the difference information includes the defect type, defect size and defect number of the corresponding defect in the difference region.

[0107] Step S129: Generate a score based on the matching results and the corresponding scoring rules.

[0108] See Figure 6 , Figure 6 This is a flowchart illustrating an embodiment of calculating a score based on matching results in this application. Specifically, step S129 may include the following steps:

[0109] Step S1291: Based on the scoring rules and difference information, set corresponding penalty scores for defects in the difference area.

[0110] Optionally, the optical inspection equipment obtains the defect type, defect size, and defect quantity of each defect in each difference region based on the difference information, and then calculates the penalty score for each difference region by multiplying the scores corresponding to each defect type, the defect size corresponding to each defect type, and the defect quantity corresponding to each defect type.

[0111] As an example, the optical inspection equipment, based on the difference information, identifies three types of defects in difference region A: open circuit, notch, and dent. There are 3 open circuit defects, 5 notch defects, and 2 dent defects. Of the 3 open circuit defects, 2 are in the first dimension segment and 1 is in the second dimension segment. All 5 notch defects are in the first dimension segment, and all 2 dent defects are in the third dimension segment. Furthermore, the penalty for open circuit defects is 10 points, for notch defects it is 8 points, and for dent defects it is 6 points; the penalty for defects in the first dimension segment is 2 points, for the second dimension segment it is 3 points, and for the third dimension segment it is 4 points. Therefore, the penalty score for difference region A is 10 × (2 × 2 + 1 × 3) + 8 × (5 × 2) + 6 × (2 × 4) points.

[0112] Step S1292: Generate a score based on the difference between the target score and the penalty score preset by the feature template.

[0113] Optionally, the optical inspection equipment sums the penalty scores for each difference region to obtain a total penalty score for the difference region; the optical inspection equipment then subtracts the total penalty score from the preset target score of the feature template to generate the score value of the printed circuit board. The preset target score of the feature template is a score set by the customer and is not specifically limited here.

[0114] Step S13: Adjust the production parameters of the optical inspection equipment based on the score value to manufacture printed circuit boards using the adjusted production parameters.

[0115] Specifically, the optical inspection equipment adjusts its current production parameters based on the score range of the score value and the type of printed circuit board, resulting in adjusted production parameters, which are used to manufacture printed circuit boards.

[0116] The scoring system has multiple score ranges, such as the first range (1000 points and above), the second range (200-999 points), the third range (50-199 points), and the fourth range (49 points and below). There are various types of printed circuit boards (PCBs), each corresponding to specific production parameters and used for different applications.

[0117] See Figure 7 , Figure 7 This is a schematic flowchart of an embodiment of adjusting production parameters based on a score value in this application. Specifically, step S13 may include the following steps:

[0118] Step S131: Determine the current production parameters of the printed circuit board based on the type of the printed circuit board and the user's settings.

[0119] The current production parameters include at least one of the following: the current printed circuit board production area, production type, production precision, critical defect type, maximum number of defects, and production quantity.

[0120] The current production parameters are dynamically changed within a preset range based on the errors of the optical inspection equipment and the influence of user operations, in order to form the actual production parameters used.

[0121] Optionally, the current production parameters are the desired production parameters obtained by the optical inspection equipment based on the type of printed circuit board and the settings parameters entered by the user.

[0122] Optionally, the current production parameters can also be the production parameters most recently adjusted before this adjustment. For example, the initial production parameters for the printed circuit board are A0, the production parameters after the first adjustment are A1, the production parameters after the second adjustment are A2, and the production parameters after the third adjustment are A3. Then, the current production parameters for this (fourth) adjustment can be either the initial production parameters A0 or the production parameters after the most recent adjustment A3.

[0123] Step S132: Adjust the actual production parameters based on the score range in which the score value is located.

[0124] Optionally, the optical inspection equipment can perform parameter identification and score-based optimization using a parameter adjustment model (e.g., the self-regulating neural network in a Deep Q Network) based on the score segment where the printed circuit board is located and the current production parameters of the printed circuit board, to output adjusted production parameters. The purpose of the parameter adjustment model in adjusting the production parameters is to reduce the defect score in the inspection image, thereby improving the production quality of the printed circuit board.

[0125] In another embodiment, the optical inspection equipment can be manually adjusted by the development engineer based on the obtained score value to enhance the effectiveness of adjusting the production parameters.

[0126] See Figure 8 , Figure 8 This is a schematic diagram of another embodiment of the process for generating score values ​​in this application.

[0127] Specifically, step S12 in the above embodiments may further include the following steps:

[0128] Step S121a: Based on the defect information, extract the feature vector of the defect in the detection image.

[0129] In one embodiment, the optical inspection device identifies the inspection image in the direction, position, and angle corresponding to the defect information based on the defect information in the inspection image. Then, it uses a feature extraction network (such as CNN, VGG, ResNet, etc.) to perform feature segmentation on the inspection, thereby segmenting the image into several corresponding segmented images. Further, the optical inspection device uses an image-embedding network to convert the segmented images into corresponding N*S-dimensional feature vectors, with each segmented image corresponding to one feature vector. For example, if an inspection image is segmented into 1000 segmented images by a CNN, the image-embedding network then converts these 1000 segmented images into corresponding 1*3-dimensional feature vectors, where 1 represents the number of segmented images and S represents the dimension of the feature vector.

[0130] Step S122a: Input the extracted feature vector into a scoring model to calculate the score, and output the score value of the printed circuit board applied to the current production parameters.

[0131] Optionally, the scoring model is trained based on user-defined scoring parameters and several training vectors. The user-defined scoring parameters include those based on various defect quantities, defect types, defect locations, defect sizes, and / or defect confidence levels. For example, a "copper slag" type defect might receive a score of 3, a "short circuit / open circuit" type defect might receive a score of 8, and a defect in defect region A might receive a score of 5, and so on.

[0132] In one embodiment, the scoring model in the optical inspection device can be trained using several training vectors based on a CNN point convolutional network and user-defined scoring parameters. The scoring process of the scoring model can calculate the base scores corresponding to each proposed feature vector through the relevant convolutional layers and fully connected layers of the CNN point convolutional network, and finally output the score value of the printed circuit board applied to the current production parameters.

[0133] Furthermore, after obtaining the first score value of the printed circuit board applied to the current production parameters, the optical inspection equipment can dynamically adjust the current production parameters and then produce a new printed circuit board using the adjusted production parameters to obtain a second score value of the new printed circuit board applied to the adjusted production parameters.

[0134] See Figure 9 , Figure 9 This is a schematic diagram of another embodiment of the process for generating score values ​​in this application.

[0135] Specifically, step S13 in the above embodiments may further include the following steps:

[0136] Step S131a: Input the score into a reinforcement learning network to predict and adjust the current production parameters in order to generate an adjustment strategy.

[0137] Specifically, the adjustment strategy is used to improve the score of printed circuit boards manufactured using the adjusted current production parameters. That is, the reinforcement learning network generates an adjustment strategy based on the first score corresponding to the current production parameters, and this adjustment strategy is used to improve the score of subsequently manufactured printed circuit boards.

[0138] Specifically, the reinforcement learning network is trained based on user-defined adjustment parameters and several training scores. These user-defined adjustment parameters include those corresponding to the user-specified number of defects detected, defect types, defect locations, defect sizes, and / or defect confidence levels. For example, adjusting the accuracy of defect detection (number of defects, type of defects, and defect size) can improve the score for the printed circuit board. Alternatively, adjusting the scores for defect locations, defect sizes, and / or defect confidence levels can also improve the score for the printed circuit board.

[0139] Step S132a: Adjust the current production parameters based on the adjustment strategy to obtain the adjusted production parameters, and apply the adjusted production parameters as the actual applied production parameters.

[0140] The optical inspection equipment adjusts the current production parameters using an adjustment strategy to obtain adjusted production parameters. These adjusted parameters are then applied to the actual application production parameters to manufacture new printed circuit boards. The score for the new printed circuit board corresponding to the adjusted production parameters is the second score (V). after The current production parameters correspond to the original printed circuit board's score as the first score value (V). before Furthermore, the difference between the two includes a second score value corresponding to the adjusted production parameters that is greater than the first score value corresponding to the current production parameters.

[0141] In one embodiment, if the second score value (V) corresponding to the production parameters is adjusted...after )≤ the first score value (V) corresponding to the current production parameters before If the optical detection device continues to input the second score value into the reinforcement learning network in step S131a, it will predict and adjust the corresponding production parameters to generate a new adjustment strategy, thereby obtaining the score value corresponding to the new adjusted production parameters. The steps of generating a new adjustment strategy and obtaining the score value corresponding to the new adjusted production parameters can be repeated continuously until the goal of making the score value corresponding to the new adjusted production parameters > the score value corresponding to the current production parameters is achieved.

[0142] Unlike existing technologies, the printed circuit board (PCB) production parameter acquisition method provided in this embodiment is applied to an optical inspection device. The method includes: acquiring PCB production parameters and defect information from an inspection image of the PCB; generating a score value based on the defect information; wherein the score value characterizes the PCB production quality; and adjusting the production parameters of the optical inspection device based on the score value to manufacture the PCB using the adjusted parameters. By using the aforementioned optical inspection device, generating a score value for the PCB from the defect information corresponding to the PCB inspection image, and then using the score value to evaluate the PCB production quality, the production parameters of the PCB can be adjusted, thereby improving the PCB production quality, optimizing the PCB production process, and reducing human resource consumption.

[0143] See Figure 10 , Figure 10 This is a schematic diagram of the structure of an electronic device provided in this application. The electronic device 100 includes a processor 101 and a memory 102 connected to the processor 101. The memory 102 stores program data. The processor 101 retrieves the program data stored in the memory 102 to execute the above-mentioned printed circuit board production parameter acquisition method.

[0144] Optionally, in one embodiment, the processor 101 is applied to an optical inspection device; the processor 101 is used to execute program data stored in the memory 102 to implement the following method: acquiring production parameters of the printed circuit board and defect information in the inspection image of the printed circuit board; generating a score value based on the defect information; the score value is used to characterize the production quality of the printed circuit board; and adjusting the production parameters of the optical inspection device based on the score value to manufacture the printed circuit board using the adjusted production parameters.

[0145] The processor 101 can also be referred to as a CPU (Central Processing Unit). The processor 101 may be an electronic chip with signal processing capabilities. The processor 101 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor.

[0146] The memory 102 can be a RAM module, TF card, etc., and can store all the information in the electronic device 100, including the input raw data, computer programs, intermediate running results, and final running results. It stores and retrieves information according to the location specified by the processor 101. With the memory 102, the electronic device 100 has a memory function and can ensure normal operation. The memory 102 of the electronic device 100 can be classified according to its purpose as main memory (RAM) and auxiliary memory (external memory), or it can be classified as external memory and internal memory. External memory is usually magnetic media or optical discs, which can store information for a long time. RAM refers to the storage components on the motherboard, used to store currently executing data and programs, but it is only used for temporary storage of programs and data; the data will be lost when the power is turned off.

[0147] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the implementation of the electronic device 100 described above is merely illustrative. For example, adjusting the baseline production parameters based on the score range where the score value is located; constructing a feature tree structure based on the feature matrix and feature type, etc., are merely one way of combining features. In actual implementation, there may be other ways of dividing features. For example, the production parameters of the optical inspection equipment can be combined with the production area, production type, production accuracy, and production quantity of the printed circuit board, or they can be combined into another system, or some features can be ignored or not executed.

[0148] Furthermore, the functional units (such as the scoring module and the printed circuit board manufacturing module) in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0149] See Figure 11 , Figure 11This is a schematic diagram of an embodiment of a computer-readable storage medium provided in this application. The computer-readable storage medium 110 stores program instructions 111 capable of implementing all the above methods.

[0150] If the integrated units of the various functional units in the various embodiments of this application are implemented as software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium 110. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer-readable storage medium 110 includes several instructions in a program instruction 111 to cause a computer device (which may be a personal computer, system server, or network device, etc.), an electronic device (e.g., MP3, MP4, etc., or a mobile terminal such as a mobile phone, tablet, or wearable device, or a desktop computer, etc.) or a processor to execute all or part of the steps of the methods of the various embodiments of this application.

[0151] Optionally, in one embodiment, program instructions 111 are applied to an optical inspection device; when executed by a processor, program instructions 111 are used to implement the following methods: acquiring production parameters of a printed circuit board and defect information in an inspection image of the printed circuit board; generating a score value based on the defect information; the score value is used to characterize the production quality of the printed circuit board; and adjusting the production parameters of the optical inspection device based on the score value to manufacture the printed circuit board using the adjusted production parameters.

[0152] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media 110 (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0153] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable storage medium 110. These computer-readable storage media 110 can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that program instructions 111, executable by the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0154] These computer-readable storage media 110 may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that program instructions 111 stored in the computer-readable storage medium 110 produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0155] These computer-readable storage media 110 may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing program instructions 111 that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0156] In one embodiment, these programmable data processing devices include a processor and memory. The processor may also be referred to as a CPU (Central Processing Unit). The processor may be an electronic chip with signal processing capabilities. The processor may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor.

[0157] Memory can be a RAM module, a TF card, etc., and it stores and retrieves information according to the location specified by the processor. Memory can be classified according to its purpose into main memory (RAM) and auxiliary memory (external storage), or it can be classified into external memory and internal memory. External storage is usually magnetic media or optical discs, which can store information permanently. RAM refers to the storage components on the motherboard, used to store currently executing data and programs, but it is only used for temporary storage of programs and data; the data will be lost when the power is turned off.

[0158] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the description and drawings of this application, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for obtaining production parameters of printed circuit boards, applied to optical inspection equipment, characterized in that, The method includes: acquiring the current production parameters of the printed circuit board and defect information in the inspection image of the printed circuit board, wherein the defect information includes multiple defect types and their hierarchical location information in the printed circuit board; Based on the defect information, a score is generated; The score value is used to characterize the production quality of the printed circuit board; The current production parameters are adjusted based on the score to obtain the adjusted production parameters; The adjustment of production parameters is used to manufacture the printed circuit board; The method for obtaining printed circuit board production parameters further includes: By using a parameter adjustment model trained based on historical production data, a parameter adjustment scheme for optimizing the production of the printed circuit board is obtained based on the score value. When the printed circuit board is a multilayer board, the parameter adjustment model assigns a higher adjustment weight to defects located in the inner layer than to defects in the outer layer. And / or, when the printed circuit board is an HDI board, the parameter adjustment model adjusts the power and speed parameters of laser drilling according to the aperture and depth-to-diameter ratio of the micro-hole; And / or, when open circuit defects and bridging defects are detected simultaneously, causing a conflict in parameter adjustment directions, the parameter adjustment model uses a multi-objective optimization algorithm to obtain the parameter adjustment scheme.

2. The method for obtaining printed circuit board production parameters according to claim 1, characterized in that, The step of adjusting the current production parameters based on the score value to obtain the adjusted production parameters includes: adjusting the current production parameters based on the score range in which the score value is located and the type of the printed circuit board to obtain the adjusted production parameters.

3. The method for obtaining printed circuit board production parameters according to claim 2, characterized in that, The step of adjusting the current production parameters based on the score range of the score value and the type of the printed circuit board to obtain the adjusted production parameters includes: determining the current production parameters of the printed circuit board based on the type of the printed circuit board and the user's setting parameters; The current production parameters include at least one of the following: production area, production type, production precision, critical defect type, maximum number of defects, and production quantity of the printed circuit board. The current production parameters are dynamically changed within a preset range based on the error of the optical detection equipment and the user's operation, so as to form the production parameters actually used. Based on the score range in which the score value falls, the actual production parameters used are adjusted.

4. The method for obtaining printed circuit board production parameters according to claim 1, characterized in that, The step of generating a score based on the defect information includes: determining the prediction type, prediction weight, and prediction quantity of defects corresponding to at least one defect region based on the defect information; Based on the prediction type, the predicted defect score of the at least one defect region is determined; Based on the prediction weights and the prediction quantity, calculate the total defect score corresponding to the predicted defect score; In response to the total defect score being greater than a preset threshold, the total penalty score corresponding to the at least one defect region is calculated; The score is generated based on the difference between the total defect score and the total penalty score.

5. The method for obtaining printed circuit board production parameters according to claim 4, characterized in that, The calculation of the total penalty score corresponding to the at least one defect region includes: obtaining the penalty score of a single defect in the at least one defect region; Based on the predicted number of defects in the at least one defect region and the penalty score, the total penalty score corresponding to the at least one defect region is determined.

6. The method for obtaining printed circuit board production parameters according to claim 1, characterized in that, The step of generating a score based on the defect information includes: extracting feature vectors of defects in the detected image based on the defect information; The extracted feature vector is input into a scoring model to calculate the score, so as to output the score value of the printed circuit board applied to the current production parameters; The scoring model is trained based on user-defined scoring parameters and several training vectors.

7. The method for obtaining printed circuit board production parameters according to claim 6, characterized in that, The step of adjusting the current production parameters based on the score value to obtain adjusted production parameters includes: inputting the score value into a reinforcement learning network to predict and adjust the current production parameters in order to generate an adjustment strategy; The adjustment strategy is used to improve the score of the printed circuit board manufactured using the adjusted current production parameters. The reinforcement learning network is trained based on user-defined adjustment parameters and several training score values; The current production parameters are adjusted based on the adjustment strategy to obtain the adjusted production parameters, and the adjusted production parameters are used as the actual application production parameters.

8. An optical inspection device, characterized in that, The optical inspection device includes: an information acquisition module, used to acquire the current production parameters of the printed circuit board and defect information in the inspection image of the printed circuit board, wherein the defect information includes multiple defect types and their hierarchical position information in the printed circuit board; The scoring module is used to generate a score based on the defect information; The score value is used to characterize the production quality of the printed circuit board; The parameter adjustment module adjusts the current production parameters based on the score value to obtain adjusted production parameters; the adjusted production parameters are used to manufacture the printed circuit board; The parameter adjustment module is also used to obtain a parameter adjustment scheme for optimizing the production of the printed circuit board based on the score value by using a parameter adjustment model trained based on historical production data. When the printed circuit board is a multilayer board, the parameter adjustment model assigns a higher adjustment weight to defects located in the inner layer than to defects in the outer layer. And / or, when the printed circuit board is an HDI board, the parameter adjustment model adjusts the power and speed parameters of laser drilling according to the aperture and depth-to-diameter ratio of the micro-hole; And / or, when open circuit defects and bridging defects are detected simultaneously, causing a conflict in parameter adjustment directions, the parameter adjustment model uses a multi-objective optimization algorithm to obtain the parameter adjustment scheme.

9. An electronic device, characterized in that, The electronic device includes a processor and a memory connected to the processor, wherein the memory stores program data, and the processor retrieves the program data stored in the memory to execute the printed circuit board production parameter acquisition method as described in any one of claims 1-7.

10. A computer-readable storage medium internally storing program instructions, characterized in that, The program instructions are executed to implement the printed circuit board production parameter acquisition method as described in any one of claims 1-7.