A method of print quality compensation for a dual mode printer, a dual mode printer

By automatically identifying the printing mode and using temperature rise and battery voltage drop prediction curves for gradual compensation, the problem of unstable print quality and insufficient heating control in dual-mode printers under different modes is solved, realizing real-time heating control and environmental adaptability, and improving print quality and compatibility.

CN121716432BActive Publication Date: 2026-05-12ZHUHAI XPRINTER ELECTRONICS TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHUHAI XPRINTER ELECTRONICS TECHNOLOGY CO LTD
Filing Date
2026-02-25
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing dual-mode printers suffer from unstable print quality and poor compatibility in different printing modes. Furthermore, their heating control lacks real-time performance and cannot adapt to changes in ambient temperature and transient voltage, resulting in fluctuations in print density and excessively rapid temperature rise.

Method used

By automatically identifying the printing mode, collecting printhead temperature and battery power in real time, and using temperature rise and battery voltage drop prediction curves for gradual compensation, the system achieves real-time adjustment of temperature and voltage, thus enabling automatic matching of the printing mode and timely compensation.

Benefits of technology

It improves the stability and compatibility of print quality, ensures real-time heating control, adapts to environmental changes, and reduces issues such as print density fluctuations and excessively rapid temperature rise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121716432B_ABST
    Figure CN121716432B_ABST
Patent Text Reader

Abstract

The application provides a printing quality compensation method and a dual-mode printer, and the method comprises the following steps: collecting the temperature of a printing head in real time and extracting the number of heating dots in a current line in heating dot array data to obtain a temperature rise prediction curve of the current line; obtaining a first heating compensation amount of each data point in the current line according to the temperature rise prediction curve, and performing a first temperature compensation on the printing head according to gradient variation; collecting the battery power of the printer in real time and calculating the load size required by the number of heating dots in the current line to obtain a battery voltage drop prediction curve of the current line; obtaining a second heating compensation amount of each data point in the current line according to the battery voltage drop prediction curve, and performing a second temperature compensation on the printing head according to gradient variation. Through the temperature and battery voltage drop compensation prediction curves, the effect of real-time heating control and timely temperature compensation is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of printer technology, specifically to a print quality compensation method for a dual-mode printer and a dual-mode printer. Background Technology

[0002] Currently, both thermal printers and thermal transfer printers are widely used in mainstream printers. Thermal printing can directly develop images using thermal paper, eliminating the need for ink and making it convenient to use, suitable for low-cost daily printing. Thermal transfer, although requiring the use of ribbons, offers more durable printing results, making it suitable for scenarios requiring long-term marking and high weather resistance. To meet the needs of different usage scenarios, users generally need to purchase different types of printers, resulting in higher operating costs. Therefore, dual-mode printers that combine thermal transfer and thermal printing functions have emerged.

[0003] Most existing dual-mode printers use fixed temperature profiles or manual parameter settings. However, different modes involve many related factors such as consumable type, consumable size, consumable properties, environmental conditions, power consumption, and non-uniformly distributed graphics. Due to the lack of feedback mechanisms, repeated trial and error adjustments to printing parameters are required, which can lead to problems such as unstable print quality and poor compatibility.

[0004] Some printers employ open-loop or simple closed-loop control, resulting in insufficient real-time response and significant delays in heating control, typically ranging from several milliseconds to tens of milliseconds, to factors such as lithium battery voltage and printhead temperature fluctuations. In lithium battery-powered devices, voltage rises with load changes, and existing algorithms cannot accurately identify these transient voltage variations, leading to errors in heating energy calculation and resulting in fluctuations in print density. Furthermore, current printhead temperature compensation methods often rely on static lookup tables or fixed heating curves, and their heating control algorithms are simplistic. They cannot flexibly adjust heating points based on content or adapt to dynamic factors such as ambient temperature changes, leading to untimely compensation, low regional heat dissipation, and excessively rapid overall temperature rise, severely impacting the printer's continuous operating performance.

[0005] Therefore, there is an urgent need to design a print quality compensation method for a dual-mode printer that can automatically match the printing mode, control heating in real time, and provide timely temperature compensation. Summary of the Invention

[0006] To address the common problems in existing technologies, the present invention aims to provide a print quality compensation method and a dual-mode printer. This invention automatically identifies and switches the printing mode, and performs temperature compensation on the print head in a stepwise manner using temperature and battery voltage drop compensation prediction curves, thereby achieving the effects of automatic matching of printing mode, real-time heating control, and timely temperature compensation.

[0007] The present invention achieves the above objectives through the following technical solutions:

[0008] A method for print quality compensation in a dual-mode printer, comprising:

[0009] S1: Determine the printing mode required for the current printing task and switch the mode accordingly. The printing modes include thermal transfer mode and thermal printing mode.

[0010] S2: Receive the data to be printed, process the data according to the current printing mode, and obtain the heating dot matrix data.

[0011] S3: Real-time acquisition of printhead temperature, extraction of the number of heating points in the current row from the heating dot matrix data, and acquisition of the current row temperature rise prediction curve based on the current printhead temperature and the number of heating points in the current row.

[0012] S4: Obtain the first heating compensation amount for each data point in the current row according to the temperature rise prediction curve, and perform temperature compensation on the print head in a stepwise manner according to the first heating compensation amount.

[0013] S5: Collect printer battery power in real time, calculate the load required for the current row of heating points, and obtain the current row battery voltage drop prediction curve based on the current printer battery power and the load size.

[0014] S6: Obtain the second heating compensation amount for each data point in the current row according to the battery voltage drop prediction curve, and perform secondary temperature compensation on the print head according to the second heating compensation amount in a stepwise manner.

[0015] Repeat steps S2 to S6 until all the data to be printed is printed.

[0016] According to the print quality compensation method for a dual-mode printer provided by the present invention, the method for determining and switching the print mode in step S1 includes:

[0017] S11: Detect whether there is a ribbon on the ribbon delivery shaft of the printer, and determine the printing mode accordingly: if so, it is thermal transfer mode; otherwise, it is thermal printing mode.

[0018] S12: Generate a mode selection signal and send it to the host computer that issued the current printing task. The host computer switches the corresponding image processing algorithm according to the mode selection signal.

[0019] S13: The host computer performs image processing on the document to be printed, generates the data to be printed, and sends it to the printer.

[0020] According to the print quality compensation method for a dual-mode printer provided by the present invention, the image processing algorithm includes a sharpening algorithm and a binarization algorithm, and the switching method of the image processing algorithm in step S12 includes:

[0021] S121: If the mode selection signal is for thermal transfer mode, switch to the sharpening algorithm; if it is for thermal printing mode, switch to the binarization algorithm.

[0022] The image processing method described in step S13 includes:

[0023] S131: The document to be printed is processed by the sharpening algorithm to obtain first valid image data, or processed by the binarization algorithm to obtain second valid image data.

[0024] The data to be printed includes the print command and the first valid image data / second valid image data.

[0025] According to the print quality compensation method for a dual-mode printer provided by the present invention, the image processing algorithm further includes an error diffusion algorithm, and the image processing method in step S13 further includes:

[0026] S132: Obtain the second valid image data and perform pixel-by-pixel scanning.

[0027] S133: Perform pixel quantization on the grayscale value of the current pixel to obtain the quantized value, and calculate the difference between the grayscale value of the current pixel and its quantized value, i.e., the quantization error.

[0028] S134: Set the diffusion weight matrix to distribute the quantization error of the current pixel to its neighboring pixels according to the diffusion weight matrix.

[0029] Repeat steps S133 to S134 to process each pixel in turn.

[0030] According to the print quality compensation method for a dual-mode printer provided by the present invention, the data processing of the data to be printed and the method for acquiring heated dot matrix data in step S2 include:

[0031] S21: Obtain the current printing mode according to the printing command, and convert the first valid image data into first image dot matrix data, or convert the second valid image data into second image dot matrix data.

[0032] S22: If the current printing mode is thermal transfer mode, then the effective data width of the first image dot matrix data is identified, and the number of heating points of the print head is matched to generate the first heating dot matrix data.

[0033] S23: If the current printing mode is thermal printing mode, then the second image dot matrix data is processed by thermal history algorithm and the second heated dot matrix data is generated.

[0034] According to the print quality compensation method for a dual-mode printer provided by the present invention, step S23 further includes:

[0035] S231: Store the second image dot matrix data into the cache pool continuously in the printing order, and monitor the amount of data in the cache pool in real time.

[0036] S232: Set a flow control threshold. If the amount of data in the cache pool is less than the flow control threshold, send a first flow control signal to request continued data storage.

[0037] S233: If the amount of data in the cache pool is greater than or equal to the flow control threshold, a second flow control signal is sent to request a pause in data storage.

[0038] S234: Extract n consecutive rows of data from the cache pool, where n ≤ flow control threshold.

[0039] The hot chronology algorithm is applied to the n consecutive rows of data, and this step is repeated until all data has been processed.

[0040] According to the print quality compensation method for a dual-mode printer provided by the present invention, step S234 further includes performing edge calculation and rounding on each of the n consecutive rows of data, and repeating this step until all data processing is completed.

[0041] The edge computing and rounding methods include:

[0042] S235: Using the current row of data as a reference point, identify the edge reference points existing in the current row of data.

[0043] S236: If there are m consecutive unheated data points in any two adjacent directions of the data point in the current row of data, where m < n, then the data point is determined as the first edge reference point.

[0044] Data points located to the right and below the first edge reference point are discarded.

[0045] S237: If there are n consecutive heated data points in all adjacent directions of the data point in the current row of data, then the data point is determined as the second edge reference point.

[0046] Using the second edge reference point as the first starting point, the q-th data point in the heating data points is discarded, where m < q < n.

[0047] Repeat steps S235 to S237 until the processing of the n consecutive rows of data is completed.

[0048] According to the print quality compensation method for a dual-mode printer provided by the present invention, the method for obtaining the temperature rise prediction curve in step S3 includes:

[0049] S31: Detect the temperature rise of the printhead under different initial temperatures and different combinations of heating points in a standard test environment, and establish a temperature rise model table.

[0050] S32: Using the first data point of the current row as the second starting point, collect the print head temperature at the second starting point and calculate the number of heating points accumulated up to each data point of the current row.

[0051] S33: Take the printhead temperature at the second starting point as the first input quantity, and sequentially input the heating point number of each data point in the current row as the second input quantity into the temperature rise model table, and obtain the temperature rise value of each data point in the current row by looking up the table.

[0052] S34: Plot the temperature rise prediction curve based on the data points of the current row and their temperature rise values.

[0053] According to the print quality compensation method for a dual-mode printer provided by the present invention, the primary temperature compensation method for the print head in step S4 includes:

[0054] S41: Obtain the temperature rise value corresponding to each data point in the current row based on the temperature rise prediction curve.

[0055] S42: The temperature rise value is used as the first heating compensation amount in the printing sequence, and the width of the heating pulse of the print head is adjusted successively according to the first heating compensation amount.

[0056] According to the print quality compensation method for a dual-mode printer provided by the present invention, the method for obtaining the battery voltage drop prediction curve in step S5 includes:

[0057] S51: Detect the voltage drop of the printer battery under different power levels and load combinations in a standard test environment, and establish a voltage drop model table.

[0058] S52: Taking the first data point of the current row as the third starting point, collect the printer battery power at the third starting point, and calculate the number of heating points accumulated to each data point of the current row and the required load size.

[0059] S53: The printer battery power at the third starting point is used as the first input quantity, and the required load size of each data point in the current row is used as the second input quantity and input to the voltage drop model table. The battery voltage drop value caused by heating of each data point in the current row is obtained by looking up the table.

[0060] S54: Plot the battery voltage drop prediction curve based on the data points of the current row and the corresponding battery voltage drop values.

[0061] According to the print quality compensation method for a dual-mode printer provided by the present invention, the secondary temperature compensation method for the print head in step S6 includes:

[0062] S61: Obtain the battery voltage drop value corresponding to each data point in the current row based on the battery voltage drop prediction curve.

[0063] S62: The battery voltage drop value is used as the second heating compensation amount in the printing sequence, and the voltage of the heating pulse of the print head is adjusted sequentially according to the second heating compensation amount.

[0064] The print quality compensation method for a dual-mode printer provided by the present invention further includes the following steps:

[0065] S301: Obtain the printer battery current limit value, calculate the maximum instantaneous current load based on the battery current limit value, and calculate the maximum number of heating points based on the maximum instantaneous current load.

[0066] S302: Obtain the total number of heating points in the current row, and determine whether the total number of heating points is greater than the maximum number of heating points. If it is greater, trigger the segmentation processing mechanism.

[0067] S303: Perform quality compensation on the current row of data in batches through the segmented processing mechanism.

[0068] A dual-mode printer includes: a memory for storing a printer program; and a processor for executing the printer program stored in the memory to implement the steps of the method.

[0069] Therefore, compared with the prior art, the present invention has the following beneficial effects: The present invention automatically identifies and switches the printing mode, and performs temperature compensation on the print head in a stepwise manner through the temperature and battery voltage drop compensation prediction curve, so as to achieve the effects of automatic matching of printing mode, real-time heating control and timely temperature compensation.

[0070] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. Attached Figure Description

[0071] Figure 1 This is a flowchart of a print quality compensation method for a dual-mode printer according to the present invention. Detailed Implementation

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

[0073] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0074] An embodiment of a print quality compensation method for a dual-mode printer.

[0075] See Figure 1 This invention relates to a print quality compensation method for a dual-mode printer, comprising:

[0076] S1: Determine the printing mode required for the current printing task and switch the mode accordingly. The printing modes include thermal transfer mode and thermal printing mode.

[0077] S2: Receive the data to be printed, process the data according to the current printing mode, and obtain the heating dot matrix data.

[0078] S3: Real-time acquisition of printhead temperature, extraction of the number of heating points in the current row from the heating dot matrix data, and acquisition of the current row temperature rise prediction curve based on the current printhead temperature and the number of heating points in the current row.

[0079] S4: Obtain the first heating compensation amount for each data point in the current row according to the temperature rise prediction curve, and perform temperature compensation on the print head in a stepwise manner according to the first heating compensation amount.

[0080] S5: Collect printer battery power in real time, calculate the load required for the current row of heating points, and obtain the current row battery voltage drop prediction curve based on the current printer battery power and the load size.

[0081] S6: Obtain the second heating compensation amount for each data point in the current row according to the battery voltage drop prediction curve, and perform secondary temperature compensation on the print head according to the second heating compensation amount in a stepwise manner.

[0082] Repeat steps S2 to S6 until all the data to be printed is printed.

[0083] In this embodiment, the method for determining and switching the printing mode in step S1 includes:

[0084] S11: Detect whether there is a ribbon on the ribbon delivery shaft of the printer, and determine the printing mode accordingly: if so, it is thermal transfer mode; otherwise, it is thermal printing mode.

[0085] S12: Generate a mode selection signal and send it to the host computer that issued the current printing task. The host computer switches the corresponding image processing algorithm according to the mode selection signal.

[0086] S13: The host computer performs image processing on the document to be printed, generates the data to be printed, and sends it to the printer.

[0087] Specifically, in this embodiment, the ribbon dispensing shaft of the printer is equipped with a positioning detection sensor. The positioning detection sensor can be installed on the inner wall or bottom of the ribbon shaft mounting groove in the ribbon dispensing shaft to detect whether the shaft core is inserted into place, or it can be installed at the ribbon shaft buckle or pressure plate position in the ribbon dispensing shaft to detect whether the ribbon roll is pressed and fixed. If the shaft core has been inserted into place / the ribbon roll has been pressed and fixed, then there is ribbon on the ribbon dispensing shaft at this time.

[0088] Specifically, in this embodiment, the positioning detection sensor can be a Hall sensor or a micro switch. The Hall sensor is installed on the inner wall of the ribbon shaft mounting groove, and a magnet is embedded at the end of the ribbon shaft. The electromagnetic signal of the ribbon shaft being inserted into place is detected to determine whether the shaft core is inserted into place. The micro switch is installed below the ribbon shaft buckle or pressure plate. When the ribbon shaft is pressed down into place, the micro switch is triggered to generate a switching signal to detect whether the ribbon roll is pressed and fixed.

[0089] Specifically, in this embodiment, determining the presence of a ribbon by detecting the ribbon delivery axis is only a preferred method, not the only one. For example, photoelectric sensors can be installed on both sides of the ribbon path to detect whether the ribbon passes through the path by emitting / receiving infrared light, thereby determining whether the ribbon is installed. Alternatively, a reflective sensor can be set to determine the presence of the ribbon by detecting the reflected light from the ribbon surface.

[0090] Specifically, in this embodiment, an RFID tag is embedded in the ribbon reel, and the RFID tag stores information such as ribbon specifications, batch, and size; the printer has a built-in reader chip that reads the information in the RFID tag through its antenna via near-field communication.

[0091] In this embodiment, the image processing algorithm includes a sharpening algorithm and a binarization algorithm, and the method for switching the image processing algorithm in step S12 includes:

[0092] S121: If the mode selection signal is for thermal transfer mode, switch to the sharpening algorithm; if it is for thermal printing mode, switch to the binarization algorithm.

[0093] The image processing method described in step S13 includes:

[0094] S131: The document to be printed is processed by the sharpening algorithm to obtain first valid image data, or processed by the binarization algorithm to obtain second valid image data.

[0095] The data to be printed includes the print command and the first valid image data / second valid image data.

[0096] Specifically, the sharpening algorithm in this embodiment includes the following processing steps: converting the document to be printed into a grayscale image and performing preliminary noise reduction to prevent the sharpening process from amplifying image noise; performing convolution operations on the grayscale image using a high-pass filter to generate an edge detail map, wherein each pixel value in the edge detail map represents the edge intensity and direction of the original image at that location; and superimposing the edge detail map back onto the original image with an adjustable intensity coefficient to obtain the first effective image data. The sharpening algorithm enhances high-frequency details in the image to compensate for edge diffusion or blurring that may occur during the printing process.

[0097] The high-pass filter employs either the Laplace operator or the Sobel operator.

[0098] Specifically, the binarization algorithm described in this embodiment includes the following steps: converting the file to be printed into a grayscale image; determining an image threshold using a thresholding method; classifying each grayscale pixel according to the threshold and assigning it a new binary value.

[0099] The thresholding method employs either a global thresholding method or a local adaptive thresholding method. The global thresholding method sets a fixed threshold based on empirical values, or automatically finds an optimal threshold using the Otsu algorithm. The local adaptive thresholding method calculates a threshold individually for each pixel in the image based on the brightness statistics of a neighborhood window surrounding the pixel.

[0100] The pixel classification and assignment methods include: If a global thresholding method is used, if the current grayscale pixel is greater than or equal to the global threshold, the output is 0 or white, corresponding to no heating; otherwise, the output is 1 or black, corresponding to heating. This process is repeated until all pixels are classified and assigned. If a local adaptive thresholding method is used, if the current grayscale pixel is greater than or equal to the local threshold of that point, the output is 0 or white, corresponding to no heating; otherwise, the output is 1 or black, corresponding to heating. This process is repeated until all pixels are classified and assigned.

[0101] Specifically, the printing command described in this embodiment includes information such as printing mode, printing resolution, printing area width, and image size.

[0102] In this embodiment, the image processing algorithm further includes an error diffusion algorithm, and the image processing method in step S13 further includes:

[0103] S132: Obtain the second valid image data and perform pixel-by-pixel scanning.

[0104] Specifically, in this embodiment, each pixel is processed sequentially from left to right and from top to bottom, starting from the top left corner of the image.

[0105] S133: Perform pixel quantization on the grayscale value of the current pixel to obtain the quantized value, and calculate the difference between the grayscale value of the current pixel and its quantized value, i.e., the quantization error E.

[0106] Specifically, in this embodiment, a fixed pixel threshold is set for the grayscale range of 0-255. The grayscale value of the current pixel is compared with the fixed pixel threshold. If it is less than the fixed pixel threshold, it is quantized to 0; otherwise, it is quantized to 255. The fixed pixel threshold can be 128.

[0107] S134: Set the diffusion weight matrix to distribute the quantization error of the current pixel to its neighboring pixels according to the diffusion weight matrix.

[0108] Specifically, in this embodiment, the neighboring pixels include those adjacent to the right, directly below, lower left, and lower right of the current pixel. The error values ​​received by the corresponding neighboring pixels are 7 / 16*E, 5 / 16*E, 3 / 16*E, and 1 / 16*E, respectively. The grayscale values ​​of the neighboring pixels are added with the assigned error values ​​before processing, thereby maintaining the grayscale characteristics of the original image as a whole and avoiding large areas of color blocks and loss of details caused by simple binarization.

[0109] Repeat steps S133 to S134 to process each pixel in turn.

[0110] In this embodiment, the data processing of the data to be printed and the method for acquiring heating dot matrix data in step S2 include:

[0111] S21: Obtain the current printing mode according to the printing command, and convert the first valid image data into first image dot matrix data, or convert the second valid image data into second image dot matrix data.

[0112] S22: If the current printing mode is thermal transfer mode, then the effective data width of the first image dot matrix data is identified, and the number of heating points of the print head is matched to generate the first heating dot matrix data.

[0113] Specifically, the effective data width identification process described in this embodiment is as follows: the first image dot matrix data is scanned line by line, the first and last points to be printed in each line are found as the left and right boundary points of the line, and the left and right boundary ranges are calculated; the maximum value of the left and right boundary ranges is taken as the effective data width to ensure that printing resources are allocated according to the actual content.

[0114] S23: If the current printing mode is thermal printing mode, then the second image dot matrix data is processed by thermal history algorithm and the second heated dot matrix data is generated.

[0115] In this embodiment, step S23 further includes:

[0116] S231: Store the second image dot matrix data into the cache pool continuously in the printing order, and monitor the amount of data in the cache pool in real time.

[0117] S232: Set a flow control threshold. If the amount of data in the cache pool is less than the flow control threshold, send a first flow control signal to request continued data storage.

[0118] S233: If the amount of data in the cache pool is greater than or equal to the flow control threshold, a second flow control signal is sent to request a pause in data storage.

[0119] S234: Extract n consecutive rows of data from the cache pool, where n ≤ flow control threshold.

[0120] The hot chronology algorithm is applied to the n consecutive rows of data, and this step is repeated until all data has been processed.

[0121] Specifically, the processing steps of the thermal history algorithm in this embodiment include: maintaining a thermal history variable in memory for each heating point of the print head to record the heating history of each heating point; reading the thermal history value of the currently printed heating point and determining that the actual temperature of the current heating point is higher than the reference temperature. If so, it indicates that the heating point has been continuously heated and has accumulated a lot of residual heat. At this time, the energy or time of this heating is reduced according to the thermal history value of the point to prevent the printed color block from being too dark or even the carbon ribbon from burning out due to overheating.

[0122] Before printing begins, the thermal history values ​​of all heating points on the print head are initialized to the ambient temperature or zero.

[0123] Specifically, in this embodiment, n=10, and the hot history algorithm is used to process the 10 consecutive rows of data each time.

[0124] In this embodiment, step S234 further includes performing edge calculation and rounding on each of the n consecutive rows of data, and repeating this step until all data processing is completed.

[0125] The edge computing and rounding methods include:

[0126] S235: Using the current row of data as a reference point, identify the edge reference points existing in the current row of data.

[0127] S236: If there are m consecutive unheated data points in any two adjacent directions of the data point in the current row of data, where m < n, then the data point is determined as the first edge reference point.

[0128] Data points located to the right and below the first edge reference point are discarded.

[0129] Specifically, in this embodiment, when processing 10 consecutive rows of data, m=3 is taken. The current row is used as the base point. For the data in the four directions of up, down, left, and right, if there is no data in two adjacent directions and three consecutive points, then this point is determined to be the first edge reference point.

[0130] S237: If there are n consecutive heated data points in all adjacent directions of the data point in the current row of data, then the data point is determined as the second edge reference point.

[0131] Using the second edge reference point as the first starting point, the q-th data point in the heating data points is discarded, where m < q < n.

[0132] Repeat steps S235 to S237 until the processing of the n consecutive rows of data is completed.

[0133] Specifically, in this embodiment, when processing 10 consecutive rows of data, q=8 is taken. If there are 10 consecutive heating points above, below, left and right of the base point, it is defined as a black block, and 8-1 bytes are discarded. For example, when the base point is 0, the case of 10 heating points is judged in sequence. For the content judged as a black block, the last heating point is discarded every 8 points.

[0134] In this embodiment, the method for obtaining the temperature rise prediction curve in step S3 includes:

[0135] S31: Detect the temperature rise of the printhead under different initial temperatures and different combinations of heating points in a standard test environment, and establish a temperature rise model table.

[0136] S32: Using the first data point of the current row as the second starting point, collect the print head temperature at the second starting point and calculate the number of heating points accumulated up to each data point of the current row.

[0137] S33: Take the printhead temperature at the second starting point as the first input quantity, and sequentially input the heating point number of each data point in the current row as the second input quantity into the temperature rise model table, and obtain the temperature rise value of each data point in the current row by looking up the table.

[0138] S34: Plot the temperature rise prediction curve based on the data points of the current row and their temperature rise values.

[0139] In this embodiment, the primary temperature compensation method for the print head in step S4 includes:

[0140] S41: Obtain the temperature rise value corresponding to each data point in the current row based on the temperature rise prediction curve.

[0141] S42: The temperature rise value is used as the first heating compensation amount in the printing sequence, and the width of the heating pulse of the print head is adjusted successively according to the first heating compensation amount.

[0142] In this embodiment, the method for obtaining the battery voltage drop prediction curve in step S5 includes:

[0143] S51: Detect the voltage drop of the printer battery under different power levels and load combinations in a standard test environment, and establish a voltage drop model table.

[0144] S52: Taking the first data point of the current row as the third starting point, collect the printer battery power at the third starting point, and calculate the number of heating points accumulated to each data point of the current row and the required load size.

[0145] S53: The printer battery power at the third starting point is used as the first input quantity, and the required load size of each data point in the current row is used as the second input quantity and input to the voltage drop model table. The battery voltage drop value caused by heating of each data point in the current row is obtained by looking up the table.

[0146] S54: Plot the battery voltage drop prediction curve based on the data points of the current row and the corresponding battery voltage drop values.

[0147] In this embodiment, the secondary temperature compensation method for the print head in step S6 includes:

[0148] S61: Obtain the battery voltage drop value corresponding to each data point in the current row based on the battery voltage drop prediction curve.

[0149] S62: The battery voltage drop value is used as the second heating compensation amount in the printing sequence, and the voltage of the heating pulse of the print head is adjusted sequentially according to the second heating compensation amount.

[0150] In this embodiment, the following steps are also included:

[0151] S301: Obtain the printer battery current limit value, calculate the maximum instantaneous current load based on the battery current limit value, and calculate the maximum number of heatable points Nmax based on the maximum instantaneous current load.

[0152] S302: Get the total number of heating points Nd in the current row, and determine whether the total number of heating points Nd is greater than the maximum number of heating points Nmax. If it is greater, trigger the segmentation processing mechanism.

[0153] S303: Perform quality compensation on the current row of data in batches through the segmented processing mechanism.

[0154] Specifically, the segmented processing mechanism described in this embodiment includes: when Nd>Nmax, the ideal number of printable blocks for the current row of data is: B =Nd / (Nmax / N), where N is the maximum segmentation parameter. The current row of data is divided into batches according to the ideal number of printable blocks B for quality compensation, and the printing is completed in sequence to ensure that the instantaneous current load is reduced to a safe range.

[0155] An embodiment of a dual-mode printer.

[0156] This invention relates to a dual-mode printer, comprising: a memory for storing a printer program; and a processor for executing the printer program stored in the memory to implement the aforementioned method steps.

[0157] Specifically, in this embodiment, the memory stores instructions that can be executed by at least one processor. By executing the instructions stored in the memory, at least one processor can perform the above-mentioned print quality compensation method.

[0158] The processor is the control center of the printer. It can connect to various parts of the control device through various interfaces and lines. By running or executing instructions stored in the memory and calling data stored in the memory, it can realize various functions of the printer and process data.

[0159] In one possible design, the processor may include one or more processing units. The processor may integrate an application processor and a modem processor, where the application processor primarily handles the operating system, user interface, and applications, while the modem processor primarily handles wireless communication. It is understood that the modem processor may also not be integrated into the processor.

[0160] In some embodiments, the processor and memory can be implemented on the same chip; in other embodiments, they can be implemented on separate chips.

[0161] Specifically, the processor in this embodiment can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the print quality compensation method disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0162] Specifically, in this embodiment, the memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The memory can include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disk, etc. Memory is any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited to this. The memory in this embodiment can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.

[0163] Specifically, in this embodiment, by designing and programming the processor, the code corresponding to the print quality compensation method described in the above embodiments can be embedded into the chip, thereby enabling the chip to execute the steps of the print quality compensation method of the embodiments during operation. How to design and program the processor is a technique known to those skilled in the art, and will not be elaborated here.

[0164] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0165] The above embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Any non-substantial changes and substitutions made by those skilled in the art based on the present invention shall fall within the scope of protection claimed by the present invention.

Claims

1. A method for compensating print quality in a dual-mode printer, characterized in that, include: S1: Determine the printing mode required for the current printing task and switch the mode accordingly. The printing modes include thermal transfer mode and thermal printing mode. S2: Receive the data to be printed, process the data according to the current printing mode, and obtain the heating dot matrix data; S3: Real-time acquisition of printhead temperature, extraction of the number of heating points in the current row from the heating dot matrix data, and acquisition of the current row temperature rise prediction curve based on the current printhead temperature and the number of heating points in the current row; The method for obtaining the temperature rise prediction curve includes: S31: Detect the temperature rise of the printhead under different initial temperatures and different combinations of heating points in a standard test environment, and establish a temperature rise model table; S32: Taking the first data point of the current row as the second starting point, collect the print head temperature at the second starting point and calculate the number of heating points accumulated up to each data point of the current row; S33: Take the printhead temperature at the second starting point as the first input quantity, and sequentially input the heating point number of each data point in the current row as the second input quantity into the temperature rise model table, and obtain the temperature rise value of each data point in the current row by looking up the table; S34: Plot the temperature rise prediction curve based on the data points of the current row and their temperature rise values; S4: Obtain the first heating compensation amount for each data point in the current row according to the temperature rise prediction curve, and perform temperature compensation on the print head in a stepwise manner according to the first heating compensation amount. The primary temperature compensation method includes: S41: Obtain the temperature rise value corresponding to each data point in the current row based on the temperature rise prediction curve; S42: The temperature rise value is used as the first heating compensation amount in the printing order, and the width of the heating pulse of the print head is adjusted successively according to the first heating compensation amount; S5: Collect printer battery power in real time, calculate the load required for the current row of heating points, and obtain the current row battery voltage drop prediction curve based on the current printer battery power and the load. The method for obtaining the battery voltage drop prediction curve includes: S51: Detect the voltage drop of the printer battery under different power levels and load combinations in a standard test environment, and establish a voltage drop model table; S52: Taking the first data point of the current row as the third starting point, collect the printer battery power at the third starting point, and calculate the number of heating points accumulated to each data point of the current row and the required load size; S53: The printer battery power at the third starting point is used as the first input quantity, and the required load size of each data point in the current row is used as the second input quantity and input to the voltage drop model table. The battery voltage drop value caused by heating of each data point in the current row is obtained by looking up the table. S54: Plot the battery voltage drop prediction curve based on the data points of the current row and the corresponding battery voltage drop values; S6: Obtain the second heating compensation amount for each data point in the current row according to the battery voltage drop prediction curve, and perform secondary temperature compensation on the print head according to the second heating compensation amount in a stepwise manner; The secondary temperature compensation method includes: S61: Obtain the battery voltage drop value corresponding to each data point in the current row based on the battery voltage drop prediction curve; S62: The battery voltage drop value is used as the second heating compensation amount in the printing sequence, and the voltage of the heating pulse of the print head is adjusted sequentially according to the second heating compensation amount; Repeat steps S2 to S6 until all the data to be printed is printed.

2. The print quality compensation method for a dual-mode printer according to claim 1, characterized in that, The method for determining and switching the printing mode in step S1 includes: S11: Detect whether there is a ribbon on the ribbon delivery shaft of the printer, and determine the printing mode accordingly: if so, it is the thermal transfer mode; otherwise, it is the thermal printing mode. S12: Generate a mode selection signal and send it to the host computer that issued the current printing task. The host computer switches the corresponding image processing algorithm according to the mode selection signal. S13: The host computer performs image processing on the document to be printed, generates the data to be printed, and sends it to the printer.

3. The print quality compensation method for a dual-mode printer according to claim 2, characterized in that: The image processing algorithm includes a sharpening algorithm and a binarization algorithm. The method for switching the image processing algorithm in step S12 includes: S121: If the mode selection signal is a thermal transfer mode, then switch to the sharpening algorithm; if it is a thermal printing mode, then switch to the binarization algorithm. The image processing method in step S13 includes: S131: The document to be printed is processed by the sharpening algorithm to obtain first valid image data, or processed by the binarization algorithm to obtain second valid image data; The data to be printed includes the print command and the first valid image data / second valid image data.

4. The print quality compensation method for a dual-mode printer according to claim 3, characterized in that: The image processing algorithm further includes an error diffusion algorithm, and the image processing method in step S13 further includes: S132: Obtain the second valid image data and perform pixel-by-pixel scanning; S133: Perform pixel quantization on the grayscale value of the current pixel to obtain the quantized value, and calculate the difference between the grayscale value of the current pixel and its quantized value, i.e., the quantization error; S134: Set the diffusion weight matrix to distribute the quantization error of the current pixel to its neighboring pixels according to the diffusion weight matrix; Repeat steps S133 to S134 to process each pixel in turn.

5. The print quality compensation method for a dual-mode printer according to claim 3, characterized in that, The data processing and heating dot matrix data acquisition methods for the data to be printed in step S2 include: S21: Obtain the current printing mode according to the printing command, and convert the first valid image data into first image dot matrix data, or convert the second valid image data into second image dot matrix data; S22: If the current printing mode is thermal transfer mode, then the effective data width of the first image dot matrix data is identified, and the number of heating points of the print head is matched to generate the first heating dot matrix data. S23: If the current printing mode is thermal printing mode, then the second image dot matrix data is processed by thermal history algorithm and the second heated dot matrix data is generated.

6. The print quality compensation method for a dual-mode printer according to claim 5, characterized in that, Step S23 also includes: S231: Store the second image dot matrix data into the cache pool continuously in the printing order, and monitor the amount of data in the cache pool in real time; S232: Set a flow control threshold. If the amount of data in the cache pool is less than the flow control threshold, send a first flow control signal to request continued data storage. S233: If the amount of data in the cache pool is greater than or equal to the flow control threshold, a second flow control signal is sent to request a pause in data storage; S234: Extract n consecutive rows of data from the cache pool, where n ≤ flow control threshold; The hot chronology algorithm is applied to the n consecutive rows of data, and this step is repeated until all data has been processed.

7. The print quality compensation method for a dual-mode printer according to claim 6, characterized in that, Step S234 further includes performing edge calculations and rounding on each of the n consecutive rows of data, and repeating this step until all data processing is completed; The edge computing and rounding methods include: S235: Using the current row of data as a reference point, identify the edge reference points existing in the current row of data; S236: If there are m consecutive unheated data points in any two adjacent directions of the data point in the current row of data, where m < n, then the data point is determined as the first edge reference point; Data points located to the right and below the first edge reference point are discarded. S237: If there are n consecutive heated data points in all adjacent directions for a data point in the current row of data, then the data point is determined as the second edge reference point; Using the second edge reference point as the first starting point, the qth data point in the heating data points is discarded, where m < q < n; Repeat steps S235 to S237 until the processing of the n consecutive rows of data is completed.

8. The print quality compensation method for a dual-mode printer according to any one of claims 1-7, characterized in that, It also includes the following steps: S301: Obtain the printer battery current limit value, calculate the maximum instantaneous current load based on the battery current limit value, and calculate the maximum number of heating points based on the maximum instantaneous current load; S302: Obtain the total number of heating points in the current row, and determine whether the total number of heating points is greater than the maximum number of heating points. If it is greater, trigger the segmentation processing mechanism. S303: Perform quality compensation on the current row of data in batches through the segmented processing mechanism.

9. A dual-mode printer, characterized in that, include: Memory, used to store printer programs; A processor, when executing a printer program stored in the memory, implements the steps of the method according to any one of claims 1-8.