Defect detection method and device, equipment and storage medium
By calling the target processing process in parallel to process image data independently, the problem that the image data processing speed in the multi-graphics card wafer detection system cannot keep up with the camera scanning speed, achieving more efficient detection efficiency.
Patent Information
- Application Number
- CN202311760413.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-18
- Publication Date
- 2025-06-20
AI Technical Summary
In the multi-graphics card wafer detection system, the image data processing speed cannot keep up with the camera scanning speed, resulting in limited detection efficiency.
By calling the target processing process in parallel to detect each frame of image data obtained by scanning, each processing process independently processes the image data using the corresponding graphics processor and combines the detection results.
By allocating image data to the processing process of different computing units, parallel processing of image data is realized, the degree of data coupling is reduced, and the detection efficiency is improved.
Smart Images

Figure CN120182076A_ABST
Abstract
Description
[0001] Technical field
[0002] This application belongs to the technical field of defect detection, and particularly relates to a defect detection method, device, equipment and storage medium. Background technique
[0003] When using multiple graphics cards for wafer detection, the Dies in the wafer are cut into multiple computing units, and each process schedules a graphics card using a multi-process architecture. The computing units are evenly distributed to each process for detection algorithm processing, which can significantly improve the detection speed of the detection system.
[0004] The wafer detection system is a commonly used automatic defect detection system in the wafer production process. The system scans the surface of the wafer through a camera to obtain image data, and then processes the image data through relevant algorithms to determine information such as the presence or absence of defects on the wafer surface, the location and size of the defect area, etc. Since the defects generated during the wafer production process are small, a camera with a higher resolution is required for imaging, resulting in a large amount of image data that needs to be processed by the detection system.
[0005] In order to meet the processing requirements of a large amount of image data, the wafer detection system usually uses multiple graphics processors to process the captured wafer image data. For this purpose, the captured wafer image data needs to be scheduled to multiple graphics processors of the processor.
[0006] However, due to the high degree of data coupling between multiple graphics processors during the scheduling process, this detection method has the problem that the processing speed of image data cannot keep up with the camera scanning speed, which in turn limits the detection efficiency. Summary of the invention
[0007] For this reason, the present application discloses the following technical solutions:
[0008] The first aspect of the present application provides a defect detection method, including:
[0009] Scanning a sample to be tested through a scanning device to obtain image data of the sample to be tested;
[0010] During the process of scanning the sample to be tested, parallelly invoking a target processing process to detect each frame of the image data obtained by scanning; wherein, the target processing process is the processing process corresponding to the computing unit to which the image data belongs among multiple processing processes, and the computing units corresponding to different processing processes are different; each processing process corresponds to a graphics processor, and the processing process uses the corresponding graphics processor to detect the image data;
[0011] Combining the detection results of each frame of the image data obtained by scanning to obtain the defect detection result of the sample to be tested.
[0012] Optionally, it further includes:
[0013] Obtain scanning path information; wherein, the scanning path information includes the number of particles covered by each scanning path of the scanning device, the total number of frames of image data that can be scanned by each scanning path, and the position information of the camera field of view;
[0014] Determine a plurality of computing units according to the scanning path information, and determine the image data included in each computing unit; wherein, the image data included in the same computing unit is scanned from the same area of multiple particles in the sample to be measured;
[0015] Allocate the plurality of computing units to each of the processing processes to determine the corresponding relationship between the processing process and the computing unit.
[0016] Optionally, the allocating the plurality of computing units to each of the processing processes includes:
[0017] Allocate the plurality of computing units to each of the processing processes according to the performance of the graphics processor bound to each processing process.
[0018] Optionally, the allocating the plurality of computing units to each of the processing processes includes:
[0019] Allocate the plurality of computing units evenly to each of the processing processes according to the process number of the processing process and the unit number of the computing unit; wherein, the unit number of the computing unit corresponding to the processing process is equal to the process number of the processing process, or equal to the process number of the processing process plus an integer multiple of the total number of processing processes.
[0020] Optionally, after obtaining the image data of the sample to be measured by scanning with the scanning device, it further includes:
[0021] For each frame of the image data scanned, store the image data in the shared memory;
[0022] The calling the target processing process to detect each frame of the image data scanned includes:
[0023] Call each of the processing processes to read the image data from the shared memory;
[0024] After determining that the target processing process has read the image data, detect the image data through the target processing process.
[0025] Optionally, after storing the image data in the shared memory, it further includes:
[0026] Modifying a data write flag of the shared memory so that the data write flag indicates that the image data has been written into the shared memory;
[0027] After calling each of the processing processes to read the image data from the shared memory, the method further includes:
[0028] The process reading completion flag corresponding to the processing process in the shared memory is modified so that the process reading completion flag indicates that the processing process has completed reading the image data in the shared memory.
[0029] Optionally, the detecting the image data includes:
[0030] Determine reference image data corresponding to the image data; wherein the image data and the reference image data belong to different particles of the sample to be tested, and the position of the image data at the particle to which it belongs is the same as the position of the reference image data at the particle to which it belongs;
[0031] The image data is detected based on the image data and the reference image data.
[0032] Optionally, calling each of the processing processes to read the image data from the shared memory includes:
[0033] Determining that the image data in the shared memory has been written according to the data writing flag, calling each of the processing processes to read the image data from the shared memory;
[0034] The determining that the target processing process reads the image data comprises:
[0035] After each processing process is called to read the image data, determining whether the computing unit to which the image data belongs is the computing unit corresponding to the called processing process;
[0036] If the computing unit to which the image data belongs is not the computing unit corresponding to the called processing process, it is determined that the target processing process has not read the image data, and the processing process is called to discard the image data;
[0037] If the computing unit to which the image data belongs is the computing unit corresponding to the called processing process, it is determined that the target processing process has read the image data.
[0038] Optionally, the detection result of each frame of the image data obtained by the combined scanning, to obtain the defect detection result of the sample to be tested, includes:
[0039] Based on the detection results of each frame of the image data obtained by combining the computing unit and the scanning path to which each frame belongs, the defect detection result of the sample to be tested is obtained.
[0040] The second aspect of the present application provides a defect detection device, including:
[0041] A scanning unit for scanning a sample to be tested through a scanning device to obtain image data of the sample to be tested;
[0042] A detection unit for, during the process of scanning the sample to be tested, parallelly invoking a target processing process to detect each frame of the image data obtained by scanning; wherein, the target processing process is the processing process corresponding to the computing unit to which the image data belongs among multiple processing processes, and the computing units corresponding to different processing processes are different; each of the processing processes corresponds to a graphics processor, and the processing process uses the corresponding graphics processor to detect the image data;
[0043] A combining unit for combining the detection results of each frame of the image data obtained by scanning to obtain the defect detection result of the sample to be tested.
[0044] The third aspect of the present application provides a computer storage medium for storing a computer program, which, when executed, is specifically used to implement the defect detection method provided in any item of the first aspect of the present application.
[0045] The fourth aspect of the present application provides a detection device, including a memory and a processor;
[0046] The memory is used for storing a computer program;
[0047] The processor is used for executing the computer program, and is specifically used to implement the defect detection method provided in any item of the first aspect of the present application.
[0048] The beneficial effect of the present application lies in:
[0049] The scanned image data is allocated to different processing processes according to different computing units to which it belongs, so that each processing process respectively uses the graphics processor corresponding to this process to detect the allocated image data. In this way, not only can the parallel processing of image data of different computing units be achieved through multiple processes, but also the processing processes of different processes can be ensured to be independent of each other, reducing the degree of data coupling, thereby achieving the effect of improving the detection efficiency. Description of the Drawings
[0050] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, other accompanying drawings can be obtained based on the provided drawings without creative efforts.
[0051] Figure 1 is a flowchart of a defect detection method provided by an embodiment of the present application;
[0052] Figure 2 is a schematic diagram of the segmentation of computing units provided by an embodiment of the present application;
[0053] Figure 3 is a schematic diagram of a data transmission process provided by an embodiment of the present application;
[0054] Figure 4 is a schematic diagram of the data structure of shared memory provided by an embodiment of the present application;
[0055] Figure 5 is a schematic diagram of reference image data provided by an embodiment of the present application;
[0056] Figure 6 is a schematic diagram of the correspondence between computing units and processing processes provided by an embodiment of the present application;
[0057] Figure 7 is a schematic diagram of the structure of a defect detection device provided by an embodiment of the present application;
[0058] Figure 8 is a schematic diagram of the structure of a detection device provided by an embodiment of the present application. Detailed implementation manners
[0059] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0060] An embodiment of the present application provides a defect detection method. Please refer to Figure 1 , which is a flowchart of this method. The method may include the following steps.
[0061] The method provided in this embodiment can be executed by any computer device (such as a server device) configured with multiple graphics processors and communicatively connected to a scanning device. Hereinafter, the detection device is used to refer to the execution subject of the method in this embodiment.
[0062] Before executing the method provided in this embodiment, the detection parameter setting interface, the path information setting interface, and the image information input interface can be registered on the computer device first, so as to configure or transmit relevant information through remote calls. Among them, the detection parameter setting interface is used to configure detection parameters, the path information setting interface is used to configure scanning path information, and the image information input interface is used to obtain image data from a scanning device.
[0063] S101, Scan the sample to be tested through a scanning device to obtain image data of the sample to be tested.
[0064] The scanning device can be a high-resolution camera.
[0065] When the scanning device scans the sample to be tested, it can scan line by line. Each line is equivalent to a scanning path. When scanning a line, the scanning device can move gradually from one end of the line to the other end, for example, move from the left end to the right end, or move from the right end to the left end. For each step of movement, the scanning device captures a frame of image data of the sample to be tested, and then moves one more step to continue capturing the next frame of image data, and so on until the entire line is scanned.
[0066] Thus, the scanning device can scan and obtain multiple frames of image data for each line on the surface of the sample to be tested. Each frame of image data is obtained by the scanning device capturing the corresponding area on the surface of the sample to be tested.
[0067] The sample to be tested can be a wafer, a chip, or other similar products that need to be defect-detected.
[0068] S102, During the process of scanning the sample to be tested, the target processing process is called in parallel to detect each frame of image data obtained by scanning. The target processing process is the processing process corresponding to the computing unit to which the image data belongs among multiple processing processes, and the computing units corresponding to different processing processes are different; each processing process corresponds to a graphics processor, and the processing process uses the corresponding graphics processor to detect the image data.
[0069] The above-mentioned multiple processing processes can be created according to the graphics processors of the computer device used to detect image data before starting the scanning. Specifically, the number of created processing processes can be the same as the number of graphics processors configured on the computer device. For example, if the computer device is configured with 4 graphics processors, 4 processing processes can be created. After creating the processing processes, each processing process can be bound to a graphics processor. For example, processing process 1 is bound to graphics processor 1, processing process 2 is bound to graphics processor 2, and so on, to ensure that each processing process has and only has one callable graphics processor.
[0070] The correspondence between the computing units and the processing processes, as well as the subordination relationship between the image data and the computing units (i.e., which computing unit each frame of image data specifically belongs to), can be determined in advance before the start of scanning.
[0071] In this embodiment, a scanning path can be divided into multiple computing units. The multiple frames of image data obtained by the scanning device along the scanning path can be distinguished by the order of shooting or by the position of the shooting area on the sample to be measured.
[0072] S103, Combine the detection results of each frame of image data obtained by scanning to obtain the defect detection result of the sample to be measured.
[0073] Among them, the detection result of a frame of image data may include whether there are defects in this frame of image data. If there are defects, the detection result may further include information such as the position, shape, and size of the defect area.
[0074] The defect detection result of the sample to be measured is composed of the detection results of all the image data scanned by the scanning device, and may include information such as whether there are defects in the sample to be measured, the position, shape, and size of the defect area.
[0075] The beneficial effects of this embodiment are as follows:
[0076] The scanned image data is allocated to different processing processes according to different computing units, so that each processing process uses the graphics processor corresponding to this process to detect the allocated image data. In this way, it can not only realize the parallel processing of the image data of different computing units through multiple processes, but also ensure that the processing processes of different processes are independent of each other, reducing the degree of data coupling, thereby achieving the effect of improving the detection efficiency.
[0077] In some alternative embodiments, the correspondence between the computing units and the processing processes, as well as the subordination relationship between the image data and the computing units, can be determined in the following manner:
[0078] Obtain the scanning path information (i.e., swath information); among them, the scanning path information includes the number of particles covered by each scanning path of the scanning device, the total number of frames of image data that can be scanned by each scanning path, and the position information of the camera field of view;
[0079] According to the scanning path information, determine multiple computing units and determine the image data included in each computing unit; among them, the image data included in the same computing unit is scanned from the same area of multiple particles in the sample to be measured;
[0080] Allocate multiple computing units to each processing process to determine the correspondence between the processing process and the computing unit.
[0081] The position information of the camera's field of view is used to indicate the position of the field of view of the scanning device on the sample to be measured when each frame of image data is captured, that is, to indicate the position of the captured area on the sample to be measured.
[0082] The following takes Figure 2 as an example to illustrate the process of determining the corresponding relationship above.
[0083] Figure 2 is an example of a scanning path on the sample to be measured. Each small solid rectangle represents an area captured by the scanning device during the scanning process. The total number of small rectangles is the total number of frames of image data that can be scanned by a scanning path. Each dashed rectangle represents a particle (also called a die) of the sample to be measured. Figure 2 The number of particles covered by a scanning path shown in
[0084] is 4, and the total number of frames of image data that can be scanned by each scanning path is 16. Figure 2 When starting to scan based on the scanning path shown in Figure 2 the scanning device translates from the left end to the right end of the scanning path. Each time it moves, the field of view of the scanning device will cover one of the areas of the small solid rectangles, and then capture a frame of image data for this area. After the capture is completed, the scanning device moves forward, and the field of view covers the next area of the small solid rectangle and captures the next frame of image data, and so on, until all the areas of the small solid rectangles shown in
[0085] are captured, thus completing the scanning of this scanning path. Figure 2 After obtaining the scanning path information corresponding to the scanning path shown in Figure 2 it is possible to first determine the number of frames of image data that each particle can obtain when scanning along this scanning path according to the scanning path information, and then determine the same number of computing units according to the number of frames of image data that each particle can obtain. For example, in
[0086] it can be determined that during the scanning process, each particle can obtain 4 frames of image data, and thus it can be determined that 4 computing units need to be set when scanning along this path.
[0087] After determining the number of computing units, the image data scanned at the same position in each particle can be assigned to the same computing unit. For example, the first frame of image data scanned in each particle is assigned to computing unit U1, the second frame of image data scanned in each particle is assigned to computing unit U2, and so on. Figure 2From the example, it can be seen that during the scanning process of the scanning device, the image data P11, P12, P13, and P14 obtained by photographing the areas P11, P12, P13, and P14 are respectively the first-frame image data of their respective particles. Thus, it is determined that the image data P11, P12, P13, and P14 belong to the same computing unit, for example, belong to the computing unit U1.
[0088] When allocating multiple computing units to each processing process, the allocation can be carried out according to the rule of average allocation. For example, when there are a total of 8 computing units and 4 processing processes, each processing process can be allocated 2 computing units; when there are 4 computing units and 4 processing processes, each processing process can be allocated 1 computing unit; when there are 10 computing units and 4 processing processes, two of the processing processes can be allocated 3 computing units, and the other two processing processes are each allocated 2 computing units.
[0089] After determining the correspondence relationship among the processing process, the computing unit, and the image data in the above manner, when executing S102, for each frame of image data scanned, it is possible to determine which particle and which computing unit the frame of image data belongs to according to the order of scanning the frame of image data or according to the position of the photographed area corresponding to the frame of image data on the sample to be measured.
[0090] Combined with the foregoing example, when the scanning device photographs an area P12 to obtain a frame of image data, the detection device determines that the frame of image data is the 5th frame of image data obtained after the start of scanning. Then, combined with the pre-input scanning path information, it is determined that the 5th frame of image data belongs to the particle D1 and is the first-frame image data of the particle, and further determines that the frame of image data belongs to the computing unit U1; or, according to the position of the scanning device at this time, combined with the position information of the foregoing camera field of view, it is determined that the frame of image data is the first-frame image data of the D1 particle obtained from the area P12, and further determines that the frame of image data belongs to the computing unit U1.
[0091] Thus, the detection device can determine the computing unit to which each frame of image data belongs, and further determine which processing process should detect each frame of image data.
[0092] The beneficial effect of determining the correspondence relationship among the computing unit, the image data, and the processing process in the above manner is as follows:
[0093] By the above method of determining the correspondence relationship, it can be ensured that the image data obtained by photographing the same positions of different particles in the sample to be measured can be allocated to the same computing unit, and thus can be processed by the same processing process. In this way, a processing process can directly process the image data obtained by photographing the same positions of different particles, without the need to read the image data obtained by photographing the same positions from other processing processes, achieving the effect of reducing the data coupling degree between processing processes and improving the processing efficiency.
[0094] In some alternative embodiments, when allocating multiple computing units to each processing process, in addition to the average allocation, the allocation can also be performed in the following manner:
[0095] Allocate multiple computing units to each processing process according to the performance of the graphics processor bound to each processing process.
[0096] In the above allocation method, the detection device can first obtain the performance-related information of each graphics processor configured in itself, including but not limited to information such as the model, version, video memory size, operating frequency, and historical operating conditions of the graphics processor, and determine the performance levels of the respective graphics processors based on this information.
[0097] If the processing performances of the multiple graphics processors configured by the detection device are the same or basically consistent, the detection device can allocate multiple computing units to each processing process in the aforementioned average allocation manner.
[0098] If there are obvious differences in the processing performances of the multiple graphics processors configured by the detection device, then the detection device can allocate fewer computing units to the processing process bound to the graphics processor with lower processing performance, and allocate more computing units to the processing process bound to the graphics processor with higher processing performance.
[0099] The beneficial effect of this embodiment lies in:
[0100] When there are performance differences in the graphics processors configured by the detection device, allocating computing units in the above manner can make full use of the performance of the high-performance graphics processors, and at the same time avoid the overall execution efficiency of the detection method being affected due to the too low processing efficiency of the low-performance graphics processors.
[0101] In some alternative embodiments, the image data scanned by the scanning device can be transmitted to the processing process in the following manner.
[0102] After scanning the sample to be measured by the scanning device to obtain the image data of the sample to be measured, for each frame of image data scanned, store the image data in the shared memory.
[0103] After the image data is stored in the shared memory, call each processing process to read the image data from the shared memory.
[0104] For each frame of image data, if the processing process that reads the frame of image data is not the target processing process corresponding to the frame of image data, then this processing process may not process the frame of image data and directly read the next frame of image data from the shared memory.
[0105] If the processing process that reads the frame of image data is the target processing process corresponding to the frame of image data, after determining that the target processing process has read the image data, the image data can be detected through the target processing process.
[0106] In the above transmission method, the detection device can pre-create a Figure 3 shared memory queue as shown, and there are multiple shared memories in the shared memory queue.
[0107] After the detection device obtains the image data, it can find an idle shared memory in the shared memory, and then write the obtained image data into the idle shared memory. After writing a full idle shared memory, it continues to find another idle shared memory and write the new image data.
[0108] The above operation of writing image data into the shared memory can be executed by the scanning process used to communicate with the scanning device.
[0109] The beneficial effect of this embodiment is that:
[0110] By transmitting image data between the scanning process and the processing process through the shared memory, the coupling degree between the scanning process and the processing process can be reduced, so that the scanning process of the scanning process and the process of the processing process detecting defects do not affect each other, thereby achieving the effect of improving the detection efficiency.
[0111] In some alternative embodiments, calling each processing process to read image data from the shared memory includes:
[0112] After determining that the image data in the shared memory has been written completely according to the data write flag, call each processing process to read the image data from the shared memory.
[0113] That is to say, only when the data write flag in the shared memory indicates that the image data has been written completely, the detection device calls each processing process to read the image data from the shared memory one by one. If the data write flag in the shared memory does not indicate that the image data has been written completely, the detection device does not call the processing process to read the shared memory.
[0114] The advantage of reading in this way is to ensure that the image data read by the processing process is a complete frame of image data that has been written completely, avoiding the situation that the detection device calls the processing process to read before the image data has been written completely, resulting in incomplete image data read by the processing process.
[0115] In some alternative embodiments, the method for determining whether the processing process that reads the image data is the target processing process may be as follows:
[0116] After each processing process is called to read the image data, it is determined whether the computing unit to which the image data belongs is the computing unit corresponding to the called processing process;
[0117] If the computing unit to which the image data belongs is not the computing unit corresponding to the called processing process, it is determined that the target processing process has not read the image data, and the processing process is called to discard the image data;
[0118] If the computing unit to which the image data belongs is the computing unit corresponding to the called processing process, it is determined that the target processing process has read the image data.
[0119] In order to determine the computing unit to which the image data belongs, when writing each frame of image data to the shared memory, the scanning process also writes the identification information of the frame of image data and the frame of image data to the shared memory together. The identification information may be any information that can indicate the processing process corresponding to the frame of image data. For example, the identification information may include which scanning path of the sample to be measured the frame of image data belongs to, which particle on the scanning path the frame of image data belongs to, and which computing unit the frame of image data belongs to.
[0120] Among them, the first item can be determined based on the position of the scanning device and / or the position information of the camera field of view when the scanning device starts scanning. For the determination methods of the second and third items, please refer to the foregoing embodiments and will not be elaborated here.
[0121] On this basis, when there is image data in the shared memory, each processing process can read the image data from the shared memory.
[0122] For each called processing process, every time the processing process reads a frame of image data, it determines which computing unit the frame of image data specifically belongs to according to the identification information of the frame of image data written together, and determines whether the computing unit to which the frame of image data belongs is the computing unit corresponding to this processing process.
[0123] If it is found that the computing unit to which the frame of image data belongs is not the computing unit corresponding to this processing process, it can be determined that this process is not the target processing process corresponding to the frame of image data, that is, it is determined that the target processing process corresponding to the frame of image data has not read the frame of image data. At this time, this processing process can discard this frame of image data without processing and continue to read the next frame of image data.
[0124] If it is found that the computing unit to which the frame image data belongs is the computing unit corresponding to the present processing process, it can be determined that the present process is the target processing process corresponding to the frame image data, that is, it is determined that the target processing process reads the image data. At this time, the target processing process detects the read frame of image data to obtain the corresponding detection result.
[0125] The beneficial effect of reading the image data in the above manner is that a frame of image data can be read by each processing process once, so as to ensure that the frame of image data can always be read and detected by the corresponding target processing process, and avoid the situation that the target processing process cannot read the corresponding image data. At the same time, after each processing process reads the image data that does not belong to its corresponding computing unit, it discards the image data in time, so as to reduce the storage resources required by each processing process and achieve the effect of saving the storage space of the detection device.
[0126] In some optional embodiments, after the scanning process stores the image data in the shared memory, the following steps may further be executed:
[0127] Modify the data write flag of the shared memory to make the data write flag indicate that the image data has been written in the shared memory;
[0128] After each processing process reads the image data from the shared memory, the following steps may further be executed:
[0129] Modify the process read completion flag corresponding to the processing process in the shared memory to make the process read completion flag indicate that the processing process has completed the reading of the image data in the shared memory.
[0130] In this embodiment, the data structure of each shared memory may Figure 4 be shown as follows.
[0131] It can be seen that a shared memory may include a data start write flag, multiple frames of image data, a data write flag corresponding to each frame of image data, and multiple process read completion flags.
[0132] Among them, the number of process read completion flags is the same as the number of processing processes. Figure 4 For example, when there are 4 processing processes, there may be 4 process read completion flags in a shared memory, and each flag corresponds to a processing process.
[0133] Based on this data structure, when data needs to be written to the shared memory, the scanning process can search for the shared memory in which all process read completion flags are read completed, and identify the shared memory as an idle shared memory.
[0134] For example, when the process read completion flag is -1, it indicates that the corresponding processing process has completed reading the shared memory. When the process read completion flag is 1, it indicates that the corresponding processing process has not completed reading the shared memory. Then, the scanning process can identify the shared memory with all process read completion flags being -1 as free shared memory.
[0135] After determining the free shared memory, the scanning process can modify the data start writing flag of the shared memory to indicate that the shared memory starts to write image data through this flag.
[0136] Exemplarily, the data start writing flag being -1 indicates that the corresponding shared memory has not written image data, and the data start writing flag being 1 indicates that the corresponding shared memory has written image data. Then, before starting to write, the scanning process can modify the data start writing flag of the free shared memory from -1 to 1.
[0137] After the modification, the scanning process starts to write image data into the shared memory frame by frame. For each frame of image data written, the scanning process modifies the data writing flag of the data after this frame of image data so that the data writing flag indicates that the previous frame of image data has been written and completed.
[0138] Exemplarily, the data writing flag being -1 indicates that the previous frame of image data has not been written and completed, and the data writing flag being 1 indicates that the previous frame of image data has been written and completed. Then, for each frame of image data written by the scanning process, it sets the data writing flag of the data after it to 1.
[0139] After a shared memory is full, the scanning process can set all the process read completion flags of the shared memory to the unread completed state, for example, all set to 1.
[0140] While the scanning process writes image data, each processing process can read the written image data from the shared memory.
[0141] Specifically, when the processing process discovers through the data start writing flag that a shared memory is writing image data, and through the data writing flag discovers that at least one frame of image data has been written and completed in this shared memory, then the processing process can start from the data start writing flag and read each frame of image data that has been written and completed in this shared memory one by one, and process the read data according to the aforementioned processing method.
[0142] When the processing process reads to the end of the shared memory, that is, reads the process read completion flag, it can modify the process read completion flag corresponding to this process to the read completed state, for example, modify it to -1, indicating that the processing process has read all the image data in this shared memory.
[0143] Further, if a processing process finds that the read completion flags of all processes for a shared memory are marked as read-completed after modifying the corresponding process read completion flag, then the processing process can reset the data start write flag and the data write flag of the shared memory to -1, so that new data can be written to the shared memory as free shared memory.
[0144] The beneficial effects of this embodiment are as follows:
[0145] By setting the above-mentioned multiple flags in the shared memory, the scanning process can determine which shared memory to write the image data to according to the flags, and the processing process can determine which shared memory to read the flags from according to the flags, without the need for the scanning process and the processing process to send messages to each other to notify the other party of data reading and writing, achieving the effect of further reducing the coupling degree between the scanning process and the processing process, simplifying the processing logic of the scanning process and the processing process, and improving the detection efficiency.
[0146] In some alternative embodiments, when the target processing process detects the image data, it can specifically detect according to the following method:
[0147] Determine the reference image data corresponding to the image data; wherein, the image data and the reference image data belong to different particles of the sample to be measured, and the positions of the image data in its respective particle and the reference image data in its respective particle are the same;
[0148] Detect the image data according to the image data and the reference image data.
[0149] For any frame of image data, its corresponding reference image data can be the image data at the same position in adjacent particles. For example, for the first frame of image data captured in a certain particle, its corresponding reference image data can be the first frame of image data captured in adjacent particles.
[0150] Taking Figure 5 as an example, when detecting the first frame of image data P12 captured in particle D1, the reference image data used can be the first frame of image data P11 captured in the adjacent particle D0 and the first frame of image data P13 captured in particle D2.
[0151] Optionally, if a particle to which a frame of image data belongs is located at one end of the scanning path, resulting in no adjacent particle on one side of the particle, then the image data at the same position in the two particles on the other side can be used as the reference image data.
[0152] Still taking Figure 5 as an example, for the image data P11, the corresponding reference image data can be P12 and P13.
[0153] After determining the reference image data, the target processing process can compare the detected image data with the reference image data to see if there are any differences. If there are differences between the detected image data and the reference image data, the area with the differences can be determined as a defective area. If there are no differences, it can be determined that the frame of image data has no defects.
[0154] The beneficial effects of this embodiment are:
[0155] Through the above-mentioned detection method, the processing process can directly use the multi-frame image data obtained by scanning to realize defect detection without the need for additional input of reference images, so that this embodiment has a wider range of applications and can complete sample defect detection without pre-determining the reference image.
[0156] In some optional embodiments, the manner of detecting the image data according to the image data and the reference image data may be:
[0157] An area in the image data that is inconsistent with the reference image data and meets a preset defect condition is determined as a defect area of the image data.
[0158] When there are two or more frames of reference image data, the defective area refers to an area that is inconsistent with each frame of reference image data and meets a preset defect condition.
[0159] The defect condition may be determined based on the detection parameters. For example, a pixel number threshold may be specified in the detection parameters, and the corresponding defect condition may be that the number of pixels contained in the inconsistent region is greater than the pixel number threshold. In other words, if a region is inconsistent with the reference image data, but the number of pixels in the region is less than or equal to the pixel number threshold, then the region is not a defective region, and if the number of pixels in the region is greater than the pixel number threshold, then the region is a defective region.
[0160] If the target processing process finds at least one defective area in a frame of image data, relevant information of the defective areas, including but not limited to size, position, shape, etc., can be determined as the detection result of the frame of image data.
[0161] If the target processing process does not find a defective area in a frame of image data, then it can be determined that the detection result of the frame of image data is defect-free.
[0162] The beneficial effects of this embodiment are:
[0163] Screening defective areas based on defect conditions can improve the accuracy of detection results.
[0164] In some optional embodiments, the method of combining the detection results of each frame of image data obtained by scanning to obtain the defect detection result of the sample to be tested may be:
[0165] Based on the detection results of each frame of image data obtained by combining the computing units and scanning paths to which the image data belongs, the defect detection result of the sample to be tested is obtained.
[0166] As described above, when the scanning process writes image data to the shared memory, the identification information of the image data can be written together. Through the identification information processing process, it can be determined from which scanning path, which particle, and which computing unit each frame of image data is specifically captured.
[0167] When combining the detection results, each processing process can pass back the detection result of each frame of image data, the identification of the scanning path to which the image data belongs, the identification of the particle to which it belongs, and the identification of the computing unit to which it belongs to the combination process for combining the detection results. The combination process combines and outputs the detection results of multiple frames of image data, the identification of the scanning path to which the image data belongs, the identification of the particle to which it belongs, and the identification of the computing unit to which it belongs in a certain format, and thus the defect detection result of the sample to be tested is obtained.
[0168] Optionally, when combining, the above information of each frame of image data scanned by the scanning device for the sample to be tested can be combined, or only the above information of those image data determined to have defective areas through detection can be combined.
[0169] The beneficial effect of this embodiment lies in:
[0170] Combining the detection results of multiple frames of image data obtained by scanning and the corresponding identification information into a defect detection result for output is conducive to subsequent processing programs or relevant personnel quickly determining which positions of the sample to be tested have defects based on the defect detection result.
[0171] In some alternative embodiments, when evenly distributing multiple computing units to each processing process, the distribution can be performed in the following manner:
[0172] According to the process number of the processing process and the unit number of the computing unit, multiple computing units are evenly distributed to each processing process; among them, the unit number of the computing unit corresponding to the processing process is equal to the process number of the processing process, or equal to the process number of the processing process plus an integer multiple of the total number of processing processes.
[0173] The following takes Figure 6 as an example to illustrate the above distribution method.
[0174] Suppose there are 4 processing processes with process numbers from 1 to 4 and 10 computing units with unit numbers from 1 to 10.
[0175] When allocating computing units to processing processes, first, the total number of processing processes with smaller numbers is allocated to multiple processing processes in sequence. The rule followed during allocation is that the computing units with smaller unit numbers and the processing processes with smaller process numbers participate in the allocation first, and each processing process is allocated only one computing unit. Combining Figure 6 as an example, in this allocation process, the 4 computing units with smaller numbers, i.e., 1 to 4, are allocated to processing processes 1 to 4 in sequence. Computing unit 1 is allocated to processing process 1, computing unit 2 is allocated to processing process 2, and so on.
[0176] Then, the total number of processing processes with smaller numbers among the remaining computing units is allocated to multiple processing processes in sequence, and the allocation rule is the same as the aforementioned rule. Combining Figure 6 as an example, in this allocation process, the 4 computing units with smaller numbers among the remaining ones, i.e., 5 to 8, are allocated to processing processes 1 to 4 in sequence. Computing unit 5 is allocated to processing process 1, computing unit 6 is allocated to processing process 2, and so on.
[0177] After that, the above process of allocating the total number of processing processes with smaller numbers among the remaining computing units to multiple processing processes in sequence is repeated until all computing units are allocated.
[0178] As Figure 6 shown, after allocating the above 4 processing processes and 10 computing units in the above manner, the corresponding relationship between the processing processes and the computing units is that processing process 1 corresponds to computing units 1, 5, and 9; processing process 2 corresponds to computing units 2, 6, and 10; processing process 3 corresponds to computing units 3 and 7; and processing process 4 corresponds to computing units 4 and 8.
[0179] The beneficial effect of the allocation in the above manner is that:
[0180] After the allocation is completed, the corresponding relationship between the computing units and the processing processes can be directly obtained by taking the modulus of the unit number of the computing unit with the total number of processing processes. Taking Figure 6 as an example, when computing unit 7 takes the modulus with the total number of processing processes 4, the resulting value is the process number of the corresponding processing process 3. Thus, after allocating the computing units, there is no need to specifically record the corresponding relationship between the computing units and the processing processes. Instead, when needed, through the above operation, it can be determined which processing process any computing unit corresponds to, thereby saving the storage space of the detection device.
[0181] The embodiment of the present application also provides a defect detection device. Please refer to Figure 7 which is a schematic structural diagram of the device. The device may include the following units.
[0182] A scanning unit 701, configured to scan a sample to be detected through a scanning device to obtain image data of the sample to be detected;
[0183] The detection unit 702 is configured to, during the process of scanning a sample to be detected, call the target processing process in parallel to detect each frame of image data obtained by scanning; wherein, the target processing process is the processing process corresponding to the computing unit to which the image data belongs among multiple processing processes, and the computing units corresponding to different processing processes are different; each processing process corresponds to a graphics processor, and the processing process uses the corresponding graphics processor to detect the image data;
[0184] The combining unit 703 is configured to combine the detection results of each frame of image data obtained by scanning to obtain the defect detection result of the sample to be detected.
[0185] Optionally, the apparatus further includes an allocation unit 704, configured to:
[0186] Obtain the scanning path information; wherein, the scanning path information includes the number of particles covered by each scanning path of the scanning device, the total number of frames of image data that can be scanned by each scanning path, and the position information of the camera field of view;
[0187] Determine multiple computing units according to the scanning path information, and determine the image data included in each computing unit; wherein, the image data included in the same computing unit is scanned from the same area of multiple particles in the sample to be detected;
[0188] Allocate the multiple computing units to each processing process to determine the corresponding relationship between the processing process and the computing unit.
[0189] Optionally, when the allocation unit 704 allocates the multiple computing units to each processing process, it is specifically configured to:
[0190] Allocate the multiple computing units to each processing process according to the performance of the graphics processor bound to each processing process.
[0191] Optionally, when the allocation unit 704 allocates the multiple computing units to each processing process, it is specifically configured to:
[0192] Allocate the multiple computing units to each processing process evenly according to the process number of the processing process and the unit number of the computing unit; wherein, the unit number of the computing unit corresponding to the processing process is equal to the process number of the processing process, or equal to the process number of the processing process plus an integer multiple of the total number of processing processes.
[0193] Optionally, after the scanning unit 701 scans the sample to be detected through the scanning device to obtain the image data of the sample to be detected, it is further configured to:
[0194] For each frame of image data obtained by scanning, store the image data in the shared memory;
[0195] When the detection unit 702 calls the target processing process to detect the image data, it is specifically used for:
[0196] Call each processing process to read the image data from the shared memory;
[0197] After the target processing process reads the image data, detect the image data through the target processing process.
[0198] Optionally, when the detection unit 702 calls each processing process to read the image data from the shared memory, it is specifically used for:
[0199] After determining that the image data in the shared memory has been written completely according to the data write flag, call each processing process to read the image data from the shared memory;
[0200] When the detection unit 702 determines that the target processing process has read the image data, it is specifically used for:
[0201] After each processing process is called to read the image data, determine whether the computing unit to which the image data belongs is the computing unit corresponding to the called processing process;
[0202] If the computing unit to which the image data belongs is not the computing unit corresponding to the called processing process, determine that the target processing process has not read the image data, and call the processing process to discard the image data;
[0203] If the computing unit to which the image data belongs is the computing unit corresponding to the called processing process, determine that the target processing process has read the image data.
[0204] Optionally, after the scanning unit 701 stores the image data in the shared memory, it is also used for:
[0205] Modify the data write flag in the shared memory so that the data write flag indicates that the image data has been written in the shared memory;
[0206] After the detection unit 702 calls each processing process to read the image data from the shared memory, it is also used for:
[0207] Modify the process read completion flag corresponding to the processing process in the shared memory so that the process read completion flag indicates that the processing process has completed reading the image data in the shared memory.
[0208] Optionally, when the detection unit 702 detects the image data, it is specifically used for:
[0209] Determine the reference image data corresponding to the image data; wherein, the image data and the reference image data belong to different particles of the sample to be measured, and the positions of the image data in the belonging particle and the reference image data in the belonging particle are the same;
[0210] Detect the image data according to the image data and the reference image data.
[0211] Optionally, when the detection unit 702 detects the image data according to the image data and the reference image data, it is specifically configured to:
[0212] Determine the defective area of the image data as the area in the image data that is inconsistent with the reference image data and meets the preset defect conditions.
[0213] Optionally, when the combining unit 703 combines the detection results of each frame of image data obtained by scanning to obtain the defect detection result of the sample to be tested, it is specifically configured to:
[0214] Combine the detection results of each frame of image data obtained by scanning according to the calculation unit and the scanning path to which each frame of image data belongs, so as to obtain the defect detection result of the sample to be tested.
[0215] For the defect detection device provided by the embodiments of the present application, its specific working principle and beneficial effects can be referred to the defect detection method provided by the embodiments of the present application, and will not be elaborated here.
[0216] The embodiments of the present application further provide a computer storage medium for storing a computer program, which, when executed, is specifically configured to implement the defect detection method provided by any embodiment of the present application.
[0217] The embodiments of the present application further provide a detection device. Please refer to Figure 8 , which is a schematic structural diagram of the detection device. The detection device may include a memory 801 and a processor 802;
[0218] The memory 801 is used to store a computer program;
[0219] The processor 802 is used to execute the computer program, and is specifically configured to implement the defect detection method provided by any embodiment of the present application.
[0220] It should be noted that the embodiments in this specification are all described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other.
[0221] For the convenience of description, when describing the above system or device, various modules or units are described separately according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0222] As can be seen from the description of the above embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0223] Finally, it should also be noted that in this text, relational terms such as first, second, third, and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.
[0224] The above are only the preferred embodiments of this application. It should be pointed out that for those of ordinary skill in the art of this technology, without departing from the principle of this application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of this application.
Claims
1. A defect detection method, characterized in that, Including: Scanning a sample to be measured by a scanning device to obtain image data of the sample to be measured; During the process of scanning the sample to be measured, a target processing process is called in parallel to detect each frame of the image data obtained by scanning; wherein, the target processing process is the processing process corresponding to the computing unit to which the image data belongs among multiple processing processes, and the computing units corresponding to different processing processes are different; each of the processing processes corresponds to a graphics processor, and the processing process uses the corresponding graphics processor to detect the image data; Combining the detection results of each frame of the image data obtained by scanning to obtain a defect detection result of the sample to be measured.
2. The method according to claim 1, characterized in that, Further including: Obtaining scanning path information; wherein, the scanning path information includes the number of particles covered by each scanning path of the scanning device, the total number of frames of image data that can be scanned by each scanning path, and the position information of the camera field of view; Determining multiple computing units according to the scanning path information, and determining the image data included in each of the computing units; wherein, the image data included in the same computing unit is scanned from the same area of multiple particles in the sample to be measured; Allocating the multiple computing units to each of the processing processes to determine the corresponding relationship between the processing processes and the computing units.
3. The method according to claim 2, characterized in that, The allocating the multiple computing units to each of the processing processes includes: Allocating the multiple computing units to each of the processing processes according to the performance of the graphics processor bound to each of the processing processes.
4. The method according to claim 2, characterized in that, The allocating the multiple computing units to each of the processing processes includes: Evenly allocating the multiple computing units to each of the processing processes according to the process number of the processing process and the unit number of the computing unit; wherein, the unit number of the computing unit corresponding to the processing process is equal to the process number of the processing process, or equal to the process number of the processing process plus an integer multiple of the total number of processing processes.
5. The method according to claim 1, characterized in that, After obtaining the image data of the sample to be measured by scanning the sample to be measured with the scanning device, further including: Each time a frame of the image data is obtained by scanning, storing the image data in a shared memory; The calling the target processing process to detect each frame of the image data obtained by scanning includes: Calling each of the processing processes to read the image data from the shared memory; After determining that the target processing process has read the image data, detecting the image data through the target processing process.
6. The method according to claim 5, characterized in that, After storing the image data in the shared memory, further including: Modifying a data write flag of the shared memory to make the data write flag indicate that the image data has been written in the shared memory; After calling each of the processing processes to read the image data from the shared memory, further including: Modifying a process read completion flag corresponding to the processing process in the shared memory to make the process read completion flag indicate that the processing process has completed reading the image data in the shared memory.
7. The method according to claim 5, characterized in that, The detecting the image data includes: Determine the reference image data corresponding to the image data; wherein, the image data and the reference image data belong to different particles of the sample to be measured, and the positions of the image data in the respective particles are the same as the positions of the reference image data in the respective particles; Detect the image data according to the image data and the reference image data.
8. The method according to claim 5, characterized in that, The step of calling each of the processing processes to read the image data from the shared memory includes: After determining that the writing of the image data in the shared memory is completed according to the data writing flag, call each of the processing processes to read the image data from the shared memory; The step of determining that the target processing process reads the image data includes: After each call to a processing process to read the image data, determine whether the computing unit to which the image data belongs is the computing unit corresponding to the called processing process; If the computing unit to which the image data belongs is not the computing unit corresponding to the called processing process, determine that the target processing process has not read the image data, and call the processing process to discard the image data; If the computing unit to which the image data belongs is the computing unit corresponding to the called processing process, determine that the target processing process has read the image data.
9. The method according to claim 1, characterized in that, The step of combining the detection results of each frame of the image data obtained by scanning to obtain the defect detection result of the sample to be measured includes: According to the computing unit to which each frame of the image data belongs and the detection results of each frame of the image data obtained by combining the scanning paths, obtain the defect detection result of the sample to be measured.
10. A defect detection device, characterized in that, Comprising: A scanning unit, configured to scan a sample to be measured through a scanning device to obtain the image data of the sample to be measured; A detection unit, configured to, during the process of scanning the sample to be measured, call a target processing process in parallel to detect each frame of the image data obtained by scanning; wherein, the target processing process is the processing process corresponding to the computing unit to which the image data belongs among multiple processing processes, and the computing units corresponding to different processing processes are different; each of the processing processes corresponds to a graphics processor, and the processing process uses the corresponding graphics processor to detect the image data; A combining unit, configured to combine the detection results of each frame of the image data obtained by scanning to obtain the defect detection result of the sample to be measured.
11. A computer storage medium, characterized in that, For storing a computer program, when the computer program is executed, it is specifically configured to implement the defect detection method according to any one of claims 1 to 9.
12. A detection device, characterized in that, Comprising a memory and a processor; The memory is used for storing a computer program; The processor is used for executing the computer program, and is specifically configured to implement the defect detection method according to any one of claims 1 to 9.