Data deletion method, device, equipment and storage medium for visual inspection

By automatically deleting hard disk folders based on storage age during AI/AOI inspection, I/O operation issues caused by insufficient hard disk space are resolved, improving system performance, ensuring inspection stability, and enabling multi-system collaboration.

CN116932793BActive Publication Date: 2025-09-30HON HAI PRECISION INDUSTRY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210369387.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-08
Publication Date
2025-09-30
Estimated Expiration
2042-04-08

AI Technical Summary

Technical Problem

In AI/AOI defect inspection, when hard disk space is insufficient, existing technologies free up space by deleting images one by one, resulting in a large number of I/O operations and reducing system performance.

Method used

By creating folders on the hard disk and recording storage time information, the oldest folders are automatically deleted based on storage time to free up space, avoiding large-scale I/O operations. Deletion is only performed when the hard disk space is insufficient, ensuring that data retention time is maximized.

Benefits of technology

Improve system performance, ensure detection stability and long-term operation, realize multi-system collaboration, and facilitate software development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116932793B_ABST
    Figure CN116932793B_ABST
Patent Text Reader

Abstract

A data deletion method, device, equipment, and storage medium for visual inspection can avoid a large number of I / O operations, thereby improving system performance. The method includes: a first system obtains an image of the current object to be inspected; the first system writes the image of the current object to be inspected into a current folder; the current folder is stored on the hard disk of an automatic optical inspection device; the current folder is used to store multiple images of the objects to be inspected; the current folder includes storage time information; a second system automatically inspects the objects to be inspected through vision based on the image; if the available space on the hard disk is less than a preset value, a third system deletes one or more folders with the earliest storage time from multiple folders on the hard disk based on the storage time information until the available space on the hard disk is greater than or equal to the preset value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of AI (artificial intelligence) / AOI (Automated Optical Inspection), and in particular to a data deletion method, apparatus, device, and storage medium for visual inspection. Background Art

[0002] AI / AOI technology is currently the mainstream defect detection technology both domestically and internationally. During defect detection, the object to be inspected must be photographed with a camera and the captured image stored on a hard drive for subsequent inspection and data analysis. However, after prolonged or frequent defect detection, the hard drive may become filled with images and other data, making it impossible to continue defect detection. Currently, when hard drive space is insufficient, images can be deleted one by one to free up hard drive space. However, this will require a large number of I / O operations, reducing system performance. Summary of the Invention

[0003] In view of the above, embodiments of the present application provide a data deletion method, apparatus, device, and storage medium for visual inspection, which can avoid a large number of I / O operations and thereby improve system performance.

[0004] In the first aspect, an embodiment of the present application provides a data deletion method for visual inspection, which is applied to an automatic optical inspection device including multiple systems, and the multiple systems include a first system, a second system and a third system. The method includes: the first system obtains an image of the current object to be inspected; the first system writes the image of the current object to be inspected into a current folder; the current folder is stored in the hard disk of the automatic optical inspection device; the current folder is used to store multiple images of objects to be inspected; the current folder includes storage time information; the second system automatically inspects the object to be inspected through vision based on the image; if the available space of the hard disk is less than a preset value, the third system deletes one or more folders with the earliest storage time from multiple folders in the hard disk according to the storage time information until the available space of the hard disk is greater than or equal to the preset value.

[0005] The data deletion method for visual inspection of the present application can realize AI / AOI inspection by automatically inspecting the object to be inspected based on the image of the current object to be inspected; by writing the image of the current object to be inspected into the current folder, and when the available space of the monitoring hard disk is less than the preset value, deleting one or more folders with the earliest storage time until the available space of the hard disk is greater than or equal to the preset value, the images can be deleted in batches by folder, avoiding large-scale I / O operations, improving system performance, and only deleting the folders with the earliest storage time when the available space of the hard disk is insufficient, ensuring that the data retention time is maximized, and data can be effectively cleared, ensuring stable and long-term inspection operation; by integrating the three different systems of the first system, the second system, and the third system on the automatic optical inspection equipment, the automatic optical inspection equipment can realize the mutual collaboration of multiple different systems, facilitating software development.

[0006] According to some embodiments of the present application, the method further includes: the first system creating a new folder at a predetermined creation time; and updating the new folder to the current folder. By creating a new folder and updating the current folder to the new folder, the present application allows different folders to store different images, facilitating subsequent deletion of the folder with the oldest storage time.

[0007] According to some embodiments of the present application, the first system writes the image of the current object to be detected into the current folder, including: the first system writes the image of the current object to be detected into the current folder to generate the current storage path information of the image of the current object to be detected; the method also includes: if the current detection result indicates that the detection is passed, the third system writes the current storage path information into the first file of the database; the third system deletes the images corresponding to all storage path information in the first file from the hard disk at preset deletion time. The present application can selectively delete images by preferentially deleting images that have passed the detection from the hard disk and retaining images that have failed the detection, thereby increasing the cycle time of the images that have failed the detection, maximizing the retention time of the images that have failed the detection, and using the images that have failed the detection for more applications, such as analyzing the production line yield and defect concentration.

[0008] According to some embodiments of the present application, if the available space of the hard disk is less than a preset value, the third system deletes one or more folders with the earliest storage time from multiple folders in the hard disk according to the storage time information until the available space of the hard disk is greater than or equal to the preset value, the method further includes: the third system writes the current detection result and the current folder information in the current storage path information into the second file of the database; if the available space of the hard disk is less than a preset value, the third system deletes one or more folders with the earliest storage time from multiple folders in the hard disk according to the storage time information until the available space of the hard disk is greater than or equal to the preset value, the method further includes: the third system deletes data corresponding to the deleted folder information from the second file of the database. The present application saves the detection results and folder information in the second file, so that the second file can be used for subsequent analysis and can be used together with the image to back-analyze the production line operation status.

[0009] According to some embodiments of the present application, the method further includes: the first system transmitting image information including the current storage path information to the second system; the second system automatically detecting the object to be detected by vision based on the image, including: the second system obtaining an image of the current object to be detected from the hard disk based on the current storage path information in the image information; the second system automatically detecting the object to be detected by vision based on the image of the current object to be detected. The present application transmits image information between the first and second systems, eliminating the need to transmit images, reducing image transmission traffic, and accelerating transmission speed.

[0010] According to some embodiments of the present application, the method further includes: the second system transmitting detection information including the current storage path information and the current detection result to the third system; if the current detection result is a pass, the third system writing the current storage path information into the first file of the database includes: if the current detection result in the detection information indicates a pass, the third system writing the current storage path information in the detection information into the first file of the database. The present application transmits the detection result and storage path information to the third system via the second system, facilitating data analysis by the third system.

[0011] According to some embodiments of the present application, the second system communicates with the first system, and with the third system, via a presentation layer state transfer API. This application facilitates information exchange between different software / systems over a network by enabling communication between different systems via a presentation layer state transfer API, providing a method for integrating different systems into a single automated optical inspection device.

[0012] In the second aspect, an embodiment of the present application provides a data deletion device for visual inspection, the device comprising: an image acquisition module for acquiring an image of the current object to be inspected; the image acquisition module is also used to write the image of the current object to be inspected into a current folder; the current folder is stored in the hard disk of the automatic optical inspection device; the current folder is used to store images of multiple objects to be inspected; the current folder includes storage time information; an automatic detection module for automatically inspecting the object to be inspected visually based on the image; a data processing module for deleting one or more folders with the earliest storage time from multiple folders in the hard disk according to the storage time information if the available space of the hard disk is less than a preset value until the available space of the hard disk is greater than or equal to the preset value.

[0013] In a third aspect, an embodiment of the present application provides an automatic optical inspection device, which includes a processor and a memory, wherein the memory is used to store program instructions. When the processor calls the program instructions, it implements the data deletion method for visual inspection as described in any possible embodiment of the first aspect above.

[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program, wherein the program enables a computer device to execute the data deletion method for visual detection as described in any possible embodiment of the first aspect above.

[0015] For the specific descriptions of the second to fourth aspects and their various implementations in this application, reference can be made to the detailed descriptions in the first aspect and its various implementations; and for the beneficial effects of the second to fourth aspects and their various implementations, reference can be made to the analysis of the beneficial effects in the first aspect and its various implementations, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0017] Figure 1 This is a schematic diagram of an application scenario of the automatic optical inspection equipment according to an embodiment of the present application.

[0018] Figure 2 Schematic diagram of the hardware structure of the automatic optical inspection equipment of an embodiment of the present application.

[0019] Figure 3 This is a flow chart of a data deletion method for visual inspection according to an embodiment of the present application.

[0020] Figure 4 This is a diagram of the architecture of the automatic optical inspection equipment according to an embodiment of the present application.

[0021] Figure 5 This is a schematic diagram of folders stored in a hard disk according to an embodiment of the present application.

[0022] Figure 6 Schematic diagram of a data deletion method for visual detection according to an embodiment of the present application.

[0023] Figure 7 A schematic diagram of scheduling according to an embodiment of the present application.

[0024] Figure 8 Schematic diagram of a data deletion device for visual detection according to an embodiment of the present application.

[0025] Description of main component symbols

[0026] Automatic optical inspection equipment 10

[0027] Camera 11

[0028] Current objects to be detected 12

[0029] Automatic optical inspection equipment 20

[0030] Memory 21

[0031] Processor 22

[0032] Display 23

[0033] Communication interface 24

[0034] Automatic optical inspection equipment 40

[0035] First System 41

[0036] Second System 42

[0037] Third System 43

[0038] Data deletion device 80 for visual inspection

[0039] Image acquisition module 81

[0040] Automatic detection module 82

[0041] Data processing module 83

[0042] The following specific implementation methods will further illustrate the present application in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0043] In the description of the embodiments of this application, words such as "for example" and "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "for example" in the embodiments of this application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "for example" is intended to present the relevant concepts in a concrete manner.

[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art in the art to which this application relates. The terms used in the specification of this application are for the purpose of describing specific embodiments only and are not intended to limit this application. It should be understood that, in this application, unless otherwise specified, "a plurality" means two or more than two.

[0045] Please refer to Figure 1 , Figure 1Schematic diagram of the application scenario of the automatic optical inspection equipment of the embodiment of the present application. The automatic optical inspection equipment 10 may be an industrial computer. It is understood that the automatic optical inspection equipment 10 may also be a computer, etc., and this application does not limit this. The automatic optical inspection equipment 10 may be connected to a camera 11. The connection between the automatic optical inspection equipment 10 and the camera 11 may be a wired connection or a wireless connection. The camera 11 may be an industrial camera. It is understood that the camera 11 may also be other camera devices, and this application does not limit this. The automatic optical inspection equipment 10 is used to control the camera 11 to capture the image of the current object to be inspected 12, obtain the captured image of the current object to be inspected 12 from the camera 11, and store the image of the current object to be inspected 12 in the hard disk of the automatic optical inspection equipment 10. The automatic optical inspection equipment 10 is also used to perform automatic detection of the object to be inspected based on the image of the object to be inspected, monitor the available space of the hard disk, and perform image cleaning based on the available space of the hard disk. It is understandable that the camera 11 may also be a built-in camera 11 of the automatic optical inspection device 10 , that is, the automatic optical inspection device 10 may include the camera 11 , and this application does not impose any limitation on this.

[0046] Please refer to Figure 2 , Figure 2 Schematic diagram of the hardware structure of the automatic optical inspection device of the embodiment of the present application. The automatic optical inspection device 20 can be an industrial computer, a computer, etc. The present application does not limit the specific type of the automatic optical inspection device 20.

[0047] The automatic optical detection device 20 includes a memory 21, a processor 22, a display screen 23 and a communication interface 24. It can be understood by those skilled in the art that Figure 2 The structure shown in the figure does not constitute a limitation on the automatic optical inspection device 20. The automatic optical inspection device 20 may include more or fewer components than shown in the figure, such as a camera, or a combination of certain components, or a separation of certain components, or a different arrangement of components.

[0048] The memory 21 can be used to store software programs and / or modules / units. The processor 22 implements the various functions of the automated optical inspection device 20 by running or executing the software programs and / or modules / units stored in the memory 21 and accessing data stored in the memory 21. The memory 21 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as an image playback function); the data storage area may store data (such as image data) generated based on the use of the automated optical inspection device 20. In addition, the memory 21 may include non-volatile computer-readable memory, such as a hard disk, memory, etc. It is understood that the memory 21 may also include other non-volatile computer-readable memories, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device.

[0049] The processor 22 may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 22 may be a microprocessor or any conventional processor. The processor 22 is the control center of the automated optical inspection device 20 and connects various parts of the automated optical inspection device 20 using various interfaces and lines.

[0050] The display screen 23 can be used to display images, videos, and the like. The display screen 23 includes a display panel. The display panel can be a liquid crystal display, an organic light-emitting display, a flexible display, a plasma display, or the like. It is understood that the display screen 23 can also be used to receive user input and can include a touch panel, although this application does not limit this.

[0051] The communication interface 24 may include a standard wired interface, a wireless interface, etc. The communication interface 24 is used for the automatic optical inspection device 20 to communicate with the camera.

[0052] Please refer to Figure 3 , Figure 3 This is a flow chart of a data deletion method for visual detection according to an embodiment of the present application. The flow chart of the data deletion method for visual detection is applied to Figure 2 Please also refer to the automatic optical inspection equipment shown. Figure 4 , Figure 4 This is an architectural diagram of an automated optical inspection device according to an embodiment of the present application. The automated optical inspection device 40 includes a first system 41, a second system 42, and a third system 43. The first system 41 may be an image acquisition system. The second system 42 may be an AI / AOI automated inspection system. The third system 43 may be a data processing system. The second system 42 may communicate with the first system 41. The second system 42 may communicate with the third system 43. The data deletion method for visual inspection includes:

[0053] Step S301: the first system acquires an image of the object to be detected.

[0054] In some embodiments, the first system may control the camera connected to the automatic optical inspection device to capture an image of the current object to be inspected, and obtain the image of the current object to be inspected captured by the camera from the camera.

[0055] In some embodiments, the first system may acquire an image of the object to be inspected through a camera built into the automatic optical inspection equipment.

[0056] In some embodiments, the object to be detected may be an assembly line product such as a PCB board, a connector, a semiconductor, or a chip capacitor.

[0057] Step S302: The first system writes the image of the current object to be detected into a current folder; the current folder is stored in the hard disk of the automatic optical inspection device; the current folder is used to store multiple images of objects to be detected; the current folder includes storage time information.

[0058] The first system writes the image of the current object to be detected into the current folder as follows Figure 4 In some embodiments, the hard disk may store multiple folders, such as Figure 5 As shown. Figure 5 In the example, the hard disk stores a folder called batch-1631005002, a folder called batch-1631003562, a folder called batch-1631002122, and a folder called batch-1631000682. Multiple folders can be stored in the root directory of the hard disk, for example Figure 5The multiple folders are arranged in the order of storage time information from the earliest to the latest, for example, Figure 5 As shown, the batch-1631000682 folder, batch-1631002122 folder, batch-1631003562 folder, and batch-1631005002 folder are arranged in order from far to near according to the storage time information. The storage time information can be the creation time of the folder, or the time when the first image in the folder is written to the folder, or the time when the last image in the folder is written to the folder, etc., and this application does not impose any restrictions on this. Among them, the batch-1631005002 folder is the current folder, and the batch-1631000682 folder, batch-1631002122 folder, and batch-1631003562 folder are the folders before the current folder. Each folder stores multiple images of the object to be detected acquired within a preset time period. For example, if the current time is 10:05, each folder stores images of the object to be detected acquired within 1 hour, and an image of the current object to be detected is acquired every 5 seconds. Then, the batch-1631002122 folder stores multiple images of the object to be detected acquired between 8:00 and 9:00, the batch-1631003562 folder stores multiple images of the object to be detected acquired between 9:00 and 10:00, and the batch-1631005002 folder stores images of the object to be detected acquired at the current time. It is understandable that if the current time is 10:02, the batch-1631005002 folder stores images of the object to be detected acquired at the current time and multiple images of the object to be detected acquired between 10:00 and 10:02. It is understandable that Figure 5 This is an example of storing folders in a hard disk. The number of folders may be other numbers, the names of the folders may be other names, and the arrangement of the folders may be other arrangements. This application does not limit the content and form of the storage of the folders.

[0059] In some embodiments, the method further includes: the first system creates a new folder every preset creation time, and updates the new folder to the current folder, such as Figure 6 As shown. Therefore, the time of acquiring images stored in different folders is different. Figure 6 In the embodiment, while acquiring and storing images, the first system also creates a new folder at a preset creation time and updates the new folder to the current folder. That is, the first system acquires and stores images, and the first system creates and updates the new folder, which are two parallel processes and do not interfere with each other. The automatic optical inspection device stores a scheduling file, such as Figure 7As shown. Figure 7 In one embodiment, the scheduling file includes a first scheduling file. The first scheduling file includes first scheduling content and a first scheduling period. The first scheduling content includes the creation of a folder. The first scheduling period includes a preset creation time, such as 1 hour. In some embodiments, the first system creates a new folder at the preset creation time according to the first scheduling file and updates the new folder to the current folder.

[0060] In some embodiments, the first system writes the image of the current object to be detected into the current folder to generate the current storage path information of the image of the current object to be detected. In some embodiments, the first system also transmits the image information including the current storage path information to the second system via a Restful (Representational State Transfer) API (Application Programming Interface), such as Figure 4 As shown. The Restful API is a network architecture interface that specifies a unified communication protocol. The Restful API facilitates information exchange between different software / systems on a network. The Restful API can integrate multiple different functions into an automated optical inspection device, for example, integrating the first system and the second system into the automated optical inspection device. In some embodiments, the image information also includes image size information.

[0061] Step S303: the second system automatically detects the object to be detected through vision according to the image.

[0062] In some embodiments, the second system can automatically detect the color, appearance, size, defects, etc. of the object to be inspected, for example, detecting dents on the object to be inspected, detecting the location and size of damage on the object to be inspected, detecting the welding position of the object to be inspected, etc.

[0063] In some embodiments, the second system receives the image information from the first system. Figure 4 As shown, the second system obtains the image of the current object to be detected from the hard disk according to the current storage path information in the image information; the second system also automatically detects the object to be detected through vision based on the image of the current object to be detected.

[0064] In some embodiments, the second system further determines the true size of the object to be detected based on the size information of the image in the image information, thereby improving the accuracy of detection.

[0065] In some embodiments, the method further includes: the second system transmitting the detection information including the current storage path information and the current detection result to the third system. The current detection result includes, for example, the damage location and damage size of the object to be detected, or no damage, etc. In some embodiments, as Figure 4 As shown, the second system transmits the detection information including the current storage path information and the current detection result to the third system via the Restful API. Thus, the Restful API can integrate the first system, the second system, and the third system into the automatic optical inspection device.

[0066] Step S304: If the available space of the hard disk is less than a preset value, the third system deletes one or more folders with the earliest storage time from the multiple folders in the hard disk according to the storage time information until the available space of the hard disk is greater than or equal to the preset value.

[0067] In some embodiments, as Figure 6 As shown, if the available space of the hard disk is less than a preset value, the third system deletes one or more folders with the earliest storage time from the multiple folders in the hard disk according to the storage time information until the available space of the hard disk is greater than or equal to the preset value, and the method further includes: monitoring whether the available space of the hard disk is less than the preset value. In some embodiments, as Figure 7 As shown, the scheduling file also includes a second scheduling file. The second scheduling file includes a second scheduling content and a second scheduling period. The second scheduling content includes monitoring of the available space of the hard disk. The second scheduling period includes a preset monitoring time, such as 1 second. In some embodiments, the available space of the hard disk is monitored to see if it is less than a preset value according to the second scheduling file. Thus, the hard disk space can be released in a timely manner. The present application can delete images in batches by folder, avoiding large-scale I / O operations, improving system performance, and only deleting the folders with the earliest storage time when the available space on the hard disk is insufficient, thereby ensuring that the data retention time is maximized, and data can be effectively cleared, ensuring stable and long-term detection.

[0068] In some embodiments, the third system deleting one or more folders with the oldest storage time from the multiple folders on the hard disk according to the storage time information until the available space on the hard disk is greater than or equal to the preset value includes: the third system sorting the multiple folders on the hard disk according to the storage time information in a preset order according to the storage time, and the third system deleting one or more folders with the oldest storage time in the sorted order according to the preset order until the available space on the hard disk is greater than or equal to the preset value. The preset order includes from far to near or from near to far.

[0069] In some embodiments, as Figure 6 As shown, if the current test result indicates that the test is passed, the third system writes the current storage path information into the first file of the database. Figure 4 As shown, if the current test result indicates that the object to be tested is flawless, the third system writes the current storage path information into the ok_images data table of the database. The database can be stored on a hard disk or in a cloud database. In some embodiments, the third system can receive the test information from the second system via a Restful API. If the current test result in the test information indicates that the test passed, the third system writes the current storage path information in the test information into the first file in the database.

[0070] In some embodiments, the third system may further delete images corresponding to all storage path information in the first file from the hard disk at predetermined deletion times, such as Figure 6 As shown. Among them, Figure 6 In the embodiment, the third system reads the images corresponding to all the storage path information in the first file from the hard disk at every preset deletion time, and the third system also deletes the read images. While the third system writes the current storage path information into the first file of the database, the third system can also delete the images corresponding to all the storage path information in the first file from the hard disk at every preset deletion time. That is, the third system writing the current storage path information into the first file of the database and the third system deleting the images corresponding to all the storage path information in the first file from the hard disk are two parallel processes, which do not interfere with each other. In some embodiments, as Figure 7 As shown, the scheduling file also includes a third scheduling file. The third scheduling file includes a third scheduling content and a third scheduling cycle. The third scheduling content includes the deletion of images that have passed the inspection. The third scheduling cycle includes a preset deletion time, such as 30 seconds. In some embodiments, the third system can also delete images corresponding to all storage path information in the first file from the hard disk at preset deletion times according to the third scheduling file. Thus, the present application can give priority to deleting images that have passed the inspection from the hard disk and retain images that have failed the inspection, can achieve selective deletion of images, can increase the cycle time of the images that have failed the inspection, maximize the retention time of images that have failed the inspection, and can use images that have failed the inspection for more applications, such as analyzing the yield rate of the production line and the concentration of defects.

[0071] In some embodiments, the third system further deletes data corresponding to the deleted image from the first file of the database. Thus, after deleting the image that has passed the inspection, the storage path information corresponding to the image in the first file is also deleted.

[0072] In some embodiments, as Figure 6 As shown, the method also includes: the third system writes the current detection result and the current folder information in the current storage path information into the second file of the database. The second file can be used for subsequent analysis, and can be used together with the image to infer the production line operation status. The third system writes the current detection result and the current folder information in the current storage path information into the second file of the database, including: the third system extracts the current folder information from the current storage path information, and the third system writes the current detection result and the current folder information into the second file of the database. Take the storage path information of image 1_2021-0901.png as the above Figure 5 For example, the current storage path information is: / data / images / batch-1631000682 / 1_2021-0901.png, then the current folder information in the current storage path information is: batch-1631000682. The second file of the database can be, for example, the inference_result data table. For example, Figure 4 As shown, the current detection result and batch-1631000682 are written into the inference_result data table of the database. Then, the inference_result data table stores all the detection results and the folder information in all the storage path information. In some embodiments, when the third system writes the current detection result and the current folder information in the current storage path information into the second file of the database, it also adds a new field for the current folder information. The field is used to indicate that the corresponding information stored is the current folder information, and the name of the field can be, for example, the name of the stored folder. In some embodiments, if the available space of the hard disk is less than a preset value, the third system deletes one or more folders with the earliest storage time from the multiple folders in the hard disk according to the storage time information until the available space of the hard disk is greater than or equal to the preset value, and the method further includes: the third system writes the current detection result and the current folder information in the current storage path information into the second file of the database.

[0073] In some embodiments, as Figure 6As shown, the method further includes: the third system deleting the data corresponding to the information of the deleted folder from the second file of the database. For example, the data corresponding to the information of the deleted folder is deleted from the above-mentioned inference_result data table. Then, the earliest multiple data recorded in the inference_result data table are deleted. In some embodiments, if the available space of the hard disk is less than a preset value, the third system deletes one or more folders with the earliest storage time from the multiple folders in the hard disk according to the storage time information until the available space of the hard disk is greater than or equal to the preset value, the method further includes: the third system deleting the data corresponding to the information of the deleted folder from the second file of the database.

[0074] In some embodiments, the third system writing data into the second file of the database and the third system monitoring the available space of the hard disk and deleting one or more folders with the earliest storage time are two parallel processes that do not interfere with each other.

[0075] Please refer to Figure 8 , Figure 8 Schematic diagram of a data deletion device 80 for visual detection according to an embodiment of the present application. The data deletion device 80 for visual detection includes an image acquisition module 81, an automatic detection module 82, and a data processing module 83. The image acquisition module 81 is used to acquire an image of the current object to be detected. The image acquisition module 81 is also used to write the image of the current object to be detected into a current folder; the current folder is stored in the hard disk of the automatic optical detection device; the current folder is used to store images of multiple objects to be detected; the current folder includes storage time information. The automatic detection module 82 is used to automatically detect the object to be detected by vision based on the image. The data processing module 83 is used to delete one or more folders with the earliest storage time from multiple folders in the hard disk according to the storage time information if the available space of the hard disk is less than a preset value until the available space of the hard disk is greater than or equal to the preset value.

[0076] In some embodiments, the image acquisition module 81 is further configured to create a new folder at a preset creation time, and to update the new folder to the current folder.

[0077] In some embodiments, the image acquisition module 81 is further configured to write the image of the current object to be detected into a current folder to generate current storage path information of the image of the current object to be detected. The data processing module 83 is further configured to write the current storage path information into a first file in the database if the current detection result indicates that the detection has passed. The data processing module 83 is further configured to delete from the hard disk all images corresponding to the storage path information in the first file at a preset deletion time.

[0078] In some embodiments, the data processing module 83 is further configured to write the current detection result and the current folder information in the current storage path information into a second file in the database. The second file can be used for subsequent analysis and, together with the image, can be used to infer the production line operating status. The data processing module 83 is further configured to delete the data corresponding to the deleted folder information from the second file in the database.

[0079] In some embodiments, the image acquisition module 81 is further configured to transmit the image information including the current storage path information to the automatic detection module 82. The automatic detection module 82 is further configured to acquire the image of the current object to be detected from the hard disk based on the current storage path information in the image information. The automatic detection module 82 is further configured to automatically detect the object to be detected by visual means based on the image of the current object to be detected.

[0080] In some embodiments, the automatic detection module 82 is further configured to transmit detection information including the current storage path information and the current detection result to the data processing module 83. The data processing module 83 is further configured to write the current storage path information in the detection information into a first file in the database if the current detection result in the detection information indicates that the detection has passed.

[0081] In some embodiments, the second system communicates with the first system and the second system communicates with the third system via a presentation layer state transfer application programming interface.

[0082] In addition to the above methods and devices, the embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program, wherein the program enables the automatic optical inspection device to execute Figure 3 The data removal method for visual inspection is shown.

[0083] A computer program product includes computer-executable instructions stored in a computer-readable storage medium; at least one processor of an automated optical inspection device can read the computer-executable instructions from the computer-readable storage medium, and the at least one processor executes the computer-executable instructions so that the automated optical inspection device implements Figure 3 The data removal method for visual inspection is shown.

[0084] The present application can realize AI / AOI detection by automatically detecting the object to be detected based on the image of the current object to be detected; by writing the image of the current object to be detected into the current folder, and when the available space of the monitoring hard disk is less than the preset value, deleting one or more folders with the oldest storage time until the available space of the hard disk is greater than or equal to the preset value, the images can be deleted in batches by folder, avoiding large-scale I / O operations, which can improve system performance, and only deleting the folders with the oldest storage time when the available space of the hard disk is insufficient, which can ensure that the data retention time is maximized, and data can be effectively cleared, ensuring stable and long-term detection; by integrating the three different systems of the first system, the second system, and the third system on the automatic optical inspection equipment, the automatic optical inspection equipment can realize the mutual collaboration of multiple different systems, thereby facilitating software development.

[0085] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is merely a logical functional division. In actual implementation, other division methods may be used, such as combining or integrating multiple units or components into another device, or ignoring or not implementing certain features.

[0086] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0087] Through the description of the above embodiments, it is clear to those skilled in the art that the present application can be implemented by means of software plus necessary general-purpose hardware, and of course it can also be implemented by means of dedicated hardware including application-specific integrated circuits, dedicated CPUs, dedicated memories, dedicated components, etc. In general, all functions performed by computer programs can be easily implemented with corresponding hardware, and the specific hardware structures used to implement the same function can also be various, such as analog circuits, digital circuits, or dedicated circuits, etc. However, for the present application, software program implementation is a better implementation method in most cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer's floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0088] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0089] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, a computer, a server, or a data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode to another website, a computer, a server, or a data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium can be a magnetic medium, (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state drive (SSD)).

[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit the present application. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present application.

Claims

1. A data deletion method for visual inspection, characterized in that: The method is applied to an automatic optical inspection device including multiple systems, wherein the multiple systems include a first system, a second system, and a third system. The method includes: The first system acquires an image of the object to be detected; The first system writes the image of the current object to be detected into a current folder; the current folder is stored in the hard disk of the automatic optical detection device; the current folder is used to store multiple images of the objects to be detected; the current folder includes storage time information; The second system automatically detects the object to be detected by vision according to the image; If the available space of the hard disk is less than a preset value, the third system deletes one or more folders with the earliest storage time from the multiple folders in the hard disk according to the storage time information until the available space of the hard disk is greater than or equal to the preset value; The first system writing the image of the current object to be detected into the current folder includes: The first system writes the image of the current object to be detected into the current folder to generate current storage path information of the image of the current object to be detected; The method further comprises: If the current detection result indicates that the detection is passed, the third system writes the current storage path information into the first file of the database; The third system deletes images corresponding to all storage path information in the first file from the hard disk at every preset deletion time.

2. The method according to claim 1, wherein The method further comprises: The first system creates a new folder every preset creation time; Update the new folder to the current folder.

3. The method according to claim 1, wherein: If the available space of the hard disk is less than a preset value, the third system deletes one or more folders with the earliest storage time from the multiple folders in the hard disk according to the storage time information until the available space of the hard disk is greater than or equal to the preset value, the method further includes: The third system writes the current detection result and the current folder information in the current storage path information into the second file of the database; If the available space of the hard disk is less than a preset value, the third system deletes one or more folders with the earliest storage time from the multiple folders in the hard disk according to the storage time information until the available space of the hard disk is greater than or equal to the preset value, the method further includes: The third system deletes data corresponding to the deleted information of the folder from the second file of the database.

4. The method according to claim 1, wherein: The method further comprises: The first system transmits the image information including the current storage path information to the second system; The second system automatically detects the object to be detected by vision according to the image, including: The second system acquires the image of the current object to be detected from the hard disk according to the current storage path information in the image information; The second system automatically detects the object to be detected through vision according to the current image of the object to be detected.

5. The method according to claim 1, wherein: The method further comprises: The second system transmits the detection information including the current storage path information and the current detection result to the third system; If the current detection result is passed, the third system writes the current storage path information into the first file of the database, including: If the current detection result in the detection information indicates that the detection is passed, the third system writes the current storage path information in the detection information into the first file of the database.

6. The method according to claim 1, wherein: The second system communicates with the first system and the second system communicates with the third system via a presentation layer state transfer application programming interface.

7. A data deletion device for visual inspection, characterized in that: The device comprises: An image acquisition module is used to acquire an image of the object to be detected; The image acquisition module is further configured to write the image of the current object to be detected into a current folder; the current folder is stored in the hard disk of the automatic optical detection device; the current folder is configured to store multiple images of the objects to be detected; and the current folder includes storage time information; An automatic detection module, configured to automatically detect the object to be detected by vision based on the image; a data processing module, configured to, if the available space of the hard disk is less than a preset value, delete one or more folders with the earliest storage time from the plurality of folders in the hard disk according to the storage time information until the available space of the hard disk is greater than or equal to the preset value; In which, the image acquisition module is also used to write the image of the current object to be detected into the current folder to generate the current storage path information of the image of the current object to be detected; the data processing module is also used to write the current storage path information into the first file of the database when the current detection result indicates that the detection is passed; the data processing module is also used to delete the images corresponding to all storage path information in the first file from the hard disk every preset deletion time.

8. An automatic optical inspection device, characterized in that: The automatic optical inspection device includes a processor and a memory, wherein the memory is used to store program instructions. When the processor calls the program instructions, the data deletion method for visual inspection according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a program that causes an automatic optical inspection device to implement the data deletion method for visual inspection according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Log file deleting method and device, electronic equipment and storage medium

    CN111984601A

  • Method, apparatus and computer program for synchronizing data between a first repository and a second repository

    EP3722965A1