A component missing detection method, electronic device and readable storage medium

By performing target detection and model analysis on the circuit board, the missing components are directly determined, solving the problem of high detection costs in the existing technology and achieving efficient and accurate component missing detection.

CN118393327BActive Publication Date: 2024-09-06GUANGDONG LAB OF ARTIFICIAL INTELLIGENCE & DIGITAL ECONOMY (SZ)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410833127.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-09-06
Estimated Expiration
2044-06-26

AI Technical Summary

Technical Problem

In the current circuit board manufacturing process, the detection of missing components requires the production of templates first, resulting in high detection costs.

Method used

By performing target detection on the circuit board to be inspected, using the trained target detection model, the location and category of components are determined, and the number of non-missing component categories is calculated, and then the missing number of missing circuit boards and missing components are determined, realizing the implementation of components Deletion detection.

Benefits of technology

There is no need to use templates for comparison, which reduces detection costs, improves detection efficiency and accuracy, and can quickly locate fault locations. It is suitable for circuit board detection in various scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118393327B
    Figure CN118393327B
Patent Text Reader

Abstract

The present application provides a component missing detection method, electronic device and readable storage medium, the method comprising: performing target detection on multiple circuit boards to be detected to obtain detection results; determining the circuit board where each component is located based on the detection information of each circuit board to be detected and each component, and obtaining the circuit board information of each component; determining the component category, component quantity and component position of each circuit board to be detected based on the circuit board information and detection information of each component; determining the non-missing number of each component category based on the number of components of each component category on each circuit board to be detected; determining the missing number of missing circuit boards and each missing component category based on the non-missing number of each component category; comparing the reference circuit board with each missing circuit board to determine the missing position of each missing component on each missing circuit board. The present application can obtain the missing situation of the circuit board without using a template to compare with the circuit board, thereby reducing the detection cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and in particular, relates to a component missing detection method, an electronic device, and a readable storage medium. Background Art

[0002] In the process of circuit board manufacturing, if there are missing components, it will cause the function of the circuit board to fail or the performance to deteriorate. Therefore, the circuit board will be inspected to find the missing components.

[0003] The existing method is to first make a template of the original component image, determine the difference between the circuit board and the template, and then determine whether there is a missing component. However, this method requires making a template first, resulting in high detection costs. Summary of the invention

[0004] The embodiments of the present application provide a method, device, electronic device, readable storage medium and computer program product for detecting missing components, which can solve the problem of high detection costs caused by the existing use of templates to detect missing components.

[0005] In a first aspect, an embodiment of the present application provides a component missing detection method, comprising:

[0006] Performing target detection on multiple circuit boards to be detected to obtain detection results, wherein the circuit boards to be detected are of the same type, and the detection results include detection information of the circuit boards to be detected and detection information of each component;

[0007] According to the detection information of each circuit board to be detected and the detection information of each component, determine the circuit board where each component is located, and obtain the circuit board information of each component;

[0008] Determine the component category and corresponding component quantity of each circuit board to be detected according to the circuit board information and the detection information of each component;

[0009] Determine the non-missing quantity of each component category according to the quantity of components of each component category on each circuit board to be inspected;

[0010] The missing circuit boards and the missing component quantities of each missing component category are determined based on the non-missing quantity of each component category.

[0011] In one embodiment, the method further comprises:

[0012] Determine the position of each component on each circuit board to be detected according to the circuit board information and the detection information of each component;

[0013] For each missing circuit board, a reference circuit board is compared with the missing circuit board to determine the missing position of each missing component on the missing circuit board. The reference circuit board is a circuit board to be detected with no missing components and correct component positions.

[0014] In one embodiment, for each missing circuit board, comparing the reference circuit board with the missing circuit board to determine the missing position of each missing component on the missing circuit board includes:

[0015] For each of the missing component categories of each of the missing circuit boards, determining a first degree of coincidence between each of the components belonging to the missing component category on the reference circuit board and the components corresponding to the missing component category on the missing circuit board;

[0016] For each of the first overlaps, when the first overlap is less than a first preset overlap, obtaining a corresponding target component on the reference circuit board, and determining the missing position of the corresponding missing component according to the position of the target component;

[0017] Or, for each missing circuit board, perform image subtraction between the reference circuit board and the missing circuit board to obtain each target image area and the corresponding target component on the reference circuit board, wherein the pixel value of the target image area is greater than a preset pixel value;

[0018] For each of the target image regions, determining the missing position of the missing component corresponding to the target component according to the target image region;

[0019] The type of the missing component is the same as the type of the target component.

[0020] In one embodiment, for each missing circuit board, comparing the reference circuit board with the missing circuit board to determine the missing position of each missing component includes:

[0021] For each of the missing circuit boards, determining a second degree of overlap between each of the components on the reference circuit board and the corresponding components on the missing circuit board;

[0022] If each of the second overlaps is less than the second preset overlap, determining the current transformation operation from the unselected transformation operations;

[0023] According to the current transformation operation, the reference circuit board is transformed in direction to obtain a transformed reference circuit board;

[0024] Determine a third degree of coincidence between each of the components on the transformed reference circuit board and the corresponding components on the missing circuit board;

[0025] If each of the third overlaps is less than the second preset overlap, return to the execution step: determine the current transformation operation from the unselected transformation operations until each of the third overlaps is greater than or equal to the second preset overlap, and obtain the target reference circuit board;

[0026] The target reference circuit board is compared with the missing circuit board to determine the missing position of each missing component.

[0027] In one embodiment, for each missing circuit board, comparing the reference circuit board with the missing circuit board to determine the missing position of each missing component includes:

[0028] For each missing circuit board, determining a target transformation operation of the reference circuit board according to the board type of the missing circuit board;

[0029] According to the target transformation operation, the reference circuit board is transformed in direction to obtain a target reference circuit board;

[0030] The target reference circuit board is compared with the missing circuit board to determine the missing position of each missing component.

[0031] In one embodiment, before comparing the reference circuit board with the missing circuit board for each missing circuit board to determine the missing position of each missing component on the missing circuit board, the method further includes:

[0032] Compare the original circuit board with a first preset number of reference circuit boards to obtain the first preset number of comparison results, wherein the original circuit board is a pre-specified reference circuit board, and the reference circuit board is a circuit board to be detected in which the number of components of each component category is the non-missing number;

[0033] If there are not a second preset number of comparison results indicating that the component position is correct, then determine that one of the reference circuit boards is the original circuit board, and return to the execution step: compare the original circuit board with the first preset number of reference circuit boards to obtain the first preset number of comparison results, until there are a second preset number of comparison results indicating that the component position is correct;

[0034] If there are the second preset number of the comparison results indicating that the component positions are correct, determining that the original circuit board is the reference circuit board;

[0035] Wherein, the first preset number is greater than the second preset number.

[0036] In one embodiment, the step of performing target detection on a plurality of circuit boards to be detected and obtaining detection results includes:

[0037] The trained target detection model is used to perform target detection on multiple circuit boards to obtain detection results.

[0038] In a second aspect, an embodiment of the present application provides a device for detecting missing components, including:

[0039] A target detection module is used to perform target detection on multiple circuit boards to be detected and obtain detection results, wherein the circuit boards to be detected are of the same type, and the detection results include detection information of the circuit boards to be detected and detection information of each component;

[0040] A component missing detection module, used to determine the circuit board where each component is located according to the detection information of each circuit board to be detected and the detection information of each component, and obtain the circuit board information of each component;

[0041] It is also used to determine the component category and the corresponding component quantity of each circuit board to be detected according to the circuit board information and the detection information of each component;

[0042] It is also used to determine the non-missing quantity of each component category according to the quantity of components of each component category on each circuit board to be inspected;

[0043] It is also used to determine the missing quantity of missing circuit boards and each missing component category based on the non-missing quantity of each component category.

[0044] In one embodiment, the component missing detection module is also used to determine the position of each component on each circuit board to be detected based on the circuit board information and the detection information of each component; for each missing circuit board, the reference circuit board is compared with the missing circuit board to determine the missing position of each missing component on the missing circuit board, and the reference circuit board is a circuit board to be detected in which no components are missing and the component positions are correct.

[0045] In one embodiment, a missing component detection module is specifically used to determine, for each missing component category of each missing circuit board, a first degree of overlap between each component belonging to the missing component category on the reference circuit board and the component corresponding to the missing component category on the missing circuit board; for each first degree of overlap, when the first degree of overlap is less than a first preset degree of overlap, obtain the corresponding target component on the reference circuit board, and determine the missing position of the corresponding missing component according to the position of the target component; or, for each missing circuit board, perform image subtraction between the reference circuit board and the missing circuit board to obtain each target image area and the corresponding target component on the reference circuit board, the pixel value of the target image area being greater than the preset pixel value; for each target image area, determine the missing position of the missing component corresponding to the target component according to the target image area; wherein the type of the missing component is the same as the type of the target component.

[0046] In one embodiment, a component missing detection module is specifically used to determine, for each missing circuit board, a second degree of overlap between each component on the reference circuit board and the corresponding component on the missing circuit board; if each of the second degrees of overlap is less than a second preset degree of overlap, determine the current transformation operation from an unselected transformation operation; according to the current transformation operation, perform a direction transformation on the reference circuit board to obtain a transformed reference circuit board; determine a third degree of overlap between each component on the transformed reference circuit board and the corresponding component on the missing circuit board; if each of the third degrees of overlap is less than the second preset degree of overlap, return to the execution step: determine the current transformation operation from an unselected transformation operation until each of the third degrees of overlap is greater than or equal to the second preset degree of overlap to obtain a target reference circuit board; compare the target reference circuit board with the missing circuit board to determine the missing position of each missing component.

[0047] In one embodiment, the missing component detection module is specifically used to determine, for each missing circuit board, a target transformation operation of the reference circuit board according to the board type of the missing circuit board; according to the target transformation operation, transform the direction of the reference circuit board to obtain a target reference circuit board; and compare the target reference circuit board with the missing circuit board to determine the missing position of each missing component.

[0048] In one embodiment, the component missing detection module is further used to compare the original circuit board with a first preset number of reference circuit boards to obtain the first preset number of comparison results, wherein the original circuit board is a pre-specified reference circuit board, and the reference circuit board is a circuit board to be detected in which the number of components of each component category is the non-missing number; if there are not a second preset number of comparison results showing that the component positions are correct, then one of the reference circuit boards is determined to be the original circuit board, and the execution step is returned to: compare the original circuit board with a first preset number of reference circuit boards to obtain the first preset number of comparison results, until there are a second preset number of comparison results showing that the component positions are correct; if there are a second preset number of comparison results showing that the component positions are correct, then the original circuit board is determined to be the reference circuit board; wherein the first preset number is greater than the second preset number.

[0049] In one embodiment, the target detection module is specifically used to perform target detection on the plurality of circuit boards to be detected using a trained target detection model to obtain the detection results.

[0050] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method described in any one of the first aspects above is implemented.

[0051] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method as described in any one of the above-mentioned first aspects is implemented.

[0052] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes any one of the methods described in the first aspect.

[0053] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0054] The embodiment of the present application determines the circuit board where each component is located according to the detection information of each circuit board to be detected and the detection information of each component, and obtains the circuit board information of each component; determines the component category and the corresponding component quantity set on each circuit board to be detected according to the circuit board information and detection information of each component; so as to know the types of all components and the quantity of each component type on the circuit board to be detected; and determines the non-missing number of each component category according to the number of components of each component category on each circuit board to be detected; determines the missing circuit boards and the missing number of each missing component category according to the non-missing number of each component category, so that the number of each component category when it is not missing can be known based on statistical principles, and then the missing component category and the corresponding missing number of each circuit board can be known through comparison, without using templates and circuit boards to compare to know the missing situation of the circuit boards, thereby reducing the detection cost.

[0055] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0057] Figure 1 This is a first flow chart of a component missing detection method provided in an embodiment of the present application;

[0058] Figure 2 This is a first example diagram of a large circuit board provided by an embodiment of the present application;

[0059] Figure 3 This is an example diagram of components provided by an embodiment of the present application being located in a circuit board to be tested;

[0060] Figure 4 This is a second flow chart of the component missing detection method provided in one embodiment of the present application;

[0061] Figure 5 This is a first example diagram for obtaining a missing position provided by an embodiment of the present application;

[0062] Figure 6 This is a second example diagram for obtaining a missing position provided in an embodiment of the present application;

[0063] Figure 7 This is a second example diagram of a large circuit board provided in an embodiment of the present application;

[0064] Figure 8 is an example diagram of a transformation relationship provided by an embodiment of the present application;

[0065] Fig. 9 It is a structural schematic diagram of a component missing detection device provided in an embodiment of the present application;

[0066] Fig.10 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0067] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0068] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0069] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0070] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0071] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0072] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0073] Please refer to Figure 1 , Figure 1 This is a schematic diagram of the first process of the component missing detection method provided by an embodiment of the present application. Figure 1 As shown, the method comprises:

[0074] S11: Perform target detection on multiple circuit boards to be detected to obtain detection results.

[0075] The circuit boards to be tested are of the same type, and the test results include test information of the circuit boards to be tested and test information of the components.

[0076] In actual situations, on a production line, multiple circuit boards to be tested in the same scenario are usually spliced ​​into a larger circuit board in a certain form. Figure 2 , Figure 2 This is a first example diagram of a large circuit board provided by an embodiment of the present application. Figure 2 As shown, a large circuit board (secondary circuit board) is provided with multiple circuit boards to be detected (primary circuit boards), and various components are provided on the circuit boards to be detected. By performing target detection on the secondary circuit board, target detection can be achieved on multiple primary circuit boards. Target detection can also be performed on the primary circuits one by one to achieve target detection on multiple primary circuit boards.

[0077] In a possible implementation, step S11 includes:

[0078] The trained target detection model is used to perform target detection on multiple circuit boards to obtain detection results.

[0079] In the application, the trained target detection model is used to detect the circuit board to be inspected, identify the position of the circuit board to be inspected and the categories and positions of all components to obtain the detection results.

[0080] The trained target detection model may be a trained YOLO model (You Only Look Once, object detection and image segmentation model). In an example, the YOLO model is a YOLOv8 model.

[0081] The object detection model training process is to collect image data of the secondary circuit board in the actual scene in advance, and perform data annotation, annotate the category and location of the primary circuit board and the components in the primary circuit board, and obtain training data. The training data is used to train and test the object detection model to obtain a trained object detection model.

[0082] In a possible implementation, after the image data is labeled, data enhancement processing such as rotation, scaling, translation, cropping, and padding may be performed on the image data to obtain training data.

[0083] In a possible implementation, a predefined detection model may be obtained, and pre-trained weights may be loaded, and then training may be performed using training data.

[0084] S12: According to the detection information of each circuit board to be detected and the detection information of each component, the circuit board where each component is located is determined, and the circuit board information of each component is obtained.

[0085] In the application, after traversing each component and each circuit board to be inspected, the inspection information of the circuit board to be inspected includes the position, and the inspection information of the component includes the category and the position.

[0086] For each component, the position of the component is compared with the position of each circuit board to be tested in turn to determine the circuit board where the component is located.

[0087] Specifically, the position of the circuit board includes the coordinates of the upper left corner and the lower right corner of the circuit board. The position of the component includes the coordinates of the upper left corner and the lower right corner of the component. Compare the position of the component with the position of one of the circuit boards to be detected. If the position of the component is within the position of the circuit board to be detected, it is determined that the component is set on the circuit board to be detected. If the position of the component is not within the position of the circuit board to be detected, it is determined that the component is not set on the circuit board to be detected. Determine the next circuit board to be detected, and compare the position of the component with the position of the next circuit board to be detected until the circuit board where the component is located is determined. Each component performs the above steps to obtain the circuit board information of each component.

[0088] Please refer to Figure 3 , Figure 3 1 is an example diagram of components provided in an embodiment of the present application being located in a circuit board to be tested. Figure 3 As shown, when the position of the component satisfies the following expression, it is determined that the component is located in the circuit board to be tested.

[0089] The expression is: , where (xi,yi) is the coordinate of the upper left corner of the component, (xj,yj) is the coordinate of the lower right corner of the component, (Xi,Yi) is the coordinate of the upper left corner of the circuit board to be tested, and (Xj,Yj) is the coordinate of the lower right corner of the circuit board to be tested.

[0090] S13: Determine the component category and corresponding component quantity of each circuit board to be inspected according to the circuit board information and inspection information of each component.

[0091] In the application, according to the circuit board information and category of each component, the number of components and the category of all components on each circuit board to be detected are determined and recorded. Among them, this information can be stored in the memory or hard disk through a preset program to achieve recording.

[0092] For example, there are eight circuit boards to be tested, and there are three types of components set on the circuit boards to be tested. The types of components set on each circuit board to be tested and the corresponding number of components are shown in Table 1:

[0093]

[0094] Table 1

[0095] S14: Determine the non-missing quantity of each component category according to the quantity of components of each component category on each circuit board to be inspected.

[0096] In the application, when the first-level circuit boards and components on the production line have not changed, the non-missing quantity of each component category can be obtained through a single statistics and can be used continuously.

[0097] In a possible implementation, step S14 includes:

[0098] For each component category, the number of components of the component category of each circuit board to be tested is counted to obtain the number of occurrences of each component quantity, and the component quantity with the largest number of occurrences is determined as the non-missing number of the component category.

[0099] For example, there are eight circuit boards to be tested, and there are three types of components set on the circuit boards to be tested. The number of components that are not missing in each type is shown in Table 2:

[0100]

[0101] Table 2

[0102] In a possible implementation, step S14 includes:

[0103] The number of circuit boards to be tested is counted to obtain the total number of circuit boards to be tested. The number of components of each component category on each circuit board to be tested is counted to obtain the total number of components of each component category. Based on the total number of components of each component category and the total number of circuit boards to be tested, the number of components that are not missing in each component category is determined.

[0104] Specifically, the formula for determining the non-missing quantity of a component category is:

[0105] v=C(Mi / N), where v is the number of non-missing components, C is used to round up when the result is a decimal, Mi is the total number of components in the i-th component category, and N is the total number of circuit boards to be tested.

[0106] For example, there are eight circuit boards to be tested, and the total number of circuit boards to be tested is 8. There are three types of components set in the circuit boards to be tested. The number of components that are not missing in each category is shown in Table 3:

[0107]

[0108] Table 3

[0109] S15: Determine the missing quantity of missing circuit boards and each missing component category based on the non-missing quantity of each component category.

[0110] In the application, for each circuit board to be tested, the number of components of each component category on the circuit board to be tested is compared with the corresponding non-missing number to obtain the quantity comparison result of each component category. If there is at least one target component category, the circuit board to be tested is determined to be a missing circuit board, and the quantity comparison result of the target component category is determined to be the missing quantity of the missing component category, and the target component category is the component category whose quantity comparison result is not zero.

[0111] For example, based on the above table, the component quantity of components 1, 2, 3 of each circuit board to be tested is compared with the corresponding non-missing quantity to obtain the quantity comparison result of components 1, 2, 3.

[0112] Circuit board 3 has a target component category (component 1, the quantity comparison result of component 1 is 1-0=1), circuit board 3 is determined to be a missing circuit board, and the quantity comparison result of component 1 is determined to be the missing quantity of the missing component category (component 1).

[0113] Circuit board 7 has a target component category (component 2, the quantity comparison result of component 2 is 2-0=2), circuit board 7 is determined to be a missing circuit board, and the quantity comparison result of component 2 is determined to be the missing quantity of the missing component category (component 2).

[0114] The determination process of circuit board 4, circuit board 5, and circuit board 8 is the same, so it will not be repeated here.

[0115] It can be understood that by determining the non-missing number of each component category based on the number of components in each component category on each circuit board to be detected; determining the missing circuit boards and the missing number of each missing component category based on the non-missing number of each component category, it is possible to detect whether there are missing components on the circuit boards based on the relationship between the components inside each circuit board in the scene, so that it can be applicable to various scenarios and is not limited to scenarios with fixed or predictable target appearance.

[0116] In addition, by determining the number of components of each component category on each circuit board to be tested, the number of components of each category is determined, and the accurate number of components is obtained. By determining the missing number of missing circuit boards and each missing component category according to the number of components of each category, the accurate number of missing components of each category on the missing circuit board is obtained, which ensures the accuracy of detection, is conducive to ensuring the quality of circuit boards, improving production efficiency, and meeting market demand.

[0117] This embodiment determines the circuit board where each component is located according to the detection information of each circuit board to be detected and the detection information of each component, and obtains the circuit board information of each component; determines the component category and the corresponding component quantity set on each circuit board to be detected according to the circuit board information and detection information of each component; so as to know the types of all components and the quantity of each component type on the circuit board to be detected; and determines the non-missing number of each component category according to the number of components of each component category on each circuit board to be detected; determines the missing circuit boards and the missing number of each missing component category according to the non-missing number of each component category, so that the number of each component category when it is not missing can be known based on statistical principles, and then the missing component category and the corresponding missing number of each circuit board can be known through comparison, without using templates and circuit boards to compare to know the missing situation of the circuit boards, thereby reducing the detection cost.

[0118] Please refer to Figure 4 , Figure 4 2 is a schematic diagram of a second flow chart of a component missing detection method provided in an embodiment of the present application. Figure 4 As shown, the method further includes:

[0119] S16: Determine the position of each component on each circuit board to be inspected according to the circuit board information and inspection information of each component.

[0120] In the application, the position of each component on each circuit board to be inspected is determined according to the circuit board where the component is located and the position of the component.

[0121] S17: For each missing circuit board, compare the reference circuit board with the missing circuit board to determine the missing position of each missing component on the missing circuit board.

[0122] The reference circuit board is a circuit board to be tested in which all components are not missing and the components are positioned correctly.

[0123] In the application, since there are no missing components on the reference circuit board and the components are in the correct position, based on the image mode, the missing circuit board is compared with the reference circuit board, and the missing position of each missing component on the missing circuit board is determined according to the position of each component on the reference circuit board.

[0124] In one possible implementation, in order to obtain the accurate missing position of the missing component, the missing circuit board can be matched with the reference circuit board by aligning the coordinates of the upper left corner and the lower right corner of the circuit board, and then the missing circuit board can be compared with the reference circuit board.

[0125] Specifically, the upper left corner of the missing circuit board is aligned with the upper left corner of the reference circuit board, and then one of the circuit boards is selected for scaling to align the lower right corner of the missing circuit board with the lower right corner of the reference circuit board. In addition, during the scaling process, the size and position of the components are also scaled while the circuit board is scaled.

[0126] In a possible implementation, step S17 includes:

[0127] S21: For each missing component category of each missing circuit board, determine a first degree of coincidence between each component belonging to the missing component category on the reference circuit board and the components corresponding to the missing component category on the missing circuit board.

[0128] In the application, for each missing component category on a missing circuit board, after each component belonging to the missing component category on the reference circuit board is matched one-to-one with each component belonging to the missing component category on the missing circuit board, a first overlap between the corresponding two components is calculated.

[0129] Specifically, the first coincidence degree formula is:

[0130] IOU1= ; Where Ai is the area of ​​components on the reference circuit board, and Aj is the area of ​​components on the missing circuit board.

[0131] S22: For each first overlap, when the first overlap is less than a first preset overlap, a target component on the corresponding reference circuit board is obtained, and a missing position of the corresponding missing component is determined according to the position of the target component.

[0132] The type of the missing component is the same as the type of the target component.

[0133] In the application, for each first overlap, if the first overlap is less than the first preset overlap, it is determined that there is a component missing at the position, and the target component on the reference circuit board and the missing component on the missing circuit board corresponding to the first overlap are obtained. The missing position of the missing component on the missing circuit board is determined according to the position of the target component on the reference circuit board. If the first overlap is greater than or equal to the first preset overlap, it is determined that there is no component missing at the position.

[0134] For example, the missing component category of the missing circuit board is component 2, the non-missing quantity is 2, the missing quantity is 1, and the missing component is 2`-2.

[0135] After the reference circuit board is aligned with the missing circuit board, for component 2, a first degree of overlap between component 2-1 on the reference circuit board belonging to component 2 and component 2'-1 on the missing circuit board corresponding to component 2 is calculated. A first degree of overlap between component 2-2 on the reference circuit board belonging to component 2 and component 2'-2 on the missing circuit board corresponding to component 2 is calculated.

[0136] Because component 2`-1 on the missing circuit board is not missing, the corresponding first overlap is greater than the first preset overlap. Because component 2`-2 on the missing circuit board is missing, the corresponding first overlap is less than the first preset overlap, and the target component (component 2-2) and the missing component (component 2`-2) of the reference circuit board are obtained. The missing position of the missing component (component 2`-2) is determined according to the position of component 2-2.

[0137] The missing position of the missing component (component 2 '- 2 ) can be marked on the image of the missing circuit board by the shape of component 2 , or can be marked on the image of the missing circuit board by a rectangular frame.

[0138] Please refer to Figure 5 , Figure 5 This is a first example diagram of obtaining a missing position provided by an embodiment of the present application. Figure 5 As shown, the missing component category of the missing circuit board is component 2, the number of non-missing components is 2, the number of missing components is 1, and the missing component is 2`-2 (indicated by the dotted rectangular box). After aligning the reference circuit board with the missing circuit board and calculating the overlap, the missing position of the missing component 2`-2 of the missing circuit board is obtained (indicated by the solid rectangular box).

[0139] Or, S21`: for each missing circuit board, perform image subtraction between the reference circuit board and the missing circuit board to obtain each target image area and the corresponding target component on the reference circuit board, and the pixel value of the target image area is greater than the preset pixel value.

[0140] In the application, there is no component at the position where the component is missing on the missing circuit board, and the pixel value of the area after the image difference is greater than the preset pixel value. However, at the position where the component is not missing, the pixel value of the area after the image difference is less than the preset pixel value. For each missing circuit board, the reference circuit board is image-differencing with the missing circuit board to obtain an area with a pixel value greater than the preset pixel value, i.e., the target image area.

[0141] In one possible implementation, in order to obtain the accurate missing position of the missing component, the missing circuit board can be matched with the reference circuit board by aligning the coordinates of the upper left corner and the lower right corner of the circuit board, and then the image difference between the reference circuit board and the missing circuit board is performed.

[0142] S22': For each target image region, determine the missing position of the missing component corresponding to the target component according to the target image region.

[0143] In the application, for each target image area, the missing position of the missing component corresponding to the target component is determined according to the position of the target image area.

[0144] In one possible implementation, in order to obtain the accurate missing position of the missing component, the target image area can be first denoised, edge features extracted, edges enhanced, and a bounding rectangle generated, and then the missing position of the missing component is determined based on the position of the processed target image area.

[0145] For example, the missing component category of the missing circuit board is component 3, the non-missing quantity is 1, and the missing quantity is 1.

[0146] After the reference circuit board is aligned with the missing circuit board, the image difference between the reference circuit board and the missing circuit board is performed to obtain the target image area (the area corresponding to component 3) and the corresponding target component (component 3) on the reference circuit board. According to the position of the target image area, the position of the missing component (component 3') corresponding to the target component (component 3) is determined.

[0147] Please refer to Figure 6 , Figure 6 This is a second example diagram of obtaining a missing position provided by an embodiment of the present application. Figure 6 As shown, the missing component category of the missing circuit board is component 3, the number of non-missing components is 1, the number of missing components is 1, and the missing component 3' (indicated by the dotted rectangular box) is missing. After the reference circuit board is aligned with the missing circuit board and the images are subtracted, the missing position of the missing component 3' of the missing circuit board is obtained (indicated by the solid rectangular box).

[0148] This embodiment determines the position of each component on each circuit board to be inspected based on the circuit board information and detection information of each component; for each missing circuit board, the reference circuit board is compared with the missing circuit board to determine the missing position of each missing component on the missing circuit board, so as to obtain the accurate missing position of the missing component, so that the fault position can be quickly located, and automated monitoring, data analysis, and prevention can be realized, thereby improving production safety.

[0149] In one embodiment, in actual situations, on a production line, multiple circuit boards to be inspected in the same scenario are generally spliced ​​into a larger circuit board in different placement directions. The placement directions include splicing after rotation and splicing after flipping. In this scenario, the transformation relationship between other circuit boards and the reference circuit board is a left-right flip relationship, an up-down flip relationship, and a rotation relationship. Please refer to Figure 7 , Figure 7 This is a second example diagram of a large circuit board provided in an embodiment of the present application. Figure 7 As shown, a plurality of circuit boards to be tested (primary circuit boards) are arranged on a large circuit board (secondary circuit board), and the placement direction includes flipping and splicing. In this case, it is necessary to first determine the transformation relationship between the two circuit boards, and transform the reference circuit board to obtain the missing position of the missing components on the missing circuit board.

[0150] In a possible implementation, step S17 includes:

[0151] S31: For each missing circuit board, determining a second degree of coincidence between each component on the reference circuit board and the corresponding component on the missing circuit board.

[0152] In the application, after the components on the reference circuit board correspond to the components on the missing circuit board, the second coincidence degree between the corresponding two components is calculated.

[0153] S32: If each second degree of overlap is smaller than the second preset degree of overlap, determining the current transformation operation from the unselected transformation operations.

[0154] In the application, when each second overlap is less than the second preset overlap, it means that the position of the components of the reference circuit board is different from the position of the components of the missing circuit board, and the reference circuit board needs to be transformed. Then the current transformation operation is selected from the unselected transformation operations.

[0155] The selectable transformation operations are determined according to the transformation relationship between the circuit boards to be detected in the actual scene.

[0156] S33: According to the current transformation operation, the reference circuit board is transformed in direction to obtain a transformed reference circuit board.

[0157] S34: Determine a third degree of coincidence between each component on the transformed reference circuit board and the corresponding component on the missing circuit board.

[0158] In the application, after the components on the transformed reference circuit board correspond to the components on the missing circuit board, the third coincidence degree between the corresponding two components is calculated.

[0159] S35: If each third degree of overlap is less than the second preset degree of overlap, return to the execution step: determine the current transformation operation from the unselected transformation operations until each third degree of overlap is greater than or equal to the second preset degree of overlap, and obtain the target reference circuit board.

[0160] In the application, when each third overlap is less than the second preset overlap, it means that the position of the components of the reference circuit board after the transformation is still different from the position of the components of the missing circuit board, and the reference circuit board needs to be further transformed. Then, the current transformation operation is selected from the unselected transformation operations. Among them, the current unselected transformation operation does not include the transformation operation that was executed last time.

[0161] Then, the reference circuit board is continuously transformed in direction according to the current transformation operation to obtain a transformed reference circuit board, and a third degree of coincidence between each component on the transformed reference circuit board and the corresponding component on the missing circuit board is determined.

[0162] If each of the third degrees of overlap is smaller than the second preset degree of overlap, the current transformation operation continues to be determined from the unselected transformation operations until each of the third degrees of overlap is larger than the second preset degree of overlap.

[0163] When each third overlap degree is greater than or equal to the second preset overlap degree, it means that the position of the components of the transformed reference circuit board is the same as the position of the components of the missing circuit board, and the transformed reference circuit board is determined as the target reference circuit board. At the same time, the target transformation operation can be obtained.

[0164] S36: Compare the target reference circuit board with the missing circuit board to determine the missing position of each missing component.

[0165] For example, the transformation relationship between the other circuit boards and the reference circuit board is a left-right flip relationship, an up-down flip relationship, and a rotation relationship. Correspondingly, the transformation operation includes up-down flip, left-right flip, and rotation.

[0166] In general scenarios, multiple first-level circuit boards need to be effectively spliced ​​into second-level circuit boards, so the transformation relationship is generally 180° left-right flip relationship, 180° up-down flip relationship, and 180° rotation relationship. Please refer to Figure 8 , Figure 8 is an example diagram of the transformation relationship provided by an embodiment of the present application. Figure 8As shown, the reference circuit board is located in the center. The transformation relationship between the reference circuit board and the circuit board located above it is a 180° up-and-down flip relationship. The transformation relationship between the reference circuit board and the circuit board located to the right of it is a 180° left-and-right flip relationship. The transformation relationship between the reference circuit board and the circuit board located below it is a 180° rotation relationship.

[0167] Correspondingly, the transformation operations include 180° upside down flip, 180° left-right flip, and 180° rotation. The formula for 180° upside down flip is: ; The formula for 180° flip is ; The formula for 180° rotation is ; Among them, (xt, yt) is the coordinate point after transformation, (xb, yb) is the coordinate point before transformation, (xc, yc) is the center coordinate point of the circuit board, w and h are the image width and image height of the circuit board.

[0168] The transformation relationship between the preset reference circuit board and the missing circuit board is a 180° rotation relationship. Determine the second overlap between the reference circuit board and the missing circuit board. Each second overlap is less than the second preset overlap, and select the current transformation operation: 180° left-right flip from the unselected transformation operations (180° up and down flip, 180° left-right flip, 180° rotation). Perform a 180° left-right flip operation on the reference circuit board to obtain a transformed reference circuit board. Determine the third overlap between the transformed reference circuit board and the missing circuit board.

[0169] If each third overlap is less than the second preset overlap, the current transformation operation is selected from the unselected transformation operations (180° upside down flip, 180° rotation): 180° upside down flip. The reference circuit board is flipped 180° upside down to obtain a transformed reference circuit board. The third overlap between the transformed reference circuit board and the missing circuit board is determined.

[0170] If each third degree of overlap is less than the second preset degree of overlap, the current transformation operation is selected from the unselected transformation operations (180° rotation): 180° rotation. The reference circuit board is rotated 180° to obtain a transformed reference circuit board. The third degree of overlap between the transformed reference circuit board and the missing circuit board is determined. If each third degree of overlap is greater than the second preset degree of overlap, the transformation relationship between the reference circuit board and the missing circuit board is a 180° rotation relationship, and the target reference circuit board (the reference circuit board after 180° rotation) is obtained.

[0171] It can be understood that by determining the degree of overlap between the transformed reference circuit board and the missing circuit board, the transformation relationship between the reference circuit board and the missing circuit board can be accurately known, and the target reference circuit board is compared with the missing circuit board to determine the missing position of each missing component, so as to obtain the accurate missing position of each missing component of the missing circuit board, so that the fault position can be quickly located, and automated monitoring, data analysis, and prevention can be further realized, thereby improving production safety.

[0172] And when there is a transformation relationship between the reference circuit board and the missing circuit board, the missing position of the missing components of the missing circuit board can be determined, further improving the applicability of the solution.

[0173] In a possible implementation, step S17 includes:

[0174] S31': For each missing circuit board, determine the target transformation operation of the reference circuit board according to the board type of the missing circuit board.

[0175] Among them, the board types include upside-down flip board, left-right flip board, rotating board, and reference board.

[0176] In the application, the trained target detection model is used to detect the circuit board to be detected and identify the board type of the circuit board to be detected. According to the board type of the missing circuit board, the transformation relationship between the reference circuit board and the missing circuit board and the target transformation operation of the reference circuit board are determined.

[0177] S32`: According to the target transformation operation, the reference circuit board is transformed in direction to obtain a target reference circuit board.

[0178] S33`: Compare the target reference circuit board with the missing circuit board to determine the missing position of each missing component.

[0179] In an application, the positions of the components of the target reference circuit board are the same as the positions of the components of the missing circuit board. The target reference circuit board can be compared with the missing circuit board to determine the missing position of each missing component.

[0180] It can be understood that by determining the target transformation operation of the reference circuit board based on the board type of the missing circuit board, the transformation relationship and target transformation operation between the reference circuit board and the missing circuit board can be quickly and accurately determined, and then the target reference circuit board is compared with the missing circuit board to determine the missing position of each missing component, so as to obtain the accurate missing position of each missing component of the missing circuit board, so that the fault position can be quickly located, and automated monitoring, data analysis, and prevention can be further realized, thereby improving production safety.

[0181] In one embodiment, before step S17, the method further includes:

[0182] S41: Compare the original circuit board with a first preset number of reference circuit boards to obtain a first preset number of comparison results.

[0183] The original circuit board is a pre-specified reference circuit board, and the reference circuit board is a circuit board to be tested in which the number of components of each component category is not missing.

[0184] Generally, the reference circuit board is selected as the circuit board to be tested which is located around the original circuit board and does not have any missing components. After the reference circuit board is aligned with the original circuit board, the components of the reference circuit board are matched with the components of the original circuit board.

[0185] In the application, to prevent the situation where there are actually missing components in the original circuit board but they are not detected, resulting in the original circuit board being used as the reference circuit board, that is, to prevent the original circuit board from being misdetected, the original circuit board is compared with a first preset number of reference circuit boards to obtain a first preset number of comparison results.

[0186] It can be understood that comparing the original circuit board with the first preset number of reference circuit boards can reduce the situation where the inaccurate position of components on a certain reference circuit board affects the detection of the original circuit board.

[0187] S42: If there are not a second preset number of comparison results indicating that the component position is correct, determine that one of the reference circuit boards is the original circuit board, and return to the execution step: compare the original circuit board with the first preset number of reference circuit boards to obtain a first preset number of comparison results, until there are a second preset number of comparison results indicating that the component position is correct.

[0188] In the application, if there are no second preset number of comparison results showing that the component positions are correct, it means that the situation of the original circuit board is inconsistent with the situations of most of the surrounding reference circuit boards, including missing components on the original circuit board and / or the positions of the components do not correspond, resulting in missing component categories on the original circuit board. It is necessary to use other circuit boards without missing components to replace the original circuit board and determine that one of the reference circuit boards is the original circuit board.

[0189] In order to determine whether the original circuit board obtained after replacement is accurate, continue to judge the original circuit board obtained after replacement. Continue to compare the original circuit board obtained after replacement with the first preset number of reference circuit boards to obtain the first preset number of comparison results. If there are still no second preset number of comparison results that the position of the components is correct, continue to replace it with other circuit boards without missing components, and continue to perform the steps of comparing with the first preset number of reference circuit boards until there are second preset number of comparison results that the position of the components is correct.

[0190] S43: If there are a second preset number of comparison results indicating that the component positions are correct, the original circuit board is determined to be the reference circuit board.

[0191] The first preset number is greater than the second preset number. The first preset number and the second preset number are set according to actual scene requirements.

[0192] In the application, if there are a second preset number of comparison results that the component positions are correct, it means that the situation of the original circuit board is consistent with that of most of the surrounding reference circuit boards (because there may be inaccurate component positions on a certain reference circuit board, it is only required to be consistent with most of them), there are no missing components on the original circuit board and the positions of each component correspond, so that the original circuit board does not have any missing component categories, and then it is used as the reference circuit board.

[0193] In this embodiment, the original circuit board is compared with a first preset number of reference circuit boards to obtain a first preset number of comparison results. If there are no comparison results showing that the components are correctly positioned within the second preset number, one of the reference circuit boards is determined to be the original circuit board, and the execution step is returned to: the original circuit board is compared with the first preset number of reference circuit boards to obtain a first preset number of comparison results until there are comparison results showing that the components are correctly positioned within the second preset number; if there are comparison results showing that the components are correctly positioned within the second preset number, the original circuit board is determined to be a reference circuit board, so that a reference circuit board with no missing components and accurate component positions can be obtained, thereby providing a guarantee for obtaining the accurate missing positions of the missing components.

[0194] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0195] Corresponding to the method described in the above embodiment, for the convenience of explanation, only the part related to the embodiment of the present application is shown.

[0196] Please refer to Fig. 9 , Fig. 9 Schematic diagram of the structure of a component missing detection device provided by an embodiment of the present application. Fig. 9 As shown, the device comprises:

[0197] The target detection module 10 is used to perform target detection on multiple circuit boards to be detected and obtain detection results. The circuit boards to be detected are of the same type. The detection results include detection information of each circuit board to be detected and detection information of each component.

[0198] The component missing detection module 11 is used to determine the circuit board where each component is located according to the detection information of each circuit board to be detected and the detection information of each component, and obtain the circuit board information of each component;

[0199] It is also used to determine the component category and corresponding component quantity of each circuit board to be tested according to the circuit board information and test information of each component;

[0200] It is also used to determine the non-missing quantity of each component category according to the quantity of components of each component category on each circuit board to be detected;

[0201] It is also used to determine the missing quantity of missing circuit boards and each missing component category based on the non-missing quantity of each component category.

[0202] In one embodiment, the component missing detection module is also used to determine the position of each component on each circuit board to be detected based on the circuit board information and detection information of each component; for each missing circuit board, the reference circuit board is compared with the missing circuit board to determine the missing position of each missing component on the missing circuit board, and the reference circuit board is a circuit board to be detected in which no components are missing and the component positions are correct.

[0203] In one embodiment, a missing component detection module is specifically used to determine, for each missing component category of each missing circuit board, a first degree of overlap between each component belonging to the missing component category on the reference circuit board and the component corresponding to the missing component category on the missing circuit board; for each first degree of overlap, when the first degree of overlap is less than a first preset degree of overlap, obtain the corresponding target component on the reference circuit board, and determine the missing position of the corresponding missing component according to the position of the target component; or, for each missing circuit board, perform image subtraction between the reference circuit board and the missing circuit board to obtain each target image area and the corresponding target component on the reference circuit board, the pixel value of the target image area being greater than the preset pixel value; for each target image area, determine the missing position of the missing component corresponding to the target component according to the target image area; wherein the type of the missing component is the same as the type of the target component.

[0204] In one embodiment, a component missing detection module is specifically used to determine, for each missing circuit board, a second degree of overlap between each component on a reference circuit board and a corresponding component on the missing circuit board; if each second degree of overlap is less than a second preset degree of overlap, then determine the current transformation operation from an unselected transformation operation; according to the current transformation operation, perform a direction transformation on the reference circuit board to obtain a transformed reference circuit board; determine a third degree of overlap between each component on the transformed reference circuit board and a corresponding component on the missing circuit board; if each third degree of overlap is less than the second preset degree of overlap, then return to the execution step: determine the current transformation operation from an unselected transformation operation until each third degree of overlap is greater than or equal to the second preset degree of overlap to obtain a target reference circuit board; compare the target reference circuit board with the missing circuit board to determine the missing position of each missing component.

[0205] In one embodiment, the missing component detection module is specifically used to determine, for each missing circuit board, a target transformation operation of a reference circuit board according to the board type of the missing circuit board; according to the target transformation operation, transform the direction of the reference circuit board to obtain a target reference circuit board; and compare the target reference circuit board with the missing circuit board to determine the missing position of each missing component.

[0206] In one embodiment, the component missing detection module is also used to compare the original circuit board with a first preset number of reference circuit boards to obtain a first preset number of comparison results, where the original circuit board is a pre-specified reference circuit board, and the reference circuit board is a circuit board to be detected in which the number of components of each component category is not missing; if there is not a second preset number of comparison results showing that the component positions are correct, then one of the reference circuit boards is determined to be the original circuit board, and the execution step is returned to: compare the original circuit board with the first preset number of reference circuit boards to obtain a first preset number of comparison results, until there is a second preset number of comparison results showing that the component positions are correct; if there is a second preset number of comparison results showing that the component positions are correct, then the original circuit board is determined to be the reference circuit board; wherein the first preset number is greater than the second preset number.

[0207] In one embodiment, the target detection module is specifically used to perform target detection on multiple circuit boards to be detected using a trained target detection model to obtain detection results.

[0208] Fig.10 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Fig.10 As shown, the electronic device 9 of this embodiment includes: at least one processor 90 ( Fig.10Only one is shown in the figure), a memory 91, and a computer program 99 stored in the memory 91 and executable on the at least one processor 90, wherein the processor 90 implements the steps of any of the above-mentioned method embodiments when executing the computer program 99.

[0209] The electronic device 9 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device 9 may include, but is not limited to, a processor 90 and a memory 91. Those skilled in the art will appreciate that Fig.10 It is only an example of the electronic device 9 and does not constitute a limitation on the electronic device 9. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0210] The processor 90 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0211] In some embodiments, the memory 91 may be an internal storage unit of the electronic device 9, such as a hard disk or memory of the electronic device 9. In other embodiments, the memory 91 may also be an external storage device of the electronic device 9, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 9. Further, the memory 91 may also include both an internal storage unit of the electronic device 9 and an external storage device. The memory 91 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory 91 may also be used to temporarily store data that has been output or is to be output.

[0212] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0213] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0214] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0215] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0216] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some cases, the computer-readable medium cannot be an electric carrier signal and a telecommunication signal.

[0217] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0218] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0219] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0220] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0221] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A component missing detection method, characterized in that: include: Performing target detection on multiple circuit boards to be detected to obtain detection results, wherein the circuit boards to be detected are of the same type, and the detection results include detection information of the circuit boards to be detected and detection information of each component; According to the detection information of each circuit board to be detected and the detection information of each component, determine the circuit board where each component is located, and obtain the circuit board information of each component; Determine the component category and corresponding component quantity of each circuit board to be detected according to the circuit board information and the detection information of each component; Determine the non-missing quantity of each component category according to the quantity of components of each component category on each circuit board to be inspected; The missing circuit boards and the missing component quantities of each missing component category are determined based on the non-missing quantity of each component category.

2. The method according to claim 1, characterized in that Also includes: Determine the position of each component on each circuit board to be detected according to the circuit board information and the detection information of each component; For each missing circuit board, a reference circuit board is compared with the missing circuit board to determine the missing position of each missing component on the missing circuit board. The reference circuit board is a circuit board to be detected with no missing components and correct component positions.

3. The method according to claim 2, characterized in that: For each missing circuit board, comparing the reference circuit board with the missing circuit board to determine the missing position of each missing component on the missing circuit board includes: For each of the missing component categories of each of the missing circuit boards, determining a first degree of coincidence between each of the components belonging to the missing component category on the reference circuit board and the components corresponding to the missing component category on the missing circuit board; For each of the first overlaps, when the first overlap is less than a first preset overlap, obtaining a corresponding target component on the reference circuit board, and determining the missing position of the corresponding missing component according to the position of the target component; Or, for each missing circuit board, perform image subtraction between the reference circuit board and the missing circuit board to obtain each target image area and the corresponding target component on the reference circuit board, wherein the pixel value of the target image area is greater than a preset pixel value; For each of the target image regions, determining the missing position of the missing component corresponding to the target component according to the target image region; The type of the missing component is the same as the type of the target component.

4. The method according to claim 2, characterized in that: For each missing circuit board, comparing the reference circuit board with the missing circuit board to determine the missing position of each missing component on the missing circuit board includes: For each of the missing circuit boards, determining a second degree of overlap between each of the components on the reference circuit board and the corresponding components on the missing circuit board; If each of the second overlaps is less than the second preset overlap, determining the current transformation operation from the unselected transformation operations; According to the current transformation operation, the reference circuit board is transformed in direction to obtain a transformed reference circuit board; Determine a third degree of coincidence between each of the components on the transformed reference circuit board and the corresponding components on the missing circuit board; If each of the third overlaps is less than the second preset overlap, return to the execution step: determine the current transformation operation from the unselected transformation operations until each of the third overlaps is greater than or equal to the second preset overlap, and obtain the target reference circuit board; The target reference circuit board is compared with the missing circuit board to determine the missing position of each missing component.

5. The method according to claim 2, characterized in that: For each missing circuit board, comparing the reference circuit board with the missing circuit board to determine the missing position of each missing component on the missing circuit board includes: For each missing circuit board, determining a target transformation operation of the reference circuit board according to the board type of the missing circuit board; According to the target transformation operation, the reference circuit board is transformed in direction to obtain a target reference circuit board; The target reference circuit board is compared with the missing circuit board to determine the missing position of each missing component.

6. The method according to claim 2, characterized in that Before comparing the reference circuit board with the missing circuit board for each missing circuit board to determine the missing position of each missing component on the missing circuit board, the method further includes: Compare the original circuit board with a first preset number of reference circuit boards to obtain the first preset number of comparison results, wherein the original circuit board is a pre-specified reference circuit board, and the reference circuit board is a circuit board to be detected in which the number of components of each component category is the non-missing number; If there are not a second preset number of comparison results indicating that the component position is correct, then determine that one of the reference circuit boards is the original circuit board, and return to the execution step: compare the original circuit board with the first preset number of reference circuit boards to obtain the first preset number of comparison results, until there are a second preset number of comparison results indicating that the component position is correct; If there are the second preset number of the comparison results indicating that the component positions are correct, determining that the original circuit board is the reference circuit board; The first preset number is greater than the second preset number.

7. The method according to any one of claims 1 to 6, characterized in that: The target detection is performed on a plurality of circuit boards to be detected to obtain detection results, including: The trained target detection model is used to perform target detection on the plurality of circuit boards to be detected to obtain the detection results.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.