Dispensing method based on gap dispensing, electronic equipment and storage medium

By using visual devices and preset template profile widths in the dispensing method to identify and filter error interference, filter reference edge points, and perform trajectory line compensation, the problems of uneven dispensing and overflow are solved, and a more efficient dispensing effect is achieved.

CN120460239APending Publication Date: 2025-08-12DONG GUAN GAO WEI GUANG XUE DIAN ZI YOU XIAN GONG SI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510578549.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

The existing dispensing method causes uneven distribution or overflow of glue when there is irregular bump interference on the gap surface of the target product, and the dispensing effect is poor.

Method used

The dispensing gap diagram is obtained through the visual device, and the preset template profile width is greater than the preset standard gap width of the target product. The error interference in the first edge point is identified and filtered, the reference edge point is filtered, the reference trajectory line is obtained, the trajectory line compensation is performed, and the dispensing head is controlled for dispensing.

Benefits of technology

Improve the accuracy and effect of dispensing, ensure uniform distribution of glue, avoid overflow, and meet dispensing requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120460239A_ABST
    Figure CN120460239A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a dispensing method based on gap dispensing, electronic equipment and a storage medium, and belongs to the technical field of automatic dispensing. According to the method, the width of a preset template contour is set to be larger than the preset standard gap width of a target product, a dispensing gap map and the preset template contour are matched, a coarse positioning area of the dispensing gap map is obtained, the coarse positioning area is input into a preset edge detection model, a first edge point corresponding to the coarse positioning area is obtained, and a reference edge point is obtained through screening. And obtaining a reference trajectory based on the reference edge point, compensating a preset initial trajectory according to the reference trajectory to obtain a target trajectory, and dispensing according to the target trajectory. The contour width of the preset template is set to be larger than the preset standard gap width of the target product, interference in the first edge points is recognized and filtered, the reference trajectory is obtained by using the screened reference edge points, the preset initial trajectory is compensated, and dispensing is performed based on the compensated target trajectory, so that the dispensing effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automatic dispensing technology, and in particular to a dispensing method, electronic equipment and storage medium based on gap dispensing. Background Art

[0002] With the development of the electronics manufacturing industry, the demand for securing and sealing electronic components has increased, leading to the widespread application of glue dispensing technology in the industry. Existing glue dispensing methods rely on a pre-set glue dispensing trajectory, controlling the dispensing head according to the pre-set glue dispensing trajectory. However, if irregular protrusions interfere with the gap surface of the target product, dispensing according to the pre-set glue dispensing trajectory can lead to uneven glue distribution or overflow, resulting in poor dispensing results. Summary of the Invention

[0003] In order to solve the above problems, the present application proposes a dispensing method, electronic device and storage medium based on gap dispensing, which can compensate the preset initial trajectory line based on the reference trajectory line, and control the dispensing head to dispense glue on the gap of the target product according to the compensated target trajectory line, thereby improving the dispensing effect.

[0004] To achieve the above objectives, in a first aspect, an embodiment of the present application provides a dispensing method based on gap dispensing, which is applied to a dispensing device, wherein the dispensing device is provided with a dispensing head and a visual device, and the dispensing method includes:

[0005] Acquire a dispensing gap diagram of a target product through the visual device;

[0006] Obtaining a preset initial trajectory line and a preset template contour corresponding to the preset initial trajectory line, wherein the preset initial trajectory line is a dispensing trajectory line corresponding to a preset standard gap of the target product, the preset initial trajectory line is located in the middle of the preset template contour, and the width of the preset template contour is greater than the width of the preset standard gap of the target product;

[0007] According to the preset template contour, a coarse positioning area is determined in the dispensing gap map, the coarse positioning area is input into a preset edge detection model, and a first edge point corresponding to the coarse positioning area is detected;

[0008] Screening the first edge points to obtain reference edge points, obtaining a reference trajectory line based on the reference edge points, and compensating the preset initial trajectory line according to the reference trajectory line to obtain a target trajectory line;

[0009] The dispensing head is controlled based on the target trajectory to dispense glue at the dispensing gap of the target product.

[0010] In a second aspect, an electronic device provided according to an embodiment of the present application includes:

[0011] at least one processor;

[0012] at least one memory for storing at least one program;

[0013] When at least one of the programs is executed by at least one of the processors, any of the dispensing methods described in the first aspect is implemented.

[0014] In a third aspect, a computer-readable storage medium is provided according to an embodiment of the application, storing computer-executable instructions, wherein the computer-executable instructions are used to execute any dispensing method described in the first aspect.

[0015] In summary, the above embodiments of the present application set the preset template contour width to be greater than the preset standard gap width of the target product, match the dispensing gap map with the preset template contour, obtain the coarse positioning area of the dispensing gap map, input the coarse positioning area into the preset edge detection model, obtain the first edge point corresponding to the coarse positioning area, screen and obtain the reference edge point, obtain the reference trajectory line based on the reference edge point, compensate the preset initial trajectory line according to the reference trajectory line, obtain the target trajectory line, and control the dispensing head to dispense glue in the dispensing gap of the target product based on the target trajectory line. The present application sets the preset template contour width to be greater than the preset standard gap width of the target product, identifies and filters the error interference in the first edge point, uses the screened reference edge point to obtain the reference trajectory line, and then compensates the preset initial trajectory line. The dispensing head is controlled to dispense glue based on the compensated target trajectory line, which can improve the dispensing effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A flow chart of a dispensing method according to an embodiment of the present application;

[0017] Figure 2 A schematic diagram showing that a preset template outline width is set to be greater than a preset initial trajectory line width according to an embodiment of the present application;

[0018] Figure 3 A schematic diagram of the preset grayscale threshold principle of an embodiment provided in this application;

[0019] Figure 4 A schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application.

[0020] Reference numerals:

[0021] The first plane 10 , the thickness 11 of the first plane, the second plane 20 , the height difference 30 between the first plane and the second plane, the preset template outline 40 , the gap edge 50 , the preset initial trajectory line 60 , and the noise point 70 . DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0024] With the rapid development of the electronics manufacturing industry, the complexity and precision of electronic products are constantly improving, and the requirements for the fixation and sealing of electronic components are becoming increasingly higher. Since dispensing technology has the functions of bonding, sealing, insulation and heat dissipation of electronic components, the application of dispensing technology in industrial production is becoming increasingly widespread.

[0025] Existing dispensing methods utilize a dispensing device equipped with a dispensing head. These dispensing methods control the dispensing head's dispensing operations based on a pre-planned dispensing trajectory. However, in real-world production environments, the gaps between target products often contain various irregular protrusions, depressions, or other interfering factors. These irregular surface features can cause deviations between the actual dispensing trajectory and the pre-set dispensing trajectory, leading to the dispensing head misjudging the dispensing location. This can result in glue not accurately filling the gap, or excessive glue accumulation on protruding areas, reducing the accuracy of the dispensing trajectory and failing to meet dispensing requirements.

[0026] Based on this, an embodiment of the present application provides a dispensing method based on gap dispensing, which can compensate the preset initial trajectory line through the reference trajectory line, and control the dispensing head to dispense glue on the target product gap according to the compensated target trajectory line, thereby improving the dispensing effect.

[0027] The dispensing device of the embodiment of the present application is provided with a dispensing head and a visual device.

[0028] Figure 1 This is a flow chart of the dispensing method of the embodiment of the present application, refer to Figure 1 As shown, the compensation method includes steps S101 to S105, which are specifically as follows:

[0029] Step S101, obtaining a dispensing gap map of a target product through a visual device;

[0030] Step S102: obtaining a preset initial trajectory line and a preset template contour corresponding to the preset initial trajectory line, wherein the preset initial trajectory line is a dispensing trajectory line corresponding to a preset standard gap of the target product, the preset initial trajectory line is located in the middle of the preset template contour, and the width of the preset template contour is greater than the width of the preset standard gap of the target product;

[0031] Step S103, determining a coarse positioning area in the dispensing gap map according to a preset template contour, inputting the coarse positioning area into a preset edge detection model, and detecting and obtaining a first edge point corresponding to the coarse positioning area;

[0032] Step S104, screening the first edge points to obtain reference edge points, obtaining a reference trajectory line based on the reference edge points, and compensating the preset initial trajectory line according to the reference trajectory line to obtain a target trajectory line;

[0033] Step S105 , controlling the dispensing head to dispense glue at the dispensing gap of the target product based on the target trajectory.

[0034] Therefore, the embodiment of the present application sets the preset template contour width to be greater than the preset standard gap width of the target product, matches the dispensing gap map with the preset template contour, obtains the coarse positioning area of the dispensing gap map, inputs the coarse positioning area into the preset edge detection model, obtains the first edge point corresponding to the coarse positioning area, filters to obtain the reference edge point, obtains the reference trajectory line based on the reference edge point, compensates the preset initial trajectory line according to the reference trajectory line, obtains the target trajectory line, and controls the dispensing head to dispense glue to the dispensing gap of the target product based on the target trajectory line. The present application can set the preset template contour width to be greater than the preset standard gap width of the target product, identify and filter the error interference in the first edge point, use the filtered reference edge point to obtain the reference trajectory line, and then compensate the preset initial trajectory line, control the dispensing head to dispense glue based on the compensated target trajectory line, and improve the dispensing effect.

[0035] In some embodiments, the target product may be a camera, which includes a lens module. The image sensor and voice coil motor driver chip in the camera module are ESD-sensitive devices. During the production, assembly, or use process, the human body or equipment may carry static electricity. When the static electricity is released through the pins or connectors of the module, it will generate instantaneous high voltage and large current, which may break down sensitive semiconductor devices. In the embodiment of the present application, the lens module is wrapped with a stiffener (also known as a reinforcing sheet). The stiffener can prevent the camera module from being damaged by the current and play a grounding protection role. However, there is a gap between the lens module and the reinforcing sheet. The gap between the lens module and the reinforcing sheet can be photographed by a visual device to obtain a dispensing gap map. Those skilled in the art do not make specific restrictions on the visual device, and those skilled in the art can selectively select a visual device according to actual circumstances. The visual device in the embodiment of the present application can be a ToF camera (Time-of-Flight Camera), a binocular vision camera, and a structured light camera. Taking a structured light camera as an example, the gap between the lens module and the reinforcing sheet is photographed by the structured light camera to obtain a dispensing gap map of the depth map type.

[0036] In the embodiments of the present application, the preset initial trajectory is a preset dispensing trajectory for a dispensing device, and the preset initial trajectory includes the dispensing position coordinates of the dispensing head. Exemplarily, the dispensing device controls the dispensing head to dispense glue at the dispensing gap based on the dispensing position coordinates in the preset initial trajectory. The preset template contour corresponding to the preset initial trajectory represents a series of points comprising the dispensing gap corresponding to the preset initial trajectory, meaning that the shape of the dispensing gap can be determined based on the preset template contour.

[0037] In some embodiments, the determination of the coarse positioning area in step S103 can be performed by extracting feature points of the dispensing gap map and the preset template contour, and then calculating the matching relationship based on the distance between the feature points, thereby determining the coarse positioning area based on the matching relationship. This can combine the advantages of feature extraction and matching, so that the scale change and rotation of the dispensing gap map have a certain robustness. In the embodiment of the present application, the determination of the coarse positioning area in step S103 can be performed by matching using the ORB (Oriented FAST and Rotated BRIEF) operator, the cv2.matchTemplate function of OpenCV (Open Source Computer Vision Library), or a convolutional neural network, thereby determining the coarse positioning area. Taking the matching using the ORB operator as an example, feature points are first extracted using the ORB operator, and then the Hamming distance between the feature points is calculated. Matching feature point pairs are screened out based on the Hamming distance, and finally the coarse positioning area is determined based on the matching feature points.

[0038] The edge detection model has the ability to extract the contours and boundary information of objects in an image, and has the advantages of high noise resistance and high edge positioning accuracy. Therefore, the embodiment of the present application can accurately extract edge points from the coarse positioning area of the image through the edge detection model, so that the trajectory line determined based on the edge points is more accurate.

[0039] In some embodiments, the gap between the lens module and the reinforcement sheet in the dispensing gap diagram can be composed of first edge points. However, since the first edge points are easily affected by noise interference, the trajectory line fitted based on the first edge points deviates from the actual trajectory line. In the embodiment of the present application, the preset initial trajectory line is set to be located in the middle of the preset template contour, and the width of the preset template contour is greater than the width of the preset standard gap of the target product, so that the range of the preset template contour can cover the preset initial trajectory line, that is, the preset template contour can cover more first edge points than the preset initial trajectory line, so that the proportion of noise points in edge detection in the edge detection model is relatively small, and then the reference edge points are obtained by screening, and the noise points can be identified and filtered out, thereby improving the accuracy of the reference edge points, so that the target trajectory line determined based on the reference edge points is more accurate.

[0040] For example, refer to Figure 2 As shown, the gap edge 50 includes multiple first edge points, and the width of the preset template contour 40 is greater than the preset standard gap width of the target product, so that the range of the preset template contour 40 can cover the preset initial trajectory line 60, and the preset template contour 40 can cover the noise point 70.

[0041] In some embodiments, inputting the coarse positioning area into a preset edge detection model to detect and obtain a first edge point corresponding to the coarse positioning area includes:

[0042] Divide the coarse positioning area into multiple rectangular areas with equal spacing according to the preset caliper distance and the preset caliper height, and calculate the grayscale gradient of each pixel point in each rectangular area, where the grayscale gradient represents the grayscale change of the pixel point;

[0043] When the grayscale gradient of a pixel point is greater than or equal to a preset grayscale threshold, the pixel point is determined as a first edge point.

[0044] Therefore, the embodiment of the present application calculates the grayscale gradient of each pixel point in the rectangular area and identifies the first edge point based on the grayscale gradient. Since the grayscale gradient represents the degree of grayscale change of the pixel point, and the edge point of the image is an area with drastic grayscale change, the grayscale gradient can be used to accurately identify the first edge point, thereby improving the accuracy of identifying the gap edge of the product.

[0045] In some embodiments, the localized processing method of dividing the coarse positioning area into multiple rectangular areas in the embodiments of the present application can more accurately capture grayscale changes within each area, thereby reducing noise interference with global detection, thereby improving the accuracy of identifying the first edge point. Those skilled in the art do not impose a specific limit on the number of rectangular areas into which the coarse positioning area is divided, and those skilled in the art can selectively set the number based on actual circumstances.

[0046] In some embodiments, since the grayscale level of each pixel in the image corresponds to a fixed physical depth increment, the gap is composed of a first plane and a second plane, that is, the thickness of the first plane is the minimum height difference between the two planes. In embodiments of the present application, the preset grayscale threshold is obtained by dividing the minimum height difference between the first plane and the second plane by the physical depth increment. In other embodiments, the minimum height difference between the first plane and the second plane is divided by the physical depth increment to obtain a theoretical preset grayscale threshold, and the preset grayscale threshold is obtained by subtracting a preset redundancy from the theoretical preset threshold.

[0047] For example, reference Figure 3 As shown, the first plane 10 and the second plane 20 form a height difference 30 between the first and second planes. Since the thickness 11 of the first plane is 0.068 mm, the minimum value of the height difference 30 between the first and second planes is 0.068 mm. For example, if the minimum value of the height difference 30 between the first and second planes is 0.068 mm, the fixed physical depth increment corresponding to the grayscale level of each pixel in the image is set to 0.0008 mm, and the redundancy is set to 20 mm, the preset grayscale threshold can be calculated to be 0.068 ÷ 0.0008 - 20 = 65 mm.

[0048] In some embodiments, screening the first edge point to obtain a reference edge point, and obtaining a reference trajectory line corresponding to the reference edge point according to the reference edge point includes:

[0049] Performing straight line fitting on the first edge point to obtain a first fitting straight line;

[0050] Calculating the distance between each first edge point and the first fitting straight line, and taking the first edge point as a reference edge point when the distance is less than or equal to a preset distance threshold;

[0051] Perform straight line fitting on the reference edge points to obtain the reference trajectory line.

[0052] Therefore, the embodiment of the present application calculates the distance between the first edge point and the first fitted line to screen out the reference edge points. This embodiment of the present application screens out the reference edge points based on the distance, removing outliers that deviate significantly from the fitted line, reducing the error of the reference edge points, and thus improving the accuracy and reliability of the reference trajectory.

[0053] When the dispensing gap of the target product has a complex shape or uneven distribution, the embodiment of the present application can better adapt to the local changes in the edge of the dispensing gap through distance screening, reduce the error caused by global fitting, thereby more accurately reflecting the characteristics of the dispensing gap edge and improving the accuracy of the reference edge point.

[0054] In some embodiments, the present invention can use the least squares method to calculate a fitted line. The slope and intercept of the fitted line are calculated based on the reference edge points, so that the sum of the squares of the vertical distances from all points to the fitted line is minimized. Because the least squares method can effectively balance the influence of each reference edge point on the fitted line, even if there are certain noise points in the reference edge points, the least squares method can still better fit the overall trend of the data. This makes the fitting result more tolerant to random fluctuations and noise in the data, thereby improving the accuracy of the reference trajectory line.

[0055] In some embodiments, compensating a preset initial trajectory line according to a reference trajectory line to obtain a target trajectory line includes:

[0056] Calculate the direction vector of the reference trajectory line;

[0057] The angle of the preset initial trajectory is compensated according to the direction vector to obtain the target trajectory.

[0058] Therefore, the embodiment of the present application compensates the angle of the preset initial trajectory line through the direction vector of the reference trajectory line, which can reduce the error of the target trajectory line and improve the accuracy of the dispensing trajectory.

[0059] It is understandable that during the dispensing process of the target product, due to factors such as unevenness in the dispensing gap area of the target product, the actual dispensing trajectory may deviate from the preset initial dispensing trajectory line. In the embodiment of the present application, by calculating the direction vector of the reference trajectory line, the direction vector represents the direction of the reference trajectory line, and can quantify the angular deviation between the preset initial trajectory line and the reference trajectory line. Based on the direction vector, the angle of the preset initial trajectory line is accurately compensated, which can ensure that the target trajectory line and the reference trajectory line maintain consistency in direction, thereby reducing the error between the preset initial trajectory line and the target trajectory line and improving the accuracy of the dispensing trajectory.

[0060] In some embodiments, controlling the dispensing head to dispense glue at a dispensing gap of a target product based on a target trajectory line includes:

[0061] Determine the reference gap size of each track point in the target track line;

[0062] Perform coordinate conversion on the trajectory point coordinates of each trajectory point and the corresponding reference gap size to obtain the dispensing coordinates of the dispensing point;

[0063] Configure target dispensing speed for each dispensing point based on each reference gap size;

[0064] The dispensing head is controlled to dispense glue at corresponding dispensing coordinates according to each target dispensing speed.

[0065] Therefore, the embodiment of the present application obtains the dispensing points and the target dispensing speeds corresponding to the dispensing points through the target trajectory line, thereby controlling the dispensing head to dispense glue at the corresponding dispensing coordinates according to each target dispensing speed, and enables the dispensing head to dispense glue according to the target trajectory line at the target dispensing speed, so that the dispensing trajectory of the product can fit the actual dispensing trajectory line.

[0066] This embodiment of the application first uses the coordinates of each track point on the target trajectory as basic positioning parameters, which define the motion path of the dispensing head in three-dimensional space. Then, the reference gap size corresponding to each track point on the target trajectory is used as a correction parameter to adjust the deviation between the track coordinates of the target trajectory and the preset standard gap, thereby generating the dispensing coordinates of the dispensing points.

[0067] In the embodiments of the present application, the gap size is characterized by the size of the gap. The gap size is obtained by calculating the height difference between the two planes forming the gap and subtracting the thickness of one of the planes from the height difference. In the embodiments of the present application, the gap size can be calculated using Formula 1, which is as follows: gap = y2 - y1 - h (1), where gap is the gap size, y2 is the height of the second plane, y1 is the height of the first plane, and h is the thickness of the first plane.

[0068] For example, if the height of the second plane is set to 0.4 mm, the height of the first plane is set to 0.1 mm, and the thickness of the first plane is set to 0.2 mm, then according to formula (1), gap = 0.4 - 0.1 - 0.2 = 0.1, and the volume data at this time is 0.1 mm.

[0069] In some embodiments, the dispensing device of the embodiment of the present application is provided with a driving motor. The frequency and duty cycle of the pulse width modulation signal of the driving motor can be adjusted according to the dispensing points and the dispensing speeds corresponding to the dispensing points, so as to realize the driving force provided by the driving motor to the dispensing head, thereby realizing dispensing.

[0070] In some embodiments, configuring a target dispensing speed for each dispensing point based on each reference gap size includes:

[0071] Obtain a mapping table, which indicates the mapping relationship between gap size and dispensing speed. Different gap sizes correspond to different dispensing speeds.

[0072] The dispensing speed corresponding to each reference gap size in the mapping table is determined as the target dispensing speed of the corresponding dispensing point.

[0073] Therefore, the target dispensing speed can be dynamically adjusted through a mapping table based on the reference gap size, so that the target dispensing speed can dynamically adapt to the gap, thereby improving the accuracy of dispensing.

[0074] In the embodiments of the present application, the gap size can be set to multiple different gap size ranges, and preset dispensing speeds can be assigned as target dispensing speeds according to the different gap size ranges. The preset speed data corresponding to the gap size of the dispensing point can be determined by a mapping table. Persons skilled in the art do not place specific restrictions on the preset dispensing speeds in the mapping table, and those skilled in the art can selectively set them according to actual circumstances.

[0075] Exemplarily, a mapping table of gap size and dispensing speed is constructed as shown in Table 1. At this time, the dispensing speed corresponding to the reference gap size of the dispensing point can be determined by querying Table 1.

[0076] Three gap size ranges are set in Table 1, and a dispensing speed is set for each gap size range. For example, assuming that the gap size of the dispensing point is 0.1mm, the dispensing speed corresponding to the gap size is 3mm / s according to Table 1.

[0077] Among them, Table 1 is as follows:

[0078] Gap size range (mm) Dispensing speed (mm / s) 0 to 0.2 3 0.2 to 0.4 2.8 0.4 to 0.6 2.6

[0079] Table 1

[0080] In some embodiments, after controlling the dispensing head to dispense glue at the dispensing gap of the target product based on the target trajectory, the method further includes:

[0081] Obtaining dispensing track images on the target product through a visual device;

[0082] When a gap is detected at any dispensing point of the target product based on the dispensing trajectory image, the dispensing speed corresponding to the reference gap size of the dispensing point with the gap in the mapping table is adjusted downward based on the preset speed threshold;

[0083] When glue overflow is detected at any glue point of the target product based on the glue trajectory image, the glue dispensing speed corresponding to the reference gap size of the glue dispensing point with glue overflow in the mapping table is increased based on the preset speed threshold.

[0084] Therefore, the embodiment of the present application detects whether any glue point in the glue trajectory image meets the glue dispensing requirements, and adjusts the glue dispensing speed corresponding to the reference gap size of the glue dispensing point in the mapping table according to the detection results, so that the glue dispensing speed in the mapping table can more accurately reflect the mapping relationship between the gap size and the glue dispensing speed.

[0085] It can be understood that when a gap is detected at the dispensing point of the target product, the target dispensing speed of the dispensing head can be reduced so that the dispensing head takes a longer time to pass through the dispensing gap of the target product, thereby increasing the amount of glue obtained in the gap of the target product and reducing incomplete dispensing of the target product; when overflow is detected at the dispensing point of the target product, the target dispensing speed of the dispensing head can be increased so that the time to pass through the dispensing gap of the target product is shorter, thereby reducing the amount of glue obtained in the gap of the target product and reducing overflow in the dispensing of the target product.

[0086] In the embodiment of the present application, a preset speed threshold corresponding to the detection result can be obtained by constructing a mapping table. Those skilled in the art do not impose any specific numerical restrictions on the speed threshold in the mapping table, and those skilled in the art can selectively set it according to actual conditions.

[0087] For example, a mapping table of test results and speed thresholds is constructed as shown in Table 2. The speed threshold corresponding to the test result can be obtained by querying Table 2. Assuming the test result is overflow, Table 2 shows that the corresponding speed threshold is 0.1 mm / s. Assuming the test result is a gap, Table 2 shows that the corresponding speed threshold is 0.2 mm / s.

[0088] Among them, Table 2 is as follows:

[0089] Test results Speed threshold (mm / s) There is glue overflow 0.1 There is a gap 0.2

[0090] Table 2

[0091] In some embodiments, determining a coarse positioning area in the dispensing gap map according to a preset template contour includes:

[0092] The dispensing gap image is filtered by a filter to obtain a filtered image;

[0093] Perform contour extraction on the filtered image to obtain the initial contour of the dispensing gap map;

[0094] The preset template contour is matched with the initial contour to obtain the coarse positioning area of the dispensing gap map.

[0095] Therefore, the embodiment of the present application performs contour matching on the preset template contour and the dispensing gap map to obtain a coarse positioning area of the dispensing gap map, and can improve the accuracy of the coarse positioning area based on contour matching.

[0096] Contour extraction and matching are highly adaptable to the shape of the dispensing gap diagram, enabling more accurate target positioning. In the embodiments of this application, contour extraction and matching are used to obtain a coarse positioning area. Even if the gap in the target product where dispensing is required is irregular in shape, key feature points of the target product gap can be extracted and contour matched, thereby improving the accuracy of the coarse positioning area.

[0097] When a vision device acquires a dispensing gap map, it is subject to interference from external factors such as ambient light, which can cause noise in the dispensing gap map. This noise can interfere with contour extraction from the dispensing gap map, leading to incomplete extracted contours and contour errors. Therefore, in the embodiments of the present application, filtering is performed on the dispensing gap map. This filtering process can reduce noise in the dispensing gap map and reduce its interference with contour extraction, thereby improving the accuracy of contour matching.

[0098] In some embodiments, the filter is a Gaussian filter, and the Gaussian filter includes a preset standard deviation parameter. Since the Gaussian filter has the advantage of maintaining the contours and edges of the image on the basis of removing noise, the standard deviation parameter in the Gaussian filter characterizes the discrete degree of the image data distribution, and the noise removal is positively correlated with the standard deviation parameter, while the ability to maintain the contours and edges of the image is negatively correlated with the standard deviation parameter. Relevant personnel in this field can set the specific value of the standard deviation parameter according to actual needs. For example, the standard deviation parameter of the Gaussian filter is set to 3 to achieve the purpose of maintaining the contours and edges of the dispensing gap diagram on the basis of removing the noise of the dispensing gap diagram. Therefore, the embodiment of the present application uses a Gaussian filter to filter the dispensing gap diagram, and on the basis of ensuring that the edges of the dispensing gap diagram are not distorted, the Gaussian noise of the dispensing gap diagram can be removed.

[0099] The present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned dispensing method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, an in-vehicle computer, or the like.

[0100] See also Figure 4 , Figure 4 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:

[0101] The processor 901 can be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0102] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called by the processor 901 to execute the dispensing method of the embodiments of this application.

[0103] Input / output interface 903, used to implement information input and output;

[0104] Communication interface 904, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);

[0105] Bus 905 , which transmits information between various components of the device (e.g., processor 901 , memory 902 , input / output interface 903 , and communication interface 904 );

[0106] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0107] In some embodiments, the embodiments of the present application further provide a computer-readable storage medium, which stores a computer program, and the computer program implements the above-mentioned dispensing method when executed by a processor.

[0108] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0109] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0110] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0111] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0112] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0113] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0114] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0115] 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 schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0117] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0118] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

Claims

1. A dispensing method based on gap dispensing, characterized in that: Applied to a dispensing device, the dispensing device is provided with a dispensing head and a visual device, and the dispensing method includes: Acquire a dispensing gap diagram of a target product through the visual device; Obtaining a preset initial trajectory line and a preset template contour corresponding to the preset initial trajectory line, wherein the preset initial trajectory line is a dispensing trajectory line corresponding to a preset standard gap of the target product, the preset initial trajectory line is located in the middle of the preset template contour, and the width of the preset template contour is greater than the width of the preset standard gap of the target product; According to the preset template contour, a coarse positioning area is determined in the dispensing gap map, the coarse positioning area is input into a preset edge detection model, and a first edge point corresponding to the coarse positioning area is detected; Screening the first edge points to obtain reference edge points, obtaining a reference trajectory line based on the reference edge points, and compensating the preset initial trajectory line according to the reference trajectory line to obtain a target trajectory line; The dispensing head is controlled based on the target trajectory to dispense glue at the dispensing gap of the target product.

2. The dispensing method based on gap dispensing according to claim 1, characterized in that: Inputting the coarse positioning area into a preset edge detection model to detect and obtain a first edge point corresponding to the coarse positioning area includes: Dividing the coarse positioning area into a plurality of rectangular areas at equal intervals according to a preset caliper distance and a preset caliper height, and calculating a grayscale gradient for each pixel in each of the rectangular areas, wherein the grayscale gradient represents a grayscale change of the pixel; When the grayscale gradient of the pixel point is greater than or equal to a preset grayscale threshold, the pixel point is determined as a first edge point.

3. The dispensing method based on gap dispensing according to claim 2, characterized in that: The filtering of the first edge points to obtain reference edge points, and obtaining, based on the reference edge points, a reference trajectory line corresponding to the reference edge points, includes: Performing straight line fitting on the first edge points to obtain a first fitting straight line; Calculating the distance between each of the first edge points and the first fitting straight line, and taking the first edge point as a reference edge point if the distance is less than or equal to a preset distance threshold; A straight line fitting is performed on the reference edge points to obtain the reference trajectory line.

4. The dispensing method based on gap dispensing according to claim 1, characterized in that: The compensating the preset initial trajectory line according to the reference trajectory line to obtain the target trajectory line includes: Calculating the direction vector of the reference trajectory line; The angle of the preset initial trajectory line is compensated according to the direction vector to obtain the target trajectory line.

5. The dispensing method based on gap dispensing according to claim 1, characterized in that: The step of controlling the dispensing head to dispense glue at the dispensing gap of the target product based on the target trajectory line includes: Determining the track point coordinates and reference gap size of each track point in the target track line; Performing coordinate conversion on the track point coordinates of each track point and the corresponding reference gap size to obtain the dispensing coordinates of the dispensing point; configuring a target dispensing speed for each of the corresponding dispensing points based on each of the reference gap sizes; The dispensing head is controlled to dispense glue at the corresponding dispensing points according to the target dispensing speeds.

6. The dispensing method based on gap dispensing according to claim 5, characterized in that: The configuring a target dispensing speed for each of the corresponding dispensing points based on each of the reference gap sizes includes: Obtaining a mapping table, wherein the mapping table is used to indicate a mapping relationship between gap size and dispensing speed, wherein different gap sizes correspond to different dispensing speeds; The dispensing speed corresponding to each reference gap size in the mapping table is determined as the target dispensing speed of the corresponding dispensing point.

7. The dispensing method based on gap dispensing according to claim 5, characterized in that: After controlling the dispensing head to dispense glue at the dispensing gap of the target product based on the target trajectory, the method further includes: Obtaining a dispensing track image on a target product through the visual device; When a gap is detected at any glue point of the target product based on the glue trajectory image, the glue dispensing speed corresponding to the reference gap size of the glue dispensing point with the gap in the mapping table is lowered based on a preset speed threshold; When overflow is detected at any glue point of the target product based on the glue trajectory image, the glue dispensing speed corresponding to the reference gap size of the glue dispensing point with a gap in the mapping table is increased based on a preset speed threshold.

8. The dispensing method based on gap dispensing according to claim 1, characterized in that: Determining a rough positioning area in the dispensing gap map according to the preset template contour includes: Performing filtering processing on the dispensing gap image through a filter to obtain a filtered image; Performing contour extraction on the filtered image to obtain an initial contour of the dispensing gap map; The preset template contour is matched with the initial contour to obtain a rough positioning area of the dispensing gap map.

9. An electronic device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When at least one of the programs is executed by at least one of the processors, the method according to any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium storing computer-executable instructions, characterized in that: The computer-executable instructions are used to execute the method according to any one of claims 1 to 8.