Label editing and printing method and system based on physical resolution of printer

By establishing the physical resolution conversion relationship of the printer and using visual comparison technology, the consistency and reliability issues in label editing and printing software have been resolved, achieving consistency in accuracy and quality of labels during editing, printing and inspection processes, making it suitable for high-frequency and unattended printing scenarios.

CN121996178APending Publication Date: 2026-05-08SHANGHAI YAPEI TRADING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI YAPEI TRADING CO LTD
Filing Date
2026-01-27
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing label editing and printing software does not take into account the physical resolution of the printer, resulting in size deviations, positional drifts, and accuracy degradation between the display effect of the editing interface and the actual printing results, making it difficult to meet the requirements of high consistency and high reliability in industrial applications.

Method used

By establishing a physical resolution conversion relationship for printers, label templates are constructed based on this relationship, editing constraints are applied, printing instructions are generated, and print quality is ensured through visual comparison, including image alignment, brightness uniformity, and defect area analysis.

Benefits of technology

It achieves consistency and reliability of labels during the editing and printing process, ensuring consistent accuracy and quality across multiple editing, printing, and inspection processes, and is suitable for high-frequency and unattended printing scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121996178A_ABST
    Figure CN121996178A_ABST
Patent Text Reader

Abstract

The invention relates to a label editing and printing system based on physical resolution of a printer, which comprises the following steps of: establishing a conversion relation between an editing unit and a printing point according to a physical resolution parameter of a target printer, establishing a label template, and configuring an object to form a layer, the object is edited, a printing task is established, the process of establishing the printing task comprises the steps of mapping a label template completed by configuring the object into a printing instruction based on a conversion relation and executing the printing task, and the process of executing the printing task comprises the steps that a target printer executes the printing instruction, and cooperative work among label design, printing output and detection verification is achieved. And the consistency and the reliability of the label in multiple editing, printing and detection processes are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a label editing and printing system based on the physical resolution of a printer. Background Technology

[0002] Labels serve as an important carrier for industrial production, logistics management, and product traceability, and are widely used in manufacturing, warehousing, medical, and retail industries. Existing label editing and printing software typically constructs label templates using screen pixels or components, and then adapts and outputs them through drivers or commands during the printing stage.

[0003] However, printers have a fixed physical resolution during actual operation, and their printing instructions exhibit discrete characteristics in terms of position, size, and barcode magnification. Because existing software does not incorporate printer physical resolution constraints during the editing stage, there are issues such as size deviations, positional drifts, and accuracy degradation after multiple export and import operations between the displayed editing interface and the actual printed results.

[0004] Furthermore, with the improvement of industrial automation, labels are no longer only used for printing output, but are also gradually involved in printing quality inspection, visual comparison and production cycle control. Existing solutions generally lack systematic support for printing task scheduling, printing image output and collaborative work with visual inspection systems, making it difficult to meet the needs of industrial applications with high consistency and high reliability. Summary of the Invention

[0005] In view of the technical problems existing in the background art, the present invention aims to provide a label editing and printing method and system based on the physical resolution of the printer, so that the label is constrained by the physical resolution of the printer during the editing stage.

[0006] To solve the above technical problems, the present invention adopts the following technical solution: This label editing and printing method based on the physical resolution of the printer includes the following steps: establishing a conversion relationship between editing units and printing points according to the physical resolution parameters of the target printer, establishing a label template, configuring objects to form layers, the method of configuring objects includes: selecting objects and adding them to the label template, editing the objects, establishing a print job, the process of establishing a print job includes: mapping the label template completed by configuring objects into print instructions based on the conversion relationship, executing the print job, the process of executing the print job includes: the target printer executing the print instructions.

[0007] In this scheme, one object corresponds to one layer, which facilitates layout. Complex label templates can be edited in layers with controllable editing. Printing instructions are generated based on conversion relationships. The position, size, and shape parameters of the object are integer multiples of the print points, and no intermediate states that the printer cannot express are generated, ensuring the consistency of the object's position and size in the editing and printing stages.

[0008] Preferably, the process of establishing a printing task further includes: generating a reference image based on the same label template; executing the printing task further includes: a visual acquisition device acquiring a scanned image of the printed label; aligning the scanned image with the reference image and comparing the differences; the process of aligning the scanned image with the reference image includes: obtaining a homography matrix based on feature point matching and performing perspective transformation and / or affine fine-tuning; the process of comparing the scanned image with the reference image includes: unifying the brightness of the scanned image and the reference image; performing differential, thresholding, morphological denoising, connected component analysis and contour analysis within the printing area mask of the reference image; extracting defect areas; generating comparison results based on the area, number and type of defect areas; and an audible and visual alarm device outputting alarm information based on the judgment results.

[0009] This solution reduces false alarms caused by changes in lighting and slight displacement by using alignment, brightness normalization, and printing area masking, thereby confirming the printing results and ensuring the quality of subsequent printing.

[0010] Preferably, the selected object is added to the label template to generate anchor points. The methods for editing the object include: adding object content, setting the length and width of the object, setting the position of the anchor point on the label template, scaling the barcode object in a step-like manner, and importing Excel to batch replace the fields of the text object.

[0011] In this solution, the layer position can be easily adjusted based on the anchor point, and the barcode object can be scaled in a step-like manner so that its size can only fall within the discrete range that the printer can output stably, making batch replacement convenient.

[0012] Preferably, the methods for creating a label template include: opening a saved label template, creating a new label template, or importing print instructions.

[0013] This solution supports the reuse of label templates.

[0014] Preferably, the text object includes a time field, and the method for editing the text object includes: setting the content of the time field to be automatically generated based on the current time, the print time, or a preset rule.

[0015] In this solution, the time field update logic is bound to the printing process, reducing manual configuration and maintaining page stability. It is suitable for high-frequency printing and unattended printing scenarios.

[0016] Preferably, the process of creating a print job also includes setting a trigger time or time window.

[0017] This solution is suitable for high-frequency printing and unattended printing scenarios.

[0018] This label editing and printing system based on printer physical resolution includes a physical resolution conversion module, an editing constraint module, an object management module, a print instruction generation module, a print task scheduling module, and a print control module. The physical resolution conversion module is used to establish the conversion relationship between editing units and print points. The editing constraint module is used to apply print physical constraints to objects. The object management module is used to manage objects such as text, graphics, and barcodes. The print instruction generation module is used to map label templates into print instructions based on the conversion relationship. The print task scheduling module is used to distribute print tasks to the print control module of the target printer. The print control module is used to control the target printer to execute print instructions.

[0019] In this scheme, the physical resolution conversion module establishes the conversion relationship between editing units and printing points, and the editing constraint module continuously applies printing physical constraints to the object based on the conversion relationship during the editing process.

[0020] Preferably, it also includes a print instruction parsing module, which is used to perform structured parsing of print instructions based on conversion relationships and reconstruct label templates.

[0021] This solution achieves an equivalent mapping and bidirectional conversion between label templates and printing instructions, ensuring consistency after multiple rounds of export and import, and allowing the same label template to be reused.

[0022] Preferably, the system further includes an image output module, an image acquisition module, and a visual comparison module. The image output module is used to generate a reference image based on a label template. The image acquisition module is used to acquire printed labels to generate scanned images. The visual comparison module is used to align the scanned images with the reference images and compare the differences.

[0023] In this solution, the printed labels are inspected and compared to ensure the quality of subsequent printing.

[0024] Preferably, the printing control module includes a printing communication unit, a status analysis and process linkage unit, a scanning control unit, a scanning stitching unit, a visual comparison unit, and an alarm linkage unit. The printing communication unit is used to send printing instructions to the printer and receive feedback data. The status analysis and process linkage unit is used to analyze the status signals in the feedback data stream and drive the scanning control module. The scanning control unit is used to start and stop the image acquisition module and maintain the scanning status file and session directory. The scanning stitching unit is used to read multiple frames of images in the session directory and stitch them together to generate a scanned image. The visual comparison unit is used to align, differentiate, mask, denoise, extract defects, and determine the template and the scanned image. The alarm linkage unit is used to control the audible and visual alarm device.

[0025] In this scheme, multiple frames of images are stitched together to generate a scanned image, which is then compared with the scanned image.

[0026] The beneficial effects of this invention are that it enables collaborative work between label design, printing output, and testing and verification, ensuring the consistency and reliability of labels during multiple editing, printing, and testing processes. Therefore, this invention has substantial features and progress compared to existing technologies. Attached Figure Description

[0027] The following description, in conjunction with the accompanying drawings, details the embodiments and working principles of the present invention.

[0028] Figure 1 This is a flowchart of the present invention.

[0029] Figure 2 This is a flowchart illustrating the creation of label templates and configuration objects in this invention.

[0030] Figure 3 This is a structural block diagram of the present invention. Detailed Implementation

[0031] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the implementation of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0032] In the description of this application, it should be understood that the terms "upper" and "lower" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.

[0033] In the description of this application, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.

[0034] An embodiment of this invention provides a label editing and printing method based on the printer's physical resolution, comprising the following steps: Scan the printing device and select the target printer; Establish the conversion relationship between editing units and print dots based on the physical resolution parameters of the target printer; Creating a label template involves several methods: opening a saved label template, creating a new label template, or importing print instructions. Configuring objects to form layers involves selecting objects and adding them to the label template to generate anchor points. Editing objects involves adding object content, setting the object's length and width, setting the anchor point's position on the label template, scaling barcode objects in a stepped manner, importing data from Excel to batch replace text object fields, and setting the time field content to be automatically generated based on the current time, print time, or preset rules. Creating a print job involves: mapping the label template completed by the configuration object into print instructions based on the conversion relationship, generating a reference image based on the same label template, and setting the trigger time or time window. The printing task is executed, and the process includes: the target printer executes the printing instruction; the visual acquisition device acquires a scanned image of the printed label; the scanned image is aligned with a reference image and the differences are compared; the process of aligning the scanned image with the reference image includes: obtaining the homography matrix based on feature point matching and performing perspective transformation and / or affine fine-tuning; the process of comparing the scanned image with the reference image includes: unifying the brightness of the scanned image and the reference image; performing differential analysis, thresholding, morphological denoising, connected component analysis, and contour analysis within the printing area mask of the reference image; extracting defect areas; generating comparison results based on the area, number, and type of defect areas; and the audible and visual alarm device outputs alarm information based on the judgment results.

[0035] In this embodiment, multiple printers can be managed in batches. After selecting the target printer, label templates are created and objects are edited. Based on the physical resolution of the target printer, the number of printing dots per millimeter (DPMM = DPI / 25.4) is calculated. During the editing stage, millimeters are used as the smallest unit for creating label templates and editing objects.

[0036] Label templates can be reused or created entirely. When editing an object, an XY coordinate system is generated for the operator's reference, facilitating anchor point adjustments. Objects include text, images, barcodes, QR codes, etc. Each object corresponds to a layer for easy editing and layout. QR code sizes are snapped to the pre-calculated step table corresponding to ZPL magnification (1-10) during editing / dragging (QR code step-like size constraints). Barcode widths are snapped to the step table corresponding to module width points (1-10). This means the scaling of QR codes and barcodes is discrete, not continuous. The time field of text objects participates in layout calculations during the editing stage, and its size changes can be predicted by the system. When the content of the time field changes, the system automatically adjusts the position of related objects according to preset layout rules. This layout process is completed without violating physical printing constraints. Multiple fields of text objects can be saved as field templates for batch import and export, facilitating editing. Each field template includes at least field type, display rules, and update logic, allowing reuse in different label templates to quickly build labels with consistent structure but different content. This is suitable for batch printing and multi-template production scenarios.

[0037] The printing / external exchange side uses ZPL as the instruction expression. During the rendering / output stage, millimeters are converted to dots (the smallest unit for printing). When exporting ZPL, key values ​​are integerized to dots (quantizeDot) to reduce size drift caused by decimal conversion. When importing ZPL, reconstruction is completed with "1 dot ≈ 1 px (edit internal rendering scale)" and quantization is performed on fields such as font height to avoid the risk of unreadable data due to arbitrary width. Barcode height supports pixel / dot quantization strategy. The system supports ZPL export and ZPL reverse import (parsing instruction fragments such as ^FO, ^FB, ^A, ^BQN, ^BY / ^BCN, ^GB, etc. and reconstructing the canvas). Printing tasks include printing time, number of prints, and printing conditions.

[0038] Specifically, the print point is the smallest control unit that can be stably output under the target printer and its resolution parameters; the physical constraints of printing, namely the editing size and position, are integer multiples of the print point; the template is saved and managed internally by the system as structured data (JSON template file) for describing objects in the editing state; the print command is the control command used by thermal or thermal transfer printers; the update logic of the time field is bound to the label printing process, rather than relying on external scripts to trigger it; each layer records the object type, display order, editing state, and printing participation state respectively; by controlling the display order and editing state of the layers, the system can achieve occlusion management, editing locking, and selective export between complex label objects, thereby ensuring the consistency of the label in the editing and printing stages; the fields of text objects can be saved as field templates, and the field templates at least contain field types, display rules, and update logic; multiple fields of multiple text objects can be saved and imported in batches; the visual editing of label templates and objects is a mature technology.

[0039] A label editing and printing system based on printer physical resolution includes a physical resolution conversion module, an editing constraint module, an object management module, a print instruction generation module, a print task scheduling module, and a print control module. The physical resolution conversion module is used to establish the conversion relationship between editing units and print points. The editing constraint module is used to apply print physical constraints to objects. The object management module is used to manage objects such as text, graphics, and barcodes. The print instruction generation module is used to map label templates into print instructions based on the conversion relationship. The print task scheduling module is used to distribute print tasks to the print control module of the target printer. The print control module is used to control the target printer to execute print instructions.

[0040] It also includes an image output module, an image acquisition module, and a visual comparison module. The image output module is used to generate a reference image based on a label template. The image acquisition module is used to acquire printed labels to generate scanned images. The visual comparison module is used to align the scanned images with the reference images and compare the differences.

[0041] The printing control module includes a printing communication unit, a status analysis and process linkage unit, a scanning control unit, a scanning stitching unit, a visual comparison unit, and an alarm linkage unit. The printing communication unit sends printing commands to the printer and receives feedback data. The status analysis and process linkage unit analyzes the status signals in the feedback data stream and drives the scanning control module. The scanning control unit starts and stops the image acquisition module and maintains the scanning status file and session directory. The scanning stitching unit reads multiple frames of images from the session directory and stitches them together to generate a scanned image. The visual comparison unit aligns, differentiates, masks, denoises, extracts and judges defects between the template and the scanned image. The alarm linkage unit controls the audible and visual alarm device.

[0042] In this embodiment, the printing control module is a Linux motherboard, which, along with the vision comparison module and the image acquisition module, is located at the printer. The printing execution and vision detection are uniformly time-bound and linked on the motherboard, making it suitable for unattended scenarios. Other modules are located on the host computer, and the reference image files are saved or transferred to the file system of the Linux motherboard according to a preset path.

[0043] After receiving a print job, Linux loads the current print template file, replaces the time field if necessary, and then sends it out. It sends a reset or cleanup command to the printer to clear the status, then sends a label template to trigger printing. In parallel, it starts a status reading thread. The status parsing and process linkage unit reads the status data stream returned by the printer through the USB communication interface and parses it to obtain the status signals used for process linkage.

[0044] When the "Start Scan" signal is parsed or the printing trigger condition is met, the CIS scanning process is started and the image acquisition state is entered. Scan status information is written for subsequent mutual exclusion and tracking. After the scan is started, the warm-up waiting window is entered to check whether at least one valid image frame has been generated in the session directory. If no valid frame is generated within the preset warm-up timeout, an exception message is output and the fault tolerance strategy is executed.

[0045] The scanning process stops after the preset scanning time is met or a "stop scanning" signal is received. It reads multiple frames of images from the session directory and stitches them together in frame order to generate a scanned image. The scanned image is aligned with the reference image and its brightness is normalized. Differentiation and binarization are performed within the preset ROI or the printing area mask generated by the template. Defect areas are extracted by combining morphological processing and connected component / contour analysis. OK / NG judgment is given based on indicators such as defect area, quantity, or type. The alarm result is output through an audible and visual alarm device. It supports triggering printing, label template switching, re-inspection, or stopping via external buttons or input devices. Mutual exclusion control is set for printing, scanning, and inspection actions to avoid device conflicts caused by concurrency.

[0046] The print task scheduling module distributes print tasks to the print control module immediately or at a specified time. The print control module controls the printer to execute print commands at a specified time or under specified conditions, improving the automation and controllability of the printing process. The image acquisition module is a CIS or camera device. The audible and visual alarm device includes a tri-color light and a buzzer, and the motherboard controls its brightness, color, or sound through a serial communication protocol. The process linkage signals include at least one or more of the following: start scan signal, stop scan signal, and automatic reprint signal. The scan status file records the scan process number and session directory path to achieve scan mutual exclusion and anomaly tracing. Multiple frames of images are stitched line by line according to file name order or time order to generate a single bitmap file.

[0047] The above description represents the preferred embodiments of the present invention. It should be noted that the scope of protection of the present invention is not limited thereto. For those skilled in the art, various improvements, modifications, or equivalent substitutions can be made without departing from the equivalent inventive concept disclosed in the present invention, and these modifications and substitutions are also considered to be within the scope of protection of the present invention.

Claims

1. A label editing and printing method based on the physical resolution of a printer, characterized in that, Includes the following steps: Establish the conversion relationship between editing units and print dots based on the physical resolution parameters of the target printer; Create a label template and configure objects to form a layer. Methods for configuring objects include: selecting objects and adding them to the label template, and editing the objects. Creating a print job involves mapping the label templates configured by the configuration object into print instructions based on conversion relationships. Executing a print job involves the target printer executing print commands.

2. The label editing and printing system based on the physical resolution of the printer as described in claim 1, characterized in that, The process of creating a print job also includes: generating a reference image based on the same label template; executing the print job also includes: The visual acquisition device acquires scanned images of the printed labels; Aligning the scanned image with a reference image and comparing their differences involves: obtaining the homography matrix based on feature point matching and performing perspective transformation and / or affine fine-tuning. The process of comparing the scanned image with the reference image includes: unifying the brightness of the scanned image and the reference image, performing differential analysis, thresholding, morphological denoising, connected component analysis and contour analysis within the printing area mask of the reference image, extracting defect areas, and generating comparison results based on the area, number and type of defect areas. The audible and visual alarm device outputs alarm information based on the judgment result.

3. The label editing and printing method based on the physical resolution of the printer as described in claim 1, characterized in that, Select an object and add it to the tag template to generate anchor points. Methods for editing objects include: Add object content, set the object's length and width, and set the anchor point's position on the tag template; Stepped scaling barcode object; Import Excel files to batch replace fields in text objects.

4. The label editing and printing method based on the physical resolution of the printer as described in claim 1, characterized in that, Methods for creating label templates include: opening a saved label template, creating a new label template, or importing print instructions.

5. The label editing and printing method based on the physical resolution of the printer as described in claim 1, characterized in that: The text object includes a time field. Methods for editing the text object include: setting the time field content to be automatically generated based on the current time, print time, or preset rules.

6. The label editing and printing system based on the physical resolution of the printer as described in claim 1, characterized in that: The process of creating a print job also includes setting a trigger time or time window.

7. A label editing and printing system based on the physical resolution of a printer, characterized in that: include The physical resolution conversion module is used to establish the conversion relationship between editing units and print points; The constraint editing module is used to apply printable physical constraints to objects; The object management module is used to manage objects such as text, graphics, and barcodes. The print instruction generation module is used to map label templates into print instructions based on conversion relationships; The print job scheduling module is a print control module used to distribute print jobs to target printers. The print control module is used to control the target printer to execute print commands.

8. A label editing and printing system based on printer physical resolution as described in claim 7, characterized in that: It also includes a print instruction parsing module, which is used to perform structured parsing of print instructions based on conversion relationships and reconstruct label templates.

9. A label editing and printing system based on printer physical resolution as described in claim 7, characterized in that: Also includes An image output module, used to generate a reference image based on a label template; The image acquisition module is used to acquire printed labels and generate scanned images. The visual comparison module is used to align the scanned image with a reference image and compare the differences.

10. A label editing and printing system based on printer physical resolution as described in claim 9, characterized in that: The printing control module includes A print communication unit, which is used to send print commands to the printer and receive return data; The status analysis and process linkage unit is used to analyze the status signals in the feedback data stream and drive the scan control module. The scanning control unit is used to start and stop the image acquisition module and maintain the scanning status file and session directory. The scanning and stitching unit is used to read multiple frames of images from the session catalog and stitch them together to generate a scanned image. Alarm linkage unit, which is used to control audible and visual alarm devices.