Inkjet device nozzle detection and orifice compensation method and related devices

CN122747480APending Publication Date: 2026-09-15TECH & ENG CENT FOR SPACE UTILIZATION CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611091439.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-09-15

AI Technical Summary

Technical Problem

第一,现有检测方法较多侧重于判断喷头整体是否需要清洗、维护或更换,难以形成与每一个喷孔编号一一对应的状态序列,因而不利于后续根据具体异常喷孔位置自动生成补偿策略

Benefits of technology

[0019]采用上述进一步方案的有益效果是:使喷头的加权状态被标准化为0至1区间的统一度量,便于后续与预设阈值进行比较以确定风险等级。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122747480A_ABST
    Figure CN122747480A_ABST
Patent Text Reader

Abstract

The application discloses a nozzle detection and ejection hole compensation method of an inkjet device and related equipment, and relates to the technical field of inkjet control.The application enumerates candidate offset amounts, judges whether the offset ejection hole belongs to the normal ejection hole in the compensation ejection hole set, and automatically establishes a candidate mapping relationship for each abnormal ejection hole, in which the normal ejection hole compensates for the abnormal ejection hole.For each candidate offset amount, the score is calculated according to the coverage number, the remaining continuous abnormal penalty and the offset distance, and the candidate offset amount with the highest score is selected as the compensation offset amount in this round, so that the abnormal ejection hole coverage number, the remaining continuous abnormal risk and the offset distance can be comprehensively considered, and the effectiveness of the compensation strategy can be improved.The multiple rounds of compensation searches are iteratively executed, the remaining abnormal ejection hole set is updated in each round, and the stop condition is judged, so that the compensation process can automatically cover as many abnormal ejection holes as possible until the compensation cannot be continued or the preset stop condition is met, and the compensation result is accurate to each ejection hole number and offset amount.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of inkjet control technology, and in particular to a method and related equipment for printhead detection and nozzle compensation in inkjet equipment. Background Technology

[0002] Inkjet equipment is widely used in inkjet printing, inkjet coating, inkjet deposition, inkjet forming, and inkjet additive manufacturing. These devices typically use printhead arrays to selectively spray liquid, semi-liquid, slurry, functional inks, binders, or other jettable materials according to a predetermined pattern onto a carrier medium, powder bed, substrate surface, or pre-formed layer, thereby achieving image imaging, material deposition, pattern preparation, or three-dimensional structure forming. Printheads usually consist of hundreds to thousands of tiny nozzles. The stability and accuracy of each nozzle in ejecting droplets directly affects the integrity of the sprayed pattern, deposition uniformity, forming precision, surface quality, and the consistency of the part or product. In actual use, nozzles are easily affected by factors such as changes in material viscosity, material deposition residue, dust contamination, air bubble entrainment, printhead aging, nozzle wear, drive waveform drift, temperature changes, and fluctuations in the working environment, leading to abnormal states such as nozzle clogging, weak spraying, intermittent spraying, skewed spraying, abnormal droplet volume, or complete failure. For inkjet printing, nozzle abnormalities may lead to missing prints, broken lines, streaks, color differences, missing patterns, or uneven local deposition. For inkjet forming, inkjet deposition, and inkjet additive manufacturing, nozzle abnormalities may also form pores, cracks, weakened interlayer bonding, insufficient local material, or reduced structural strength after multiple depositions or multilayer stacking, thereby affecting product quality and even causing parts to be scrapped or requiring repeated processing.

[0003] Existing printhead inspection technologies typically involve printing test patterns and acquiring images. The presence of anomalies in the nozzles is determined based on the number, location, area, grayscale, morphology, and differences from reference images of detection lines, ink dots, jet trajectories, or test areas. Other technologies employ light transmission substrate imaging for transparent or semi-transparent materials, or determine the nozzle ejection state through aerial droplet images, nozzle electrical signals, pressure signals, and acoustic signals. While these solutions can achieve printhead status detection and improve automation to some extent, they still have shortcomings in inkjet equipment requiring per-nozzle compensation control. Specifically: First, existing detection methods largely focus on determining whether the printhead as a whole needs cleaning, maintenance, or replacement, making it difficult to establish a state sequence that corresponds one-to-one with each nozzle number. This hinders the automatic generation of compensation strategies based on the specific location of abnormal nozzles. Second, conventional detection methods often rely on fixed thresholds, human experience, or single image features. Their adaptability and stability are insufficient when faced with different inkjet materials in terms of color, transparency, viscosity, diffusion characteristics, lighting conditions, image size, and imaging equipment differences. Third, existing evaluation methods typically use the number or proportion of abnormal nozzles as the main indicator, but fail to adequately distinguish the risk differences between isolated and consecutive abnormal nozzles. In inkjet equipment, consecutive abnormal nozzles are more likely to cause continuous inkjet leakage, streaks, localized deposition loss, or structural weakening, and their harm is usually significantly greater than that of an equal number of scattered abnormal nozzles. Fourth, existing compensation methods mostly employ methods such as increasing the jet volume of adjacent nozzles, simple position substitution, or manual parameter adjustment, lacking the ability to automatically search for multi-round offset compensation schemes based on nozzle-by-nozzle detection results. Summary of the Invention

[0004] This invention aims to address the shortcomings of existing technologies, specifically providing a method and related equipment for printhead detection and nozzle compensation in inkjet equipment, as detailed below: 1) In a first aspect, the present invention provides a printhead detection and nozzle compensation method for an inkjet device. The specific technical solution is as follows: Obtain and determine whether nozzle compensation should be performed based on the printhead nozzle detection data, and obtain a judgment result; when the judgment result is yes, determine the remaining abnormal nozzle set and the compensation nozzle set; enumerate candidate offsets within a preset maximum offset step range; for each candidate offset, traverse each abnormal nozzle in the remaining abnormal nozzle set, and determine whether the nozzle corresponding to the abnormal nozzle after offset by the candidate offset belongs to the normal nozzle in the compensation nozzle set; if yes, establish a candidate mapping relationship where the normal nozzle compensates for the abnormal nozzle; for each candidate offset, calculate the score corresponding to the candidate offset based on a preset evaluation index. The process involves selecting the candidate offset with the highest score as the compensation offset for this round, determining and recording the compensation mapping relationship between each abnormal nozzle and the normal compensated nozzle based on the candidate mapping relationship corresponding to the compensation offset for this round, marking the compensated abnormal nozzles for this round as compensated nozzles, updating the set of remaining abnormal nozzles, and determining whether the stopping condition is met. If not, the process returns to the step of enumerating candidate offsets within the preset maximum offset step range, using the updated set of remaining abnormal nozzles as the current set of remaining abnormal nozzles to continue the next round of compensation search. The process outputs the nozzle detection results and nozzle compensation results, which include at least the offsets of each round of compensation and the compensation mapping relationship between the abnormal nozzle number and the corresponding normal nozzle number.

[0005] The beneficial effects of the printhead detection and nozzle compensation method for inkjet equipment provided by this invention are as follows: Nozzle detection results are used for nozzle compensation decisions. By determining whether nozzle compensation should be performed, the remaining abnormal nozzle set and the compensation nozzle set are determined when compensation is required, thereby ensuring that the compensation operation is only performed when necessary, avoiding unnecessary consumption of computational resources. By enumerating candidate offsets and determining whether the offset nozzle belongs to the normal nozzle in the compensation nozzle set, a candidate mapping relationship between normal nozzles and abnormal nozzles can be automatically established for each abnormal nozzle, achieving a precise correspondence between abnormal nozzles and compensation nozzles. For each candidate offset, a score is calculated based on the coverage quantity, remaining continuous abnormal penalty, and offset distance, and the candidate offset with the highest score is selected as the compensation offset for this round. This comprehensively considers the coverage quantity of abnormal nozzles, the remaining continuous abnormal risk, and the offset distance, prioritizing the elimination of high risks caused by continuous abnormal nozzles and improving the effectiveness of the compensation strategy. By iteratively executing multiple rounds of compensation search and updating the remaining abnormal nozzle set and determining the stopping condition in each round, the compensation process can automatically cover as many abnormal nozzles as possible until compensation can no longer continue or the preset stopping condition is met. The final output includes the offset of each round of compensation and the compensation mapping relationship between the abnormal nozzle number and the corresponding normal nozzle number. This makes the compensation result accurate to each nozzle number and offset, forming a traceable, verifiable, and executable compensation scheme, which improves the automation level and compensation accuracy of nozzle abnormality handling in inkjet equipment.

[0006] Furthermore, based on the nozzle orifice detection data, the process determines whether orifice compensation should be performed, and obtains a judgment result. This includes: acquiring the nozzle orifice detection data; constructing a nozzle state sequence based on the nozzle orifice detection data, with each nozzle state in the sequence corresponding one-to-one with its nozzle number, where the nozzle state includes normal nozzles and abnormal nozzles; scanning the nozzle state sequence to identify continuous abnormal nozzle clusters composed of adjacent abnormal nozzles, and calculating the weighted state of the nozzle based on the length of each continuous abnormal nozzle cluster; determining the risk level of the nozzle based on the weighted state; and determining whether orifice compensation should be performed based on the risk level, thus obtaining a judgment result.

[0007] The beneficial effects of adopting the above-mentioned further scheme are as follows: By acquiring the nozzle detection data of the printhead and constructing a nozzle state sequence according to the nozzle number, each nozzle state in the nozzle state sequence corresponds one-to-one with the nozzle number, thereby accurately locating the position of each abnormal nozzle and providing an accurate nozzle-by-nozzle state basis for subsequent compensation. By scanning the nozzle state sequence to identify continuous abnormal nozzle clusters composed of adjacent abnormal nozzles, and calculating the printhead's weighted state based on the length of each continuous abnormal nozzle cluster, the risk difference between isolated abnormal nozzles and continuous abnormal nozzles can be fully distinguished, and continuous abnormal nozzle clusters can be given a higher penalty, thus more accurately reflecting the higher risk posed by continuous abnormal nozzles to inkjet quality. Determining the printhead's risk level based on the weighted state and determining whether to perform nozzle compensation based on the risk level can match the compensation decision with the actual risk status of the printhead, avoiding unnecessary compensation operations under low-risk conditions, and improving the efficiency and rationality of nozzle abnormality handling in inkjet equipment.

[0008] Furthermore, when the judgment result is yes, the remaining abnormal nozzle set and the compensation nozzle set are determined, including: when the judgment result is yes, the remaining abnormal nozzle set is determined according to the nozzle state sequence, and nozzles that can be used for compensation are selected from the normal nozzles as the compensation nozzle set.

[0009] The beneficial effects of adopting the above-mentioned further scheme are as follows: By determining the set of remaining abnormal nozzles based on the nozzle state sequence when nozzle compensation is required, and including the nozzle numbers of all abnormal nozzles in the nozzle state sequence into the set of remaining abnormal nozzles, the subsequent compensation search has a clear and complete compensation object, avoiding the omission of any abnormal nozzles that need compensation. By selecting nozzles that can be used for compensation from normal nozzles as the compensation nozzle set, and using all nozzles in a normal state as potential compensation sources, it is ensured that the nozzles used to replace abnormal nozzles in performing the jetting action are all healthy and usable nozzles, avoiding the use of nozzles in unreliable states for compensation and the generation of new jetting quality problems. The separate determination of the above two sets establishes a clear correspondence between the compensation object and the compensation source in the compensation process, providing an accurate input data foundation for subsequent candidate offset enumeration and candidate mapping relationship establishment, thereby improving the accuracy and reliability of nozzle compensation in inkjet equipment.

[0010] Furthermore, after outputting the printhead detection results and nozzle compensation results, the process also includes: writing the compensation mapping relationship into the inkjet equipment's ejection control data; controlling the printhead to perform ejection operations according to the ejection control data, wherein, for abnormal nozzles with established compensation mapping relationships, the ejection action of the abnormal nozzle is stopped, and the normal compensation nozzle corresponding to the abnormal nozzle performs the ejection action in place of the abnormal nozzle according to the compensation mapping relationship; and generating a nozzle status visualization diagram and compensation mapping based on the offset of each round of compensation in the nozzle compensation results and the compensation mapping relationship between the abnormal nozzle number and the corresponding normal nozzle number. The diagram shows the nozzle status visualization. Each nozzle is distinguished by different colors or markers to identify normal nozzles, abnormal nozzles, and compensated nozzles. The compensation mapping diagram is used to display the compensation correspondence between each abnormal nozzle and its corresponding normal compensated nozzle. The nozzle detection results and nozzle compensation results are exported as data files according to a preset format. The data files include a nozzle status table and a compensation mapping table. The nozzle status table records the nozzle number, nozzle status, and whether each nozzle has been compensated. The compensation mapping table records the offset of each round of compensation and the compensation mapping relationship between the abnormal nozzle number and its corresponding normal nozzle number.

[0011] The beneficial effects of adopting the above-mentioned further solution are as follows: By writing the compensation mapping relationship into the inkjet equipment's ejection control data and controlling the printhead to perform ejection operations according to the ejection control data, the ejection action of abnormal nozzles with established compensation mapping relationships is stopped, and the corresponding normal compensation nozzles replace them in performing the ejection action according to the compensation mapping relationship. This allows the compensation scheme to be directly converted into an executable ejection command, ensuring that the ejection task of each abnormal nozzle is accurately replaced by the corresponding normal compensation nozzle. By generating a nozzle status visualization diagram and a compensation mapping diagram based on the compensation offset of each round in the nozzle compensation results and the compensation mapping relationship between the abnormal nozzle number and the corresponding normal nozzle number, operators can intuitively view the status of each nozzle and the compensation correspondence between each abnormal nozzle and the corresponding normal compensation nozzle. By exporting the printhead detection results and nozzle compensation results into a data file containing a nozzle status table and a compensation mapping table according to a preset format, the nozzle number, nozzle status, whether it has been compensated, the offset of each round of compensation, and the compensation mapping relationship between the abnormal nozzle number and the corresponding normal nozzle number are structurally saved for process debugging, quality re-inspection, production archiving, and subsequent control system calls.

[0012] Furthermore, within a preset maximum offset step range, candidate offsets are enumerated. For each candidate offset, each abnormal nozzle in the remaining abnormal nozzle set is traversed, and it is determined whether the nozzle corresponding to the abnormal nozzle after offset by the candidate offset belongs to the normal nozzle in the compensation nozzle set. If so, a candidate mapping relationship is established for the normal nozzle to compensate the abnormal nozzle, including: denoting the preset maximum offset step as... The candidate offset is denoted as Candidate offset The enumeration range is: For each enumerated candidate offset Iterate through each abnormal nozzle in the remaining set of abnormal nozzles, and record the nozzle number of the abnormal nozzle as... The abnormal nozzle is adjusted according to the candidate offset. The offset nozzle number is recorded as Determine the nozzle number Does the corresponding nozzle belong to the normal nozzle in the compensation nozzle set? If the nozzle number is... If the corresponding nozzle belongs to the normal nozzle in the compensation nozzle set, then a candidate mapping relationship is established for the normal nozzle to compensate for the abnormal nozzle. The candidate mapping relationship records the nozzle number of the abnormal nozzle. The nozzle number is the same as the normal nozzle number. The correspondence between them; if the nozzle number If the corresponding nozzle does not belong to the normal nozzle in the compensation nozzle set, then the abnormal nozzle is in the candidate offset. The following is not compensated; after traversal, the offset of each abnormal nozzle in the remaining abnormal nozzle set at the current candidate offset is obtained. Candidate mapping relationships.

[0013] The advantages of adopting the above-mentioned further scheme are: it can limit the offset search range and eliminate invalid zero offsets, thus improving search efficiency. For each enumerated candidate offset d, each abnormal nozzle in the remaining abnormal nozzle set is traversed. The nozzle number of the abnormal nozzle is recorded as i, and the nozzle number after the abnormal nozzle is offset by the candidate offset d is recorded as i+d. By determining whether i+d belongs to the normal nozzle in the compensation nozzle set, if it does, a candidate mapping relationship is established to compensate the abnormal nozzle by the normal nozzle, and the correspondence between i and i+d is recorded. If it does not belong, the abnormal nozzle is not compensated under the candidate offset d, so that the abnormal nozzle whose position after offset does not belong to the compensation nozzle set enters the uncovered state. After traversal, the candidate mapping relationship of each abnormal nozzle in the remaining abnormal nozzle set under the current candidate offset d is obtained, so that the compensation state of each abnormal nozzle under the current candidate offset can be accurately recorded, providing a complete candidate mapping relationship data foundation for subsequent scoring calculation.

[0014] Furthermore, for each candidate offset, a score is calculated based on a preset evaluation index, including: denoting the candidate offset as... Candidate offset The number of abnormal nozzles that can be covered in this round is recorded as follows: Candidate offsets will be used. The number of consecutive abnormal segments formed by abnormal nozzles that are still not covered after compensation is denoted as , will the The length of each consecutive abnormal segment is denoted as . And calculate the remaining continuous anomaly penalty. : Candidate offset The absolute value is denoted as ; Obtain the preset coverage weight Preset residual risk weights and preset offset distance weight ; Calculate candidate offsets Corresponding rating : Among them, the coverage quantity weight Residual risk weights and offset distance weight All are positive numbers.

[0015] The beneficial effects of adopting the above-mentioned further scheme are: it enables the three indicators of coverage quantity, remaining continuous anomaly risk and offset distance to achieve flexible balance through their respective weight coefficients, and can adjust the importance of each indicator according to the process requirements of inkjet equipment, so that the scoring results can guide the selection of the optimal candidate offset.

[0016] Further, acquiring nozzle detection data includes: acquiring nozzle detection images, which are obtained by an image acquisition device capturing the detection pattern sprayed by the nozzle; loading a nozzle template corresponding to the nozzle, which records the ROI detection box, center point coordinates, and nozzle number for each nozzle; calculating the image registration relationship between the nozzle detection image and the nozzle template based on the positioning identifier in the nozzle detection image, where the image registration relationship is either an affine transformation or a homography transformation; mapping each ROI detection box in the nozzle template to the nozzle detection image based on the image registration relationship to obtain the ROI detection area corresponding to each nozzle; for each nozzle, performing grayscale processing and threshold segmentation on the ROI detection area, counting the number of foreground pixels within the ROI detection area, and determining the nozzle state as an abnormal nozzle when the number of foreground pixels is less than a preset pixel threshold, and as a normal nozzle when the number of foreground pixels is greater than or equal to the preset pixel threshold; and generating nozzle detection data based on the nozzle state of each nozzle.

[0017] The beneficial effects of adopting the above-mentioned further scheme are as follows: By acquiring the nozzle detection image of the nozzle and loading the nozzle template corresponding to the nozzle, the template records the ROI detection box, center point coordinates, and nozzle number of each nozzle. The image registration relationship is calculated based on the positioning identifier in the nozzle detection image. The registration relationship is either an affine transformation relationship or a homography transformation relationship. This solves the problem of inaccurate ROI positioning when the nozzle detection image is translated, rotated, scaled, or has perspective changes relative to the nozzle template. It ensures that each ROI detection box in the template is accurately mapped to the current detection image, guaranteeing that each nozzle obtains a unique ROI detection area corresponding to its number. For each nozzle, the ROI detection area is processed by grayscale conversion and threshold segmentation, and the number of foreground pixels is counted. By comparing the number of foreground pixels with a preset pixel threshold, it is possible to objectively and quantitatively determine whether each nozzle is a normal or abnormal nozzle, avoiding the uncertainty caused by relying on human experience. Nozzle detection data of the nozzle is generated based on the nozzle status of each nozzle, so that the nozzle detection data includes the nozzle number and corresponding nozzle status information, providing an accurate nozzle-by-nozzle data foundation for subsequently constructing a nozzle status sequence.

[0018] Furthermore, the weighted state of the nozzle is calculated based on the length of each consecutive abnormal nozzle cluster, including: recording the number of consecutive abnormal nozzle clusters identified by the scanned nozzle state sequence as... , will the The length of a continuous cluster of anomalous nozzles is denoted as Obtain the preset continuous anomaly penalty coefficient. According to the first Length of a continuous abnormal nozzle cluster and continuous anomaly penalty coefficient Calculate the first Weighted anomalies of a continuous cluster of anomalous nozzles : The weighted anomalies of each consecutive abnormal nozzle cluster are summed to obtain the total weighted anomaly. : ; Get the total number of nozzles on the nozzle Based on the total weighted outlier and the total number of nozzles Calculate the weighted state of the nozzle. : ,in, The function represents the The calculation results are limited to the range of 0 to 1.

[0019] The beneficial effect of adopting the above-mentioned further solution is that the weighted state of the nozzle is standardized into a uniform metric in the range of 0 to 1, which facilitates subsequent comparison with the preset threshold to determine the risk level.

[0020] Furthermore, the nozzle status also includes intermittent spraying status. Based on the nozzle detection data, a nozzle status sequence is constructed according to the nozzle number, including: for each nozzle, the ROI detection region is input into a trained convolutional neural network model. The convolutional neural network model outputs the nozzle status category and corresponding confidence level. The nozzle status categories include normal state, intermittent spraying state, and failure state. Nozzles corresponding to the normal state are marked as normal nozzles, and nozzles corresponding to the failure state are marked as abnormal nozzles. A preset strategy determines whether to mark nozzles corresponding to the intermittent spraying state as abnormal nozzles. If the preset strategy is to mark nozzles corresponding to the intermittent spraying state as abnormal nozzles, then the nozzle is marked as an abnormal nozzle. If the preset strategy is to mark nozzles corresponding to the intermittent spraying state as nozzles to be processed, then the nozzle is marked as a nozzle to be processed. The marking results of each nozzle are constructed into a nozzle status sequence according to the nozzle number. The beneficial effects of adopting the above-mentioned further scheme are as follows: By inputting the ROI detection area of ​​each nozzle into a trained convolutional neural network model, the model automatically outputs three nozzle state categories—normal state, intermittent spraying state, and failure state—along with their corresponding confidence levels. This makes nozzle state recognition independent of fixed thresholds or human experience, and can adapt to changes in the color, transparency, lighting conditions, and morphological differences of different sprayed materials, thus improving the adaptability and stability of nozzle state detection. By marking nozzles corresponding to the normal state as normal nozzles and nozzles corresponding to the failure state as abnormal nozzles, and determining whether to mark nozzles corresponding to the intermittent spraying state as abnormal nozzles or nozzles to be processed according to a preset strategy, the processing method for intermittent spraying nozzles can be flexibly configured according to process requirements. Intermittent spraying nozzles can be included in the compensation range to ensure spraying quality, or they can be marked as nozzles to be processed for subsequent manual review by operators, improving the flexibility of nozzle state processing. The marking results of each nozzle are sorted according to the nozzle number and constructed into a nozzle state sequence, so that each nozzle state in the sequence corresponds one-to-one with the nozzle number, providing an accurate nozzle-by-nozzle state data basis for subsequent identification of continuous abnormal nozzle clusters and weighted state calculation of nozzles.

[0021] 2) In a second aspect, the present invention also provides a printhead detection and nozzle compensation system for an inkjet device, comprising an acquisition and determination module, a set determination module, a candidate mapping relationship establishment module, a compensation mapping relationship determination module, a judgment and update module, and an output module; the acquisition and determination module is used to: acquire and determine whether to perform nozzle compensation based on the nozzle detection data of the printhead, and obtain a judgment result; the set determination module is used to: when the judgment result is yes, determine the set of remaining abnormal nozzles and the set of compensated nozzles; the candidate mapping relationship establishment module is used to: enumerate candidate offsets within a preset maximum offset step range, and for each candidate offset, traverse each abnormal nozzle in the set of remaining abnormal nozzles, and determine whether the nozzle corresponding to the abnormal nozzle after offset by the candidate offset belongs to the normal nozzle in the set of compensated nozzles; if yes, then establish a candidate mapping relationship for the normal nozzle to compensate the abnormal nozzle; the compensation mapping relationship determination module is used to: compensate The mapping relationship determination module is used to: calculate the score corresponding to each candidate offset according to the preset evaluation index, select the candidate offset with the highest score as the compensation offset for this round, and determine and record the compensation mapping relationship between each abnormal nozzle and the normal compensation nozzle in this round according to the candidate mapping relationship corresponding to the compensation offset in this round; the judgment update module is used to: mark the abnormal nozzles that have been compensated in this round as compensated nozzles, update the set of remaining abnormal nozzles, and determine whether the stopping condition is met. If not, it returns to the step of enumerating candidate offsets within the preset maximum offset step range, and uses the updated set of remaining abnormal nozzles as the current set of remaining abnormal nozzles to continue to execute the next round of compensation search; the output module is used to: output the nozzle detection results and nozzle compensation results. The nozzle compensation results include at least the offsets of each round of compensation and the compensation mapping relationship between the abnormal nozzle number and the corresponding normal nozzle number.

[0022] 3) In a third aspect, the present invention also provides an electronic device, the electronic device including a processor coupled to a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor, so that the electronic device implements the printhead detection and nozzle compensation method of any of the above inkjet devices.

[0023] 4) In a fourth aspect, the present invention also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the printhead detection and nozzle compensation method of any of the above-mentioned inkjet devices.

[0024] It should be noted that the beneficial effects of the technical solutions of the second to fourth aspects of the present invention and their corresponding possible implementations can be found in the above description of the technical effects of the first aspect and its corresponding possible implementations, and will not be repeated here. Attached Figure Description

[0025] Figure 1 This is one of the flowcharts illustrating a printhead detection and nozzle compensation method for an inkjet device according to an embodiment of the present invention. Figure 2 This is a second schematic flowchart of a printhead detection and nozzle compensation method for an inkjet device according to an embodiment of the present invention. Figure 3 This is a schematic diagram of the registration of the nozzle template with the detection image and the ROI mapping. Figure 4 This is a schematic diagram of the nozzle status identification process; Figure 5 A schematic diagram illustrating the identification of nozzle state sequences and continuous abnormal nozzle clusters; Figure 6 A schematic diagram of the process for calculating the weighted state of the nozzle and determining its risk level; Figure 7 Flowchart for multi-round nozzle offset compensation search; Figure 8 This is a schematic diagram illustrating the compensation mapping relationship between abnormal nozzles and healthy compensation nozzles. Figure 9 This is a schematic diagram for visualizing the nozzle status and exporting the results.

[0026] Figure 10 This is one of the structural schematic diagrams of a printhead detection and nozzle compensation system for an inkjet device according to an embodiment of the present invention; Figure 11 This is a second schematic diagram of the structure of a printhead detection and nozzle compensation system for an inkjet device according to an embodiment of the present invention. Detailed Implementation

[0027] like Figure 1 As shown, an embodiment of the present invention provides a printhead detection and nozzle compensation method for an inkjet device, comprising the following steps: S1. Obtain and determine whether to perform nozzle compensation based on the nozzle orifice detection data, and obtain the judgment result, including: S10. Obtain nozzle orifice detection data, including: S100. Acquire the nozzle detection image. The nozzle detection image is obtained by an image acquisition device capturing the detection pattern ejected by the printhead. Specifically, the inkjet equipment controls the printhead to eject a preset detection pattern onto the detection medium. The detection pattern includes detection lines, ink dots, ejection areas, or ejection trajectories corresponding one-to-one with each nozzle of the printhead. The image acquisition device captures the detection pattern on the detection medium to obtain the nozzle detection image. The image acquisition device can be an industrial camera, a line scan camera, an area scan camera, or a microscopic imaging device.

[0028] S101. Load the nozzle template corresponding to the nozzle head. The nozzle template records the ROI detection frame, center point coordinates, and nozzle number for each nozzle. Specifically, read the nozzle template file corresponding to the nozzle head from the storage medium. The nozzle template records the ROI detection frame, center point coordinates, and nozzle number for each nozzle. The ROI detection frame is a rectangular image area pre-defined for each nozzle in the nozzle template, used to locate the spray mark corresponding to that nozzle in the detection image. The center point coordinates are the pixel position of the geometric center of the ROI detection frame in the template image. The nozzle number is a unique identifier obtained after arranging the nozzles of the nozzle head in a predetermined order. The nozzle template can also record the detection image identifier, image size, number of nozzles, number of nozzle columns, nozzle row and column arrangement, nozzle spacing, and template version information. The nozzle template file can be stored in JSON, XML, CSV, Excel, or database record format.

[0029] S102. Calculate the image registration relationship between the nozzle detection image and the nozzle template based on the positioning identifiers in the nozzle detection image. The image registration relationship is either an affine transformation relationship or a homography transformation relationship. Specifically: Identify the positioning identifiers from the nozzle detection image. Positioning identifiers are specific marks pre-set in the detection pattern or on the detection medium to assist in image positioning. They can be QR codes, positioning graphics, corner points, control points, or other artificially marked features with identifiable characteristics. Simultaneously, read the reference position of the positioning identifier in the template image from the nozzle template. Compare the actual position of the positioning identifier in the nozzle detection image with the reference position of the positioning identifier in the nozzle template to calculate the image registration relationship between the nozzle detection image and the nozzle template. The image registration relationship describes the geometric transformation parameters of the nozzle detection image relative to the nozzle template in space. When the nozzle detection image only undergoes translation, rotation, and uniform scaling relative to the nozzle template, the image registration relationship is an affine transformation relationship. An affine transformation relationship is a two-dimensional coordinate transformation that preserves straight lines and parallelism, including translation parameters, rotation parameters, scaling parameters, and shearing parameters, represented by a transformation matrix. When the nozzle detection image exhibits perspective distortion relative to the nozzle template, the image registration relationship is a homography transformation. Homography is a projection transformation that maps points on one two-dimensional plane to another, capable of describing more complex perspective distortions, and is represented by a 3×3 homography matrix. The affine transformation or homography transformation relationship can be automatically selected based on the number and distribution of the location identifiers.

[0030] S103. Based on the image registration relationship, map each ROI detection box in the nozzle template to the nozzle detection image to obtain the ROI detection region corresponding to each nozzle. Specifically: Obtain the calculated image registration relationship, which includes the spatial transformation parameters of the nozzle detection image relative to the nozzle template. For each ROI detection box recorded in the nozzle template, substitute the coordinates of the four vertices of the ROI detection box into the transformation matrix corresponding to the image registration relationship to perform coordinate transformation, obtaining the corresponding coordinates of the four vertices in the nozzle detection image. Take the rectangular area enclosed by these four corresponding coordinates in the nozzle detection image as the ROI detection region corresponding to that nozzle. Since the spatial transformation relationship between the nozzle template and the nozzle detection image has been determined through the image registration relationship, the position of the ROI detection region corresponding to each nozzle in the nozzle detection image corresponds one-to-one with the position of the ROI detection box of that nozzle in the nozzle template. After the above mapping process, number each nozzle and obtain the ROI detection region corresponding to that nozzle in the nozzle detection image.

[0031] S104. For each nozzle, perform grayscale processing and threshold segmentation on the ROI detection area, and count the number of foreground pixels within the ROI detection area. When the number of foreground pixels is less than a preset pixel threshold, the nozzle status is determined to be an abnormal nozzle; when the number of foreground pixels is greater than or equal to the preset pixel threshold, the nozzle status is determined to be a normal nozzle. Specifically: For each nozzle's corresponding ROI detection area, perform the following processing: Perform grayscale processing on the ROI detection area, converting the color image to a grayscale image. The conversion method can be a weighted average method, that is, calculating the grayscale value according to the different weights of the red, green, and blue components. Perform threshold segmentation on the grayscale-processed ROI detection area, dividing the pixels in the grayscale image into foreground and background categories according to their grayscale values. Threshold segmentation can use a fixed threshold method, an adaptive threshold method, the Otsu method, or a threshold method that is automatically updated based on the background grayscale. Determine the foreground area according to the preset pixel polarity, for example, using dark-colored spray marks as the foreground, or using bright-colored spray marks as the foreground. After threshold segmentation, the number of pixels classified as foreground within the ROI detection area is counted to obtain the foreground pixel count. This count is then compared to a preset pixel threshold. The preset pixel threshold is a pre-defined value used to determine whether the nozzle has sprayed sufficient material. When the number of foreground pixels within the ROI detection area is less than the preset pixel threshold, it indicates that the nozzle has not left sufficient foreground traces in the detection pattern, and the nozzle is classified as an abnormal nozzle. When the number of foreground pixels within the ROI detection area is greater than or equal to the preset pixel threshold, it indicates that the nozzle has left sufficient foreground traces in the detection pattern, and the nozzle is classified as a normal nozzle. Centroid offset constraints and connected component quantity constraints can be selectively superimposed to further improve detection accuracy. Centroid offset constraints calculate the lateral and longitudinal deviations between the centroid of the foreground pixels and the center point of the ROI detection area; when the deviation exceeds a preset offset threshold, it is classified as abnormal spraying. Connected component quantity constraints count the number of connected components formed by the foreground pixels; when the number of connected components does not meet a preset range, it is classified as abnormal spraying.

[0032] S105. Generate nozzle detection data for the nozzle head based on the nozzle status of each nozzle. Specifically, associate each nozzle number with the corresponding nozzle status to generate nozzle detection data for the nozzle head. The nozzle detection data includes at least the nozzle number and the nozzle status information corresponding to that nozzle number. The nozzle status information can include two states: normal nozzle and abnormal nozzle, and can further include more refined state categories such as weak spray, skewed spray, intermittent spray, and failure. The nozzle detection data can also include one or more of the following: nozzle position information, ROI detection box information, detection confidence, number of foreground pixels, centroid offset, number of connected components, droplet area, droplet morphology features, or spray trajectory features.

[0033] The nozzle template is a pre-built and stored data file that records the ROI detection box, center point coordinates, and nozzle number of each nozzle, serving as a reference for subsequent image registration and ROI mapping. The ROI detection box refers to a rectangular image region pre-defined for each nozzle in the nozzle template, used to locate the corresponding jet trace in the detection image. The nozzle number refers to a unique identifier obtained by arranging each nozzle in a predetermined order. The image registration relationship describes the geometric transformation parameters of the nozzle detection image relative to the nozzle template in space, used to map the coordinates in the nozzle template to the corresponding coordinates in the nozzle detection image. The nozzle detection data is a data set containing the nozzle number and the corresponding nozzle status information. It may also include one or more of the following: nozzle position, ROI detection box, detection confidence, number of foreground pixels, centroid offset, number of connected components, droplet area, droplet morphology features, or jet trajectory features.

[0034] S11. Based on the nozzle detection data, construct a nozzle state sequence sorted by nozzle number. Each nozzle state in the nozzle state sequence corresponds one-to-one with the nozzle number. The nozzle state includes normal nozzles and abnormal nozzles, and also includes intermittent spraying states. Constructing the nozzle state sequence based on the nozzle detection data and sorted by nozzle number includes: For each nozzle, inputting the ROI detection region into a trained convolutional neural network model. The convolutional neural network model outputs the nozzle state category and corresponding confidence level for that nozzle. The nozzle state categories include normal state and intermittent spraying. The system identifies and classifies nozzles into normal and fault states. Nozzles in normal states are marked as normal nozzles, while those in fault states are marked as faulty nozzles. A preset strategy determines whether to mark nozzles in intermittent spray states as faulty nozzles. If the preset strategy is to mark nozzles in intermittent spray states as faulty nozzles, then that nozzle is marked as faulty. If the preset strategy is to mark nozzles in intermittent spray states as nozzles to be processed, then that nozzle is marked as nozzles to be processed. The marking results of each nozzle are then sorted by nozzle number to construct a nozzle state sequence. The specific implementation process is as follows: S110. A large number of ROI detection region images of nozzles are pre-collected as training samples. Each training sample is labeled with a corresponding nozzle state category by manual methods or based on the number of foreground pixels. The nozzle state categories include normal state, intermittent spraying state, and failure state. The labeled samples are divided into training set, validation set, and test set. A convolutional neural network model is constructed. This model adopts a lightweight network structure, containing multiple convolutional layers, pooling layers, and fully connected layers. The model input layer accepts fixed-size ROI detection region images, and the output layer uses the Softmax function to generate a three-dimensional probability vector, corresponding to the probabilities of normal state, intermittent spraying state, and failure state, respectively. The convolutional neural network model is trained using the training set samples. The network parameters are continuously adjusted through backpropagation and gradient descent optimization methods, so that the cross-entropy loss function value between the model's output probability distribution and the true labels of the samples gradually decreases. During training, the generalization performance of the model is monitored using the validation set samples. Training is stopped when the validation set accuracy no longer improves. The trained convolutional neural network model is stored in [location missing] for use in the subsequent actual detection stage.

[0035] S111. For each nozzle, the ROI detection region obtained through image registration and coordinate transformation is used as input data and fed into a trained convolutional neural network model. The convolutional neural network model is a deep learning network structure that uses convolution operations for feature extraction and classification. During the training phase, a large number of ROI image samples labeled with nozzle state categories have been used for parameter optimization. The input layer of this convolutional neural network model accepts a fixed-size ROI detection region image, which undergoes successive transformations through multiple convolutional layers, pooling layers, and fully connected layers, ultimately producing a three-dimensional probability vector at the output layer.

[0036] S112. After processing the input ROI detection region image, the convolutional neural network model outputs the nozzle state category and its corresponding confidence score. The nozzle state categories include normal state, intermittent spraying state, and failure state. The three components of the three-dimensional probability vector correspond to the predicted probabilities of these three nozzle state categories, respectively. These three probability values ​​are used as the confidence score for the nozzle, representing the degree of certainty the convolutional neural network model has that the nozzle belongs to a certain state category. The state category corresponding to the highest confidence score among the three is selected as the output nozzle state category.

[0037] S113. Based on the nozzle state category output by the convolutional neural network model, perform a preliminary labeling operation on each nozzle. When the output result is a normal state, mark the nozzle as a normal nozzle. When the output result is a failure state, mark the nozzle as an abnormal nozzle. When the output result is an intermittent spraying state, do not perform final labeling, but proceed to the next step for further processing according to a preset strategy.

[0038] S114. Read the pre-set strategy parameters, which are configured and stored by the operator according to process requirements. The preset strategy specifies the handling method when the nozzle state category is intermittent spraying, and includes two optional methods. The first method is to mark the nozzles corresponding to the intermittent spraying state as abnormal nozzles. When this preset strategy is read, all nozzles with the intermittent spraying state category are marked as abnormal nozzles, allowing them to participate in the subsequent continuous abnormal nozzle cluster identification and nozzle weighted state calculation process. The second method is to mark the nozzles corresponding to the intermittent spraying state as nozzles to be processed. When this preset strategy is read, all nozzles with the intermittent spraying state category are marked as nozzles to be processed, preventing them from participating in the subsequent continuous abnormal nozzle cluster identification and nozzle weighted state calculation process. The operator then manually reviews and intervenes through subsequent visualization results and nozzle-by-nozzle state tables.

[0039] S115. Obtain the marking results of all nozzles after the above steps. The marking results include three types: normal nozzles, abnormal nozzles, or nozzles to be processed. Sort all nozzle marking results in ascending order of nozzle number. For nozzles marked as normal, determine their nozzle status as normal. For nozzles marked as abnormal, determine their nozzle status as abnormal. For nozzles marked as to be processed, determine their nozzle status as abnormal when constructing the nozzle status sequence, so that they participate in the subsequent continuous abnormal nozzle cluster identification and nozzle weighted status calculation process to ensure the conservatism of the evaluation results. Assign a one-to-one correspondence between each nozzle number and its corresponding nozzle status to form an ordered sequence of length equal to the total number of nozzles in the nozzle head. This sequence is the nozzle status sequence. Each position in the nozzle status sequence corresponds to a nozzle number, and the value at that position represents the nozzle status. The nozzle status includes at least two categories: normal and abnormal.

[0040] The nozzle state category is defined as follows: It represents the classification result type output by the convolutional neural network model, including three states: normal, intermittent spraying, and failure. A normal state indicates that the nozzle can spray stably and normally; an intermittent spraying state indicates that the spraying is intermittent or unstable; and a failure state indicates that the nozzle cannot spray at all or the spraying volume is extremely insufficient. Confidence score is the probability value generated by the output layer of the convolutional neural network model for each nozzle state category, ranging from 0 to 1. The sum of the confidence scores for the three categories equals 1; a higher confidence score indicates a higher degree of confidence in the classification result. Preset strategy refers to the processing rules pre-configured and stored by the operator according to process requirements. These rules specify the subsequent processing method when the nozzle state category is intermittent spraying, including two optional methods: marking the nozzle corresponding to the intermittent spraying state as an abnormal nozzle or marking it as a nozzle to be processed. Unprocessed Nozzles: Nozzles whose status category is intermittent spraying and are marked as unprocessed according to a preset strategy. These nozzles are not directly included as abnormal nozzles in subsequent continuous abnormal nozzle cluster identification and nozzle weighted status calculation, but can be included in the abnormal nozzle set by the operator in subsequent processing. Nozzle Status Sequence: An ordered sequence obtained by sequentially arranging the nozzle status corresponding to each nozzle number after sorting them in ascending order. The sequence length is the total number of nozzles in the nozzle head. Each element in the sequence uniquely corresponds to a nozzle number. The nozzle status includes at least two categories: normal nozzles and abnormal nozzles.

[0041] S12. Scan the nozzle state sequence, identify continuous abnormal nozzle clusters composed of adjacent abnormal nozzles, and calculate the weighted state of the nozzle based on the length of each continuous abnormal nozzle cluster. The process of scanning the nozzle state sequence and identifying continuous clusters of abnormal nozzles composed of adjacent abnormal nozzles is as follows: 1) Read the constructed nozzle state sequence. The nozzle state sequence is an ordered sequence obtained by sorting the nozzle numbers in ascending order and then sequentially arranging the nozzle states corresponding to each nozzle number. The sequence length is the total number of nozzles in the nozzle head. Each element in the sequence uniquely corresponds to a nozzle number, and the nozzle states include at least two categories: normal nozzles and abnormal nozzles. 2) Set the starting position of the sequence scan, pointing the current scan position to the first element of the nozzle state sequence, i.e., the nozzle state corresponding to the nozzle with the smallest nozzle number. Set a counter for consecutive abnormal nozzle clusters, initializing it to zero, to record the total number of identified consecutive abnormal nozzle clusters. Also set a temporary flag variable to record whether the current scan is within a consecutive abnormal nozzle cluster. 3) Starting from the first element of the nozzle state sequence, read the nozzle state corresponding to each element in the sequence sequentially in ascending order of nozzle numbers. For the currently read nozzle state, determine whether it belongs to a normal or abnormal nozzle. 4) When an element with an abnormal nozzle state is first encountered during the scan, and the preceding element is either nonexistent or its nozzle state is normal, a new continuous abnormal nozzle cluster is determined to begin from this point. The starting nozzle number of this continuous abnormal nozzle cluster is recorded; this starting nozzle number is the nozzle number corresponding to the current scan position. 5) After determining that a continuous abnormal nozzle cluster has begun, the scan continues in the direction of increasing nozzle numbers. The current continuous abnormal nozzle cluster is determined to end when one of the following two situations is encountered: First, an element with a normal nozzle state is scanned; in this case, the last abnormal nozzle before the normal nozzle is the end position of the current continuous abnormal nozzle cluster. Second, the last element of the nozzle state sequence is scanned, and this element is still an abnormal nozzle; in this case, the last element of the nozzle state sequence is the end position of the current continuous abnormal nozzle cluster. The ending nozzle number of this continuous abnormal nozzle cluster is recorded; this ending nozzle number is the nozzle number corresponding to the last abnormal nozzle in the continuous abnormal nozzle cluster. 6) Once the start and end positions of a continuous cluster of abnormal nozzles are determined, calculate the length of the cluster. The cluster length refers to the total number of abnormal nozzles in the cluster. The cluster length is calculated based on the start and end nozzle numbers, and is equal to the end nozzle number minus the start nozzle number plus one. Simultaneously, record the set of nozzles within the cluster. This set includes all nozzle numbers from the start to the end nozzle number, and all nozzles corresponding to these numbers are in abnormal states. 7) After identifying and recording a continuous cluster of abnormal nozzles, move the scan position to the element following the end position of the cluster and continue the above operations until the last element of the nozzle state sequence has been scanned.After the entire nozzle state sequence has been traversed, complete information on all consecutive abnormal nozzle clusters is obtained. 8) The information of all identified consecutive abnormal nozzle clusters is summarized and output. The information of each consecutive abnormal nozzle cluster includes the starting nozzle number, ending nozzle number, cluster length, and the set of nozzles within the cluster. A list of consecutive abnormal nozzle clusters can be generated based on this information for use in subsequent nozzle weighted state calculation steps.

[0042] A continuous abnormal nozzle cluster is a segment in the nozzle state sequence consisting of one or more adjacent abnormal nozzles. All nozzles in this segment are in an abnormal state, and the segment is continuous and uninterrupted in nozzle numbering. The preceding (if any) and following (if any) nozzles in a continuous abnormal nozzle cluster are both normal nozzles, or the cluster is located at the end of the nozzle state sequence. The starting nozzle number is the nozzle number corresponding to the first abnormal nozzle in a continuous abnormal nozzle cluster, i.e., the nozzle number corresponding to the starting position of the cluster in the nozzle state sequence. The ending nozzle number is the nozzle number corresponding to the last abnormal nozzle in a continuous abnormal nozzle cluster, i.e., the nozzle number corresponding to the ending position of the cluster in the nozzle state sequence. The cluster length is the total number of abnormal nozzles contained in a continuous abnormal nozzle cluster, equal to the ending nozzle number minus the starting nozzle number plus one. Cluster-based nozzle set: The set of all nozzle numbers in a continuous cluster of anomalous nozzles, including every nozzle number from the starting nozzle number to the ending nozzle number.

[0043] The calculation of the nozzle's weighted state based on the length of each consecutive abnormal nozzle cluster includes: recording the number of consecutive abnormal nozzle clusters identified in the scanned nozzle state sequence as... , will the The length of a continuous cluster of anomalous nozzles is denoted as Obtain the preset continuous anomaly penalty coefficient. According to the first Length of a continuous abnormal nozzle cluster and continuous anomaly penalty coefficient Calculate the first Weighted anomalies of a continuous cluster of anomalous nozzles : The weighted anomalies of each consecutive abnormal nozzle cluster are summed to obtain the total weighted anomaly. : ; Get the total number of nozzles on the nozzle Based on the total weighted outlier and the total number of nozzles Calculate the weighted state of the nozzle. : ,in, The function represents the The calculation result is limited to the range of 0 to 1. The specific implementation process is as follows: 1) Information on all consecutive abnormal nozzle clusters identified after reading the scanned nozzle state sequence. The information for each consecutive abnormal nozzle cluster includes the starting nozzle number, ending nozzle number, cluster length, and the set of nozzles within the cluster. The total number of identified consecutive abnormal nozzle clusters is denoted as... For the first For each consecutive abnormal nozzle cluster, obtain the cluster length and then... The length of a continuous cluster of anomalous nozzles is denoted as ,in The value range is 1 to Integers between, each Each value corresponds to a cluster of consecutive abnormal nozzles. The preset penalty coefficient for consecutive abnormalities is obtained. The continuous anomaly penalty coefficient is a pre-set numerical parameter greater than zero, used to control the degree of influence of the length of the continuous anomaly nozzle cluster on the weighted state of the nozzle.

[0044] 2) For the first A continuous cluster of anomalous nozzles, based on the length of the continuous cluster of anomalous nozzles. and continuous anomaly penalty coefficient Calculate the first according to the following formula Weighted anomalies of a continuous cluster of anomalous nozzles : , Indicates the first The weighted anomaly of a continuous cluster of anomalous nozzles. Indicates the first The length of a continuous cluster of anomalous nozzles The continuous anomaly penalty coefficient is a pre-defined, positive-zero numerical parameter used to control the contribution of the length of the continuous anomaly nozzle cluster to the weighted anomaly calculation. The larger this coefficient, the more significant the additional penalty contribution from the adjacency relationship between nozzles within the continuous anomaly nozzle cluster. In this formula... The part is a linear term, representing the basic contribution of the number of abnormal nozzles; Partially quadratic terms represent the additional penalty contribution from the adjacency relationship between nozzles in a continuous cluster of anomalous nozzles. This varies depending on the length of the continuous cluster of anomalous nozzles. The larger the value, the faster the quadratic term grows relative to the linear term, resulting in longer consecutive anomalous nozzle clusters receiving higher weighted anomaly values. The weighted anomaly value for each consecutive anomalous nozzle cluster is calculated sequentially according to the above formula, i.e., from the first consecutive anomalous nozzle cluster to the [missing value]. For each consecutive cluster of anomalous nozzles, obtain the weighted anomalous quantity corresponding to the cluster. .

[0045] 3) Sum the weighted anomalies of each consecutive abnormal nozzle cluster to obtain the total weighted anomaly. The total weighted outlier is calculated using the following formula: , This represents the total weighted outlier. This indicates the total number of consecutive abnormal nozzle clusters. Indicates the first Weighted anomalies of a continuous cluster of anomalous nozzles, summation sign Indicates will From 1 to All The values ​​are accumulated. Total weighted outliers It reflects the overall degree of abnormality after weighting the continuous abnormality penalties of all abnormal nozzles in the nozzle.

[0046] 4) Read the total number of nozzles on the nozzle. Total number of nozzles It is the total number of nozzles contained in the nozzle. This value is determined by the hardware structure of the nozzle, is recorded in the nozzle template, and can be read at any time.

[0047] 5) Based on the total weighted outlier and the total number of nozzles Calculate the weighted state of the nozzles according to the following formula. , , This indicates the weighted state of the nozzle. This represents the total weighted outlier. This indicates the total number of nozzles. `clamp` indicates the operation to restrict the calculation result within the parentheses to a range of 0 to 1. First, calculate... The value is 1 minus the total weighted outlier. Divide by the total number of nozzles The quotient. Then, the value is constrained using the `clamp` function: when... When the value is less than 0, The value is 0; when When the value is greater than 1, The value is 1; when When the value is in the range of 0 to 1, Values The nozzle's weighted state, based on the above calculations. Constrained within a closed interval between 0 and 1, The closer the value is to 1, the better the nozzle condition. The closer the value is to 0, the worse the nozzle condition. The calculated weighted state of the nozzle... The output is used for subsequent risk level assessment and nozzle compensation decision-making. The `clamp` function is a numerical constraint operation that limits the input value to a specified lower and upper limit. In this technical solution, the `clamp` function will... The calculation result is restricted to a closed interval between 0 and 1. When the calculation result is less than 0, the value is 0; when it is greater than 1, the value is 1; and when it is between 0 and 1, the value is the original value.

[0048] S13. Determine the risk level of the nozzle based on the weighted status, and determine whether orifice compensation should be performed based on the risk level to obtain the judgment result. The specific implementation process is as follows: S130, Read the calculated weighted state of the nozzle. Weighted state This is a numerical value ranging from 0 to 1, used to comprehensively evaluate the overall health status of the printhead. It also reads pre-set high and low thresholds. The high and low thresholds are two preset numerical parameters, where the high threshold is greater than the low threshold, and both are within the range of 0 to 1. The high and low thresholds are pre-configured and stored in the system by the operator based on the inkjet equipment's process requirements, printhead characteristics, and product quality standards.

[0049] S131, Weighting the nozzle status The risk level of the nozzle is determined by comparing its value with both the high and low thresholds. The risk level characterizes the potential impact of the nozzle's current abnormal state on spray quality. The risk level is determined according to the following rules: [The text then abruptly shifts to a different topic:] When the nozzle's weighted state... When the risk level is greater than or equal to the high threshold, the nozzle's risk level is determined to be minor. Minor risk indicates that the nozzle has a small number of abnormal nozzle holes, but these abnormal holes have a minimal impact on spray quality. (The text then abruptly shifts to a different topic: the weighted state of the nozzle.) When the risk level of the nozzle is below the high threshold but greater than or equal to the low threshold, the risk level is determined to be medium risk. Medium risk indicates that the nozzle has a certain number of abnormal nozzle holes, which may significantly affect the spray quality and require compensatory measures. (The text then abruptly shifts to a different topic: the weighted state of the nozzle.) If the risk level is below the low threshold, the nozzle is classified as a severe risk. A severe risk indicates that the nozzle has a large number of abnormal nozzles or a long cluster of consecutive abnormal nozzles. These abnormal nozzles may have a serious impact on the spray quality and require compensatory or other treatment measures.

[0050] S132. Based on the risk level determined in the previous step, determine whether to perform nozzle compensation according to the following rules: Specifically, when the risk level is minor, determine not to perform nozzle compensation, and the judgment result is "No". In this case, it is recommended to clean the nozzle or continue normal production without initiating the nozzle compensation process. When the risk level is medium, determine to perform nozzle compensation, and the judgment result is "Yes". In this case, initiate the nozzle compensation process and proceed to the subsequent steps of determining the remaining abnormal nozzle set and the compensation nozzle set. When the risk level is severe, determine to perform nozzle compensation, and the judgment result is "Yes". In this case, initiate the nozzle compensation process and proceed to the subsequent steps of determining the remaining abnormal nozzle set and the compensation nozzle set. For severe risk situations, a prompt message can also be output while initiating the compensation process, suggesting that operators clean or maintain the nozzle after compensation is completed.

[0051] S133. Output the judgment result obtained in the previous step. The judgment result includes a Boolean value indicating whether orifice compensation is needed and the corresponding risk level information. If the judgment result is yes, continue to execute the subsequent orifice compensation process. If the judgment result is no, skip the orifice compensation process and directly output the nozzle detection result. The high threshold is in the range of 0 to 1 and is used for weighting the nozzle status. Comparison. When When the value is greater than or equal to the high threshold, the nozzle is considered to have a minor risk. The low threshold, which is between 0 and 1 and less than the high threshold, is used to weight the nozzle's status. Comparison. When When the nozzle is below a low threshold, it is considered a serious risk. When the nozzle's risk level is below the high threshold but greater than or equal to the low threshold, it is classified as a medium risk. Risk level is a classification used to characterize the degree of impact that the nozzle's current abnormal condition may have on spray quality, including three levels: minor risk, medium risk, and severe risk. Minor risk indicates a small impact, medium risk indicates a significant impact, and severe risk indicates a serious impact.

[0052] S2. When the judgment result is yes, determine the set of remaining abnormal nozzles and the set of compensation nozzles, including: determining the set of remaining abnormal nozzles based on the nozzle state sequence, and selecting nozzles that can be used for compensation from the normal nozzles as the set of compensation nozzles. The specific implementation process is as follows: S20. Read the constructed nozzle state sequence. The nozzle state sequence is an ordered sequence obtained by sorting the nozzle numbers in ascending order and then sequentially arranging the nozzle states corresponding to each nozzle number. The sequence length is the total number of nozzles in the nozzle head, and each element in the sequence uniquely corresponds to a nozzle number. The nozzle states in the nozzle state sequence include two categories: normal nozzles and abnormal nozzles. Abnormal nozzles include the nozzles marked as abnormal nozzles according to the preset strategy in step S114.

[0053] S21. Traverse each nozzle state in the nozzle state sequence. For each nozzle whose state is abnormal, extract the nozzle number corresponding to that abnormal nozzle. Form a set of all abnormal nozzle numbers; this set is the initial set of remaining abnormal nozzles. Each element in the set of remaining abnormal nozzles is the nozzle number of an abnormal nozzle. The nozzles corresponding to these nozzle numbers will be the objects to be compensated in subsequent compensation searches. Since no compensation operation has been performed before the compensation process starts, the initial set of remaining abnormal nozzles contains the nozzle numbers of all abnormal nozzles in the nozzle state sequence. It should be noted that in subsequent rounds of compensation searches, after each round of compensation is completed, the compensated abnormal nozzles will be removed from the set of remaining abnormal nozzles, and the set of remaining abnormal nozzles will be dynamically updated accordingly.

[0054] S22. Traverse each nozzle state in the nozzle state sequence. For each nozzle in a normal state, extract its corresponding nozzle number. Select nozzles from these normal nozzles that can be used for compensation as the compensation nozzle set. Before any compensation operation is performed at the start of the compensation process, all nozzles in a normal state can be used as compensation nozzles. Assemble all the nozzle numbers of normal nozzles into a set; this set is the compensation nozzle set. Each element in the compensation nozzle set is the nozzle number of a normal nozzle. The nozzles corresponding to these numbers serve as compensation sources in subsequent compensation searches, replacing abnormal nozzles to perform spraying actions.

[0055] S23. Output the determined set of remaining abnormal nozzles and the determined set of compensated nozzles for use in subsequent steps of candidate offset enumeration and candidate mapping relationship establishment.

[0056] S3. Enumerate candidate offsets within a preset maximum offset step range. For each candidate offset, traverse each abnormal nozzle in the remaining abnormal nozzle set and determine whether the nozzle corresponding to the abnormal nozzle after offset by the candidate offset belongs to the normal nozzle in the compensation nozzle set. If so, establish a candidate mapping relationship for the normal nozzle to compensate the abnormal nozzle, including: S30, Record the preset maximum offset steps as... The candidate offset is denoted as Candidate offset The enumeration range is: For each enumerated candidate offset Iterate through each abnormal nozzle in the remaining set of abnormal nozzles, and record the nozzle number of the abnormal nozzle as... The abnormal nozzle is adjusted according to the candidate offset. The offset nozzle number is recorded as Specifically: Obtain the preset maximum offset steps, and record the preset maximum offset steps as... Let the candidate offset be denoted as Candidate offset The enumeration range is and Candidate offset Can be taken from arrive All integers within the range, excluding zero. Each integer value within the enumerated range is treated as a candidate offset for subsequent processing. For each enumerated candidate offset... Iterate through each abnormal nozzle in the remaining set of abnormal nozzles, and record the nozzle number of the currently visited abnormal nozzle as... The abnormal nozzle is selected based on the candidate offset. The offset nozzle number is recorded as Step S30 completes the enumeration and setting of candidate offsets and initiates the traversal of all abnormal nozzles in the remaining abnormal nozzle set, providing basic data for subsequent judgment and mapping establishment.

[0057] S31. Determine the nozzle number Whether the corresponding nozzle belongs to the normal nozzle in the compensated nozzle set, specifically: the offset nozzle number has been obtained in step S30. Based on this, step S31 performs a judgment operation. It checks if a match exists in the compensation nozzle set for the nozzle number. Matching elements determine the nozzle number. Whether the corresponding nozzle belongs to the normal nozzles in the compensation nozzle set. The compensation nozzle set is a set of nozzle numbers that are in the normal nozzle state. When the nozzle number... If it exists in the set of compensation nozzles, the judgment result is yes; if the nozzle number is... If the nozzle does not exist in the set of compensation nozzles, the result is negative. Step S31 is a purely conditional judgment step, which does not perform any mapping relationship establishment or recording operations, but only outputs the judgment result for use by step S32.

[0058] S32, if the nozzle number If the corresponding nozzle belongs to the normal nozzle in the compensation nozzle set, then a candidate mapping relationship is established for the normal nozzle to compensate for the abnormal nozzle. The candidate mapping relationship records the nozzle number of the abnormal nozzle. The nozzle number is the same as the normal nozzle number. The correspondence between them; if the nozzle number If the corresponding nozzle does not belong to the normal nozzle in the compensation nozzle set, then the abnormal nozzle is in the candidate offset. The following will not be compensated; specifically: when the judgment result of step S31 is yes, that is, the nozzle number... When the corresponding nozzle belongs to the normal nozzle in the compensation nozzle set, a candidate mapping relationship is established for the normal nozzle to compensate for the abnormal nozzle. The candidate mapping relationship records the nozzle number of the abnormal nozzle. The nozzle number is the same as the normal nozzle number. The correspondence between them. When the judgment result of step S31 is negative, that is, the nozzle number... When the corresponding nozzle does not belong to the normal nozzle in the compensation nozzle set, the abnormal nozzle is determined to be in the candidate offset. If the abnormal nozzle is not compensated, a candidate mapping relationship cannot be established under the current candidate offset. Step S32 is the actual step of establishing the candidate mapping relationship, which converts the judgment result of step S31 into a specific mapping relationship record or an uncompensated mark.

[0059] S33. After the traversal is completed, obtain the offset of each abnormal nozzle in the current candidate in the set of remaining abnormal nozzles. The candidate mapping relationship is as follows: After processing the current abnormal nozzle in step S32, step S33 continues to traverse the next abnormal nozzle in the remaining abnormal nozzle set, repeating the traversal operation initiated in step S30 and the processing in steps S31 and S32, until every abnormal nozzle in the remaining abnormal nozzle set has been traversed. When all abnormal nozzles in the remaining abnormal nozzle set have been processed, step S33 summarizes the results at the current candidate offset. The established candidate mapping relationships are used to obtain the offset of each abnormal nozzle in the remaining abnormal nozzle set at the current candidate offset. The candidate mapping relationships are as follows. These candidate mapping relationships constitute the current candidate offset. The corresponding set of candidate mapping relationships is used in subsequent scoring calculation steps. Step S33 indicates the current candidate offset. The completion of all abnormal nozzle processing tasks and the generation of a candidate mapping relationship set.

[0060] Among them, the preset maximum offset step number is used This indicates that `offset` is a pre-defined positive integer used to limit the maximum absolute value of the candidate offset. The enumeration range of the candidate offset is from... arrive All integers between 0 and 1, excluding zero. Candidate offsets are... This indicates that it is within the preset maximum offset step number. A non-zero integer value, enumerated under constraints, is used to offset the nozzle number of the abnormal nozzle in order to find a normal nozzle that can be used to compensate for the abnormal nozzle. The candidate offset can be positive or negative; a positive offset indicates an offset in the direction of increasing nozzle number, and a negative offset indicates an offset in the direction of decreasing nozzle number. This represents the nozzle number of the currently encountered abnormal nozzle, a unique identifier obtained by arranging all the nozzles of the nozzle head in a predetermined order. Nozzle Number Add candidate offset The offset nozzle number was then obtained. The offset nozzle numbering is... This indicates that the nozzles with abnormal nozzles are numbered. With candidate offset The resulting nozzle number is obtained after addition. The nozzle corresponding to this number is located at the candidate offset. The following are considered as potential compensation nozzles for the abnormal nozzle. At a certain candidate offset, when the nozzle corresponding to the abnormal nozzle after offset by that candidate offset belongs to a normal nozzle in the compensation nozzle set, a correspondence is established whereby the normal nozzle compensates for the abnormal nozzle. The candidate mapping relationship records the correspondence between the nozzle number of the abnormal nozzle and the nozzle number of the normal nozzle.

[0061] S4. For each candidate offset, calculate the score corresponding to the candidate offset according to the preset evaluation index, select the candidate offset with the highest score as the compensation offset for this round, and determine and record the compensation mapping relationship between each abnormal nozzle and the normal compensation nozzle for this round based on the candidate mapping relationship corresponding to the compensation offset for this round; wherein, for each candidate offset, the score corresponding to the candidate offset is calculated according to the preset evaluation index, including: S40. Record the candidate offset as... Candidate offset The number of abnormal nozzles that can be covered in this round is recorded as follows: Candidate offsets will be used. The number of consecutive abnormal segments formed by abnormal nozzles that are still not covered after compensation is denoted as , will the The length of each consecutive abnormal segment is denoted as . And calculate the remaining continuous anomaly penalty. : Candidate offset The absolute value is denoted as ; Obtain the preset coverage weight Preset residual risk weights and preset offset distance weight ; Calculate candidate offsets Corresponding rating : Among them, the coverage quantity weight Residual risk weights and offset distance weight All are positive numbers. Specifically: S400, For the currently enumerated candidate offsets Obtain the offset obtained in step S33 from the candidate offset. The corresponding set of candidate mapping relationships. This set of candidate mapping relationships records the mappings at the current candidate offset. Next, determine which abnormal nozzles in the remaining abnormal nozzle set can be compensated by the normal nozzles in the compensated nozzle set, and the correspondence between each pair of abnormal nozzle numbers and normal nozzle numbers. Count the total number of candidate mapping relationships in the candidate mapping relationship set, and denote this number as... . Indicates candidate offset The number of abnormal nozzles that can be covered in this round.

[0062] S401, Obtain the candidate offset The set of anomalous nozzles that are still not covered after compensation. Uncovered anomalous nozzles refer to those at the candidate offset. The following are anomalous nozzles for which no candidate mapping relationship could be established, i.e., anomalous nozzles for which no corresponding normal nozzle can be used for compensation after offset. These uncovered anomalous nozzles are arranged in ascending order of nozzle number, and consecutive anomalous segments consisting of adjacent uncovered anomalous nozzles are identified. The number of consecutive anomalous segments is denoted as . , will the The length of each consecutive abnormal segment is denoted as . ,in The value range is 1 to Integers between, each Each value corresponds to a consecutive anomaly segment. The length of this consecutive anomaly segment... It is the total number of uncovered abnormal nozzles contained in this continuous abnormal segment.

[0063] S402. Based on the determined number of consecutive abnormal segments and the length of each consecutive abnormal segment Calculate the remaining continuous anomaly penalty according to the following formula. : In the above formula, Indicates the use of candidate offsets The penalty for the remaining continuous anomalies in the continuous anomaly segments formed by the abnormal nozzles that are still not covered after compensation. Indicates the number of consecutive outlier segments. Indicates the first The length of a consecutive abnormal segment Indicates the first The summation sign is the square of the length of each consecutive outlier segment. Indicates will From 1 to All The values ​​are accumulated. Remaining consecutive exception penalties. The larger the value, the more likely it is to use a candidate offset. The higher the risk of subsequent continuous anomalies.

[0064] S403, Calculate candidate offsets The absolute value of the candidate offset The absolute value is denoted as . This represents the offset distance of the candidate offset in the direction of the nozzle number, and its value is equal to the candidate offset. The non-negative integer value after removing the sign. Retrieve the preset coverage weight. Preset residual risk weights and preset offset distance weight Coverage Quantity Weight Residual risk weights and offset distance weight All are positive numbers, configured and stored in the system in advance by the operator according to the process requirements, and used to adjust the importance of the three indicators in the scoring formula.

[0065] S404, Based on the obtained coverage quantity The remaining continuous anomaly penalty obtained The obtained offset distance Coverage Quantity Weight Residual risk weights and offset distance weight Calculate the candidate offset according to the following formula Corresponding rating : In the above formula, Indicates candidate offset The corresponding rating Indicates the coverage quantity weight. Indicates candidate offset The number of abnormal nozzles that can be covered in this round, Represents the residual risk weight. Indicates the use of candidate offsets The penalty for the remaining continuous anomalies in the continuous anomaly segments formed by the abnormal nozzles that are still not covered after compensation. Indicates the offset distance weight. Indicates candidate offset The absolute value. In this scoring formula, the coverage quantity... Positive contributions to the score, with higher scores achieved through coverage of more anomalies; remaining consecutive anomalies are penalized. The greater the remaining continuous anomaly penalty, the lower the score; offset distance. It has a negative contribution to the score; the greater the offset distance, the lower the score.

[0066] S405, calculate the score as candidate offset The evaluation results are output for use in subsequent steps to select the compensation offset for this round. The above operation is performed on each candidate offset to obtain a score for each candidate offset.

[0067] Among them, the number of coverages is used Indicates the candidate offset. The number of anomalous nozzles that can be covered in this round, i.e., the total number of anomalous nozzles for which a candidate mapping relationship has been successfully established under the current candidate offset. Among the anomalous nozzles that are still not covered after compensation using the candidate offset, a continuous segment consists of one or more adjacent uncovered anomalous nozzles. All nozzles in this segment are uncovered anomalous nozzles, and these uncovered anomalous nozzles are consecutive and uninterrupted in nozzle numbering. The length of the continuous anomalous segment is... It means that the first The total number of uncovered abnormal nozzles contained in a consecutive abnormal segment. Remaining consecutive abnormality penalty... This indicates that candidate offsets are used. The sum of the squared lengths of the continuous anomalous segments formed by the remaining uncovered anomalous nozzles after compensation is used to quantify the continuous distribution risk of the remaining anomalous nozzles after applying the candidate offset. A larger value for the remaining continuous anomalous penalty indicates a higher degree of continuity of the remaining uncovered anomalous nozzles, and thus a greater risk. The coverage quantity weight is used... This indicates that it is a preset positive weighting coefficient used to adjust the coverage amount. The weight of this weight in the scoring formula indicates its importance. A higher weight indicates a more significant positive impact of coverage on the score. The residual risk weight is... This indicates that it is a preset positive weighting coefficient used to adjust the penalty for the remaining consecutive anomalies. The weight of this weight in the scoring formula determines its importance. A larger weight indicates a more significant negative impact of the remaining continuous anomaly penalty on the score. The offset distance weight is used... This indicates that it is a preset positive weighting coefficient used to adjust the offset distance. The weight of the offset distance in the scoring formula determines its importance. A larger weight indicates a more significant negative impact of the offset distance on the score. The scoring is used... This indicates that for each candidate offset The calculated comprehensive evaluation value takes into account the number of anomalous nozzles that the candidate offset can cover, the continuous anomalous risk of the remaining uncovered anomalous nozzles after applying the offset, and the offset distance itself. A higher score indicates a better candidate offset in the evaluation scale.

[0068] S5. Mark the compensated abnormal nozzles in this round as compensated nozzles, update the set of remaining abnormal nozzles, and determine whether the stopping condition is met. If not, return to the step of enumerating candidate offsets within the preset maximum offset step range, and use the updated set of remaining abnormal nozzles as the current set of remaining abnormal nozzles to continue the next round of compensation search. The specific implementation process is as follows: S50. Obtain the candidate offset with the highest score calculated in steps S40 and S41, and use this candidate offset as the compensation offset for this round. At the same time, obtain the candidate mapping relationship set corresponding to the compensation offset for this round. The candidate mapping relationship set records which abnormal nozzles can be compensated by normal nozzles in the compensation nozzle set under the compensation offset for this round, and the correspondence between each pair of abnormal nozzle numbers and normal nozzle numbers.

[0069] S51. Based on the obtained candidate mapping relationship set, mark all abnormal nozzles corresponding to the abnormal nozzle numbers in the candidate mapping relationship set as compensated nozzles. A compensated nozzle indicates that the abnormal nozzle has already established a compensation mapping relationship with its corresponding normal nozzle in this round of compensation, and will not participate in compensation processing as an abnormal nozzle in subsequent compensation searches. Record the nozzle number of each compensated nozzle and the nozzle number of the corresponding normal compensated nozzle to form the compensation mapping record for this round.

[0070] S52. Remove the nozzle numbers of all abnormal nozzles marked as compensated nozzles from the current set of remaining abnormal nozzles. Combine all the remaining nozzle numbers after removal to form an updated set of remaining abnormal nozzles. Each element in the updated set of remaining abnormal nozzles is still the nozzle number of an abnormal nozzle that has not been compensated by any normal nozzles before the current round and needs to be processed in the compensation search of subsequent rounds.

[0071] S53. Based on the current compensation progress and the updated set of remaining abnormal nozzles, check the following stopping conditions in sequence: The first stopping condition is that the set of remaining abnormal nozzles is empty, meaning all abnormal nozzles have been compensated. The second stopping condition is that the number of compensation rounds reaches the preset maximum number of compensation rounds. The preset maximum number of compensation rounds is a pre-set positive integer used to limit the maximum number of iterations for compensation search. The third stopping condition is that the weighted state of the compensated nozzles reaches the preset target state; recalculate the weighted state of the nozzles based on the updated set of remaining abnormal nozzles. S When the weighted state is recalculated S The stopping condition is met when the value is greater than or equal to a preset target state threshold. The fourth stopping condition is that there are no valid candidate offsets, meaning that after enumerating all candidate offsets within the preset maximum offset step range, no candidate offset that can cover at least one abnormal nozzle is found. All the above stopping conditions are checked in sequence. If any one of the stopping conditions is met, the stopping condition is determined to be satisfied; if all stopping conditions are not met, the stopping condition is determined to be unsatisfactory.

[0072] S54. When the stopping condition is met, exit the compensation search loop and do not execute subsequent compensation rounds. Proceed to step S6 to output the nozzle detection result and nozzle compensation result. When the stopping condition is not met, return to step S30, use the updated set of remaining abnormal nozzles as the current set of remaining abnormal nozzles, and continue to execute the next round of compensation search. When returning to step S30, the compensation round number is incremented by one, and the entire process of candidate offset enumeration, candidate mapping relationship establishment, score calculation, and current round compensation offset selection is re-executed using the updated set of remaining abnormal nozzles.

[0073] S56. Before determining that the stopping condition is not met and returning to step S30 to execute the next round of compensation search, record the number of rounds of compensation, the compensation offset of this round, the number of abnormal nozzles compensated in this round, and the compensation mapping relationship between each abnormal nozzle and the normal compensated nozzle in this round. This information will be used in subsequent step S6 when outputting the nozzle detection results and nozzle compensation results. Then, return to step S30, use the updated set of remaining abnormal nozzles as the current set of remaining abnormal nozzles, and start a new round of compensation search.

[0074] S6. Output nozzle detection results and nozzle compensation results. The nozzle compensation results should include at least the offset of each round of compensation and the compensation mapping relationship between abnormal nozzle numbers and corresponding normal nozzle numbers. The specific implementation process is as follows: S60. Extract all the information to be output from the various types of data recorded throughout the compensation search process. The nozzle detection results include the nozzle state sequence, the nozzle state of each nozzle in the nozzle state sequence, the initial set of remaining abnormal nozzles, the weighted state of the nozzles before compensation, and information on continuous abnormal nozzle clusters. The continuous abnormal nozzle cluster information includes the starting nozzle number, ending nozzle number, cluster length, and the set of nozzles within each continuous abnormal nozzle cluster. The nozzle compensation results include the number of compensation rounds, the offset of each compensation round, the offset direction of each compensation round, the compensation mapping relationship between the abnormal nozzle numbers and the corresponding normal nozzle numbers in each compensation round, the number of remaining abnormal nozzles after each compensation round, the total compensation coverage, the number of remaining abnormal nozzles after compensation, and the weighted state of the nozzles after compensation. The total compensation coverage refers to the proportion of the total number of compensated abnormal nozzles in all rounds to the initial total number of abnormal nozzles.

[0075] S61. Generate a per-orifice status record for each orifice, following ascending order of orifice numbers. Each per-orifice status record includes the orifice number, the orifice status, and a flag indicating whether the orifice has been compensated. The orifice status is obtained from the orifice status sequence, including normal and abnormal orifices. The flag indicating whether the orifice has been compensated is determined based on whether a compensation mapping relationship has been established for the orifice in any round of compensation; if the orifice has been compensated, it is marked as yes, otherwise it is marked as no. Summarize all the per-orifice status records to generate a per-orifice status table.

[0076] S62. Generate a compensation mapping record for each compensation mapping relationship established in each compensation round, following the order of compensation rounds from smallest to largest. Each compensation mapping record includes the compensation round in which the compensation mapping relationship exists, the offset of that round of compensation, the offset direction of that round of compensation, the abnormal nozzle number, and the normal compensation nozzle number corresponding to that abnormal nozzle. The offset direction is determined by the sign of the offset; when the offset is positive, the offset direction is towards increasing nozzle numbers, and when the offset is negative, the offset direction is towards decreasing nozzle numbers. Summarize all compensation mapping records to generate a compensation mapping table.

[0077] S63. Generate a compensation round statistical record for each compensation round in ascending order of compensation round number. Each compensation round statistical record includes the number of compensation rounds, the offset of compensation round, the number of abnormal nozzles compensated in the round, the number of remaining abnormal nozzles after compensation round, the remaining continuous abnormal penalty after compensation round, and the weighted state of the nozzles after compensation round. The number of abnormal nozzles compensated in the round is obtained from the candidate mapping relationship set for that round. The number of remaining abnormal nozzles after compensation round is obtained from the updated set of remaining abnormal nozzles. The remaining continuous abnormal penalty after compensation round is calculated based on the sum of the squares of the lengths of the continuous abnormal segments formed by uncovered abnormal nozzles in the updated set of remaining abnormal nozzles. The weighted state of the nozzles after compensation round is recalculated based on the updated set of remaining abnormal nozzles. Summarize all compensation round statistical records to generate a compensation round statistical table.

[0078] S64. Summarize the key indicators of nozzle detection and orifice compensation to generate a nozzle evaluation summary. The nozzle evaluation summary includes detection time, nozzle number, detection mode, total number of orifices, number of normal orifices, number of abnormal orifices, number of consecutive abnormal orifice clusters, maximum length of consecutive abnormal orifice clusters, number of compensation rounds, total compensation coverage, weighted state of the nozzles before compensation, weighted state of the nozzles after compensation, number of remaining abnormal orifices, and risk level. The risk level is determined based on the comparison between the weighted state of the nozzles before compensation and the high and low thresholds.

[0079] S65. Generate a nozzle status visualization map based on the total number of nozzles. Each graphic unit in the nozzle status visualization map corresponds to one nozzle and is uniquely associated with a nozzle number. Different colors or markers are used to distinguish different types of nozzles based on their nozzle status and whether they have been compensated. Normal nozzles are represented in green. Uncompensated abnormal nozzles are represented in red. Compensated abnormal nozzles are represented by a bordered green marker or other distinguishing markers. A compensation mapping map is also generated, which displays the compensation correspondence between each abnormal nozzle and its corresponding normally compensated nozzle. Abnormal nozzle numbers are linked to their corresponding normally compensated nozzle numbers using connecting lines or arrows.

[0080] S66. Export the generated per-orifice status table, the generated compensation mapping table, the generated compensation round statistics table, and the generated nozzle evaluation summary as data files according to a preset format. The data file format can be Excel, CSV, JSON, or database record format. Taking Excel format as an example, generate an Excel file containing multiple worksheets, corresponding to the nozzle evaluation summary, per-orifice status table, compensation mapping table, and compensation round statistics table, respectively.

[0081] S67. Output all the above-mentioned summary data, tables, visualizations, and structured data files as nozzle detection results and orifice compensation results. The orifice compensation results should include at least the offset of each round of compensation and the compensation mapping relationship between abnormal orifice numbers and their corresponding normal orifice numbers. The output data is available for process debugging, quality re-inspection, production archiving, or subsequent control system calls.

[0082] The nozzle detection results include: all data output after nozzle status detection, including the nozzle status sequence, the nozzle status of each nozzle, the initial set of remaining abnormal nozzles, the weighted state of the nozzles before compensation, and information on continuous abnormal nozzle clusters. The nozzle compensation results include: all data output after nozzle compensation search, including the number of compensation rounds, the offset of each round, the offset direction of each round, the compensation mapping relationship between abnormal nozzle numbers and corresponding normal nozzle numbers in each round, the number of remaining abnormal nozzles after each round of compensation, the total compensation coverage, the remaining abnormal nozzle numbers after compensation, and the weighted state of the nozzles after compensation. The total compensation coverage is the ratio of the total number of compensated abnormal nozzles in all rounds to the initial total number of abnormal nozzles, used to measure the coverage of the compensation strategy for all abnormal nozzles.

[0083] The table includes the following components: **Orifice Status Table:** This table, sorted by orifice number, records the orifice number, status, and compensation status of each orifice, providing a detailed overview of the detection and compensation status of each orifice. **Compensation Mapping Table:** This table records all compensation mapping relationships in each compensation round. Each record includes the compensation round number, offset, offset direction, abnormal orifice number, and the corresponding normal compensated orifice number, allowing you to trace which normal orifice compensated each abnormal orifice. **Compensation Round Statistics Table:** This table records key statistics for each compensation round. Each round includes the round number, offset, number of abnormal orifices compensated in that round, number of remaining abnormal orifices after compensation, remaining continuous abnormal penalty after compensation, and the weighted status of the nozzles after compensation, displaying the changing trends of various indicators during the compensation process. Sprinkler Evaluation Summary: This section summarizes key data from sprinkler inspection and orifice compensation, including the total number of orifices, the number of normal orifices, the number of abnormal orifices, the number of consecutive abnormal orifice clusters, the maximum length of consecutive abnormal orifice clusters, the number of compensation rounds, the total compensation coverage, the weighted state of the sprinkler before compensation, the weighted state of the sprinkler after compensation, the number of remaining abnormal orifices, and the risk level. This provides a quick overview of the overall sprinkler status. Orifice Status Visualization: This section graphically displays the status and compensation status of each orifice. Each orifice corresponds to a graphical unit, using different colors or markers to distinguish between normal, uncompensated, and compensated abnormal orifices. Compensation Map: This section graphically displays the compensation correspondence between abnormal orifices and their corresponding normal compensated orifices, using connecting lines or arrows to link and label the abnormal orifice numbers with their corresponding normal compensated orifice numbers.

[0084] Optionally, in the above technical solution, after outputting the nozzle detection results and nozzle compensation results, the following is also included: S70. Write the compensation mapping relationship into the inkjet control data of the inkjet device. Specifically: Obtain the nozzle compensation result output in step S6. The nozzle compensation result includes at least the offset of each round of compensation and the compensation mapping relationship between the abnormal nozzle number and the corresponding normal nozzle number. Each record in the compensation mapping relationship includes the compensation round, the offset of that round, the abnormal nozzle number, and the corresponding normal compensated nozzle number. Read the inkjet control data of the inkjet device. The inkjet control data is a data structure in which each data item corresponds to a nozzle number. Each data item includes at least the enable status flag bit of the nozzle and the jet waveform parameters. Parse and process each pair of abnormal nozzle numbers and corresponding normal nozzle numbers in the compensation mapping relationship. For the nozzle corresponding to the abnormal nozzle number, find the data item corresponding to the nozzle number in the inkjet control data, and set the enable status flag bit in the data item to the disabled state. The disabled state indicates that the abnormal nozzle will not be triggered for jetting in subsequent jetting operations. For each nozzle with a normal compensation nozzle number, the corresponding data item is located in the ejection control data. A compensation identifier and compensation source information are written into this data item. Simultaneously, the ejection waveform parameters corresponding to the normal compensation nozzle at the moment the abnormal nozzle should be ejecting are superimposed or merged with the normal nozzle's own ejection waveform parameters. This allows the normal compensation nozzle to perform its own ejection task as well as the ejection task of the abnormal nozzle. All the updated ejection control data is then packaged according to the format required by the inkjet equipment control interface and written to the inkjet equipment's control memory via the data transmission bus or communication interface for subsequent ejection operations.

[0085] S71. The printhead is controlled to perform ejection operations according to the ejection control data. Specifically, for abnormal nozzles with established compensation mapping relationships, the ejection action of the abnormal nozzle is stopped, and the corresponding normal compensation nozzle performs the ejection action according to the compensation mapping relationship. Specifically, the ejection control data is read from the control memory, converted into printhead drive signals according to the ejection timing requirements of the inkjet equipment, and sent to the nozzle drive circuits of each nozzle in the printhead, controlling the printhead to perform the ejection operation according to the ejection control data. During the ejection operation, each nozzle number is traversed sequentially according to the predetermined ejection timing. For abnormal nozzles with established compensation mapping relationships, when the abnormal nozzle number is encountered, the printhead drive circuit does not apply a drive pulse to the abnormal nozzle, the abnormal nozzle remains closed, and the ejection action of the abnormal nozzle is stopped. Simultaneously, within the time window when the abnormal nozzle should be ejecting, the corresponding normal compensation nozzle performs the ejection action according to the compensation mapping relationship; that is, the normal compensation nozzle receives the drive pulse and ejects droplets within this time window. In addition to spraying droplets within its own corresponding time window, the normal compensation nozzle also sprays additional droplets within the time window that the abnormal nozzle should have sprayed. In this way, the droplets from the normal compensation nozzle replace the droplets missing from the abnormal nozzle, so that the droplet distribution sprayed onto the carrier medium is consistent with that when all nozzles are working normally.

[0086] S72. Based on the offset of each round of compensation in the nozzle compensation result and the compensation mapping relationship between the abnormal nozzle number and the corresponding normal nozzle number, generate a nozzle status visualization diagram and a compensation mapping diagram. In the nozzle status visualization diagram, each nozzle is distinguished by different colors or marks to distinguish normal nozzles, abnormal nozzles and compensated nozzles. The compensation mapping diagram is used to display the compensation correspondence between each abnormal nozzle and the corresponding normal compensated nozzle. The process involves generating a nozzle status visualization and a compensation mapping map based on the offset of each round of compensation in the nozzle compensation results and the compensation mapping relationship between abnormal nozzle numbers and their corresponding normal nozzle numbers. The generation process for the nozzle status visualization is as follows: Obtain the total number of nozzles on the nozzle head. Create a rectangular canvas and divide it into a grid of graphic units equal to the total number of nozzles, with each graphic unit's position corresponding to a nozzle number. Iterate through each nozzle number, determining the fill color or marker style of the graphic unit based on the nozzle status and compensation status corresponding to that number. For nozzles in a normal state and not involved in any compensation mapping relationship, fill the graphic unit with green. For nozzles in an abnormal state and not yet compensated, fill the graphic unit with red. For nozzles in an abnormal state and already compensated, fill the graphic unit with green and draw a border around the graphic unit, or overlay special marker symbols inside the graphic unit. For normal nozzles used as compensation nozzles, fill the graphic unit with blue or add marker symbols inside the graphic unit. Label the corresponding nozzle number next to the graphic unit to form a complete visualization of the nozzle status.

[0087] The generation process of the compensation mapping diagram is as follows: Create a coordinate system with nozzle numbers as the scale on both the horizontal and vertical axes. Mark all nozzle numbers in the coordinate system. For each compensated abnormal nozzle, draw a red marker at its corresponding nozzle number position and a blue marker at the corresponding normal compensated nozzle number position. Draw an arrowed line connecting the red and blue markers, with the arrow pointing from the abnormal nozzle to the normal compensated nozzle, indicating the direction of compensation. Label the compensation round and corresponding offset value next to the connecting line. For abnormal nozzles with multiple compensation rounds, only the final effective compensation mapping relationship is drawn. After drawing all compensation mapping relationships, a complete compensation mapping diagram is generated.

[0088] S73. Export the nozzle detection results and orifice compensation results into a data file according to a preset format. The data file includes an orifice status table and a compensation mapping table. The orifice status table records the orifice number, orifice status, and whether each orifice has been compensated. The compensation mapping table records the offset of each round of compensation and the compensation mapping relationship between abnormal orifice numbers and their corresponding normal orifice numbers. The preset format can be pre-configured by the operator and includes Excel, CSV, JSON, or database record formats. Generate a data file according to the preset format's organizational structure. The data file must include at least two tables: the orifice status table and the compensation mapping table.

[0089] The generation process of the per-orifice status table is as follows: Create table rows in ascending order of orifice numbers, with each row corresponding to one orifice. Each row contains three columns: the first column records the orifice number; the second column records the orifice status, obtained from the orifice status sequence, including normal or abnormal orifices; the third column records whether the orifice has been compensated, determined by whether the orifice number appears in any round of compensation mapping. If it appears in the compensation mapping, it is marked as yes; otherwise, it is marked as no. Arrange all rows in order of orifice number to form the per-orifice status table.

[0090] The process of generating the compensation mapping table is as follows: Create table rows in ascending order of compensation rounds, with each row corresponding to a compensation mapping relationship. Each row contains four columns: the first column records the compensation round in which the compensation mapping relationship belongs; the second column records the offset of the compensation in that round; the third column records the abnormal nozzle number; and the fourth column records the normal compensation nozzle number corresponding to the abnormal nozzle. Generate one record for each compensation mapping relationship according to the above format, and arrange all rows in order of compensation round to form the compensation mapping table.

[0091] Additional content, such as a nozzle evaluation summary table and a compensation round statistics table, can be added to the data file. The nozzle evaluation summary table includes key indicators such as the total number of nozzles, the number of normal nozzles, the number of abnormal nozzles, the number of compensation rounds, the weighted status of the nozzles before compensation, and the weighted status of the nozzles after compensation. The compensation round statistics table includes the number of rounds for each round, the offset, the number of abnormal nozzles compensated in that round, the number of remaining abnormal nozzles after compensation, and the weighted status of the nozzles after compensation. All data tables are written to different worksheets or different data segments within the same data file to complete the data file export. The exported data file is stored to a specified storage path for process debugging, quality re-inspection, production archiving, or subsequent control calls.

[0092] The inkjet control data consists of several components: **Ejection Control Data:** This is a data structure containing instruction sets for controlling the ejection action of each nozzle in the printhead. Each data item corresponds to a nozzle number and includes at least an enable / disable flag and ejection waveform parameters. The inkjet printer generates drive waveforms based on the ejection control data to control each nozzle's ejection operation. **Ejection Waveform Parameters:** These are electrical signal parameters that control the ejection action of a single nozzle, including the amplitude, pulse width, rise time, and fall time of the drive pulse. These parameters determine the volume, velocity, and direction of the ejected droplets. **Enablement Flag:** A binary flag in the ejection control data indicating whether a nozzle can be triggered to eject. When the enable flag is enabled, the nozzle can eject; when disabled, it does not. **Nozzle Drive Circuit:** This is the circuit unit in the printhead that converts the ejection control data into electrical signals to drive the piezoelectric or thermal foaming elements of the nozzles. Each nozzle has an independent drive circuit channel.

[0093] In this invention, nozzle detection data of an inkjet printer is acquired. This data can be calculated from a detection image and a nozzle template, or it can be obtained by reading a pre-exported Excel file, CSV file, or other structured data file. The nozzle detection data includes at least the nozzle number and the nozzle status information corresponding to that number. It may also include one or more of the following: nozzle position, ROI detection frame, detection confidence level, number of foreground pixels, centroid offset, number of connected components, droplet area, droplet morphology features, or jet trajectory features. When acquiring the nozzle detection data, the inkjet printer controls the printhead to spray a preset detection pattern onto the detection medium. This pattern includes detection lines, ink dots, jetting areas, or jetting trajectories corresponding one-to-one with each nozzle of the printhead. An image acquisition device captures the detection pattern on the detection medium to obtain a nozzle detection image. The image acquisition device can be an industrial camera, a line scan camera, an area scan camera, or a microscopic imaging device. Each nozzle number is associated with its corresponding nozzle status to generate the nozzle detection data for the printhead.

[0094] Create or load a nozzle template corresponding to the nozzle head. This template records the ROI detection box of each nozzle, the center point coordinates of the ROI detection box, and the nozzle number. It can also record one or more parameters from the following: detection image identifier, image size, number of nozzles, number of nozzle columns, nozzle row and column arrangement, nozzle spacing, and template version information. When loading a nozzle template, read the corresponding nozzle template file from the storage medium. The ROI detection box is a rectangular image area pre-defined for each nozzle in the nozzle template, used to locate the spray mark corresponding to that nozzle in the detection image. The center point coordinates are the pixel position of the geometric center of the ROI detection box in the template image. The nozzle number is a unique identifier obtained after arranging each nozzle of the nozzle head in a predetermined order. The template file can be stored in JSON, XML, CSV, Excel, or database record format. When the current detection image undergoes translation, scaling, rotation, shearing, or perspective changes relative to the nozzle template, an image registration relationship is calculated based on identifiers, positioning graphics, control points, or feature points in the detection image. The ROI detection box in the nozzle template is then mapped to the current detection image according to this registration relationship. The image registration relationship includes affine transformation or homography transformation. Specifically, positioning identifiers are identified from the nozzle detection image. These identifiers are specific marks pre-set on the detection pattern or detection medium, and can be QR codes, positioning graphics, corner points, control points, or other manually identifiable marks. Simultaneously, the reference position of this identifier in the template image is read from the nozzle template. The actual position is compared with the reference position to calculate the spatial geometric transformation parameters between the nozzle detection image and the nozzle template. When the nozzle detection image only undergoes translation, rotation, and uniform scaling, the registration relationship is an affine transformation, which includes translation, rotation, scaling, and shearing parameters and is represented by a transformation matrix. When perspective distortion exists, the registration relationship is a homography transformation, represented by a 3×3 homography matrix. The affine or homography transformation is automatically selected based on the number and distribution of the location identifiers. After obtaining the registration relationship, for each ROI detection box in the template, the coordinates of its four vertices are substituted into the transformation matrix to perform coordinate transformation, obtaining the corresponding coordinates of the four vertices in the detection image. The rectangular area enclosed by these coordinates is the ROI detection area of ​​the corresponding nozzle. After mapping, each nozzle is numbered to obtain its corresponding ROI detection area in the detection image.

[0095] Based on the mapped ROI detection region, state recognition is performed on each nozzle. In the nozzle detection mode based on the number of foreground pixels, image preprocessing is performed on the ROI detection region of each nozzle. Preprocessing includes one or more of the following: grayscale conversion, filtering, thresholding, and morphological processing. Then, the number of foreground pixels in the ROI detection region is counted, and centroid offset constraints, connected component quantity constraints, area constraints, or shape constraints can be combined to determine whether the corresponding nozzle is a normal or abnormal nozzle. In specific processing, the ROI detection region is grayscale converted from a color image to a grayscale image. A weighted average method can be used to calculate the grayscale value according to the different weights of the red, green, and blue components. Then, thresholding is performed on the grayscale image to divide the pixels into foreground and background categories. Thresholding can use a fixed threshold, adaptive threshold, Otsu's method, or a threshold method that is automatically updated based on the background grayscale. The foreground region (e.g., dark spray marks or bright spray marks) is determined according to the preset pixel polarity. The number of pixels designated as foreground within the ROI detection area is counted to obtain the foreground pixel count. This foreground pixel count is then compared to a preset pixel threshold, which is used to determine whether the nozzle has sprayed sufficient material. If the number of foreground pixels is less than the preset pixel threshold, the nozzle is determined to be an abnormal nozzle; if it is greater than or equal to the preset pixel threshold, it is determined to be a normal nozzle. Centroid offset constraints and connected component quantity constraints can also be optionally superimposed. The centroid offset constraint calculates the lateral and longitudinal deviations between the centroid of the foreground pixels and the center point of the ROI detection area; if the deviation exceeds a preset offset threshold, it is determined to be an abnormal spray. The connected component quantity constraint counts the number of connected components in the foreground; if the number does not meet a preset range, it is determined to be an abnormal spray.

[0096] In the nozzle state detection mode based on a convolutional neural network model, the ROI detection region of each nozzle is input into a trained convolutional neural network model. The model outputs the nozzle state category and its corresponding confidence score. The state category includes at least one of normal state, intermittent spraying state, and failure state. Based on the model output, each nozzle is mapped as a normal nozzle, intermittent spraying nozzle, or failure nozzle. Specifically, for each ROI detection region, it is fed into a convolutional neural network. This network uses convolutional operations for feature extraction and classification. During the training phase, the parameters are optimized with a large number of labeled samples. Lightweight network structures such as LeNet and VGG-Small can be used. The input layer accepts a fixed-size ROI image. After passing through multiple convolutional layers, pooling layers, and fully connected layers, the output layer generates a three-dimensional probability vector, corresponding to the predicted probabilities of the three categories: normal, intermittent spraying, and failure. These probability values ​​are the confidence scores. The category corresponding to the highest probability is selected as the state category of the nozzle.

[0097] The detection results of each nozzle are sorted according to its nozzle number, constructing a nozzle state sequence of length N, where N is the total number of nozzles in the nozzle head. Normal nozzles are marked as usable, and failed nozzles are marked as abnormal. A preset strategy determines whether to mark intermittent spray nozzles as abnormal or unprocessed, thus obtaining a nozzle state sequence corresponding one-to-one with the nozzle number. During construction, the marking results of all nozzles are obtained and sorted by nozzle number in ascending order; normal nozzles are marked as normal, and abnormal nozzles are marked as abnormal. For unprocessed nozzles, if the preset strategy is to mark intermittent spray as abnormal, the unprocessed nozzle does not exist; otherwise, the unprocessed nozzle can be marked as abnormal in the sequence to conservatively participate in subsequent evaluation. Finally, an ordered sequence of length equal to the total number of nozzles in the nozzle head is formed, with each position corresponding to a nozzle number, and a value of normal or abnormal.

[0098] The system scans the nozzle state sequence to identify consecutive abnormal nozzle clusters composed of adjacent abnormal nozzles, recording the starting nozzle number, ending nozzle number, cluster length, and the set of nozzles within each cluster. During scanning, starting from the first element of the sequence, the status of each nozzle is read sequentially in ascending order of nozzle number. When an abnormal nozzle is encountered for the first time and its preceding element is either nonexistent or a normal nozzle, a new cluster is determined, and the starting number is recorded. The scan continues, and when a normal nozzle is encountered or the end of the sequence is reached, the current cluster is determined to end, and the ending number is recorded. The cluster length is calculated as the ending number minus the starting number plus one, and all nozzle numbers within the cluster are recorded. After completing a cluster, the scan position is moved to the next element after the end of that cluster, and the above process is repeated until the sequence is traversed, summarizing the information of all consecutive abnormal nozzle clusters.

[0099] Let the first The length of the continuous abnormal nozzle cluster is The weight of continuous anomalies is Then the weighted outlier Calculate according to the following formula: ,in, Indicates the first The number of anomalous nozzles in each cluster Preset penalty coefficient. Weighted state of the nozzle. Calculate using the following formula: ,in, This represents the total number of nozzle orifices. The results are limited to between 0 and 1. In the specific calculation, all consecutive outlier clusters are read, and the total number of clusters is recorded as... , for the Clusters ( From 1 to Get its length and obtain preset According to the formula Calculate the weighted outlier for each cluster, and obtain Then all The sum of the outliers is the total weighted outlier. Then read the total number of nozzles. ,calculate ,when When less than 0 When it is 0, it is greater than 1 If the value is 1, otherwise the original value is retained.

[0100] Based on the weighted state of the nozzle The risk level of the nozzle is determined by comparing it with preset high and low thresholds. Risk levels include minor, medium, and severe risk. Based on the risk level, the number of remaining abnormal nozzles, the distribution of continuous abnormal nozzle clusters, and preset process requirements, a nozzle compensation strategy is selected. Strategies include single-round maximum coverage compensation, setting a maximum number of rounds of compensation, stopping compensation after reaching the weighted state of the target nozzle, and full coverage compensation. When determining the risk level, if... A risk level greater than or equal to the high threshold is considered minor. A risk level is defined as being below the high threshold but greater than or equal to the low threshold. A risk level below the minimum threshold is considered a serious risk. No compensation is provided for minor risks, while compensation is provided for moderate and serious risks.

[0101] When the determination indicates that compensation is required, the remaining abnormal nozzle set and the compensation nozzle set are determined. The remaining abnormal nozzle set consists of the numbers of all abnormal nozzles in the nozzle state sequence, and the compensation nozzle set consists of the numbers of all normal nozzles. Subsequently, multiple rounds of nozzle compensation search are performed: for the remaining abnormal nozzle set, within a preset maximum offset step... Enumerate candidate offsets within the range , Not equal to 0. When there is an abnormal nozzle According to candidate offset Position after offset When a healthy, usable nozzle (i.e., belonging to the set of compensated nozzles) is selected, a system is established to compensate for the abnormal nozzles using that healthy nozzle. Candidate mapping relationship, record abnormal nozzle number Compared with normal nozzle number The correspondence is as follows: if no available compensation nozzle is found, the abnormal nozzle is added to the uncovered set. During the specific enumeration, the preset maximum offset step number is denoted as... Candidate offset The enumeration range is For each Iterate through each abnormal nozzle in the remaining set of abnormal nozzles and denote its number as . The offset number is ;judge If the nozzle belongs to the set of compensated nozzles, a candidate mapping is established; otherwise, the abnormal nozzle is... The following is not compensated; after traversing all abnormal nozzles, the current... The set of candidate mapping relationships.

[0102] For each candidate offset Calculate the corresponding score The formula is as follows: ,in, Indicates the candidate offset in the current round. The number of abnormal nozzles that can be covered. This represents the penalty for consecutive anomalies in the remaining set of abnormal nozzles after applying the candidate offset. Indicates the offset distance. , , These represent the coverage quantity weight, the remaining risk weight, and the offset distance weight, respectively. The calculation is performed using the sum of squares of the lengths of the remaining anomaly continuous segments, i.e. ,in, This represents the number of consecutive abnormal segments formed by the remaining uncovered abnormal nozzles. For the first The length of each consecutive outlier segment. The total number of candidate mapping relationships is obtained. To identify uncovered abnormal nozzles and consecutive abnormal segments, the sum of the squares of the lengths of each segment is calculated. Then obtain the preset weights. , , The score is calculated according to the formula above. In each round of compensation search, the candidate offset with the highest score is selected, and the offset direction, offset amount, and mapping relationship between the abnormal nozzle and the compensation nozzle are recorded for that round of compensation.

[0103] After completing one round of compensation, the compensated abnormal nozzles are marked as compensated nozzles, and the remaining abnormal nozzle set (removing compensated nozzle numbers), consecutive abnormal nozzle clusters, and the weighted state of the compensated nozzles are updated. The compensation search stops when any of the following conditions are met: the remaining abnormal nozzle set is empty; the number of compensation rounds reaches the preset maximum number of compensation rounds; the weighted state of the compensated nozzles reaches the preset target state; there are no valid candidate compensation mappings (i.e., no candidate offset can cover at least one abnormal nozzle); or other user-defined stopping conditions are met. If the stopping conditions are not met, the process returns to the step of enumerating candidate offsets to continue the next round of compensation search with the updated remaining abnormal nozzle set.

[0104] The system outputs nozzle detection results and orifice compensation results. The output includes one or more of the following: number of compensation rounds, offset direction and amount for each round, abnormal orifice number, corresponding compensated orifice number, compensation coverage, remaining abnormal orifice numbers, weighted state of the nozzle before compensation, weighted state of the nozzle after compensation, continuous abnormal orifice cluster information, and running time. It can also generate orifice state matrices, orifice state visualizations, compensation mapping diagrams, before-and-after compensation comparison diagrams, and data files in Excel, CSV, or other formats for process debugging, quality re-inspection, production archiving, or subsequent control system calls. In the specific output, all necessary information is extracted to generate a per-orifice status table (recording the status of each orifice by orifice number and whether it has been compensated), a compensation mapping table (recording the round number, offset, abnormal orifice number, and corresponding normal orifice number for each mapping relationship by round), a compensation round statistics table (recording the round number, offset, compensation quantity, remaining quantity, remaining continuous abnormal penalty, and weighted status after compensation for each round), and a nozzle evaluation summary (including the total number of orifices, the number of normal / abnormal orifices, the number of consecutive clusters, the maximum cluster length, the number of compensation rounds, the coverage rate, the weighted status before and after compensation, and the risk level). A visualization is also generated based on the total number of orifices, using green to represent normal orifices, red to represent uncompensated abnormal orifices, and green with a border or special markings to represent compensated abnormal orifices. The compensation mapping chart shows the correspondence between abnormal orifices and their corresponding normal compensated orifices through connecting lines or arrows. Finally, all tables and charts are exported as data files in preset formats (Excel, CSV, JSON, or database) for subsequent use.

[0105] like Figure 2As shown, the step of acquiring detection data, i.e., acquiring the nozzle orifice detection data of the nozzle, involves acquiring the nozzle orifice detection image of the detection pattern sprayed by the nozzle through an image acquisition device. This image, together with the nozzle orifice template, constitutes the raw data input. In the step of creating or loading the template, i.e., loading the nozzle orifice template corresponding to the nozzle, a template file containing the ROI detection box, center point coordinates, and nozzle number for each nozzle is read from the storage medium, providing a reference for subsequent spatial mapping. Subsequently, the image registration and ROI mapping step proceeds. This involves calculating the image registration relationship between the nozzle detection image and the nozzle template based on the positioning identifiers in the nozzle detection image, and mapping each ROI detection box in the nozzle template to the nozzle detection image according to the image registration relationship, thus obtaining the ROI detection area corresponding to each nozzle. An affine transformation or homography transformation relationship is calculated based on the positioning identifiers in the detection image, and each ROI detection box in the template is mapped to the current detection image, thereby determining the corresponding ROI detection area in the detection image for each nozzle number. In the nozzle state identification step, the state of the ROI detection area of ​​each nozzle is determined. A detection mode based on the number of foreground pixels can be selected, using grayscale, threshold segmentation, and foreground pixel counting to determine normal or abnormal status. Alternatively, a detection mode based on a convolutional neural network model can be selected, with the network outputting three state categories: normal, intermittent spraying, or failure, along with their confidence levels. In the state sequence construction step, the detection results of all nozzles are organized into a nozzle state sequence of length N, sorted by nozzle number, where N is the total number of nozzles in the nozzle head. Each element in the sequence uniquely corresponds to a nozzle number, and the nozzle state includes normal and abnormal nozzles. In the continuous abnormal cluster evaluation step, i.e., scanning the nozzle state sequence to identify continuous abnormal nozzle clusters composed of adjacent abnormal nozzles, and calculating the weighted state of the nozzle based on the length of each continuous abnormal nozzle cluster, the nozzle state sequence is scanned to identify continuous abnormal nozzle clusters, recording the start number, end number, and cluster length of each cluster. The weighted state S of the nozzle is calculated based on the cluster length, using the following method: Let the length of the m-th continuous abnormal nozzle cluster be... If the penalty coefficient for continuous anomalies is λ, then the total weighted anomaly count is: The weighted state of the nozzle: ,in, The function will The calculation results are limited to the range of 0 to 1.

[0106] In the step of determining the compensation strategy, which involves determining the risk level of the nozzle based on the weighted state, and then determining whether to perform nozzle compensation based on the risk level, the result is obtained by comparing S with preset high and low thresholds to determine the risk level as slight, moderate, or severe, and deciding whether to initiate the compensation process based on the risk level. In the multi-round offset search step, which is the multi-round nozzle compensation search step, for the remaining abnormal nozzle set, within a preset maximum offset step... Enumerate candidate offsets within the range ( Number each abnormal nozzle. Determine the position after offset If a nozzle belongs to the set of normal nozzles in the compensation nozzle set, then establish a candidate mapping relationship, and then process each candidate offset. Calculate the score: ,in This indicates the number of abnormal nozzles covered by the offset. This indicates the continuous abnormal penalty for the remaining uncovered abnormal nozzles ( This represents the number of consecutive outlier segments. For the first (segment length) This is the offset distance. , , The weights are coverage quantity, remaining risk, and offset distance, respectively. The offset with the highest score is selected to perform compensation in this round, the set of remaining abnormal nozzles is updated, and the process is iterated until the stopping condition is met.

[0107] Finally, in the step of outputting compensation results, namely the step of outputting nozzle detection results and nozzle compensation results, all results are output, including the compensation offset of each round, the compensation mapping relationship between abnormal nozzle numbers and corresponding normal compensation nozzle numbers, and a nozzle status table, compensation mapping table, compensation round statistics table, nozzle evaluation summary, nozzle status visualization diagram and compensation mapping diagram are generated. The data files are exported in a preset format for subsequent process debugging, quality re-inspection or control system calls.

[0108] like Figure 3 As shown, firstly, the step of loading the nozzle template corresponding to the nozzle is performed, and the nozzle template (i.e., ...) is read from the storage medium. Figure 3 The "nozzle template (recording ROI detection frame, center point, and nozzle number)" records the ROI detection frame for each nozzle, the coordinates of the center point of the ROI detection frame, and the nozzle number, serving as a reference for spatial mapping. Simultaneously, the step of acquiring nozzle detection images is performed, using an image acquisition device to obtain the acquired images (i.e.,...). Figure 3The "acquired image" refers to the nozzle detection image, which may be translated, rotated, scaled, or perspective-distorted relative to the nozzle template. To accurately locate the ROI detection box in the template to its corresponding position in the detection image, an image registration relationship is calculated. This relationship is obtained by comparing the location identifiers (such as QR codes, location graphics, corner points, or control points) in the detection image with the corresponding reference positions in the template. Depending on the actual deformation of the detection image relative to the template, the image registration relationship can be either affine transformation or homography. When the deformation only involves translation, rotation, and uniform scaling, an affine transformation relationship is used, represented by a transformation matrix containing translation, rotation, scaling, and shearing parameters. When perspective distortion exists, a homography transformation relationship is used, represented by a 3×3 homography matrix. After obtaining the image registration relationship, the coordinates of the four vertices of each ROI detection box in the nozzle template are substituted into the transformation matrix corresponding to the transformation relationship to perform a coordinate transformation, obtaining the corresponding coordinates of the four vertices in the nozzle detection image. The rectangular area enclosed by these coordinates is the ROI detection area corresponding to that nozzle. Through this mapping, each nozzle number obtains a precisely corresponding ROI detection region in the detection image, providing a location-accurate detection region for subsequent nozzle state recognition. Ultimately, these mapped ROI detection regions will be used for nozzle-by-nozzle state recognition, and further used to construct nozzle state sequences, calculate the weighted state of the nozzles, and perform multiple rounds of nozzle compensation search. Finally, the nozzle detection results and nozzle compensation results are output, thus completing the entire process of spatial registration and ROI mapping from template to image.

[0109] Figure 4 The processing flow of two nozzle state recognition modes is demonstrated: a nozzle detection mode based on foreground pixel count and a nozzle state detection mode based on a convolutional neural network model. In the nozzle detection mode based on foreground pixel count (i.e.... Figure 4 Under "PMF rule detection", the ROI detection area of ​​each nozzle is first received (i.e., Figure 4 The "ROI input" performs image preprocessing operations on these ROI detection regions, including grayscale conversion, thresholding, and foreground pixel statistics (i.e., Figure 4 The process involves "grayscale / threshold / pixel" (or "grayscale / threshold / pixel"). Grayscale conversion transforms a color ROI image into a grayscale image. Thresholding divides grayscale pixels into foreground and background categories. The number of pixels classified as foreground within the ROI detection area is then counted to determine the foreground pixel count. Based on this foreground pixel count and a preset pixel threshold, a binary classification result is output (i.e., ...). Figure 4 The system employs a "normal / abnormal binary classification," where a nozzle is classified as abnormal when the number of foreground pixels is less than a preset pixel threshold, and as normal when it is greater than or equal to the preset pixel threshold. Based on this, centroid offset constraints and connected component quantity constraints can be selectively superimposed (i.e.,...). Figure 4In the "centroid / connected component" constraint, centroid offset constraint identifies skewed sprays by calculating the lateral and longitudinal deviations between the centroid of the foreground pixel and the center point of the ROI detection region, while connected component quantity constraint identifies discontinuous or split sprays by statistically counting the number of foreground connected components, thereby further refining the detection results. This is relevant in the nozzle state detection mode based on a convolutional neural network model (i.e.,...). Figure 4 In the "CNN detection" mode, the ROI detection region of each nozzle is also received as input and fed into the convolutional neural network model (i.e., Figure 4 The "convolutional neural network" (CNN) is a model containing multiple convolutional layers, pooling layers, and fully connected layers. It extracts image features through forward propagation and ultimately produces a three-dimensional probability vector from the output layer. This vector is then processed by the Softmax function (i.e.,...). Figure 4 The network output is processed using "Softmax probability," converting it into probability values ​​for three categories. Each probability value represents the confidence level that the nozzle belongs to the corresponding state category, and the sum of the three probability values ​​equals 1. The category corresponding to the highest probability value is selected as the three-class classification result for that nozzle (i.e., the classification result for the three categories). Figure 4 The system categorizes nozzle states into three categories: normal, intermittent, and failed. Ultimately, both modes output nozzle state information, which includes at least the nozzle number and its corresponding state category. The detection mode based on foreground pixel count outputs a binary classification result (normal or abnormal), while the detection mode based on a convolutional neural network model outputs a tri-class classification result (normal, intermittent, or failed) along with corresponding confidence levels. This provides a nozzle-by-nozzle state data foundation for subsequently constructing a nozzle state sequence.

[0110] Figure 5This section demonstrates the identification results of a nozzle state sequence and its consecutive abnormal nozzle clusters. The sequence is arranged in ascending order of nozzle number, with each nozzle number corresponding to a nozzle state. The example nozzle in the figure contains 24 nozzles, labeled from number 1 to number 24. The nozzle states in the sequence are distinguished by different colors or markers: normal nozzles indicate nozzles in a normal state, intermittent spray nozzles indicate nozzles in an intermittent spray state, and abnormal nozzles indicate nozzles in an abnormal state. Scanning the entire nozzle state sequence identifies consecutive abnormal nozzle clusters composed of adjacent abnormal nozzles. The example in the figure identifies four consecutive abnormal nozzle clusters. The first consecutive abnormal nozzle cluster is located at positions 1 to 3, with a cluster length L=3, indicating that this cluster contains three consecutive adjacent abnormal nozzles; that is, nozzles numbered 1, 2, and 3 are all abnormal. The second cluster of consecutive anomalous nozzles is located at positions 6 to 7, with a cluster length L=2. This indicates that the cluster contains two consecutive adjacent anomalous nozzles, i.e., nozzles 6 and 7 are anomalous, while nozzles 5 and 8 are normal. Therefore, this cluster is defined as an independent cluster of consecutive anomalous nozzles. The third cluster of consecutive anomalous nozzles is located at positions 10 to 12, with a cluster length L=2. This indicates that the cluster contains two consecutive adjacent anomalous nozzles, i.e., nozzles 10, 11, and 12 are all anomalous. The fourth cluster of consecutive anomalous nozzles is located at positions 13 to 15, with a cluster length L=1. In fact, the L=1 marked in the figure here should be an isolated anomalous nozzle. This cluster contains only one anomalous nozzle, i.e., nozzle 13 is anomalous, while nozzles 12 and 14 are non-anomalous (no. 12 belongs to the anomalous nozzle of the previous cluster, and no. 14 is an intermittent or normal nozzle). Therefore, this isolated anomalous nozzle is considered a cluster of consecutive anomalous nozzles with a length of 1. The fifth consecutive cluster of anomalous nozzles is located at positions 18 to 21, with a cluster length L=4. This indicates that the cluster contains four consecutive adjacent anomalous nozzles, namely nozzles 18, 19, 20, and 21, while nozzles 17 and 22 are normal. Therefore, this cluster is defined as an independent consecutive anomalous cluster. Nos. 9, 16, and 17 are normal nozzles, while nozzles 14 and 15 are intermittent nozzles. According to a preset strategy, these intermittent nozzles can be marked as anomalous or unprocessed nozzles, thus affecting the composition of anomalous nozzles in the nozzle state sequence.The starting nozzle number, ending nozzle number, cluster length, and nozzle set within each consecutive abnormal nozzle cluster are recorded. For example, the first cluster has a starting number of 1, an ending number of 3, a cluster length of 3, and a nozzle set of {1,2,3}; the second cluster has a starting number of 6, an ending number of 7, a cluster length of 2, and a nozzle set of {6,7}; the third cluster has a starting number of 10, an ending number of 12, a cluster length of 3, and a nozzle set of {10,11,12}; the fourth cluster has a starting number of 13, an ending number of 13, a cluster length of 1, and a nozzle set of {13}; and the fifth cluster has a starting number of 18, an ending number of 21, a cluster length of 4, and a nozzle set of {18,19,20,21}. Through the above scanning and identification, complete information on all consecutive abnormal nozzle clusters is obtained, providing basic data for subsequent calculation of the nozzle weighted state.

[0111] Figure 6 This document demonstrates a complete risk assessment process, starting from the nozzle state sequence, through continuous anomaly cluster identification, weighted anomaly calculation, and nozzle weighted state calculation, ultimately determining the risk level. The process begins with the nozzle state sequence, arranged in ascending order of nozzle number. Each nozzle number corresponds to a nozzle state, which includes at least two categories: normal nozzles and abnormal nozzles. The process involves identifying continuous anomaly clusters within this sequence. This involves scanning the entire nozzle state sequence, identifying clusters of consecutive abnormal nozzles composed of adjacent abnormal nozzles, and recording the starting nozzle number, ending nozzle number, cluster length, and the set of nozzles within each cluster. After continuous anomaly cluster identification, the process proceeds to calculate the weighted anomaly value U. Let the total number of identified continuous abnormal nozzle clusters be... , No. The length of the continuous abnormal nozzle cluster is (in, The value range is 1 to The preset continuous anomaly penalty coefficient is: First, according to the formula Calculate the first Weighted anomalies of a continuous cluster of anomalous nozzles Then, the weighted anomalies of all consecutive anomalous nozzle clusters are summed to obtain the total weighted anomaly: ,in, This represents the total weighted anomaly quantity, reflecting the overall anomaly level after continuous anomaly penalty weighting of all abnormal nozzles in the nozzle.

[0112] Next, the weighted state is calculated to obtain the total number of nozzle holes. Based on the total weighted outlier and the total number of nozzles According to the formula Calculate the weighted state of the nozzle. ,in The function will The calculation results are limited to the range of 0 to 1: when When less than 0 The value is 0, when When greater than 1 The value is 1, when When in the range of 0 to 1 Values itself. The closer the value is to 1, the better the nozzle condition; the closer it is to 0, the worse the nozzle condition. This obtains the weighted state of the nozzle. Then, it is compared with preset high and low thresholds, and the risk level of the nozzle is determined based on the comparison result. When the value is greater than or equal to the high threshold, it is judged as a minor risk; when When the risk level is below the high threshold but greater than or equal to the low threshold, it is classified as medium risk; when... When the value is below a low threshold, it is considered a serious risk. Through the above process, the nozzle state sequence is transformed into a quantified weighted state of the nozzle, and the risk level is finally determined, providing a basis for subsequent decision-making on whether to perform nozzle compensation.

[0113] like Figure 7 As shown, Figure 7 This demonstrates the complete process of multi-round nozzle compensation search. The process takes the set of remaining abnormal nozzles B as input, which consists of the nozzle numbers of the abnormal nozzles that have not yet been compensated. First, it performs an enumeration of offsets d, within a preset maximum offset step. Enumerate candidate offsets within the range Its enumeration range is and For each enumerated candidate offset The process involves generating candidate maps, which means traversing each abnormal nozzle in the remaining set of abnormal nozzles and recording the nozzle number of the abnormal nozzle as... The abnormal nozzle is determined based on the candidate offset. Offset nozzle number If the corresponding nozzle belongs to the set of normal nozzles for compensation, a candidate mapping relationship is established to compensate the abnormal nozzle with the normal nozzle. After the candidate mapping is generated, the coverage quantity is calculated. The operation calculates the current candidate offset. The total number of candidate mapping relationships established below is obtained. , indicating candidate offset The number of abnormal nozzles that can be covered in this round. Simultaneously, calculate the remaining consecutive abnormality penalty. The operation determines the candidate offset to be used. The set of uncovered abnormal nozzles after compensation is identified. These uncovered abnormal nozzles are sorted by nozzle number, and consecutive abnormal segments are identified. The number of consecutive abnormal segments is recorded as follows: , will the The length of each consecutive abnormal segment is denoted as . Then follow the formula: Calculate the remaining continuous anomaly penalty .get and Then, the score is calculated. The operation is based on the formula: Calculate the current candidate offset Corresponding rating ,in Indicates candidate offset The absolute value, , , These are the preset weights for coverage quantity, remaining risk, and offset distance, respectively. Positive contribution to the scoring, with the remaining continuous anomalies penalized. and offset distance This negatively impacts the scoring. The above calculation is performed for each candidate offset within the enumeration range. After scoring all candidate offsets, the operation of selecting the highest-scoring offset is initiated. The candidate offset with the highest score is selected as the compensation offset for this round, and the offset direction, offset amount, and mapping relationship between the abnormal nozzle and the compensation nozzle are recorded. After completing this round of compensation, the operation of updating the remaining nozzle set is initiated. The abnormal nozzles that have been compensated in this round are marked as compensated nozzles and removed from the remaining abnormal nozzle set, resulting in an updated remaining abnormal nozzle set. Subsequently, the operation of judging the stopping conditions is executed, sequentially checking four stopping conditions: whether the remaining abnormal nozzle set is empty, whether the number of compensation rounds has reached the preset maximum number of compensation rounds, whether the weighted state of the compensated nozzles has reached the preset target state, and whether there are valid candidate offsets. If any one of the stopping conditions is met, the process ends and the compensation result is output; if none of the stopping conditions are met, the process does not stop and proceeds to the next round, returning to the enumerated offsets. The next round of compensation search is performed, using the updated set of remaining abnormal nozzles as the current set of remaining abnormal nozzles.

[0114] Figure 8 Demonstrates the use of candidate offsets An example of compensating the original nozzle array. The original nozzle array, shown above, contains nozzles numbered 1 to 18. In the original nozzle array, nozzles numbered 1, 2, 4, 5, 6, 8, 11, and 17 are normal nozzles (represented by a lighter color or hollow), while nozzles numbered 3, 7, 9, 10, 12, 13, 14, 15, 16, and 18 are abnormal nozzles (represented by a darker color or solid). During the multi-round nozzle compensation search, for each candidate offset within the enumeration range... Calculate the score The scoring formula is: ,in Indicates candidate offset The number of abnormal nozzles that can be covered. This represents the penalty for consecutive uncovered abnormal nozzles after applying the candidate offset. Indicates the offset distance. , , These are the preset weights for coverage quantity, remaining risk, and offset distance, respectively. By applying weights to all candidate offsets (such as...) Each candidate offset is scored individually, and the candidate offset with the highest score is selected as the compensation offset for this round. Figure 8 In the case shown, the offset The selection as the compensation offset for this round means that each abnormal nozzle number Numbered by nozzle The corresponding normal nozzles are compensated. The compensated array display shows the offset. After compensation, the original abnormal nozzle number 3 is compensated by the normal nozzle number 6, the original abnormal nozzle number 7 is compensated by the normal nozzle number 10, the original abnormal nozzle number 9 is compensated by the normal nozzle number 12, the original abnormal nozzle number 10 is compensated by the normal nozzle number 13, the original abnormal nozzle number 12 is compensated by the normal nozzle number 15, the original abnormal nozzle number 13 is compensated by the normal nozzle number 16, the original abnormal nozzle number 14 is compensated by the normal nozzle number 17, and the original abnormal nozzle number 15 is compensated by the normal nozzle number 18. The original abnormal nozzle number 16 is not compensated because its corresponding number 19 is outside the nozzle's range after offset, and the original abnormal nozzle number 18 is also not compensated because it is outside the range. This one-to-one correspondence is the compensation mapping relationship. The correspondence between each abnormal nozzle number and its corresponding normal compensated nozzle number is recorded, along with the offset amount for that round of compensation. The offset direction is towards increasing nozzle number. After compensation, successfully compensated abnormal nozzles (numbers 3, 7, 9, 10, 12, 13, 14, 15) are marked as compensated nozzles and removed from the remaining abnormal nozzle set; uncompensated abnormal nozzles (numbers 16, 18) remain in the remaining abnormal nozzle set and enter the next round of compensation search. The array below visually displays the nozzle status after compensation. Originally abnormal nozzles that were successfully compensated are shown with borders or other distinguishing markers, indicating that these abnormal nozzles have been replaced by their corresponding normal nozzles to perform the spraying action. Uncompensated abnormal nozzles (such as numbers 16, 18) remain in an abnormal state, awaiting further processing in subsequent rounds.

[0115] like Figure 9 As shown, Figure 9 The interface for outputting and exporting nozzle detection and orifice compensation results is displayed. After completing all detection and compensation searches, the various data are organized into structured output content. The upper left area is the nozzle evaluation summary, which summarizes the key indicators of nozzle detection and orifice compensation, including the total number of nozzle orifices. Number of normal nozzles, number of abnormal nozzles, number of consecutive abnormal nozzle clusters, maximum length of consecutive abnormal clusters, number of compensation rounds, total compensation coverage, and weighted state of the nozzles before compensation. Weighted state of the compensated nozzle The remaining number of abnormal nozzles and their risk levels, including the weighted status of the nozzles before compensation. According to the initial nozzle state sequence, according to the formula The weighted state of the compensated nozzles was calculated. The result was recalculated based on the updated set of remaining abnormal nozzles. This represents the initial total weighted outlier. The upper right area displays the compensation strategy parameters, showing the preset parameters used in this round of compensation search, including the preset maximum offset steps. Preset maximum number of compensation rounds, preset target state threshold, and preset coverage quantity weight. Preset residual risk weights Preset offset distance weight and preset continuous anomaly penalty coefficient These parameters are used to enumerate candidate offsets and calculate scores during the compensation search process. The central area is a nozzle status matrix, a visualization of nozzle status, graphically displaying the detection and compensation status of each nozzle. Each graphical unit in the matrix corresponds to a nozzle and is uniquely associated with its number. Green indicates a normal nozzle, red indicates an uncompensated abnormal nozzle, and green borders or other distinguishing markers indicate compensated abnormal nozzles. The matrix also displays the status of intermittently spraying nozzles and nozzles awaiting processing. The lower left side shows the nozzle-by-nozzle status, corresponding to a nozzle-by-nozzle status table. It records the nozzle number, status, and a marker indicating whether the nozzle has been compensated, all in ascending order of nozzle number. The nozzle status is obtained from the nozzle status sequence, including normal and abnormal nozzles. Whether a nozzle has been compensated is determined by whether its number appears in any round of compensation mapping. The lower right side displays the compensation mapping table and compensation round statistics. The compensation mapping table records all compensation mapping relationships in each compensation round in ascending order of compensation round number. Each record includes the compensation round number of the compensation mapping relationship, the offset of the compensation in that round, the offset direction, the abnormal nozzle number, and the normal compensation nozzle number corresponding to the abnormal nozzle. The compensation round statistics table generates a statistical record for each compensation round in ascending order of compensation round number, including the number of compensation rounds, the offset of the compensation in that round, the number of abnormal nozzles compensated in that round, the number of remaining abnormal nozzles after the compensation in that round, and the remaining continuous abnormal penalty after the compensation in that round. The interface also displays the weighted status of the nozzles after this round of compensation. At the bottom of the interface is the export report, which exports the nozzle evaluation summary, per-orifice status table, compensation mapping table, compensation round statistics table, and orifice status matrix as a data file according to a preset format. The data file format can be Excel, CSV, JSON, or database record format, for process debugging, quality re-inspection, production archiving, or subsequent control system calls.

[0116] Example 1: Per-orifice detection based on detection images and orifice templates: In this embodiment, the inkjet equipment includes a printhead, an inkjet control unit, a detection pattern generation unit, an image acquisition device, a computing processing unit, and a display output unit. The printhead includes multiple nozzles arranged in a predetermined order, for example, the number of nozzles is N, and the nozzles are numbered sequentially from 1 to N. The inkjet equipment can be an inkjet printing equipment, an inkjet coating equipment, an inkjet deposition equipment, an inkjet forming equipment, or an inkjet additive manufacturing equipment.

[0117] First, the printhead is controlled to spray a preset detection pattern onto the detection medium, or a detection image already generated by the inkjet equipment is read. The detection pattern may include detection lines, ink dots, spray areas, or spray trajectories corresponding to each nozzle. An image acquisition device captures the detection pattern to obtain a nozzle detection image. The image acquisition device can be an industrial camera, line scan camera, area scan camera, microscopic imaging device, or other imaging device capable of acquiring images of spray traces. Next, the nozzle template file corresponding to the printhead is read. The nozzle template file records the ROI detection frame of each nozzle, the center point coordinates of the ROI detection frame, the nozzle number, nozzle row and column information, nozzle spacing, detection pattern size, and the location identifier or control point position. The template file can be in JSON, XML, CSV, Excel, or database record format.

[0118] When there is a positional deviation between the current detection image and the nozzle template, the image registration relationship between the current detection image and the nozzle template is calculated based on the positioning identifiers, QR codes, corner points, control points, or other feature points in the detection image. The image registration relationship can be a translation transformation, scaling transformation, rotation transformation, affine transformation, or homography transformation. Based on this image registration relationship, each ROI detection box in the nozzle template is mapped to the current detection image, thereby obtaining the ROI detection region corresponding to each nozzle. Subsequently, the ROI detection region of each nozzle is cropped, and the ROI image is subjected to grayscale conversion, filtering, thresholding, and foreground pixel statistics in a nozzle detection mode based on foreground pixel count. Thresholding can use a fixed threshold, adaptive threshold, Otsu threshold, or a threshold automatically updated based on background grayscale. The foreground region is determined according to the pixel polarity set by the user, for example, using dark ink dots or bright spray marks as the foreground. The number of foreground pixels in each ROI detection region is counted. When the number of foreground pixels is greater than or equal to a preset pixel threshold, the corresponding nozzle is initially determined to have valid spray marks; when the number of foreground pixels is less than the preset pixel threshold, the corresponding nozzle is determined to be an abnormal nozzle. Further, if centroid detection is enabled, the lateral and longitudinal deviations between the centroid of the foreground pixels and the center point coordinates of the nozzle's ROI detection box are calculated. When the deviation exceeds a preset offset threshold, the nozzle is determined to have skewed spraying or abnormal spraying. If connected component detection is enabled, the number of foreground connected components is counted. When the number of connected components does not meet a preset range, the nozzle is determined to have discontinuous spraying, split spraying, or abnormal spraying.

[0119] Through the above processing, the output for each nozzle includes at least the nozzle number and the nozzle status. The nozzle status can include both normal and abnormal states, and may further include states such as weak spray, skewed spray, intermittent spray, and failure. The detection results are sorted according to the nozzle number to generate a nozzle status sequence of length N.

[0120] Example 2: Three-class classification detection based on convolutional neural networks: In this embodiment, nozzle state detection based on convolutional neural networks is supported. First, based on the nozzle template and image registration results, multiple ROI detection region images of nozzles are cropped from the detection image, with each nozzle ROI detection region image corresponding to a nozzle number.

[0121] During model training, a nozzle detection mode based on the number of foreground pixels can be used to initially classify the nozzle ROI detection region, obtaining three initial labels: normal, intermittent spraying, and failed spraying. Users can manually correct the nozzle ROI detection region images and their labels in the training interface to improve the accuracy of training samples. The corrected samples are divided into training, validation, and test sets, for example, in a 7:2:1 or 8:1:1 ratio. The convolutional neural network can use a lightweight network structure, such as LeNet, VGG-Small, AlexNet-Small, MobileNet, or a custom lightweight convolutional network. The model input is the nozzle ROI detection region image, and the output is the nozzle state category probability. The nozzle state categories include Normal, Intermittent, and Failed, corresponding to normal spraying, intermittent spraying, and failed spraying, respectively. The last layer of the model can use a Softmax function to output the three probabilities, and the category corresponding to the highest probability is taken as the nozzle state category, and the corresponding confidence level is recorded. During the actual detection phase, the ROI detection regions of each nozzle after template registration are sequentially input into the trained convolutional neural network model to obtain the three-class classification result and confidence score for each nozzle. Low-confidence results can be flagged based on a confidence threshold, or low-confidence nozzles can be marked as nozzles requiring retesting. For the Normal category, nozzles are marked as usable; for the Failed category, nozzles are marked as abnormal; for the Intermittent category, nozzles can be marked as abnormal, nozzles awaiting processing, or low-reliability usable nozzles according to user policies.

[0122] The above methods can improve the adaptability of nozzle status recognition when there are significant differences in material color, transparency, image brightness, and spray mark morphology, and provide richer status information for subsequent nozzle status evaluation and compensation mapping.

[0123] Example 3: Weighted State Evaluation Example of a Nozzle: In this embodiment, a nozzle state sequence is constructed based on the nozzle-by-nozzle detection results, and a continuous anomaly risk assessment is performed based on this nozzle state sequence. Assuming the nozzle head has N nozzles, normal nozzles are marked as usable nozzles, and failed nozzles and intermittent spray nozzles that need to be processed according to the strategy are marked as abnormal nozzles. The nozzle state sequence is scanned from smallest to largest nozzle number to identify continuous abnormal nozzle clusters composed of adjacent abnormal nozzles. For each continuous abnormal nozzle cluster, the starting nozzle number, ending nozzle number, cluster length, and the set of nozzle numbers within the cluster are recorded.

[0124] Let the first The length of the continuous abnormal nozzle cluster is The weight of continuous anomalies is The weighted anomaly of the continuous abnormal nozzle cluster is then... for: Total weighted outlier of all outlier clusters for: The weighted state of the nozzle for: ,in, This represents the total number of nozzles. This means limiting the calculation result to between 0 and 1. This represents the penalty coefficient for continuous anomalies. The larger the value, the stronger the penalty for the nozzle condition caused by a continuous abnormal nozzle cluster.

[0125] For example, a nozzle has N nozzles. Abnormal nozzles form three consecutive abnormal clusters with cluster lengths of 3, 2, and 1 respectively. The weight of the consecutive abnormalities is... If the value is 0.05, then the total weighted outlier is... for: ,Right now: Based on this, the weighted state of the nozzle is calculated. And compare it with a preset threshold. For example, when When the risk of the nozzle is greater than or equal to the high threshold, the risk is judged as minor; when When the risk level is below the high threshold but greater than or equal to the low threshold, the nozzle risk is classified as medium risk; when... If the risk level is below the low threshold, the nozzle risk is classified as severe. Further compensation, cleaning, or maintenance strategies can be recommended based on the risk level.

[0126] Using the above evaluation method, even if the total number of abnormal nozzles is the same, a higher penalty can be imposed on continuous abnormal nozzle clusters, thereby more accurately reflecting the quality risks caused by continuous missed sprays, streak defects, or local deposition loss.

[0127] Example 4, Multi-round offset compensation example: In this embodiment, a multi-round offset compensation search is performed based on the nozzle state sequence and the weighted state of the nozzle.

[0128] First, the set of remaining abnormal nozzles and the set of compensated nozzles are obtained. For each candidate offset... , Not equal to 0, and Located at the preset maximum offset step Within the range, that is and Iterate through each abnormal nozzle in the remaining set of abnormal nozzles. ,like If the corresponding nozzle number exists in the compensation nozzle set, then a system is established based on the nozzle number... Normal nozzle compensation for abnormal nozzle Candidate mapping relationships. If Exceeding the nozzle number range, or If the corresponding nozzle is not a normal nozzle, then the abnormal nozzle cannot be compensated for at this candidate offset. For each candidate offset... Calculate the number of abnormal nozzles that can be covered in this round. And calculate the set of abnormal nozzles that are still not covered after using the candidate offset. Further calculate the remaining continuous anomaly penalty. In a preferred embodiment, The sum of the squares of the lengths of the continuous abnormal segments formed by the remaining abnormal nozzles is: ,in, Indicates the first The length of each remaining consecutive outlier segment. Calculate the candidate offset using the following scoring function. rating : ,in, To cover quantity weights, For residual risk weights, As the offset distance weight, This is the offset distance. Select. The highest candidate offset is used as the current wheel compensation offset, and the offset direction, offset amount, compensable abnormal nozzle number, and corresponding health compensation nozzle number of the wheel are recorded.

[0129] After completing one round of compensation, the compensated abnormal nozzles are marked as compensated nozzles and removed from the set of remaining abnormal nozzles. Then, the set of remaining abnormal nozzles, the remaining consecutive abnormal clusters, the compensation coverage, and the weighted state of the compensated nozzles are recalculated. Compensation stops if the set of remaining abnormal nozzles is empty, the maximum number of compensation rounds is reached, the weighted state of the compensated nozzles reaches the target threshold, or there are no valid candidate offsets; otherwise, the next round of compensation search begins.

[0130] For example, a nozzle has 1776 nozzles. The test results show 1382 normal nozzles and 394 abnormal nozzles. The initial weighted state of the nozzle... The value is 0.763. Set the maximum offset range. Candidate offset search is performed. Under the single-round maximum compensation strategy, +7 is selected as the first round compensation offset, which can compensate for 382 abnormal nozzles, leaving 12 abnormal nozzles. The compensation coverage is 96.95%. The weighted state of the nozzles after compensation is shown below. Increased to 0.993. When using a compensation strategy with a maximum of 3 compensation rounds or a full compensation strategy, the first round selects a +7 offset, the second round selects a -2 offset, cumulatively compensating for 394 abnormal nozzles, leaving 0 abnormal nozzles, with a compensation coverage rate of 100%. The weighted state of the nozzles after compensation is shown. The value is 1.000. Record the abnormal nozzle number, healthy compensation nozzle number, offset direction, offset amount, and compensation quantity in each round of compensation, and generate a compensation mapping table.

[0131] Example 5: Visualization of nozzle status and export of results: In this embodiment, after completing nozzle detection, nozzle status evaluation, and nozzle compensation search, the results are visualized and exported in a structured manner.

[0132] A nozzle status matrix or nozzle status bar, i.e., a nozzle status visualization, is automatically generated based on the total number of nozzles N. Each small square corresponds to a nozzle and is uniquely associated with its number. For nozzle detection modes based on foreground pixel counts, green represents normal nozzles and red represents abnormal nozzles. For nozzle status detection modes based on convolutional neural network models, green represents normal nozzles, yellow represents intermittent spray nozzles, and red represents failed nozzles. After compensation, abnormal nozzles that have been compensated for by healthy nozzles are displayed as bordered green squares or other distinguishing markers, while uncompensated abnormal nozzles remain displayed in red. The interface also displays a nozzle evaluation summary, including the total number of nozzles, the number of normal nozzles, the number of abnormal nozzles, the number of intermittent spray nozzles, the number of consecutive abnormal nozzle clusters, the maximum length of a consecutive abnormal cluster, the weighted state of the nozzle before compensation, the weighted state of the nozzle after compensation, the compensation coverage, the number of remaining abnormal nozzles, and recommended processing strategies.

[0133] The exported results can be in Excel, CSV, JSON, or database format. Taking an Excel file as an example, the exported file may include the following worksheets: ① Printhead Evaluation Summary Table, used to record detection time, printhead number, detection mode, total number of nozzles, number of normal nozzles, number of abnormal nozzles, compensation coverage, weighted status of printheads before and after compensation, and risk level; ② Per-Nozzle Status Table, used to record each nozzle number, ROI location, detection status, confidence level, number of foreground pixels, centroid offset, number of connected components, and whether compensation has been completed; ③ Compensation Mapping Table, used to record compensation rounds, offset direction, offset amount, abnormal nozzle numbers, healthy compensated nozzle numbers, and compensation results; ④ Compensation Round Statistics Table, used to record the number of compensations per round, the number of remaining abnormal nozzles, the remaining continuous abnormal penalty, the weighted status of printheads after compensation, and the running time. Through the above visualization and result export methods, process engineers can intuitively view the nozzle status and compensation effect, and can use the compensation mapping results for subsequent inkjet control programs, production re-inspection, quality traceability, or process parameter optimization.

[0134] This invention provides a printhead detection and orifice compensation method for inkjet equipment. It integrates image acquisition, orifice template loading and registration, orifice-by-orifice status identification, printhead weighted status evaluation, and orifice compensation decision-making into a complete processing flow. This eliminates the need for manual intervention at each stage of orifice anomaly handling, improving the automation level of orifice anomaly handling in inkjet equipment. An orifice-by-orifice status sequence is established based on orifice numbers, allowing for precise location of each abnormal orifice. A traceable compensation mapping relationship is also formed between abnormal orifice numbers and normally compensated orifice numbers, facilitating subsequent quality control and production traceability. The weighted status of the printhead is calculated using a weighted evaluation method for consecutive abnormal orifice clusters. This results in higher penalties for consecutive abnormal orifice clusters in the evaluation, avoiding the underestimation of risk caused by evaluating printhead status solely based on the number of abnormal orifices, and more accurately reflecting the true impact of consecutive abnormal orifices on inkjet quality. The orifice compensation algorithm comprehensively considers the number of abnormal orifices covered, the remaining consecutive anomaly penalty after compensation, and the offset distance. During multiple rounds of compensation, it prioritizes the elimination of high-risk consecutive abnormal areas, improving the effectiveness of the compensation strategy. It simultaneously supports both nozzle detection modes based on foreground pixel count and nozzle state detection modes based on convolutional neural network models. This retains the interpretability of rule-based detection while improving adaptability to different material colors, transparency, lighting conditions, and jetting states. It can output nozzle state visualization diagrams, compensation mapping diagrams, and structured reports, facilitating process debugging, quality re-inspection, production archiving, and subsequent control system calls for inkjet equipment. This invention is applicable to various inkjet equipment, including inkjet printing, inkjet coating, inkjet deposition, inkjet forming, and inkjet additive manufacturing, exhibiting excellent versatility and scalability.

[0135] In the above embodiments, although the steps are numbered S1, S2, etc., they are only specific embodiments given by the present invention. Those skilled in the art can adjust the execution order of S1, S2, etc. according to the actual situation. The scheme after adjusting the order is also within the protection scope of the present invention. It can be understood that in some embodiments, some or all of the above embodiments may be included.

[0136] like Figure 10 As shown, an inkjet printhead detection and nozzle compensation system according to an embodiment of the present invention includes an acquisition and determination module, a set determination module, a candidate mapping relationship establishment module, a compensation mapping relationship determination module, a judgment and update module, and an output module. The acquisition and determination module is used to: acquire and determine whether to perform nozzle compensation based on the nozzle detection data of the printhead, and obtain a judgment result. The set determination module is used to: determine the set of remaining abnormal nozzles and the set of compensation nozzles when the judgment result is yes. The candidate mapping relationship establishment module is used to: enumerate candidate offsets within a preset maximum offset step range, and for each candidate offset, traverse each abnormal nozzle in the set of remaining abnormal nozzles, and determine whether the nozzle corresponding to the abnormal nozzle after offset by the candidate offset belongs to the normal nozzle in the set of compensation nozzles; if so, establish a candidate mapping relationship in which the normal nozzle compensates for the abnormal nozzle. The compensation mapping relationship determination module is used to: perform compensation mapping. The relationship determination module is used to: calculate the score corresponding to each candidate offset according to the preset evaluation index, select the candidate offset with the highest score as the compensation offset for this round, and determine and record the compensation mapping relationship between each abnormal nozzle and the normal compensated nozzle in this round according to the candidate mapping relationship corresponding to the compensation offset in this round; the judgment update module is used to: mark the abnormal nozzles that have been compensated in this round as compensated nozzles, update the set of remaining abnormal nozzles, and determine whether the stopping condition is met. If not, it returns to the step of enumerating candidate offsets within the preset maximum offset step range, and uses the updated set of remaining abnormal nozzles as the current set of remaining abnormal nozzles to continue to execute the next round of compensation search; the output module is used to: output the nozzle detection results and nozzle compensation results. The nozzle compensation results include at least the offsets of each round of compensation and the compensation mapping relationship between the abnormal nozzle number and the corresponding normal nozzle number.

[0137] Optionally, in the above technical solution, the acquisition and determination module is specifically used for: acquiring nozzle orifice detection data of the nozzle; constructing a nozzle state sequence according to the nozzle number based on the nozzle detection data, wherein each nozzle state in the nozzle state sequence corresponds one-to-one with the nozzle number, wherein the nozzle state includes normal nozzles and abnormal nozzles; scanning the nozzle state sequence to identify a continuous abnormal nozzle cluster composed of adjacent abnormal nozzles, and calculating the weighted state of the nozzle based on the length of each continuous abnormal nozzle cluster; determining the risk level of the nozzle based on the weighted state, determining whether to perform nozzle compensation based on the risk level, and obtaining a judgment result.

[0138] Optionally, in the above technical solution, the set determination module is specifically used to: when the judgment result is yes, determine the set of remaining abnormal nozzles according to the nozzle state sequence, and select nozzles that can be used for compensation from the normal nozzles as the set of compensation nozzles.

[0139] Optionally, the above technical solution further includes an application module, which is used to: write the compensation mapping relationship into the inkjet control data of the inkjet device; control the printhead to perform inkjet operation according to the inkjet control data, wherein, for abnormal nozzles with established compensation mapping relationships, the inkjet action of the abnormal nozzle is stopped, and the normal compensation nozzle corresponding to the abnormal nozzle performs the inkjet action in place of the abnormal nozzle according to the compensation mapping relationship; and generate a nozzle status visualization diagram and a compensation mapping based on the offset of each round of compensation in the nozzle compensation result and the compensation mapping relationship between the abnormal nozzle number and the corresponding normal nozzle number. The nozzle status visualization diagram uses different colors or markers to distinguish normal nozzles, abnormal nozzles, and compensated nozzles. The compensation mapping diagram is used to display the compensation correspondence between each abnormal nozzle and its corresponding normal compensated nozzle. The nozzle detection results and nozzle compensation results are exported as data files according to a preset format. The data files include a nozzle status table and a compensation mapping table. The nozzle status table records the nozzle number, nozzle status, and whether each nozzle has been compensated. The compensation mapping table records the offset of each round of compensation and the compensation mapping relationship between the abnormal nozzle number and the corresponding normal nozzle number.

[0140] Optionally, in the above technical solution, the candidate mapping relationship establishment module is specifically used to: denot the preset maximum offset step number as... The candidate offset is denoted as Candidate offset The enumeration range is: For each enumerated candidate offset Iterate through each abnormal nozzle in the remaining set of abnormal nozzles, and record the nozzle number of the abnormal nozzle as... The abnormal nozzle is adjusted according to the candidate offset. The offset nozzle number is recorded as Determine the nozzle number Does the corresponding nozzle belong to the normal nozzle in the compensation nozzle set? If the nozzle number is... If the corresponding nozzle belongs to the normal nozzle in the compensation nozzle set, then a candidate mapping relationship is established for the normal nozzle to compensate for the abnormal nozzle. The candidate mapping relationship records the nozzle number of the abnormal nozzle. The nozzle number is the same as the normal nozzle number. The correspondence between them; if the nozzle number If the corresponding nozzle does not belong to the normal nozzle in the compensation nozzle set, then the abnormal nozzle is in the candidate offset. The following is not compensated; after traversal, the offset of each abnormal nozzle in the remaining abnormal nozzle set at the current candidate offset is obtained. Candidate mapping relationships.

[0141] Optionally, in the above technical solution, the compensation mapping relationship determination module is further specifically used to: denot the candidate offset as... Candidate offset The number of abnormal nozzles that can be covered in this round is recorded as follows: Candidate offsets will be used. The number of consecutive abnormal segments formed by abnormal nozzles that are still not covered after compensation is denoted as , will the The length of each consecutive abnormal segment is denoted as . And calculate the remaining continuous anomaly penalty. : Candidate offset The absolute value is denoted as ; Obtain the preset coverage weight Preset residual risk weights and preset offset distance weight ; Calculate candidate offsets Corresponding rating : Among them, the coverage quantity weight Residual risk weights and offset distance weight All are positive numbers.

[0142] Optionally, in the above technical solution, the acquisition and determination module is further specifically used for: acquiring the nozzle detection image of the nozzle, the nozzle detection image being obtained by an image acquisition device capturing the detection pattern sprayed by the nozzle; loading the nozzle template corresponding to the nozzle, the nozzle template recording the ROI detection box, center point coordinates, and nozzle number of each nozzle; calculating the image registration relationship between the nozzle detection image and the nozzle template based on the positioning identifier in the nozzle detection image, the image registration relationship being an affine transformation relationship or a homography transformation relationship; mapping each ROI detection box in the nozzle template to the nozzle detection image based on the image registration relationship, obtaining the ROI detection area corresponding to each nozzle; for each nozzle, performing grayscale processing and threshold segmentation processing on the ROI detection area, counting the number of foreground pixels in the ROI detection area, when the number of foreground pixels is less than a preset pixel threshold, determining the nozzle state of the nozzle as an abnormal nozzle, when the number of foreground pixels is greater than or equal to the preset pixel threshold, determining the nozzle state of the nozzle as a normal nozzle; generating nozzle detection data of the nozzle based on the nozzle state of each nozzle.

[0143] Optionally, in the above technical solution, the determination module is further specifically used to: record the number of consecutive abnormal nozzle clusters identified by the scanned nozzle state sequence as... , will the The length of a continuous cluster of anomalous nozzles is denoted as Obtain the preset continuous anomaly penalty coefficient. According to the first Length of a continuous abnormal nozzle cluster and continuous anomaly penalty coefficient Calculate the first Weighted anomalies of a continuous cluster of anomalous nozzles : The weighted anomalies of each consecutive abnormal nozzle cluster are summed to obtain the total weighted anomaly. : ; Get the total number of nozzles on the nozzle Based on the total weighted outlier and the total number of nozzles Calculate the weighted state of the nozzle. : ,in, The function represents the The calculation results are limited to the range of 0 to 1.

[0144] The nozzle status also includes intermittent spraying status. The determination module is further specifically used for: for each nozzle, inputting the ROI detection region into a trained convolutional neural network model; the convolutional neural network model outputs the nozzle status category and corresponding confidence level for that nozzle. The nozzle status categories include normal state, intermittent spraying state, and failure state. Nozzles corresponding to the normal state are marked as normal nozzles, and nozzles corresponding to the failure state are marked as abnormal nozzles. Based on a preset strategy, it is determined whether to mark nozzles corresponding to the intermittent spraying state as abnormal nozzles. If the preset strategy is to mark nozzles corresponding to the intermittent spraying state as abnormal nozzles, then that nozzle is marked as an abnormal nozzle. If the preset strategy is to mark nozzles corresponding to the intermittent spraying state as nozzles to be processed, then that nozzle is marked as a nozzle to be processed. The marking results of each nozzle are sorted according to its number and constructed into a nozzle status sequence. In another embodiment, such as Figure 11As shown, the inkjet equipment includes multiple printheads, each containing multiple nozzles. These nozzles are arranged in a predetermined order and assigned unique nozzle numbers. During inspection, the inkjet equipment controls the printheads to spray a preset inspection pattern onto the inspection medium. This pattern includes inspection lines, ink dots, spray areas, or spray trajectories corresponding to each nozzle. An image acquisition device captures the inspection pattern on the inspection medium, obtaining nozzle inspection images. This device can be an industrial camera, a line scan camera, an area scan camera, or a microscope imaging device. The nozzle inspection images are transmitted to a computer processing unit, which executes all the algorithms and data processing operations for detection and compensation. Inside the computer processing unit, the detection data acquisition module is responsible for acquiring the nozzle detection data. This data can be calculated from the detection image and the nozzle template, or it can be read from a pre-exported Excel file, CSV file, or other structured data file. The nozzle detection data includes at least the nozzle number and the nozzle status information corresponding to the nozzle number. It may also include one or more of the following: nozzle position, ROI detection box of the nozzle, detection confidence, number of foreground pixels, centroid offset, number of connected components, droplet area, droplet morphology features, or jet trajectory features. The template matching module loads the nozzle template corresponding to the nozzle head. This template records the ROI detection box of each nozzle, the center point coordinates of the ROI detection box, and the nozzle number. When the current detection image undergoes translation, scaling, rotation, shearing, or perspective changes relative to the nozzle template, this module calculates the image registration relationship (including affine transformation or homography transformation) based on the identifiers, positioning graphics, control points, or feature points in the detection image. Based on this registration relationship, the ROI detection box in the nozzle template is mapped to the current detection image, obtaining the ROI detection area corresponding to each nozzle. The nozzle state recognition module performs state recognition on each nozzle based on the mapped ROI detection area. It can choose a nozzle detection mode based on foreground pixel count, determining normal or abnormal status through grayscale conversion, threshold segmentation, and foreground pixel counting. Alternatively, it can choose a nozzle state detection mode based on a convolutional neural network model, where the network outputs three state categories: normal, intermittent spraying, or failed, along with their confidence levels, and maps each nozzle as a normal nozzle, intermittent spraying nozzle, or failed nozzle. The state evaluation module constructs a nozzle state sequence of length N, sorted by nozzle number, where N is the total number of nozzles in the nozzle head. It then scans this sequence to identify consecutive abnormal nozzle clusters composed of adjacent abnormal nozzles, recording the starting nozzle number, ending nozzle number, cluster length, and the set of nozzles within each cluster. Based on the length of each consecutive abnormal nozzle cluster, the weighted state S of the nozzle head is calculated. The calculation method is as follows: Let the length of the m-th consecutive abnormal nozzle cluster be L_m, and the consecutive abnormality penalty coefficient be λ, then the total weighted abnormality is: The weighted state of the nozzle: ,in The function will The calculation results are limited to the range of 0 to 1. The status evaluation module then compares S with preset high and low thresholds to determine the nozzle's risk level (including minor, medium, and severe risk), and determines whether nozzle compensation is necessary based on the risk level. When the compensation decision module determines that compensation is required, it identifies the remaining abnormal nozzle set and the compensation nozzle set, and performs multiple rounds of nozzle compensation search: for the remaining abnormal nozzle set, within a preset maximum offset step... Enumerate candidate offsets within the range ( Number each abnormal nozzle. Determine the position after offset If a nozzle belongs to the set of normal nozzles in the compensation nozzle set, then establish a candidate mapping relationship, and then process each candidate offset. Calculate the score: ,in This indicates the number of abnormal nozzles covered by the offset. This indicates the continuous abnormal penalty for the remaining uncovered abnormal nozzles ( This represents the number of consecutive outlier segments. For the first (segment length) This is the offset distance. , , The weights are coverage quantity, remaining risk, and offset distance. The system selects the offset with the highest score to perform the current round of compensation. The abnormal nozzles that have been compensated in this round are marked as compensated nozzles, and the set of remaining abnormal nozzles is updated. Then, it determines whether the stopping conditions are met (the set of remaining abnormal nozzles is empty, the number of compensation rounds reaches the preset maximum number of compensation rounds, the weighted state of the compensated printhead reaches the preset target state, there are no valid candidate compensation mappings, or other user-defined stopping conditions are met). If not, the next round of compensation search continues; if met, the process stops. After compensation is completed, the jet control unit writes the compensation mapping relationship into the inkjet equipment's jet control data and controls the printhead to perform jet operations according to the jet control data. For abnormal nozzles with established compensation mapping relationships, the jetting action of the abnormal nozzle is stopped, and the corresponding normal compensated nozzle replaces the abnormal nozzle in performing the jetting action according to the compensation mapping relationship. The output module outputs the nozzle detection results and orifice compensation results. The visualization module generates an orifice status visualization diagram and a compensation mapping diagram based on the offset of each round of compensation in the orifice compensation results and the compensation mapping relationship between abnormal orifice numbers and their corresponding normal orifice numbers. In the orifice status visualization diagram, each orifice is distinguished by different colors or markers to identify normal, abnormal, and compensated orifices. The compensation mapping diagram is used to display the compensation correspondence between each abnormal orifice and its corresponding normal compensated orifice. The display output unit presents the above visualization results, along with structured data such as the nozzle evaluation summary, orifice status table, compensation mapping table, and compensation round statistics table, to the operator. Simultaneously, it exports data files in preset formats (Excel, CSV, JSON, or database) for process debugging, quality re-inspection, production archiving, or subsequent control system calls.

[0145] It should be noted that the beneficial effects of the printhead detection and orifice compensation system for inkjet equipment provided in the above embodiments are the same as those of the printhead detection and orifice compensation method for inkjet equipment described above, and will not be repeated here. Furthermore, the system provided in the above embodiments is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to the actual situation to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, and will not be repeated here.

[0146] An electronic device according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the printhead detection and nozzle compensation method of any of the above-described inkjet devices. Another embodiment of the present invention includes a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the printhead detection and nozzle compensation method of any of the above-described inkjet devices.

[0147] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for printhead detection and nozzle compensation in an inkjet printer, characterized in that, include: Based on the nozzle orifice detection data, determine whether orifice compensation should be performed and obtain the judgment result; When the judgment result is yes, determine the remaining abnormal nozzle set and the compensation nozzle set; Within a preset maximum offset step range, candidate offsets are enumerated. For each candidate offset, each abnormal nozzle in the set of remaining abnormal nozzles is traversed to determine whether the nozzle corresponding to the abnormal nozzle after offset by the candidate offset belongs to the normal nozzle in the set of compensated nozzles. If so, then establish a candidate mapping relationship for the abnormal nozzle to be compensated by the normal nozzle; For each candidate offset, the score corresponding to the candidate offset is calculated according to the preset evaluation index. The candidate offset with the highest score is selected as the compensation offset for this round. According to the candidate mapping relationship corresponding to the compensation offset for this round, the compensation mapping relationship between each abnormal nozzle and the normal compensation nozzle for this round is determined and recorded. Mark the abnormal nozzles that have been compensated in this round as compensated nozzles, update the set of remaining abnormal nozzles, determine whether the stopping condition is met, if not, return to the step of enumerating candidate offsets within the preset maximum offset step range, and use the updated set of remaining abnormal nozzles as the current set of remaining abnormal nozzles to continue the next round of compensation search. Output nozzle detection results and nozzle compensation results. The nozzle compensation results include at least the offset of each round of compensation and the compensation mapping relationship between abnormal nozzle numbers and corresponding normal nozzle numbers.

2. The method for printhead detection and nozzle compensation of an inkjet device according to claim 1, characterized in that, Based on the nozzle orifice detection data, determine whether orifice compensation should be performed, and obtain the judgment result, including: Obtain the nozzle orifice detection data of the nozzle; Based on the nozzle detection data, a nozzle state sequence is constructed by sorting the nozzle numbers. Each nozzle state in the nozzle state sequence corresponds one-to-one with the nozzle number. The nozzle state includes normal nozzles and abnormal nozzles. Scan the nozzle state sequence to identify a continuous cluster of abnormal nozzles composed of adjacent abnormal nozzles, and calculate the weighted state of the nozzle based on the length of each continuous cluster of abnormal nozzles. The risk level of the nozzle is determined based on the weighted state, and the decision on whether to perform nozzle compensation is based on the risk level, thus obtaining a judgment result.

3. The method for printhead detection and nozzle compensation of an inkjet device according to claim 1, characterized in that, When the judgment result is yes, the remaining abnormal nozzle set and the compensation nozzle set are determined, including: When the judgment result is yes, the set of remaining abnormal nozzles is determined according to the nozzle state sequence, and nozzles that can be used for compensation are selected from the normal nozzles as the set of compensation nozzles.

4. A method for printhead detection and nozzle compensation in an inkjet device according to any one of claims 1 to 3, characterized in that, Following the output nozzle detection results and nozzle compensation results, the following is also included: Write the compensation mapping relationship into the inkjet control data of the inkjet device; The nozzle is controlled to perform a spraying operation according to the spraying control data. For abnormal nozzles for which the compensation mapping relationship has been established, the spraying action of the abnormal nozzle is stopped, and the normal compensation nozzle corresponding to the abnormal nozzle performs the spraying action in place of the abnormal nozzle according to the compensation mapping relationship. Based on the offset of each round of compensation in the nozzle compensation result and the compensation mapping relationship between the abnormal nozzle number and the corresponding normal nozzle number, a nozzle status visualization diagram and a compensation mapping diagram are generated. In the nozzle status visualization diagram, each nozzle is distinguished by different colors or marks to distinguish normal nozzles, abnormal nozzles and compensated nozzles. The compensation mapping diagram is used to display the compensation correspondence between each abnormal nozzle and the corresponding normal compensated nozzle. The nozzle detection results and the nozzle compensation results are exported as a data file according to a preset format. The data file includes a nozzle status table and a compensation mapping table. The nozzle status table is used to record the nozzle number, nozzle status and whether each nozzle has been compensated. The compensation mapping table is used to record the offset of each round of compensation and the compensation mapping relationship between abnormal nozzle numbers and corresponding normal nozzle numbers.

5. A printhead detection and nozzle compensation system for an inkjet printer, characterized in that, It includes a determination module, a set determination module, a candidate mapping relationship establishment module, a compensation mapping relationship determination module, a judgment and update module, and an output module; The acquisition and determination module is used to: acquire and determine whether to perform nozzle compensation based on the nozzle orifice detection data, and obtain a judgment result; The set determination module is used to: determine the remaining abnormal nozzle set and the compensation nozzle set when the judgment result is yes; The candidate mapping relationship establishment module is used to: enumerate candidate offsets within a preset maximum offset step range; for each candidate offset, traverse each abnormal nozzle in the remaining abnormal nozzle set, and determine whether the nozzle corresponding to the abnormal nozzle after offset by the candidate offset belongs to the normal nozzle in the compensation nozzle set; if so, establish a candidate mapping relationship for the normal nozzle to compensate the abnormal nozzle. The compensation mapping relationship determination module is used to: calculate the score corresponding to each candidate offset according to the preset evaluation index, select the candidate offset with the highest score as the compensation offset for this round, and determine and record the compensation mapping relationship between each abnormal nozzle and the normal compensation nozzle for this round according to the candidate mapping relationship corresponding to the compensation offset for this round. The judgment and update module is used to: mark the abnormal nozzles that have been compensated in this round as compensated nozzles, update the set of remaining abnormal nozzles, determine whether the stopping condition is met, and if not, return to the step of enumerating candidate offsets within the preset maximum offset step range, and use the updated set of remaining abnormal nozzles as the current set of remaining abnormal nozzles to continue the next round of compensation search. The output module is used to output nozzle detection results and nozzle compensation results. The nozzle compensation results include at least the offset of each round of compensation and the compensation mapping relationship between abnormal nozzle numbers and corresponding normal nozzle numbers.

6. The printhead detection and nozzle compensation system for an inkjet device according to claim 5, characterized in that, The acquisition and determination module is specifically used for: Obtain the nozzle orifice detection data of the nozzle; Based on the nozzle detection data, a nozzle state sequence is constructed by sorting the nozzle numbers. Each nozzle state in the nozzle state sequence corresponds one-to-one with the nozzle number. The nozzle state includes normal nozzles and abnormal nozzles. Scan the nozzle state sequence to identify a continuous cluster of abnormal nozzles composed of adjacent abnormal nozzles, and calculate the weighted state of the nozzle based on the length of each continuous cluster of abnormal nozzles. The risk level of the nozzle is determined based on the weighted state, and the decision on whether to perform nozzle compensation is based on the risk level, thus obtaining a judgment result.

7. The printhead detection and nozzle compensation system for an inkjet printer according to claim 5, characterized in that, The set determination module is specifically used to: when the judgment result is yes, determine the set of remaining abnormal nozzles according to the nozzle state sequence, and select nozzles that can be used for compensation from the normal nozzles as the set of compensation nozzles.

8. A printhead detection and nozzle compensation system for an inkjet device according to any one of claims 5 to 7, characterized in that, It also includes an application module, which is used for: Write the compensation mapping relationship into the inkjet control data of the inkjet device; The nozzle is controlled to perform a spraying operation according to the spraying control data. For abnormal nozzles for which the compensation mapping relationship has been established, the spraying action of the abnormal nozzle is stopped, and the normal compensation nozzle corresponding to the abnormal nozzle performs the spraying action in place of the abnormal nozzle according to the compensation mapping relationship. Based on the offset of each round of compensation in the nozzle compensation result and the compensation mapping relationship between the abnormal nozzle number and the corresponding normal nozzle number, a nozzle status visualization diagram and a compensation mapping diagram are generated. In the nozzle status visualization diagram, each nozzle is distinguished by different colors or marks to distinguish normal nozzles, abnormal nozzles and compensated nozzles. The compensation mapping diagram is used to display the compensation correspondence between each abnormal nozzle and the corresponding normal compensated nozzle. The nozzle detection results and the nozzle compensation results are exported as a data file according to a preset format. The data file includes a nozzle status table and a compensation mapping table. The nozzle status table is used to record the nozzle number, nozzle status and whether each nozzle has been compensated. The compensation mapping table is used to record the offset of each round of compensation and the compensation mapping relationship between abnormal nozzle numbers and corresponding normal nozzle numbers.

9. An electronic device, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the printhead detection and nozzle compensation method for an inkjet device as described in any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements a printhead detection and nozzle compensation method for an inkjet device as described in any one of claims 1 to 4.