Thermal printer control method and device, storage medium and computer equipment

By calculating the actual output power and temperature parameters of the thermal printer in real time and dynamically adjusting the printing time, the problem of unstable printing quality of thermal printers in dynamic environments is solved, achieving stable and uniform grayscale effects and equipment reliability.

CN121246428APending Publication Date: 2026-01-02ZHONGSHAN POLONO ELECTRONIC TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511402164.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-28
Publication Date
2026-01-02

AI Technical Summary

Technical Problem

The existing heating control methods of thermal printers are difficult to adapt to dynamically changing printing tasks and external temperature environments, resulting in unstable print quality.

Method used

By collecting the current voltage parameters of the thermal printer in real time, combining the initial printing parameters and multiple heating characteristic parameters, the actual output power of each printing point of the print head is calculated, and the current printing time is calculated by combining the current temperature parameters and grayscale data, so as to dynamically adjust the printing process.

Benefits of technology

It outputs stable and uniform grayscale results under different temperature environments, prevents thermal printers from overheating, and ensures print quality and printhead life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121246428A_ABST
    Figure CN121246428A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of thermal printing, and discloses a control method and device of a thermal printer, a storage medium and computer equipment. Current voltage parameters of the thermal printer are collected in real time, and initial printing parameters and multiple heating characteristic parameters are combined; the actual output power of each printing point of a printing head of the thermal printer is calculated, the current printing time of the thermal printer is calculated by further combining the current temperature parameter and the current gray scale data of the thermal printer, and the target printing image is printed according to the current printing time. The stable and uniform gray scale effect can be output in different temperature environments, meanwhile, the thermal printer can be effectively prevented from being overheated, and the printing quality and the service life of a printing head are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of thermal printing, in particular to a control method and device of a thermal printer, a storage medium and computer equipment. BACKGROUND

[0002] The thermal printer is a device that prints by heating the print head to cause the coating on the thermal paper to react chemically and develop, thereby completing the printing.

[0003] In related technologies, the heating control method usually adopts a fixed heating time or a simple static lookup table method. From a fixed parameter table pre-burned in the firmware, the corresponding heating pulse width, i.e., the printing time, is looked up, and then the print head heating element is driven to work. This method is difficult to adapt to dynamically changing printing tasks and external temperature environments, resulting in unstable printing quality. SUMMARY

[0004] Therefore, the present application provides a control method and device of a thermal printer, a storage medium and computer equipment to solve the problem of difficulty in adapting to dynamically changing printing tasks and external temperature environments, resulting in unstable printing quality.

[0005] In a first aspect, the present application provides a control method of a thermal printer, which comprises: In response to the start of the thermal printer, the initial printing parameters of the thermal printer are obtained; According to the initial printing parameters, a heating printing instruction is triggered; According to the heating printing instruction, the current voltage parameter, the plurality of heating characteristic parameters, the plurality of temperature characteristic parameters and the target printing image of the thermal printer are obtained; According to the current voltage parameter, the initial printing parameter and the plurality of heating characteristic parameters, the actual output power of each printing point of the print head of the thermal printer is calculated; According to the plurality of temperature characteristic parameters, the current temperature parameter of the thermal printer is calculated; The current gray level and the current gray value of the target printing image are calculated; According to the current gray level, the current gray value, the current temperature parameter and the actual output power, the current printing time of the thermal printer is calculated, and the target printing image is printed according to the current printing time.

[0006] In some optional embodiments, the initial printing parameters include an initial printing density, an initial temperature parameter and an initial voltage parameter. According to the initial printing parameters, the heating printing instruction is triggered, which comprises: When the initial printing density is consistent with the preset printing density, when the initial temperature parameter is consistent with the preset temperature parameter, and when the initial voltage parameter is consistent with the preset voltage parameter, the heating printing instruction is triggered.

[0007] In some optional embodiments, the plurality of heating characteristic parameters comprises: an average resistance of the print head of the thermal printer, a common electrode resistance of the print head of the thermal printer, a number of heating points of the print head of the thermal printer, a driving chip resistance of the print head of the thermal printer. According to the current voltage parameter, the initial printing parameter and the plurality of heating characteristic parameters, the actual output power of each printing point of the print head of the thermal printer is calculated by the following formula:

[0008] wherein, the actual output power of each printing point of the print head of the thermal printer, the current voltage parameter, the average resistance of the print head of the thermal printer, the common electrode resistance of the print head of the thermal printer, the number of heating points of the print head of the thermal printer, the resistance of the driving chip.

[0009] In some optional embodiments, according to the plurality of temperature characteristic parameters, the current temperature parameter of the thermal printer is calculated by the following formula:

[0010] wherein, the current resistance value of the thermistor of the thermal printer under the current temperature parameter, the nominal resistance value of the thermistor of the thermal printer under the normal temperature parameter, the temperature characteristic parameter of the thermal printer, the current temperature parameter, the normal temperature parameter.

[0011] In some optional embodiments, the current gray level and the current gray value of the target printing image are calculated, comprising: scanning each target pixel point row by row from the starting pixel point of the target printing image until the scanning is completed, to obtain the target gray value corresponding to the target pixel point; judging whether the target gray value of the target gray value is greater than a preset threshold value; if yes, marking the current gray level of the target printing image as a first gray level; if no, marking the current gray level of the target printing image as a second gray level.

[0012] In some optional embodiments, according to the current gray level, the current gray value, the current temperature parameter and the actual output power, the current printing time of the thermal printer is calculated, comprising: If the current gray level is the first gray level, the current printing time of the thermal printer is calculated by the first printing algorithm based on the current gray value corresponding to the first gray level, the current temperature parameter, and the actual output power. If the current grayscale level is the second grayscale level, the current printing time of the thermal printer is calculated using the second printing algorithm based on the current grayscale value corresponding to the second grayscale level, the current temperature parameter, and the actual output power.

[0013] In some optional implementations, the current printing time of the thermal printer is calculated based on the current grayscale level, current grayscale value, current temperature parameter, and actual output power, including: If the current gray level is the first gray level, the current printing time of the thermal printer is calculated by the first printing algorithm based on the first preset heating value, the first preset gray concentration, the current gray value corresponding to the first gray level, the current temperature parameter and the actual output power. If the current grayscale level is the second grayscale level, the current printing time of the thermal printer is calculated by the second printing algorithm based on the second preset heating value, the second preset grayscale concentration, the current grayscale value corresponding to the second grayscale level, the current temperature parameter, and the actual output power.

[0014] In some optional implementations, the control method for the thermal printer in this embodiment further includes: Based on the current temperature parameter, update the initial temperature parameter and multiple heating characteristic parameters.

[0015] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the control method for a thermal printer described in the first aspect or any corresponding embodiment thereof.

[0016] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the control method for a thermal printer described in the first aspect or any corresponding embodiment thereof.

[0017] The technical solution of this invention has the following advantages: This invention discloses a control method, device, storage medium, and computer equipment for a thermal printer. The method involves real-time acquisition of the thermal printer's current voltage parameters, combined with initial printing parameters and multiple heating characteristic parameters, to calculate the actual output power of each print point on the thermal printer's printhead. Furthermore, it combines the thermal printer's current temperature parameters and current grayscale data to calculate the current printing time, and prints the target image based on the current printing time. This achieves stable and uniform grayscale output under different temperature environments, while effectively preventing overheating of the thermal printer, thus ensuring print quality and printhead lifespan. Attached Figure Description

[0018] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating a control method for a thermal printer according to an embodiment of the present invention; Figure 2 This is a structural block diagram of the control device for a thermal printer according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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 present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] Traditional heating control methods typically employ fixed heating times or simple static lookup tables, which retrieve the corresponding heating pulse width (i.e., printing time) from a pre-programmed fixed parameter table in the firmware and then drive the printhead heating element. This method is ill-suited to adapting to dynamically changing printing tasks and external environments, resulting in unstable print quality.

[0022] In view of this, embodiments of the present invention provide a control method for a thermal printer. By real-time acquisition of the current voltage parameters of the thermal printer, combined with initial printing parameters and multiple heating characteristic parameters, the actual output power of each printing point of the thermal printer's print head is calculated. Furthermore, by combining the current temperature parameters and current grayscale data of the thermal printer, the current printing time of the thermal printer is calculated, and the target image is printed according to the current printing time. This achieves stable and uniform grayscale printing effects under different temperature environments, while effectively preventing overheating and improving printing accuracy and equipment reliability.

[0023] According to an embodiment of the present invention, a control method for a thermal printer is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0024] This embodiment provides a control method for a thermal printer, which can be used in computer devices such as mobile phones, tablets, desktop computers, laptops, servers, etc. Figure 1 This is a flowchart of a semantic map fusion method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: In response to the start of the thermal printer, the initial printing parameters of the thermal printer are obtained.

[0025] In a specific example, the initial printing parameters include: initial print density, initial temperature, and initial voltage. These initial printing parameters of the thermal printer are used as the basis for subsequent calculations involving the thermal printer.

[0026] Step S102: Trigger the heating printing command according to the initial printing parameters.

[0027] Determine if the initial print parameters meet the print trigger conditions. If the initial print parameters meet the heating print conditions, execute the print operation process. If the initial print parameters do not meet the heating print conditions, end the print operation process.

[0028] In some specific implementations, the initial printing parameters include: initial printing density, initial temperature parameters, and initial voltage parameters. Based on the initial printing parameters, a heating printing command is triggered, including: A heating printing command is triggered when the initial print density matches the preset print density, the initial temperature parameter matches the preset temperature parameter, and the initial voltage parameter matches the preset voltage parameter.

[0029] The initial print density is the default setting of the thermal printer driver, which determines the darkness of the image on the print page.

[0030] Step S103: According to the heating and printing instruction, obtain the current voltage parameters, multiple heating characteristic parameters, multiple temperature characteristic parameters, and target print image of the thermal printer.

[0031] The current voltage parameter is the real-time voltage parameter collected by the thermal printer. Multiple heating characteristic parameters characterize the thermal printer's heating performance, and multiple temperature characteristic parameters characterize its temperature performance. The target print image contains the relevant data for printing.

[0032] Step S104: Calculate the actual output power of each print point of the thermal printer's print head based on the current voltage parameters, initial printing parameters, and multiple heating characteristic parameters.

[0033] In some specific implementations, multiple heating characteristic parameters include: the average resistance of the thermal printer's printhead, the common electrode resistance of the thermal printer's printhead, the number of heating points in the thermal printer's printhead, and the resistance of the thermal printer's printhead's driver chip. Based on the current voltage parameters, initial printing parameters, and multiple heating characteristic parameters, calculate the actual output power of each print point of the thermal printer's print head using the following formula:

[0034] in, This refers to the actual output power of each print point on the print head of a thermal printer. For the current voltage parameters, The average resistance of the printhead in a thermal printer. This is the common electrode resistor of the printhead in a thermal printer. This refers to the number of heating points on the printhead of a thermal printer. The resistor is for driving the chip.

[0035] This embodiment uses the above method to quickly calculate the actual output power of the thermal printer's printhead, which facilitates the subsequent calculation of the thermal printer's current printing time.

[0036] Step S105: Calculate the current temperature parameters of the thermal printer based on multiple temperature characteristic parameters.

[0037] In some specific implementations, the current temperature parameter of the thermal printer is calculated based on multiple temperature characteristic parameters using the following formula:

[0038] in, This represents the current resistance value of the thermistor in the thermal printer at the current temperature parameters. This refers to the nominal resistance value of the thermistor in a thermal printer under normal temperature parameters. These are the temperature characteristic parameters of a thermal printer. The current temperature parameter, These are normal temperature parameters.

[0039] In some optional implementations, the control method for the thermal printer in this embodiment includes: Step a1: Determine whether the calculated current temperature parameter is greater than the upper temperature threshold. Step a2: If yes, gradually adjust the current temperature parameter multiple times until the current temperature parameter is less than the upper temperature threshold. Step a3: If not, save the current temperature parameters.

[0040] By adjusting the current temperature parameters, the thermal printer can be prevented from overheating and becoming damaged.

[0041] Step S106: Calculate the current gray level and current gray value of the target printed image.

[0042] In some specific implementations, step S106 above, calculating the current grayscale level and current grayscale value of the target printed image, includes: Step b1: Scan each target pixel line by line from the starting pixel of the target printed image until the scanning is finished, and obtain the target grayscale value corresponding to the target pixel.

[0043] Step b2: Determine whether the target grayscale value is greater than a preset threshold.

[0044] Step b3: Determine whether the current grayscale value of the target grayscale value is greater than the preset threshold.

[0045] Step b4, if yes, mark the current gray level of the target printed image as the first gray level.

[0046] Step b5: If not, mark the current gray level of the target printed image as the second gray level.

[0047] For example, the target printed image is a 24-bit color image data, where each target pixel in the color image data consists of 8-bit R, G, and B values. Iterate through each target pixel in the target printed image, and for each pixel, obtain the values ​​of its red (R), green (G), and blue (B) components, typically integers between 0 and 255. Select a grayscale conversion method, most commonly a weighted average method, to calculate the grayscale value of the pixel.

[0048]

[0049] in, The target grayscale value of the target pixel. Red element Green element for Blue elements. This rounds the calculation result to ensure that the result is an integer.

[0050] By iterating through the target printed image, the target grayscale value of each target pixel can be obtained. It is then determined whether the target grayscale value of each target pixel is greater than a preset threshold. If so, the target grayscale value is marked as the first grayscale level; otherwise, it is marked as the second grayscale level.

[0051] Step S107: Calculate the current printing time of the thermal printer based on the current grayscale level, current grayscale value, current temperature parameter and actual output power, and print the target image according to the current printing time.

[0052] In some optional implementations, step S107 above, which calculates the current printing time of the thermal printer based on the current grayscale level, current grayscale value, current temperature parameter, and actual output power, includes: Step c1: If the current grayscale level is the first grayscale level, calculate the current printing time of the thermal printer using the first printing algorithm based on the current grayscale value corresponding to the first grayscale level, the current temperature parameter, and the actual output power.

[0053] Step c2: If the current grayscale level is the second grayscale level, calculate the current printing time of the thermal printer using the second printing algorithm based on the current grayscale value corresponding to the second grayscale level, the current temperature parameter, and the actual output power.

[0054] Further, in step c1, if the current gray level is the first gray level, the current printing time of the thermal printer is calculated by the first printing algorithm based on the first preset heating value, the first preset gray concentration, the current gray value corresponding to the first gray level, the current temperature parameter, and the actual output power.

[0055] Further, in step c2, if the current grayscale level is the second grayscale level, the current printing time of the thermal printer is calculated by the second printing algorithm based on the second preset heating value, the second preset grayscale concentration, the current grayscale value corresponding to the second grayscale level, the current temperature parameter, and the actual output power.

[0056] The first preset gray concentration and the second preset gray concentration are different, as are the first preset heating value and the second preset heating value.

[0057] The first printing algorithm, denoted by A, is an algorithm that matches the first grayscale level. It combines the current grayscale value corresponding to the first grayscale level, the current temperature parameter, the actual output power, the first preset heating value, and the first preset grayscale concentration to calculate the current printing time for a thermal printer that matches the first grayscale level. The first preset heating value and the first preset grayscale concentration are preset based on the first grayscale level. The first grayscale level can be a low-level level.

[0058] The second printing algorithm, denoted by B, is a matching algorithm for the second grayscale level. It combines the current grayscale value corresponding to the second grayscale level, the current temperature parameter, the actual output power, the second preset heating value, and the second preset grayscale concentration to calculate the current printing time for a thermal printer that matches the second grayscale level. The second preset heating value and the second preset grayscale concentration are preset based on the second grayscale level, which can be a higher level.

[0059] The first preset heating value and the second preset heating value mentioned above are comprehensive parameters that control the current magnitude and energizing time of each printing point on the print head of the thermal printer. The first preset grayscale density and the second preset grayscale density represent the lightness or darkness of the target printed image.

[0060] The thermal printer control method in this embodiment collects the current voltage parameters of the thermal printer in real time, and calculates the actual output power of each printing point of the thermal printer's print head by combining the initial printing parameters and multiple heating characteristic parameters. Furthermore, it combines the current temperature parameters and current grayscale data of the thermal printer to calculate the current printing time of the thermal printer, and prints the target image according to the current printing time. This achieves stable and uniform grayscale effect output under different temperature environments, while effectively preventing the thermal printer from overheating, thus ensuring print quality and print head life.

[0061] In some optional implementations, the control method for the thermal printer in this embodiment further includes: The number of heating cycles required for the thermal printer to print the target image is determined, where the number of heating cycles is either preset or calculated from parameters of the target image. These parameters can be grayscale data.

[0062] In addition, in this embodiment, the aforementioned current printing time is the heating time for each heating cycle when the thermal printer prints the target image.

[0063] This embodiment also provides a control device for a thermal printer, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0064] This embodiment provides a control device for a thermal printer, such as... Figure 2 As shown, it includes: The initial parameter acquisition module 201 is used to acquire the initial printing parameters of the thermal printer in response to the start of the thermal printer. The print command triggering module 202 is used to trigger a heating print command based on the initial print parameters; The print data acquisition module 203 is used to acquire the current voltage parameters, multiple heating characteristic parameters, multiple temperature characteristic parameters and target print image of the thermal printer according to the heating print command; The printing power calculation module 204 is used to calculate the actual output power of each printing point of the thermal printer's print head based on the current voltage parameters, initial printing parameters, and multiple heating characteristic parameters. The current temperature calculation module 205 is used to calculate the current temperature parameters of the thermal printer based on multiple temperature characteristic parameters. The current grayscale calculation module 206 is used to calculate the current grayscale level and current grayscale value of the target printed image; The printing time calculation module 207 is used to calculate the current printing time of the thermal printer based on the current gray level, current gray value, current temperature parameter and actual output power, and print the target image according to the current printing time.

[0065] In some optional implementations, the initial printing parameters include: initial printing density, initial temperature parameters, and initial voltage parameters. The printing command triggering module 202 includes: The print trigger submodule is used to trigger the heating print command when the initial print density is consistent with the preset print density, when the initial temperature parameter is consistent with the preset temperature parameter, and when the initial voltage parameter is consistent with the preset voltage parameter.

[0066] In some optional implementations, multiple heating characteristic parameters include: the average resistance of the thermal printer's printhead, the common electrode resistance of the thermal printer's printhead, the number of heating points in the thermal printer's printhead, and the resistance of the driver chip in the thermal printer's printhead. The printing power calculation module 204 calculates the actual output power of each print point of the thermal printer's print head based on the current voltage parameters, initial printing parameters, and multiple heating characteristic parameters, using the following formula:

[0067] in, This refers to the actual output power of each print point on the print head of a thermal printer. For the current voltage parameters, The average resistance of the printhead in a thermal printer. This is the common electrode resistor of the printhead in a thermal printer. This refers to the number of heating points on the printhead of a thermal printer. The resistor is for driving the chip.

[0068] In some optional implementations, the current temperature calculation module 205 calculates the current temperature parameter of the thermal printer based on multiple temperature characteristic parameters using the following formula:

[0069] in, This represents the current resistance value of the thermistor in the thermal printer at the current temperature parameters. This refers to the nominal resistance value of the thermistor in a thermal printer under normal temperature parameters. These are the temperature characteristic parameters of a thermal printer. The current temperature parameter, These are normal temperature parameters.

[0070] In some optional implementations, the current grayscale calculation module 206 calculates the current grayscale level and current grayscale value of the target printed image, including: The pixel scanning submodule is used to scan each target pixel line by line from the starting pixel of the target printed image until the scanning is finished, and to obtain the target grayscale value corresponding to the target pixel. The grayscale judgment submodule is used to determine whether the target grayscale value is greater than a preset threshold. The first determining submodule is used to mark the current gray level of the target printed image as the first gray level if the condition is met. The second determining submodule is used to mark the current gray level of the target printed image as the second gray level if no.

[0071] In some alternative implementations, the printing time calculation module 207 includes: The first calculation submodule is used to calculate the current printing time of the thermal printer by means of the first printing algorithm if the current gray level is the first gray level, based on the first preset heating value, the first preset gray concentration, the current gray value corresponding to the first gray level, the current temperature parameter and the actual output power. The second calculation submodule is used to calculate the current printing time of the thermal printer by means of the second printing algorithm if the current gray level is the second gray level, based on the second preset heating value, the second preset gray concentration, the current gray value corresponding to the second gray level, the current temperature parameter and the actual output power.

[0072] In some optional implementations, the control device for the thermal printer in this embodiment further includes: The preset parameter update module is used to update the initial temperature parameter and multiple heating characteristic parameters based on the current temperature parameter.

[0073] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0074] In this embodiment, the control device for the thermal printer is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0075] This invention also provides a computer device having the control device for the thermal printer described above.

[0076] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 3 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 3 Take a processor 10 as an example.

[0077] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0078] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.

[0079] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0080] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0081] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.

[0082] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.

[0083] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0084] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A control method for a thermal printer, characterized in that, The method includes: In response to the thermal printer starting up, obtain the initial printing parameters of the thermal printer; Based on the initial printing parameters, a heating printing command is triggered; According to the heating and printing command, the current voltage parameters, multiple heating characteristic parameters, multiple temperature characteristic parameters, and target print image of the thermal printer are obtained; Based on the current voltage parameters, the initial printing parameters, and the multiple heating characteristic parameters, calculate the actual output power of each printing point of the thermal printer's print head; Calculate the current temperature parameters of the thermal printer based on the multiple temperature characteristic parameters; Calculate the current gray level and current gray value of the target printed image; Based on the current grayscale level, the current grayscale value, the current temperature parameter, and the actual output power, the current printing time of the thermal printer is calculated, and the target image is printed according to the current printing time.

2. The method according to claim 1, characterized in that, The initial printing parameters include: initial printing density, initial temperature parameters, and initial voltage parameters. Based on the initial printing parameters, a heating printing command is triggered, including: A heating printing command is triggered when the initial print density matches the preset print density, the initial temperature parameter matches the preset temperature parameter, and the initial voltage parameter matches the preset voltage parameter.

3. The method according to claim 2, characterized in that, The plurality of heating characteristic parameters include: the average resistance of the thermal printer's printhead, the common electrode resistance of the thermal printer's printhead, the number of heating points of the thermal printer's printhead, and the resistance of the driver chip of the thermal printer's printhead. Based on the current voltage parameters, the initial printing parameters, and the multiple heating characteristic parameters, the actual output power of each printing point of the thermal printer's print head is calculated using the following formula: in, This refers to the actual output power of each print point on the print head of the thermal printer. The current voltage parameter, The average resistance of the printhead in a thermal printer. This refers to the common electrode resistance of the printhead of the thermal printer. This refers to the number of heating points on the printhead of a thermal printer. The resistor is for driving the chip.

4. The method according to claim 1, characterized in that, Based on the multiple temperature characteristic parameters, the current temperature parameter of the thermal printer is calculated using the following formula: in, This refers to the current resistance value of the thermistor of the thermal printer under the current temperature parameters. This refers to the nominal resistance value of the thermistor in the thermal printer under normal temperature parameters. These are the temperature characteristic parameters of the thermal printer. The current temperature parameter, These are normal temperature parameters.

5. The method according to claim 1, characterized in that, Calculating the current grayscale level and current grayscale value of the target printed image includes: Scan each target pixel line by line from the starting pixel of the target printed image until the scanning is finished, and obtain the target grayscale value corresponding to the target pixel; Determine whether the target grayscale value is greater than a preset threshold; If so, mark the current gray level of the target printed image as the first gray level; If not, mark the current gray level of the target printed image as the second gray level.

6. The method according to claim 5, characterized in that, Based on the current grayscale level, the current grayscale value, the current temperature parameter, and the actual output power, the current printing time of the thermal printer is calculated, including: If the current grayscale level is the first grayscale level, the current printing time of the thermal printer is calculated by the first printing algorithm based on the current grayscale value corresponding to the first grayscale level, the current temperature parameter, and the actual output power. If the current grayscale level is the second grayscale level, the current printing time of the thermal printer is calculated using the second printing algorithm based on the current grayscale value corresponding to the second grayscale level, the current temperature parameter, and the actual output power.

7. The method according to claim 5, characterized in that, Based on the current grayscale level, the current grayscale value, the current temperature parameter, and the actual output power, the current printing time of the thermal printer is calculated, including: If the current gray level is the first gray level, the current printing time of the thermal printer is calculated by the first printing algorithm based on the first preset heating value, the first preset gray concentration, the current gray value corresponding to the first gray level, the current temperature parameter, and the actual output power. If the current grayscale level is the second grayscale level, the current printing time of the thermal printer is calculated by the second printing algorithm based on the second preset heating value, the second preset grayscale concentration, the current grayscale value corresponding to the second grayscale level, the current temperature parameter, and the actual output power.

8. The method according to claim 2, characterized in that, Also includes: Based on the current temperature parameter, update the initial temperature parameter and multiple heating characteristic parameters.

9. A control device for a thermal printer, characterized in that, The device includes: The initial parameter acquisition module is used to acquire the initial printing parameters of the thermal printer in response to the start of the thermal printer. The print command triggering module is used to trigger a heating print command based on the initial print parameters; The print data acquisition module is used to acquire the current voltage parameters, multiple heating characteristic parameters, multiple temperature characteristic parameters, and target print image of the thermal printer according to the heating print command. The printing power calculation module is used to calculate the actual output power of each printing point of the print head of the thermal printer based on the current voltage parameters, the initial printing parameters, and the multiple heating characteristic parameters. The current temperature calculation module is used to calculate the current temperature parameters of the thermal printer based on the multiple temperature characteristic parameters. The current grayscale calculation module is used to calculate the current grayscale level and current grayscale value of the target printed image; The printing time calculation module is used to calculate the current printing time of the thermal printer based on the current grayscale level, the current grayscale value, the current temperature parameter, and the actual output power, and to print the target image according to the current printing time.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the control method for the thermal printer as described in any one of claims 1 to 8.

11. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the control method for the thermal printer as described in any one of claims 1 to 8.