Historical printing data-based layered heating control method of thermal printer
By adopting a layered heating control method based on historical printing data in the thermal printer, the heating spots are extracted and controlled according to the heating time, the problem of excessive temperature of the heating spot affecting the printing quality and life is solved, and efficient printing speed and quality are achieved .
Patent Information
- Application Number
- CN202411383821.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2024-12-31
AI Technical Summary
During the printing process, existing thermal printers affect the life of the print head and the quality of the print head due to the high temperature of the heating point. In order to avoid this problem, increasing the rest time will cause the printing speed to slow down, affecting the user experience.
Using a layered heating control method based on historical printing data, three sets of heating data are extracted from the printing data of the current line and the first two lines, and heating is carried out according to the theoretical heating time of each set of data to ensure accurate control of the heating spot and reduce heating time , avoid overheating of the heating spots.
Without sacrificing printing speed, the printing quality and print head life are improved, printing errors and speed reduction problems caused by overheating of heating spots are avoided, and the competitiveness of the product is enhanced.
Smart Images

Figure CN119225667A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of thermal printing, and in particular to a layered heating control method of a thermal printer based on historical printing data. Background Art
[0002] In modern printing technology, thermal printers are widely used in various fields, such as cash register systems, ticket printing, label printing, etc., due to their advantages of high speed, high precision, low noise and easy maintenance. Thermal printers heat the thermal element on the print head, making it contact with thermal paper and produce a chemical reaction, thereby forming an image or text on the paper.
[0003] Taking a common POS thermal printer as an example, the print head of a thermal printer is 48mm wide and contains 384 heating points, corresponding to 48 bytes of print data (i.e., each line can print a maximum of 48 bytes of content). When each line of data is printed, the printer will control whether the corresponding heating point is heated according to the 48 bytes (384 bits, each bit corresponds to a heating point) content of the line. In the existing thermal printer control technology, each line of data is printed independently, without considering whether the corresponding heating point has been heated in the previous line. If some heating points have been heated in the first few lines, without sufficient rest and heat dissipation, the temperature of these heating points will be too high, affecting the life of the print head. Moreover, when printing the next line of data where these heating points do not need to be heated, because these heating points are too high and have not completely dissipated the heat, the thermal printing paper corresponding to these heating points will turn black, affecting the printing effect or causing the printed content to be inconsistent with expectations.
[0004] To solve the above problem, the common practice is to add some rest time after a line is printed to allow the heating point to fully dissipate heat before printing the next line. Although this solution can solve the problem of overheating of the heating point affecting the printed content and the life of the print head, the time required to print the entire content is greatly increased due to the additional rest time for each line, that is, the printing speed is slowed down, affecting the user experience. Summary of the invention
[0005] In view of the deficiencies in the prior art, the present invention provides a layered heating control method for a thermal printer based on historical printing data, which fully considers the impact of previous printing data on current line printing data, and ensures printing quality and print head life without sacrificing printing speed.
[0006] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:
[0007] A layered heating control method for a thermal printer based on historical printing data, comprising:
[0008] 1) Obtain the print data of the current row from the print data queue, and extract three sets of heating data from the print data of the current row and the print data of the previous two rows, wherein the three sets of heating data are respectively the original data of the current row, the data consisting of the points that need to be heated in the current row but not heated in the previous row, and the data consisting of the points that need to be heated in the current row but not heated in the previous two rows;
[0009] 2) Obtain the theoretical heating time corresponding to the three groups of data according to the rest time of the heating point corresponding to each group of data, and finally heat the three groups of data according to the corresponding heating time. In this way, each row of data is heated in turn until all the data is printed.
[0010] As a possible implementation mode, further, step 1) specifically includes the following steps:
[0011] 1.1) Get the print data of the current line from the print data queue;
[0012] 1.2) Extract the following three sets of heating data from the current line of print data and the previous two lines of print data:
[0013] Data 1: the original data of the current row, which contains all the points to be heated in the current row;
[0014] Data 2: Data consisting of points to be heated in the current row but not heated in the previous row;
[0015] Data 3: Data consisting of points that are to be heated in the current row but not heated in the previous two rows.
[0016] As a possible implementation method, further, the logical operation method of data 2 is: firstly, the original data of the current row is ANDed with the print data of the previous row, and then the result is XORed with the print data of the current row, and finally data 2 is obtained.
[0017] As a possible implementation method, further, the logical operation method of data 3 is: firstly, the first two lines of printed data are operated with data 2, and then the obtained result is operated with data 2, and finally data 3 is obtained.
[0018] As a possible implementation mode, further, step 2) specifically includes the following steps:
[0019] 2.1) Obtain the theoretical heating time corresponding to the three groups of data according to the rest time of the heating point corresponding to each group of data, wherein the theoretical heating time of data 1 is T1, the theoretical heating time of data 2 is T2, and the theoretical heating time of data 3 is T3;
[0020] 2.2) The heating point to be heated in data 1 is heated according to the heating time T1, then data 2 is heated according to the heating time T2-T1, and finally data 3 is heated according to the heating time T3-T2;
[0021] 2.3) Loop through steps 1) to 2) until all print data is printed.
[0022] Based on the above, the present invention also provides a computer-readable storage medium, in which at least one instruction, at least one program, code set or instruction set is stored, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the layered heating control method based on historical printing data of the above-mentioned thermal printer.
[0023] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art:
[0024] The present invention overcomes the current situation of isolated printing of each line of data in the existing thermal printer control method. By fully considering the influence of the residual temperature of the heating points corresponding to the first two lines of printing data on the heating points corresponding to the current line of printing data, the heating time of the heating points heated in the first two lines of printing data is reduced when the current line of printing data is printed, and the heating points are prevented from overheating due to too long heating time, thereby affecting the printing quality and the life of the print head. At the same time, the present invention also adopts precise heating time control of the heating points, so there is no need to add some rest time after printing a line to allow the print head to fully rest and dissipate heat, so it will not cause the printing speed to slow down and affect the user experience, thereby improving the competitiveness of the product. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 It is a simplified flow chart of the present invention;
[0027] Figure 2 This is an example diagram of obtaining data 1, data 2, and data 3 according to the current row data and the previous two rows of data in one embodiment of the present invention ( Figure 2 In the table, "1" means heating and "0" means no heating). DETAILED DESCRIPTION
[0028] The present invention will be further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present invention, but are not intended to limit the scope of the present invention. Similarly, the following examples are only partial embodiments of the present invention rather than all embodiments, and all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present invention.
[0029] The present embodiment provides a hierarchical heating control method based on historical printing data of a thermal printer, comprising: obtaining the printing data of the current line from a printing data queue, extracting three groups of heating data from the printing data of the current line and the printing data of the previous two lines, the three groups of heating data respectively being the original data of the current line, data consisting of points that need to be heated in the current line but not heated in the previous line, and data consisting of points that need to be heated in the current line but not heated in the previous two lines, then obtaining theoretical heating times corresponding to the three groups of data respectively according to the rest time of the heating points corresponding to each group of data, finally heating the three groups of data according to the corresponding heating times, and heating each line of data in this way in turn until all the data are printed.
[0030] See attached Figure 1 As shown, the hierarchical heating control method based on historical printing data of the thermal printer in this embodiment specifically includes the following steps:
[0031] 1) Get the print data of the current line from the print data queue;
[0032] 2) Extract the following three sets of heating data from the current line of printing data and the previous two lines of printing data (see attached Figure 2 shown):
[0033] Data 1: the original data of the current row, which contains all the points to be heated in the current row;
[0034] Data 2: Data consisting of the points to be heated in the current row but not heated in the previous row; the logical operation of data 2 is: first, the original data of the current row is ANDed with the print data of the previous row, and then the result is XORed with the print data of the current row, and finally data 2 is obtained.
[0035] Data 3: Data consisting of the points to be heated in the current row but not heated in the first two rows; the logical operation of data 3 is: first perform an AND operation on the first two rows of printed data and data 2, then perform an XOR operation on the result and data 2, and finally obtain data 3.
[0036] 3) According to the rest time of the heating point corresponding to each set of data (rest time is the time when the heating point is not heated between two adjacent heating processes), the theoretical heating time corresponding to the three sets of data is obtained respectively, wherein the theoretical heating time is related to the rest time of the heating point. Generally, the longer the rest time of the heating point is (i.e., the longer the heat dissipation time of the heating point is), the longer the heating time required for the next heating is. After obtaining the rest time of the heating point corresponding to each set of data, the existing thermal printer can automatically calculate the theoretical heating time corresponding to each set of data.
[0037] In this embodiment, the theoretical heating time of data 1 is T1, the theoretical heating time of data 2 is T2, and the theoretical heating time of data 3 is T3.
[0038] 4) Heat the heating point to be heated in data 1 according to the heating time T1, and then heat data 2 according to the heating time T2-T1 (it can be understood that since the heating point corresponding to data 2 has been heated for time T1 when data 1 is heated, the heating time of data 2 here is not T2, but the time T1 that data 2 has been heated in the heating stage of data 1 should be subtracted, so that the heating time of data 2 is T2-T1); finally, heat data 3 according to the heating time T3-T2 (similarly, since the heating point corresponding to data 3 has been heated for time T1+(T2-T1)=T2 in the heating stages of data 1 and data 2, the heating time of data 3 here is not T3, but the time T2 that data 3 has been heated in the heating stages of data 1 and data 2 should be subtracted, so that the heating time of data 3 is T3-T2).
[0039] 5) Determine whether all the data to be printed has been printed. If not, return to step 1) and continue to take the next line of data and print it according to the above steps. Repeat steps 1) to 5) until all the print data has been printed.
[0040] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0041] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0042] The above descriptions are only some embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent device or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A layered heating control method based on historical printing data of a thermal printer, characterized in that: include: 1) Obtain the print data of the current row from the print data queue, and extract three sets of heating data from the print data of the current row and the print data of the previous two rows, wherein the three sets of heating data are respectively the original data of the current row, the data consisting of the points that need to be heated in the current row but not heated in the previous row, and the data consisting of the points that need to be heated in the current row but not heated in the previous two rows; 2) Obtain the theoretical heating time corresponding to the three groups of data according to the rest time of the heating point corresponding to each group of data, and finally heat the three groups of data according to the corresponding heating time. In this way, each row of data is heated in turn until all the data is printed.
2. The layered heating control method based on historical printing data of a thermal printer according to claim 1, characterized in that: Step 1) specifically includes the following steps: 1.1) Get the print data of the current line from the print data queue; 1.2) Extract the following three sets of heating data from the current line of print data and the previous two lines of print data: Data 1: the original data of the current row, which contains all the points to be heated in the current row; Data 2: Data consisting of points to be heated in the current row but not heated in the previous row; Data 3: Data consisting of points that are to be heated in the current row but not heated in the previous two rows.
3. The layered heating control method based on historical printing data of a thermal printer according to claim 1, characterized in that: The logical operation method of data 2 is: first, the original data of the current row is ANDed with the print data of the previous row, and then the result is XORed with the print data of the current row, and finally data 2 is obtained.
4. The layered heating control method based on historical printing data of a thermal printer according to claim 1, characterized in that: The logical operation method of data 3 is: first, the first two lines of printed data are ANDed with data 2, and then the result is XORed with data 2 to finally obtain data 3.
5. The layered heating control method based on historical printing data of a thermal printer according to claim 1, characterized in that: Step 2) specifically includes the following steps: 2.1) Obtain the theoretical heating time corresponding to the three groups of data according to the rest time of the heating point corresponding to each group of data, wherein the theoretical heating time of data 1 is T1, the theoretical heating time of data 2 is T2, and the theoretical heating time of data 3 is T3; 2.2) The heating point to be heated in data 1 is heated according to the heating time T1, then data 2 is heated according to the heating time T2-T1, and finally data 3 is heated according to the heating time T3-T2; 2.3) Loop through steps 1) to 2) until all print data is printed.
6. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the layered heating control method based on historical printing data of the thermal printer as described in one of claims 1 to 5.
Citation Information
Patent Citations
Printing method of thermal printer, thermal printer and storage medium
CN109353127A
Thermal printing method and device and terminal equipment
CN112060777A
Heating data resume control method of thermal printing head, storage medium and printer
CN114312036A
Heating and cooling module
US20070215602A1
Cited By
Heating control method and device of thermal printer and electronic equipment
CN119974780A
