Heating control method, device and electronic equipment of thermal printer
By combining the dot matrix data of the current and adjacent rows of the thermal printer, the heating energy level and duration are dynamically adjusted, solving the problem of the inflexible adjustment of heating intensity in existing technologies and achieving an improvement in high-precision printing results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2026-03-20
AI Technical Summary
Existing thermal printers cannot dynamically adjust the heating intensity according to the different requirements of the printed content, resulting in unsatisfactory printing results. In particular, when printing high-precision images, problems such as blurry images, overheating damage to the print head, or paper discoloration are prone to occur.
By combining the multi-row dot matrix data of the current row and neighboring rows, the heating energy level of each pixel in the row to be printed is determined, and the corresponding heating duration is configured according to the heating energy level to precisely control the heating process of each pixel.
It achieves precise control of heating energy at the pixel level, improving print quality and overall print effect, and avoiding problems of overheating or underheating.
Smart Images

Figure CN119974780B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of thermal printing technology, and in particular to a heating control method, apparatus, and electronic device for a thermal printer. Background Technology
[0002] Thermal printers are widely used in printing invoices, barcodes, and labels. Their working principle involves controlling the temperature of the heating element in the thermal printhead to conduct heat to the thermal paper, creating a chemical reaction that displays the image. Existing thermal printers mostly use simple constant-temperature heating control, unable to dynamically adjust the heating intensity according to the different requirements of the printed content. This method easily leads to unsatisfactory print results, especially when printing high-precision images, resulting in problems such as blurry images, overheating damaging the printhead, or paper discoloration. Current technology still has many shortcomings in flexible heating control for different printing needs, especially when printing complex content or using different types of thermal paper. How to effectively balance the accuracy and power consumption of the heating process has become a technical challenge. Summary of the Invention
[0003] This application provides a heating control method, apparatus, and electronic device for a thermal printer, which can solve the technical problem in the related art of not being able to accurately control the heating accuracy of each pixel on the printing paper.
[0004] In a first aspect, embodiments of this application provide a heating control method for a thermal printer, the method comprising:
[0005] Based on the dot matrix data of the row to be printed and at least one target row, determine the heating energy level of each pixel in the row to be printed, wherein the target row is adjacent to the row to be printed and there are multiple heating energy levels;
[0006] The heating duration of each pixel is determined based on its heating energy level.
[0007] Each pixel on the printing paper is heated according to its corresponding heating time.
[0008] In some feasible embodiments of this application, determining the heating energy level of each pixel in the row to be printed based on the dot matrix data of the row to be printed and at least one target row includes: determining the thermal history data corresponding to each heating energy level based on the dot matrix data of the row to be printed and at least one target row, wherein the thermal history data is used to characterize whether each pixel in the row to be printed needs to be heated at each heating energy level; and determining the heating energy level of each pixel in the row to be printed based on the thermal history data corresponding to each heating energy level.
[0009] In some possible embodiments of the present application, the determining of the thermal history data corresponding to each heating energy level comprises: calculating the dot matrix data of the to-be-printed row and the at least one target row according to the thermal history algorithm formula corresponding to each heating energy level, respectively, to obtain the thermal history data corresponding to each heating energy level.
[0010] In some possible embodiments of the present application, the determining of the heating energy level of each pixel point in the to-be-printed row according to the thermal history data corresponding to each heating energy level comprises: determining the target heating energy level that needs to be heated corresponding to each pixel point in the to-be-printed row according to the thermal history data corresponding to each heating energy level, respectively; and determining the target heating energy level with the longest heating duration corresponding to each pixel point as the heating energy level of each pixel point.
[0011] In some possible embodiments of the present application, the at least one target row is the front N rows and the back M rows corresponding to the to-be-printed row, N and M are non-negative integers and N and M are not 0 at the same time; and the number of pixel points of the target row in the dot matrix data is greater than or equal to the to-be-printed row.
[0012] In some possible embodiments of the present application, the method further comprises: allocating the heating duration to each heating energy level in a preset manner.
[0013] In some possible embodiments of the present application, the heating of each pixel point on the printing paper according to the heating duration corresponding to each pixel point comprises: starting the heating of each pixel point at the same time, and controlling the total heating time of each pixel point according to the heating duration corresponding to each pixel point.
[0014] In some possible embodiments of the present application, the allocating of the heating duration to each heating energy level in a preset manner comprises: determining at least one target heating energy level that needs to be adjusted in the heating duration and an adjustment manner of each target heating energy level according to the position rule of the pixel point corresponding to each heating energy level in the to-be-printed content; and increasing or decreasing the heating duration of each target heating energy level according to the adjustment manner of each target heating energy level.
[0015] In some possible embodiments of the present application, the duration amplitude of the increasing and the decreasing does not exceed a preset proportion of the original heating duration.
[0016] In some possible embodiments of the present application, the determination of the target heating energy level requiring heating time adjustment and the adjustment mode of each target heating energy level according to the position of the pixel corresponding to each heating energy level in the to-be-printed content includes: determining whether the pixel corresponding to each heating energy level needs to reduce heating energy according to the position of the pixel corresponding to each heating energy level in the to-be-printed content, and if yes, determining the heating energy level as a first target heating energy level requiring heating time reduction; and determining whether the pixel corresponding to each heating energy level needs to increase heating energy according to the position of the pixel corresponding to each heating energy level in the to-be-printed content, and if yes, determining the heating energy level as a second target heating energy level requiring heating time increase.
[0017] In some possible embodiments of the present application, the increase or decrease of the heating time of each target heating energy level includes: reducing the heating time of the first target heating energy level, determining the total heating time t d , and distributing t d to each second target heating energy level.
[0018] In some possible embodiments of the present application, the increase or decrease of the heating time of each target heating energy level includes: determining the heating time t i that the second target heating energy level with the highest energy level needs to increase, and distributing t i to other second target heating energy levels.
[0019] In some possible embodiments of the present application, the dot matrix data is binary data, and the pixel requiring heating in the binary data is represented by a bit value 1, and the pixel not requiring heating is represented by a bit value 0.
[0020] In some possible embodiments of the present application, before the determination of the heating energy level of each pixel in the to-be-printed row according to the dot matrix data of the to-be-printed row and at least one target row, the method further includes: receiving dot matrix data of to-be-printed content, the to-be-printed content being edited by a user; and obtaining the dot matrix data of the to-be-printed row and at least one target row from the dot matrix data of the to-be-printed content.
[0021] In a second aspect, the embodiments of the present application provide a heating control device of a thermal printer, which comprises:
[0022] an energy level obtaining module, configured to determine the heating energy level of each pixel in the to-be-printed row according to the dot matrix data of the to-be-printed row and at least one target row, the target row being adjacent to the to-be-printed row and the heating energy level having multiple values;
[0023] a heating calculation module, configured to determine the heating time of each pixel based on the heating energy level of each pixel.
[0024] A pixel heating module is configured to heat each pixel on the printing paper according to a heating duration corresponding to each pixel.
[0025] In a third aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and performing the steps of the method.
[0026] In a fourth aspect, an embodiment of the present application provides an electronic device, which comprises a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the computer program is suitable for being loaded by the processor and performing the steps of the method.
[0027] The technical scheme provided by some embodiments of the present application has at least the following beneficial effects:
[0028] The present application provides a heating control method of a thermal printer. According to dot matrix data of a to-be-printed line and at least one target line, the heating energy level of each pixel in the to-be-printed line is determined. The target line is adjacent to the to-be-printed line, and the heating energy level has multiple values. The heating duration of each pixel is determined based on the heating energy level of each pixel. Each pixel on the printing paper is heated according to the corresponding heating duration of each pixel. In the present application, the heating energy level of each pixel in the to-be-printed line is determined by combining the dot matrix data of the current line and the adjacent lines. Then, the heating duration of each pixel is further configured according to the required heating energy level of the pixel. Each pixel is heated using the appropriate heating duration. The thermal energy existing in the surrounding environment of the to-be-printed line can be analyzed from the dot matrix data of the adjacent lines. By analyzing the thermal energy of the to-be-printed line itself and the surrounding environment as a whole, the required heating energy level of each pixel in the to-be-printed line can be more accurately determined. Thus, the heating duration of each pixel can be more accurately controlled. The heating energy at the pixel level is precisely controlled. The printing effect of each pixel is more clear, and the overall printing quality is improved. BRIEF DESCRIPTION OF DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the present application. Those skilled in the art can obtain other drawings according to these drawings without any creative effort.
[0030] Figure 1 An exemplary system architecture diagram of the heating control method of the thermal printer provided by an embodiment of the present application;
[0031] Figure 2 A flowchart of the heating control method of the thermal printer provided by an embodiment of the present application;
[0032] Figure 3 A dot matrix data example diagram of a to-be-printed row and a target row provided for an embodiment of the present application;
[0033] Figure 4 An allocation example diagram of heating time length of each heating energy level provided for an embodiment of the present application;
[0034] Figure 5 A flowchart of a heating control method of a thermal printer provided for an embodiment of the present application;
[0035] Figure 6 A setting example diagram of heating energy level of each pixel provided for an embodiment of the present application;
[0036] Figure 7 A calculation result example diagram of heating energy level of a hot pixel provided for an embodiment of the present application;
[0037] Figure 8 A flowchart of a heating control method of a thermal printer provided for an embodiment of the present application;
[0038] Figure 9 A fine-tuning example diagram of heating time length of each heating energy level provided for an embodiment of the present application;
[0039] Figure 10 A structural block diagram of a heating control device of a thermal printer provided for an embodiment of the present application;
[0040] Figure 11 A structural schematic diagram of an electronic device provided for an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to make the features and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0042] The following description refers to the accompanying drawings. Unless otherwise noted, like elements in different drawings have the same or similar reference numerals. The following description of illustrative embodiments is not meant to limit or restrict the scope of the application, but is to enable any person skilled in the art to make or use the application. Numerous specific details are described to provide a thorough understanding of the embodiments of the present application. However, in the interest of not obscuring the application, the principles and aspects of the application can be practiced with not all specific details. Conjunctions, such as "and", "or", and "and / or", as used herein, are to be interpreted in an inclusive (and complementary) sense (i.e., "and / or" means one or all). Conjunctive language such as "and / or" is used to indicate a quantity of associated objects, such as a quantity of objects in a set. For example, "a, b, and / or c" means "a, b, or c" or any combination thereof.
[0043] Hereinafter, the terms "first" and "second" are used only for the purpose of description and should not be construed as suggesting or implying relative importance or implying the number of the technical features indicated. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more of the features.
[0044] The working principle of a thermal printer is based on heating elements inside the thermal print head, which can quickly adjust to a specific temperature according to the input print signal. When the heating elements come into contact with the special thermal paper, through the action of heat conduction, the special coating on the thermal paper will undergo a chemical reaction, showing clear text and image information, without the need for traditional ink or carbon tape, thus achieving a fast and low-noise printing experience. However, most thermal printers currently use constant temperature heating control technology. Although this technology is simple and direct, it cannot well adapt to diversified and high-precision printing needs. Specifically, it cannot flexibly adjust the heating intensity according to the specific characteristics of the print content (such as the thickness of the text, the density variation of the image, etc.), but maintains a constant heating level. When the same position is continuously heated by the heating points, the accumulated heat is too large, resulting in a decrease in printing effect, mainly manifested as the appearance of connected strokes in thick strokes, barcode connections, and paper surface melting when printing black blocks.
[0045] Therefore, the embodiments of the present application provide a heating control method for a thermal printer. When heating the pixel points, the heating energy levels of the pixel points of the to-be-printed row are determined in combination with the multi-row dot matrix data of the current row and the adjacent rows, and then the heating time of each pixel point is further configured according to the required heating energy level of the pixel point, and each pixel point is heated using the appropriate heating time, so as to solve the above technical problems.
[0046] Please refer to Figure 1 , Figure 1 An exemplary system architecture diagram of a heating control method for a thermal printer is provided in the embodiments of the present application.
[0047] like Figure 1 As shown, the system architecture may include electronic device 101, network 102, and terminal 103. Electronic device 101 may be a thermal printer or other device with thermal printing capabilities. Specifically, electronic device 101 may include a control module, an execution module, and a data acquisition module. The control module may include various integrated circuits and circuit boards such as microcontrollers, processors, and System-on-Chip (SoC). The execution module may include the print head, motor, paper feed mechanism, paper return mechanism, and other components that perform the printing process. The data acquisition module may include a touch panel, various sensors, and communication chips for acquiring various external data.
[0048] Terminal 103 can be any type of terminal device that transmits printed content to electronic device 101, such as mobile phones, tablets, portable digital cameras, media players, portable gaming devices, desktop computers, laptops, etc. Network 102 can include various types of wired or wireless communication links, for example: wired communication links include at least a USB data cable, and wireless communication links include Bluetooth communication links, Wireless-Fidelity (Wi-Fi) communication links, etc.
[0049] Electronic device 101 can interact with terminal 103 via network 102 to receive messages from or send messages to terminal 103. Alternatively, electronic device 101 can interact with terminal 103 via network 102 to receive messages or data sent to terminal 103 by other users. Network 102 serves as the medium for providing a communication link between electronic device 101 and terminal 103. The messages and data transmitted between electronic device 101 and terminal 103 can be content to be printed, processed data to be printed, printing result report information, etc. This application does not specifically limit the type of information and data.
[0050] In this embodiment of the application, taking the electronic device 101 as a thermal printer as an example, the electronic device 101 first determines the heating energy level of each pixel in the row to be printed based on the dot matrix data of the row to be printed and at least one target row, wherein the target row is adjacent to the row to be printed and there are multiple heating energy levels; further, the electronic device 101 can determine the heating duration of each pixel based on the heating energy level of each pixel; on this basis, the electronic device 101 heats each pixel on the printing paper according to the heating duration corresponding to each pixel, thereby realizing the printing of the row to be printed. By performing the above steps on each row of the content to be printed, the complete printing of the content to be printed can be completed.
[0051] It should be understood that Figure 1The number of electronic devices, networks and terminals in the figure is only illustrative, and can be any number of electronic devices, networks and terminals according to the implementation needs.
[0052] Please refer to Figure 2 , Figure 2 A flowchart of a heating control method of a thermal printer is provided for the embodiments of the present application. The execution subject of the embodiments of the present application can be an electronic device that executes the heating control of the thermal printer, can be a processor in the electronic device that executes the heating control method of the thermal printer, and can also be a heating control service of the thermal printer in the electronic device that executes the heating control method of the thermal printer. For the convenience of description, the specific execution process of the heating control method of the thermal printer is introduced below by taking the execution subject as the processor in the electronic device as an example.
[0053] As Figure 2 indicated, the embodiments of the present application take the electronic device as an example to describe the thermal printer, and the heating control method of the thermal printer can at least include:
[0054] S202, determining the heating energy level of each pixel point in the to-be-printed row according to the dot matrix data of the to-be-printed row and at least one target row, the target row being adjacent to the to-be-printed row and having multiple heating energy levels.
[0055] Optionally, the thermal printer needs to obtain the dot matrix data of the to-be-printed content before performing the thermal printing operation. The dot matrix data of the to-be-printed content is obtained based on the to-be-printed content information, the thermal paper size, the print head configuration information and other data information, and is used to represent whether each pixel point needs to be heated. When the thermal printer performs thermal printing on the to-be-printed content, the pixel points on the thermal paper are heated one by one according to the dot matrix data of the to-be-printed content.
[0056] Specifically, the dot matrix data received by the thermal printer is binary data, and the pixel points that need to be heated are represented by bit value 1, and the pixel points that do not need to be heated are represented by bit value 0. Each row on the thermal paper is divided into multiple bytes with 8 pixel points as a byte unit, and the thermal printer usually calculates in byte units when performing printing on each row. Please refer to Figure 3 , Figure 3 A dot matrix data example diagram of a to-be-printed row and a target row is provided for the embodiments of the present application. As Figure 3 indicated, the 8 pixel points in the to-be-printed row are taken as an example to describe, wherein the dot matrix data of the 8 pixel points in the to-be-printed row (i.e. the current row) is 11111110, which represents that the first 7 pixel points need to be heated, and the last pixel point does not need to be heated.
[0057] In a possible implementation, before determining the heating energy level of each pixel in the to-be-printed line according to the dot matrix data of the to-be-printed line and at least one target line, the thermal printer can receive the dot matrix data of the to-be-printed content edited by a user. The to-be-printed content can be in various forms such as text, picture, and the like. When the thermal printer acquires the dot matrix data, the dot matrix data can be generated by a client operated by the user and then sent to the thermal printer, or the thermal printer can generate the dot matrix data after the client sends the to-be-printed content to the thermal printer. When the dot matrix data is generated, if the user has specific processing requirements for the to-be-printed content (such as color adjustment operation, brightness adjustment operation, font size adjustment operation, and the like), the to-be-printed content can be processed according to the specific processing requirements of the user, and corresponding dot matrix data of the processing result is generated, to ensure that the printing effect is consistent with the user's expectation.
[0058] Optionally, during the printing process, after the print head heats the pixel, the pixel has a certain residual heat, and the residual heat will spread to the surroundings of the pixel. Then when there are multiple pixels to be heated around a pixel to be heated, the pixel to be heated will be affected by the diffusion heat energy of the surrounding pixels in addition to the heat energy applied by the print head, resulting in heat energy overflow. Finally, the pixel to be heated may have a heavier printing effect than expected, and such a pixel to be heated can easily cause the final printing result to have problems such as dense strokes, barcode connection, and even melting of the paper surface. Correspondingly, for a pixel to be heated without other heated pixels around, the surroundings of the pixel to be heated remain cool and do not have any excess heat energy. Then, the pixel to be heated may have a lighter printing effect during printing, which can cause the final printing result to have a problem of unclearness.
[0059] Based on this, in the embodiments of the present application, in order to achieve a more accurate printing effect, the heating energy of the to-be-printed line and the surroundings can be analyzed as a whole in combination with the heating of the pixels in the to-be-printed line and the heating of the pixels in the surrounding adjacent lines. Then the heating energy required by each pixel in the line is determined, and the heating control is performed according to the heating energy required by each pixel, so that the to-be-printed content can be printed completely and clearly. In the specific implementation process, the dot matrix data of the to-be-printed line and the dot matrix data of at least one target line adjacent to the to-be-printed line can be determined, and the heating energy required by the pixels in the to-be-printed line can be analyzed based on the dot matrix data of multiple lines. This analysis not only considers the heating requirement of the pixels themselves, but also fully considers the influence of the heat energy of the surrounding pixels, including the heating state and heat energy diffusion of the adjacent pixels in the adjacent lines.
[0060] In a possible implementation, the at least one adjacent target row selected for the to-be-printed row can be the front N rows and the back M rows corresponding to the to-be-printed row, N and M are non-negative integers and N and M are not 0 at the same time. That is, starting from the rows adjacent to the to-be-printed row, at least one row is selected as a target row. Meanwhile, considering that a pixel point is not only affected by the heat from the row directly above and the row directly below, but also by the overflow heat from the row above and the row below, the number of pixel points in the target row can be greater than or equal to that in the to-be-printed row in the dot matrix data. Please refer to Figure 3 Taking N=2 and M=1 as an example, the front row, the front two rows and the future row of the to-be-printed row (that is, the current row) are selected as target rows, and one more pixel point is selected on the left and right of the front row. That is, when the heating energy level of the eight pixel points in the current row is determined, eight pixel points in the current row (dot matrix is 11111110), ten pixel points in the front row (dot matrix is 0000111111), eight pixel points in the front two rows (dot matrix is 00000010) and eight pixel points in the future row (dot matrix is 10000001) are selected to form the dot matrix data required for calculation.
[0061] It should be noted that the selection scheme of the target row and the number of pixel points in the target row is not limited to the above examples, but can be selected according to actual needs, professional experience, etc., and the embodiments of the present application do not limit this.
[0062] Further, in order to control the heating energy received by the pixel points more systematically, several heating levels can be divided according to the heating capacity of the print head, and each heating level corresponds to different heating energy. That is, in the embodiments of the present application, according to the dot matrix data of the to-be-printed row and the at least one target row, appropriate heating levels can be assigned to each pixel point in the to-be-printed row, so as to ensure that each pixel point in the printing process obtains appropriate heating energy, thereby avoiding the problems of overheating or insufficient heating of each pixel point, and making the to-be-printed content more accurate in detail performance.
[0063] S204, determining the heating time length of each pixel point based on the heating level of each pixel point.
[0064] Optionally, considering that the heating time length is directly related to the total amount of energy actually applied and is a key factor for controlling the accuracy of the printing effect, after the heating level of each pixel point in the to-be-printed row is determined, the heating time length of each pixel point is further determined according to the heating level, so that each pixel point can obtain the heating energy corresponding to its own heating level through appropriate heating time.
[0065] S206, heating each pixel point on the printing paper according to the heating time length corresponding to each pixel point.
[0066] Optionally, the thermal printer can strictly perform the heating operation according to the heating time calculated for each pixel. This is usually achieved by a series of heating elements (such as tiny heating points in the thermal print head), which can quickly and accurately respond to instructions to heat the corresponding pixel on the print paper. The synchronization and accuracy of the heating elements are maintained during this process to ensure the uniformity and consistency of the entire print surface. By combining the multi-line dot matrix data of the current line and adjacent lines to determine the heating energy level of each pixel in the to-be-printed line, and accurately configuring the heating time, fine control of the heating energy at the pixel level is achieved.
[0067] In the embodiments of the present application, a heating control method of a thermal printer is provided. According to the dot matrix data of a to-be-printed line and at least one target line, the heating energy level of each pixel in the to-be-printed line is determined. The target line is adjacent to the to-be-printed line and has multiple heating energy levels. The heating time of each pixel is determined based on the heating energy level of each pixel. Each pixel on the print paper is heated according to the corresponding heating time of each pixel. In the present application, when heating the pixels, the heating energy level of each pixel in the to-be-printed line is determined by combining the multi-line dot matrix data of the current line and adjacent lines. Then, the heating time of each pixel is further configured according to the required heating energy level of the pixel, and each pixel is heated using the appropriate heating time. In this way, the thermal energy existing in the surrounding environment of the to-be-printed line can be analyzed from the dot matrix data of the adjacent lines. By analyzing the thermal energy of the to-be-printed line itself and its surroundings as a whole, the required heating energy level of each pixel in the to-be-printed line can be more accurately determined, thereby more accurately controlling the heating time of each pixel, achieving fine control of the heating energy at the pixel level, and making the final printing effect of each pixel clearer and improving the overall printing quality.
[0068] In order to facilitate the determination of the heating time of each pixel according to the heating energy level of each pixel, the heating time corresponding to each heating energy level needs to be preset. Therefore, in some embodiments of the present application, the heating control method of the thermal printer can at least include:
[0069] allocating the heating time to each heating energy level in a preset manner.
[0070] Optionally, for the heating time allocation scheme of a plurality of heating energy levels, in order to facilitate calculation and control, it can be set that from the first energy level to the Xth energy level, X is a positive integer greater than 1, that is, the heating time of the Xth energy level is the longest and the heating time of the first energy level is the shortest.
[0071] It should be noted that the specific values of the preset manner and the heating time can be selected and allocated according to actual needs in actual application, and the present application does not limit the preset manner and the specific heating time of each heating energy level.
[0072] Further, based on the heating time length allocated to each heating energy level, in the heating control method of the thermal printer, step S206 can further include the following steps:
[0073] Meanwhile, heating is started for each pixel point, and the total heating time of each pixel point is controlled according to the heating time length corresponding to each pixel point.
[0074] Alternatively, considering that the heating time increases with the increase of the energy level, the heating time of a higher energy level must contain the heating time of a lower energy level, therefore, in order to improve the heating efficiency, instead of sequentially heating each level, heating is started for each pixel point at the same time, and the total heating time of each pixel point is controlled according to the heating time length corresponding to each pixel point. That is, for the A pixel point requiring first energy level heating and the B pixel point requiring second energy level heating, heating is started at the same time, after the heating time length of the first energy level ends, the A pixel point stops heating, while the B pixel point continues heating until the heating time length of the second energy level ends.
[0075] Specifically, taking X=7 as an example. Please refer to Figure 4 , Figure 4 Fig. 1 is an example of the allocation of the heating time length of each heating energy level provided by the embodiment of the present application. As shown in Figure 4 , it is assumed that the longest heating time length of the pixel point is the heating time length of the highest energy level, that is, the heating time length of the seventh energy level is t, the total heating time is divided into 7 parts, and the heating time of each level is t / 7 more than the heating time of the previous level, and so on. Thus, the heating time of each level is obtained as follows: the heating time of the first energy level is t / 7*1, the heating time of the second energy level is t / 7*2, the heating time of the third energy level is t / 7*3, the heating time of the fourth energy level is t / 7*4, the heating time of the fifth energy level is t / 7*5, and the heating time of the sixth energy level is t / 7*6. After the heating energy level of each pixel point in the to-be-printed row is calculated, heating is started for each pixel point at the same time, and the heating of the pixel point is stopped after the heating time of the corresponding heating energy level ends, Figure 4 In Fig. 1, the blank grid in each heating time length represents the heated time, and the blue grid represents the heating time that needs to be extended compared with the lower energy level.
[0076] In the embodiment of the present application, by reasonably allocating the heating time length of the heating energy level and simultaneously controlling the heating of each pixel point, the total heating time required for printing each row is at most the heating time length of the highest heating energy level, and the heating control efficiency and the printing efficiency in the printing process are improved.
[0077] In some embodiments of the present application, the specific implementation of step S202 can refer to the following embodiments. As shown in Figure 5A flowchart of a heating control method of a thermal printer is shown. The embodiment is based on the heating control method of the thermal printer Figure 2 A detailed description of step S202 in the heating control method of the thermal printer according to the corresponding embodiment, in the heating control method of the thermal printer, step S202 can further include the following steps:
[0078] S502, determining, according to the dot matrix data of the to-be-printed row and at least one target row, thermal history data corresponding to each heating energy level, the thermal history data being used to represent whether each pixel point in the to-be-printed row needs to be heated at each heating energy level.
[0079] S504, determining the heating energy level of each pixel point in the to-be-printed row according to the thermal history data corresponding to each heating energy level.
[0080] Optionally, when determining the heating energy level of each pixel point in the to-be-printed row, the thermal history data corresponding to each heating energy level can be calculated for the to-be-printed row first, that is, it is calculated whether each pixel point in the to-be-printed row needs to be heated at each heating energy level, and then the corresponding heating energy level of each pixel point is determined according to the thermal history data corresponding to each heating energy level.
[0081] For example, if there are two heating energy levels in total, which are the first energy level and the second energy level, then there are two thermal history data corresponding to each heating energy level of the to-be-printed row, the thermal history data of the first energy level represents which pixel points in the to-be-printed row need the heating of the first energy level and which pixel points do not need the heating of the first energy level, and similarly, the thermal history data of the second energy level also represents which pixel points in the to-be-printed row need the heating of the second energy level and which pixel points do not need the heating of the second energy level. Then according to the thermal history data, it can be determined whether each pixel point needs to be heated at each heating energy level, and then the corresponding heating energy level of each pixel point in the to-be-printed row can be determined.
[0082] Specifically, the present embodiment constructs the corresponding heating energy level for each to-be-heated pixel point according to the surrounding thermal energy information of the to-be-heated pixel point. Please refer to Figure 6 , Figure 6 An example diagram of the setting of the heating energy level of each pixel point provided by the present embodiment is shown. As Figure 6 shown, taking setting of seven heating energy levels as an example, each heating energy level is represented as the first energy level, the second energy level, the third energy level, the fourth energy level, the fifth energy level, the sixth energy level, and the seventh energy level in sequence, for the purpose of description.
[0083] Further, according to the example heating time setting manner in the above embodiment, the heating time of the seventh energy level is the longest, and the heating time of the first energy level is the shortest. In combination with Figure 6It can be seen that, from the actual printing effect, the heating pixel points in different positions should be adaptively set to different heating energy levels due to the different influences of the surrounding thermal energy. If the heating pixel points have no surrounding pixel points heated (i.e., no excess thermal energy), the heating pixel points should be set to a heating energy level with a longer heating time, such as the seventh energy level, so that the heating pixel points have sufficient thermal energy to achieve the expected printing effect. Similarly, for the heating pixel points corresponding to the surrounding pixel points with more heating pixel points (i.e., more overflow thermal energy), the heating pixel points should be set to a heating energy level with a shorter heating time, such as the first energy level, so that the heating pixel points do not overheat and affect the printing effect.
[0084] It should be noted that the pixel point conditions corresponding to each heating energy level set in the actual situation are not limited to the above examples. The above only lists one or two possibilities for each level, and there can be multiple corresponding pixel point conditions for each level in actual setting. In addition to this, the pixel point conditions corresponding to each heating energy level can also be set according to business experience and actual needs, and are not limited to the examples given in the above embodiments. The setting method of the heating energy level in the embodiments of the present application is not limited.
[0085] Based on the above pre-set matching relationship between the pixel points and the heating energy levels, in order to facilitate the calculation of the thermal history data of each heating energy level during printing, the thermal history algorithm formula corresponding to each heating energy level can be converted according to the above set heating energy levels, so that during actual printing, binary bit operations can be performed on the binary dot matrix data of the to-be-printed row and the target row to obtain the thermal history data corresponding to each heating energy level, thereby obtaining information on whether each pixel point needs to be heated in each heating energy level.
[0086] In the embodiments of the present application, the dot matrix data of the to-be-printed row (current row) is denoted as cur, the dot matrix data of the previous row is denoted as pre1, the dot matrix data of the previous two rows is denoted as pre2, and the dot matrix data of the future row is denoted as fut. Moreover, if the number of pixel points of a certain target row is greater than that of the current row, the target row with more pixel points also needs to be split into multiple dot matrix data with the same number of pixel points as the current row. Taking the current row with 8 pixel points as an example, if the previous row has 10 pixel points on the left and right sides, respectively, which is one more than the current row, the previous row also needs to determine the dot matrix data of 1-8 pixel points as pre1_left and the dot matrix data of 3-10 pixel points as pre1_right, thereby realizing binary calculation between multiple equal dot matrix data.
[0087] Based on the above data representation, the thermal history algorithm formula for the 1-7 level heating energy levels can be converted according to the setting of the heating energy levels as follows:
[0088] 7th level hot history algorithm formula:
[0089] his7 = cur & (~prel) & (~prel_left) & (~prel_righ) & (~pre2) & fut;
[0090] 6th level hot history algorithm formula: his6 = his7
[0091] cur & (~prel) & (~prel_left) & (~prel_righ) & (~pre2) & (~fut);
[0092] 5th level hot history algorithm formula: his5 = his6
[0093] cur & (~prel) & (~prel_left) & (prel_righ) & (~pre2) & (~fut);
[0094] 4th level hot history algorithm formula: his4 = his5
[0095] cur & (prel) & (~prel_left) & (~prel_righ) & (~pre2) & (~fut);
[0096] 3rd level hot history algorithm formula: his3 = his4
[0097] cur & (prel) & (prel_left) & (~prel_righ) & (~pre2) & (~fut)
[0098] cur & (prel) & (~prel_left) & (prel_righ) & (~pre2) & (~fut);
[0099] 2nd level hot history algorithm formula: his2 = his3
[0100] cur & (prel) & (prel_left) & (prel_righ) & (~pre2) & (~fut);
[0101] 1st level hot history algorithm formula: hisl = his2
[0102] cur & (prel) & (prel_left) & (prel_righ) & (pre2) & (~fut);
[0103] Wherein, for the operators in the formula, “&” represents bit AND operation, “|” represents bit OR operation, and “~” represents bit inversion operation.
[0104] Further, continue to calculate and illustrate with the dot matrix data example in Figure 3 Figure 3 From the dot matrix data table in, the dot matrix data of the to-be-printed row (current row) is cur = 11111110 = 0xFE; the dot matrix data of the previous row is pre1 = 00011111 = 0x1F; the dot matrix data of the left side of the previous row is pre1_left = 00001111 = 0x0F; the dot matrix data of the right side of the previous row is pre1_right = 00111111 = 0x3F; the dot matrix data of the previous two rows is pre2 = 00000010 = 0x02; and the dot matrix data of the future row is fut = 10000001 = 0x81. According to the heat history algorithm formula corresponding to each heating level, the heat history data of each heating level of the to-be-printed row can be calculated as follows:
[0105] The heat history data of the 7th level is Grade7 = 10000000 = 0x80;
[0106] The heat history data of the 6th level is Grade6 = 11000000 = 0xC0;
[0107] The heat history data of the 5th level is Grade5 = 11100000 = 0xE0;
[0108] The heat history data of the 4th level is Grade4 = 11100000 = 0xE0;
[0109] The heat history data of the 3rd level is Grade3 = 11110000 = 0xF0;
[0110] The heat history data of the 2nd level is Grade2 = 11111100 = 0xFC;
[0111] The heat history data of the 1st level is Grade1 = 11111110 = 0xFE.
[0112] As can be seen, in each level of heat history data, 1 indicates that the pixel point in the to-be-printed row needs to be heated, and 0 indicates that the pixel point in the to-be-printed row does not need to be heated. In the 8 pixel points in the example, the first pixel point is 1 in the 1st to 7th level heat history data, which means that the first pixel point needs to be heated by the 1st to 7th level; the second pixel point is 1 in the 1st to 6th level heat history data and 0 in the 7th level heat history data, which means that the second pixel point needs to be heated by the 1st to 6th level and does not need to be heated by the 7th level; and the third pixel point is 1 in the 1st to 5th level heat history data and 0 in the 6th and 7th level heat history data, which means that the third pixel point needs to be heated by the 1st to 5th level and does not need to be heated by the 6th and 7th levels.
[0113] Based on this, when determining the heating energy level corresponding to each pixel point, the target heating energy level that needs to be heated corresponding to each pixel point in the to-be-printed row can be determined according to the thermal history data corresponding to each heating energy level, for example, the target heating energy level that needs to be heated corresponding to the first pixel point in the above example is all energy levels from the first to the seventh, and the target heating energy level that needs to be heated corresponding to the second pixel point is all energy levels from the first to the sixth. Since the heating time increases with the increase of the energy level, the heating time of the higher energy level will inevitably pass through the heating time of the lower energy level, so the target heating energy level with the longest heating time corresponding to each pixel point can be directly determined as the heating energy level of each pixel point, and then the heating time of each pixel point is determined according to the heating energy level corresponding to each pixel point.
[0114] For example, the target heating energy level with the longest heating time corresponding to the first pixel point is the seventh energy level, so the heating energy level of the first pixel point is the seventh energy level; the target heating energy level with the longest heating time corresponding to the second pixel point is the sixth energy level, so the heating energy level of the second pixel point is the sixth energy level; correspondingly, the energy level of the third pixel point is the fifth energy level, the energy level of the fourth pixel point is the third energy level, the energy levels of the fifth and sixth pixel points are both the second energy level, the energy level of the seventh pixel point is the first energy level, and the eighth pixel point does not need to be heated, that is, it does not need any heating.
[0115] In a possible embodiment, please refer to Figure 7 , Figure 7 A calculation result example diagram of the heating energy level of a thermal pixel point is provided in the embodiment of the present application. Taking the "middle" character as an example, the heating energy level corresponding to each pixel point can be calculated as shown in Figure 7 .
[0116] In the embodiment of the present application, a heating control method of a thermal printer is provided. According to the heating information of the pixel point itself and the thermal energy information existing around the pixel point, a plurality of heating energy levels with different heating times and a thermal history algorithm formula corresponding to each heating energy level are set. Thus, in the actual printing process, the printing system of the thermal printer can perform binary bit operation on the binary dot matrix data of the to-be-printed row and the target row to obtain the thermal history data corresponding to each heating energy level, so as to obtain the heating energy level corresponding to each pixel point according to the thermal history data of each level. Since the heating energy demand of the pixel point itself is considered in the calculation process, and the possible influence of the thermal energy of the surrounding environment on the heating effect of the pixel point is also fully considered. Therefore, the determined heating energy level is more in line with the actual printing demand, and the clarity and accuracy of the printing effect can be ensured.
[0117] To achieve more accurate printing effect, the heating time of each pixel point can also be fine-tuned based on the position characteristics of the pixel point in the content to be printed, on the basis of the heating time allocated to the pixel point according to the heating energy level. For example, the pixel point at the edge has no heat energy beside it, so it can compensate for a small amount of heating time to ensure that it receives sufficient heat energy, thereby avoiding unclear printing of the pixel point; for the pixel point in the last row, the future row does not need to be heated, so the heating time of the pixel point itself needs to be appropriately reduced to avoid tailing effect.
[0118] Therefore, in some embodiments of the present application, when performing the step of allocating heating time to each heating energy level in a preset manner, the step can also be specifically performed as Figure 8 A flowchart of a heating control method of a thermal printer is shown. In the heating control method of the thermal printer, the step of allocating heating time to each heating energy level in a preset manner can also specifically include the following steps:
[0119] S802, according to the position rule of the pixel point corresponding to each heating energy level in the content to be printed, determine at least one target heating energy level that needs to be adjusted in heating time and the adjustment mode of each target heating energy level.
[0120] S804, increase or decrease the heating time of each target heating energy level according to the adjustment mode of each target heating energy level.
[0121] In the embodiments of the present application, by setting each heating energy level, it can be determined that the pixel point of each heating energy level has a certain position rule in the content to be printed. Then, according to the position rule of the pixel point corresponding to each heating energy level in the content to be printed, for example, whether it is in a position without excess heat energy around or whether it is in a position with more overflow heat energy around, at least one target heating energy level that needs to be adjusted in heating time and the adjustment mode of each target heating energy level can be further determined. In this way, the heating time of each heating energy level can be adjusted more finely to achieve accurate heating control of each pixel point.
[0122] Specifically, for the position of the pixel point of each heating energy level, it can be determined whether the pixel point corresponding to each heating energy level needs to reduce heating energy, and if so, the heating energy level is determined as the first target heating energy level that needs to reduce heating time; and it can be determined whether the pixel point corresponding to each heating energy level needs to increase heating energy, and if so, the heating energy level is determined as the second target heating energy level that needs to increase heating time.
[0123] For example, from the position of the pixel point of each heating energy level, it can be determined whether the pixel point corresponding to each heating energy level needs to reduce heating energy, and if so, the heating energy level is determined as the first target heating energy level that needs to reduce heating time; and it can be determined whether the pixel point corresponding to each heating energy level needs to increase heating energy, and if so, the heating energy level is determined as the second target heating energy level that needs to increase heating time. Figure 7From the heating levels of each pixel in the "middle" character, it can be seen that the second and third levels have a greater impact on the vertical lines of the "middle" character. The second and third levels can be determined as the second target heating levels, and the heating time of the second and third levels can be appropriately increased. In this way, the content of the vertical lines can be printed more clearly, but it should not be too large to prevent obvious trailing caused by heat overflow. The seventh and first levels have a greater impact on the horizontal lines. The seventh level generally appears at the beginning of heating and requires a large amount of heating energy. Therefore, the seventh level can also be determined as the second target heating level, and the heating time of the seventh level can be appropriately increased; while the first level generally appears at the end of printing and does not require too much heating energy. Therefore, the first level can be determined as the first target heating level, and the heating time of the first level can be appropriately reduced to avoid trailing.
[0124] In a preferred embodiment, when fine-tuning the duration of the first target heating level and the second target heating level, the increase and decrease amplitudes of the duration do not exceed the preset ratio of the original heating duration. That is, the adjusted duration is generally selected within the range of 0 to the original heating duration, to avoid overly large adjusted duration amplitudes from destroying the duration control balance between the heating levels.
[0125] In some embodiments of the present application, a feasible duration adjustment scheme is provided. When there are both the first target heating level and the second target heating level, the heating duration of the first target heating level can be reduced first, and the total reduced heating duration t d is determined, and t d is allocated to each second target heating level that needs to extend the heating duration. It is also possible to first determine the highest level among the second target heating levels, increase its heating duration by t i , and then allocate t i to other lower second target heating levels. In this way, fine-tuning the duration of each heating level based on the total extended and reduced duration can control the overall heating duration within a suitable range.
[0126] Exemplarily, please refer to Figure 9 , Figure 9 which is a fine-tuning example diagram of the heating duration of each heating level provided in the embodiments of the present application. Among them, the first level is the first target heating level, and the second, third, and seventh levels are the second target heating levels. As shown in (A) of [[ID=二十二]] Figure 9 one adjustment method is to compensate the reduced heating time t d of the first level to the second and third levels, and the seventh level directly obtains the heating duration t i on the basis of the total duration, and the heating times of levels 1 to 7 are obtained as follows: T1 = t / 7 * 1 - t d ; T2 = t / 7 * 2 + a * td T3 = t / 7*3 + b*t d ;T4=t / 7*4; T5=t / 7*5; T6=t / 7*6; T7=t / 7*7+t i Where a and b are the assignments of t to the third and second energy levels. d The coefficient, that is, a + b = 1. For example... Figure 9 As shown in (B), if the reduced heating time of the first energy level is insufficient to compensate for the second and third energy levels, the heating time t of the seventh energy level can be extended. i A portion is also compensated for in the second and third energy levels, resulting in the heating times for levels 1 through 7 as follows: T1 = t / 7 * 1 - t d T2 = t / 7*2 + a*t d +c*t i T3 = t / 7*3 + b*t d +d*t i ;T4=t / 7*4; T5=t / 7*5; T6=t / 7*6; T7=t / 7*7+t i , where a+b=1; c+d≤1.
[0127] This application provides a heating control method for a thermal printer. Based on allocating heating time to pixels according to heating energy levels, the heating time of each pixel is finely adjusted according to its positional characteristics within the content to be printed. Each pixel, based on its specific positional attributes, receives a heating time slightly longer or shorter than the standard heating time set based on the heating energy level. Through this method, this application not only enables more flexible and precise adjustment of the heating time for each heating energy level but also achieves more accurate heating control for each pixel. This refined heating fine-tuning strategy improves the quality of the printed output.
[0128] Please see Figure 10 , Figure 10 This is a structural block diagram of a heating control device for a thermal printer provided in an embodiment of this application. Figure 10 As shown, the heating control device 1000 of the thermal printer includes:
[0129] The energy level acquisition module 1010 is used to determine the heating energy level of each pixel in the row to be printed based on the dot matrix data of the row to be printed and at least one target row, wherein the target row is adjacent to the row to be printed and there are multiple heating energy levels.
[0130] The heating calculation module 1020 is used to determine the heating duration of each pixel based on the heating energy level of each pixel.
[0131] The pixel heating module 1030 is configured to heat each pixel on the printing paper according to the heating duration corresponding to each pixel.
[0132] Optionally, the energy level acquisition module 1010 is further configured to determine, according to the dot matrix data of the to-be-printed line and the at least one target line, heat history data corresponding to each heating energy level, the heat history data being used to represent whether each pixel in the to-be-printed line needs to be heated under each heating energy level; and determine the heating energy level of each pixel in the to-be-printed line according to the heat history data corresponding to each heating energy level.
[0133] Optionally, the energy level acquisition module 1010 is further configured to calculate the dot matrix data of the to-be-printed line and the at least one target line according to the heat history algorithm formula corresponding to each heating energy level respectively, to obtain the heat history data corresponding to each heating energy level respectively.
[0134] Optionally, the energy level acquisition module 1010 is further configured to determine, according to the heat history data corresponding to each heating energy level, a target heating energy level corresponding to each pixel in the to-be-printed line that needs to be heated respectively; and determine, as the heating energy level of each pixel, the target heating energy level corresponding to each pixel that has the longest heating duration.
[0135] Optionally, the at least one target line is the front N lines and the back M lines corresponding to the to-be-printed line, N and M are non-negative integers and N and M are not 0 at the same time; and the number of pixels of the target line in the dot matrix data is greater than or equal to the to-be-printed line.
[0136] Optionally, the heating control device 1000 of the thermal printer further comprises a heating duration configuration module configured to allocate the heating duration to each heating energy level in a preset manner.
[0137] Optionally, the pixel heating module 1030 is further configured to start heating each pixel at the same time, and control the total heating time of each pixel according to the heating duration corresponding to each pixel.
[0138] Optionally, the heating duration configuration module is further configured to determine, according to the position rule of the pixel corresponding to each heating energy level in the to-be-printed content, at least one target heating energy level that needs to be adjusted in the heating duration and an adjustment manner of each target heating energy level; and increase or decrease the heating duration of each target heating energy level according to the adjustment manner of each target heating energy level.
[0139] Optionally, the increased and decreased duration amplitude does not exceed a preset proportion of the original heating duration.
[0140] Optionally, the heating time length configuration module is further configured to determine whether the pixel point corresponding to each heating energy level needs to reduce heating energy according to the position of the pixel point corresponding to each heating energy level in the to-be-printed content, and if yes, determine the heating energy level as a first target heating energy level which needs to reduce heating time length; determine whether the pixel point corresponding to each heating energy level needs to increase heating energy according to the position of the pixel point corresponding to each heating energy level in the to-be-printed content, and if yes, determine the heating energy level as a second target heating energy level which needs to increase heating time length.
[0141] Optionally, the heating time length configuration module is further configured to reduce the heating time length of the first target heating energy level, and determine the total heating time length t d to be reduced. d and distribute t i to other second target heating energy levels.
[0142] Optionally, the heating time length configuration module is further configured to determine the heating time length t i to be increased for the second target heating energy level with the highest energy level. i and distribute t i to other second target heating energy levels.
[0143] Optionally, the dot matrix data is binary data, and the pixel point needing heating is represented by bit value 1, and the pixel point not needing heating is represented by bit value 0.
[0144] Optionally, the heating control device 1000 of the thermal printer further comprises a printing content receiving module configured to receive dot matrix data of to-be-printed content, the to-be-printed content being edited by a user, and obtain dot matrix data of a to-be-printed line and at least one target line from the dot matrix data of the to-be-printed content.
[0145] Please refer to Figure 11 , Figure 11 for a structural schematic diagram of an electronic device provided by an embodiment of the present application. As shown in Figure 11 , the electronic device 1100 can include at least one processor 1101, at least one network interface 1104, a user interface 1103, a memory 1105, and at least one communication bus 1102.
[0146] The communication bus 1102 is configured to realize connection and communication between the components.
[0147] The user interface 1103 can include a display screen (Display) and a camera (Camera), and the optional user interface 1103 can further include a standard wired interface and a wireless interface.
[0148] The network interface 1104 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0149] The processor 1101 can include one or more processing cores. The processor 1101 connects various parts within the entire electronic device 1100 through various interfaces and lines, and performs various functions of the electronic device 1100 and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 1105, and calling data stored in the memory 1105. Alternatively, the processor 1101 can be implemented in at least one of a hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), a programmable logic array (PLA). The processor 1101 can integrate a combination of one or several of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes an operating system, a user interface, and an application program; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used for processing wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 1101, but can be realized by a separate chip.
[0150] The memory 1105 can include a random access memory (RAM) and can also include a read-only memory (ROM). Alternatively, the memory 1105 includes a non-transitory computer-readable storage medium. The memory 1105 can be used to store instructions, programs, codes, code sets, or instruction sets. The memory 1105 can include a program storage area and a data storage area, wherein the program storage area can store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area can store data involved in the above-mentioned various method embodiments, etc. The memory 1105 can alternatively be at least one storage device located away from the aforementioned processor 1101. As shown, the memory 1105 as a computer storage medium can include an operating system, a network communication module, a user interface module, and a heating control program of the thermal printer. Figure 11
[0151] In Figure 11 In the electronic device 1100 shown, the user interface 1103 is mainly used to provide an interface for user input, and obtain data input by the user; and the processor 1101 can be used to call the heating control program of the thermal printer stored in the memory 1105, and specifically perform the following operations:
[0152] According to the dot matrix data of the to-be-printed row and the at least one target row, determine the heating energy level of each pixel point in the to-be-printed row, the target row is adjacent to the to-be-printed row and there are multiple heating energy levels;
[0153] Determine the heating time of each pixel point based on the heating energy level of each pixel point.
[0154] Heat each pixel point on the printing paper according to the heating time corresponding to each pixel point.
[0155] In some embodiments, when the processor 1101 performs the operation of determining the heating energy level of each pixel point in the to-be-printed row according to the dot matrix data of the to-be-printed row and the at least one target row, it specifically performs the following steps: according to the dot matrix data of the to-be-printed row and the at least one target row, determine the heat history data corresponding to each heating energy level, the heat history data is used to represent whether each pixel point in the to-be-printed row needs to be heated under each heating energy level; determine the heating energy level of each pixel point in the to-be-printed row according to the heat history data corresponding to each heating energy level.
[0156] In some embodiments, when the processor 1101 performs the operation of determining the heat history data corresponding to each heating energy level, it specifically performs the following steps: according to the heat history algorithm formula corresponding to each heating energy level, respectively calculate the dot matrix data of the to-be-printed row and the at least one target row, to obtain the heat history data corresponding to each heating energy level.
[0157] In some embodiments, when the processor 1101 performs the operation of determining the heating energy level of each pixel point in the to-be-printed row according to the heat history data corresponding to each heating energy level, it specifically performs the following steps: according to the heat history data corresponding to each heating energy level, respectively determine the target heating energy level that needs to be heated corresponding to each pixel point in the to-be-printed row; determine the target heating energy level with the longest heating time corresponding to each pixel point as the heating energy level of each pixel point.
[0158] In some embodiments, the at least one target row is the front N rows and the back M rows corresponding to the to-be-printed row, N and M are non-negative integers and N and M are not 0 at the same time; the number of pixel points of the target row in the dot matrix data is greater than or equal to the to-be-printed row.
[0159] In some embodiments, the processor 1101 further specifically performs the following steps: allocate the heating time to each heating energy level in a preset manner.
[0160] In some embodiments, when the processor 1101 performs the heating of each pixel on the printing paper according to the heating duration corresponding to each pixel, the processor 1101 specifically performs the following steps: simultaneously starting the heating of each pixel, and controlling the total heating time of each pixel according to the heating duration corresponding to each pixel.
[0161] In some embodiments, when the processor 1101 performs the allocation of the heating duration to each heating energy level according to the preset manner, the processor 1101 specifically performs the following steps: determining at least one target heating energy level that needs to be adjusted in the heating duration and an adjustment manner of each target heating energy level according to the position rule of the pixel corresponding to each heating energy level in the to-be-printed content; and increasing or decreasing the heating duration of each target heating energy level according to the adjustment manner of each target heating energy level.
[0162] In some embodiments, the increased and decreased duration does not exceed a preset proportion of the original heating duration.
[0163] In some embodiments, when the processor 1101 performs the determination of the target heating energy level that needs to be adjusted in the heating duration and the adjustment manner of each target heating energy level according to the position rule of the pixel corresponding to each heating energy level in the to-be-printed content, the processor 1101 specifically performs the following steps: determining whether the pixel corresponding to each heating energy level needs to reduce the heating energy according to the position of the pixel corresponding to each heating energy level in the to-be-printed content, and if so, determining that the heating energy level is a first target heating energy level that needs to reduce the heating duration; determining whether the pixel corresponding to each heating energy level needs to increase the heating energy according to the position of the pixel corresponding to each heating energy level in the to-be-printed content, and if so, determining that the heating energy level is a second target heating energy level that needs to increase the heating duration.
[0164] In some embodiments, when the processor 1101 performs the increasing or decreasing of the heating duration of each target heating energy level, the processor 1101 specifically performs the following steps: decreasing the heating duration of the first target heating energy level, determining the total heating duration t d , and allocating t d to each second target heating energy level.
[0165] In some embodiments, when the processor 1101 performs the increasing or decreasing of the heating duration of each target heating energy level, the processor 1101 specifically performs the following steps: determining the heating duration t i that needs to be increased by the second target heating energy level with the highest energy level, and allocating t i to other second target heating energy levels.
[0166] In some embodiments, the dot matrix data is binary data, and the pixel that needs to be heated in the binary data is represented by a bit value 1, and the pixel that does not need to be heated is represented by a bit value 0.
[0167] In some embodiments, the processor 1101 further specifically performs the following steps before determining the heating energy level of each pixel point in the to-be-printed line according to the dot matrix data of the to-be-printed line and the at least one target line: receiving dot matrix data of to-be-printed content, the to-be-printed content being edited by a user; and obtaining the dot matrix data of the to-be-printed line and the at least one target line from the dot matrix data of the to-be-printed content.
[0168] The embodiments of the present application further provide a computer storage medium, which can store a plurality of instructions, and the instructions are suitable for being loaded and executed by a processor to perform the steps of the method in any one of the above embodiments.
[0169] The device, the computer readable storage medium, the computer program product or the electronic device provided by the embodiments of the present application are all used to execute the corresponding method provided above, so the beneficial effects that can be achieved by the device, the computer readable storage medium, the computer program product or the electronic device are referable to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0170] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented by other manners. For example, the apparatus embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and actual implementation can have another division manner, for example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed modules can be indirect coupling or communication connection through some interfaces, apparatuses or modules, and can be electrical, mechanical or other forms.
[0171] The modules illustrated as separate components can or can not be physically separate, and the components illustrated as modules can or can not be physical modules, that is, can be located in one place, or can be distributed to a plurality of network modules. According to actual needs, part or all of the modules can be selected to achieve the purpose of the present embodiment scheme.
[0172] In the above embodiments, all or part can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part can be implemented in the form of a computer program product. The above computer program product includes one or more computer instructions. When loaded and executed on a computer, the above computer program instructions generate, in whole or in part, the processes or functions described above according to the embodiments of the present specification. The above computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above computer instructions can be stored in a computer-readable storage medium or transmitted by the above computer-readable storage medium. The above computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) manner. The above computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The above available medium can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, digital versatile disc (DVD)), or a semiconductor medium (for example, solid state disk (SSD)) and the like.
[0173] It should be noted that for the foregoing method embodiments, in order to facilitate description, they are all expressed as a combination of a series of actions, but those skilled in the art should know that the present application is not limited by the order of the described actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0174] In addition, it should be further pointed out that the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of the present application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0175] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order and still achieve desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown or sequential order in order to achieve the desired results. In some implementations, multitasking and parallel processing can be advantageous or necessary.
[0176] In the above embodiments, the description of each embodiment is focused on, and the part not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0177] The above is the description of the heating control method, device and electronic equipment of the thermal printer provided by the present application. For those skilled in the art, according to the idea of the embodiments of the present application, the specific implementation and application range will be changed. In summary, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A heating control method for a thermal printer, characterized in that, The method includes: Based on the dot matrix data of the row to be printed and at least one target row, determine the heating energy level of each pixel in the row to be printed, wherein the target row is adjacent to the row to be printed and there are multiple heating energy levels; The heating duration of each pixel is determined based on its heating energy level. Each pixel on the printing paper is heated according to the heating time corresponding to each pixel. The step of determining the heating energy level of each pixel in the row to be printed based on the dot matrix data of the row to be printed and at least one target row includes: Based on the dot matrix data of the row to be printed and at least one target row, determine the thermal history data corresponding to each heating level. The thermal history data is used to characterize whether each pixel in the row to be printed needs to be heated at each heating level. Based on the thermal history data corresponding to each heating level, the target heating level that needs to be heated for each pixel in the row to be printed is determined respectively; The target heating energy level with the longest heating time corresponding to each pixel is determined as the individual heating energy level for each pixel.
2. The method according to claim 1, characterized in that, The determination of the thermal history data corresponding to each heating energy level includes: The dot matrix data of the row to be printed and at least one target row are calculated according to the thermal history algorithm formula corresponding to each heating energy level to obtain the thermal history data corresponding to each heating energy level.
3. The method according to claim 1, characterized in that, The at least one target row is the N rows before and the M rows after the row to be printed, where N and M are non-negative integers and N and M are not both 0; the number of pixels in the target row in the dot matrix data is greater than or equal to the row to be printed.
4. The method according to claim 1, characterized in that, The method further includes: The heating time is allocated to each heating level according to the preset method.
5. The method according to claim 1 or 4, characterized in that, Heating each pixel on the printing paper according to the heating time corresponding to each pixel includes: Simultaneously, heating begins on each pixel, and the total heating time for each pixel is controlled according to the heating duration corresponding to each pixel.
6. The method according to claim 4, characterized in that, The method of allocating heating time to each heating energy level according to a preset method includes: Based on the positional pattern of the pixels corresponding to each heating energy level in the content to be printed, determine at least one target heating energy level that needs to be adjusted for heating duration and the adjustment method for each target heating energy level. The heating time of each target heating level is increased or decreased according to the adjustment method of each target heating level.
7. The method according to claim 6, characterized in that, The increase and decrease in duration do not exceed a preset proportion of the original heating duration.
8. The method according to claim 6 or 7, characterized in that, The process of determining the target heating energy level requiring heating time adjustment and the adjustment method for each target heating energy level based on the positional patterns of pixels corresponding to each heating energy level within the content to be printed includes: Based on the position of the pixel corresponding to each heating energy level in the content to be printed, determine whether the pixel corresponding to each heating energy level needs to reduce the heating energy. If so, determine that heating energy level as the first target heating energy level that needs to reduce the heating time. Based on the position of the pixel corresponding to each heating energy level in the content to be printed, determine whether the pixel corresponding to each heating energy level needs to be heated more. If so, determine that the heating energy level is the second target heating energy level that needs to be heated for longer.
9. The method according to claim 6, characterized in that, The process of increasing or decreasing the heating time for each target heating energy level includes: Reduce the heating time for the first target heating level and determine the total reduction in heating time t. d , will t d The energy is allocated to each of the second target heating levels.
10. The method according to claim 6 or 9, characterized in that, The process of increasing or decreasing the heating time for each target heating energy level includes: The additional heating time t required to determine the second target heating energy level with the highest energy level. i , will t i It is allocated to other secondary target heating energy levels.
11. The method according to claim 1, characterized in that, The dot matrix data is binary data, in which pixels that need to be heated are represented by a bit value of 1, and pixels that do not need to be heated are represented by a bit value of 0.
12. The method according to claim 1, characterized in that, Before determining the heating energy level of each pixel in the row to be printed based on the dot matrix data of the row to be printed and at least one target row, the method further includes: Receive dot matrix data of content to be printed, wherein the content to be printed is edited by the user; Obtain the dot matrix data of the row to be printed and at least one target row from the dot matrix data of the content to be printed.
13. A heating control device for a thermal printer, characterized in that, The device includes: The energy level acquisition module is used to determine the heating energy level of each pixel in the row to be printed based on the dot matrix data of the row to be printed and at least one target row, wherein the target row is adjacent to the row to be printed and there are multiple heating energy levels; The heating calculation module is used to determine the heating duration of each pixel based on the heating energy level of each pixel. A pixel heating module is used to heat each pixel on the printing paper according to the heating time corresponding to each pixel. The energy level acquisition module is further configured to determine the thermal history data corresponding to each heating energy level based on the dot matrix data of the row to be printed and at least one target row. The thermal history data is used to characterize whether each pixel in the row to be printed needs to be heated under each heating energy level. Based on the thermal history data corresponding to each heating energy level, the module determines the target heating energy level that needs to be heated for each pixel in the row to be printed. The module then determines the target heating energy level with the longest heating time for each pixel as the heating energy level for each pixel.
14. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions adapted for loading by a processor and executing the steps of the method as claimed in any one of claims 1 to 12.
15. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method as described in any one of claims 1 to 12.
16. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to perform the steps of the method as described in any one of claims 1 to 12.
Citation Information
Patent Citations
Printer heating operation processing method based on inverted sequence logic control
CN114889347A
Simple gray level representation method for thermal printer
CN118426720A