Heating control method and device of thermal printer and electronic equipment
By determining the heating energy level and duration of pixel dots based on the dot matrix data in the thermal printer, the problem of inaccurate heating control in the prior art is solved, and a high-precision printing effect is achieved.
Patent Information
- Application Number
- CN202510078854.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-01-17
AI Technical Summary
Existing thermal printers cannot accurately control the heating accuracy of each pixel on the printing paper, resulting in unsatisfactory printing effect. Especially when printing high-precision images, it is easy to have problems such as image blur, overheating damage to the print head or paper discoloration.
By determining the heating energy level of each pixel dot based on the dot matrix data of the line to be printed and at least one target row, and determining the heating time of each pixel dot based on the heating energy level, precise heating of each pixel dot on the printing paper is achieved.
The pixel-point-level heating energy control is achieved, which improves the printing quality and makes the final printing effect of each pixel point clearer.
Smart Images

Figure CN119974780A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of thermal printing technology, and in particular to a heating control method, device and electronic equipment for a thermal printer. Background Art
[0002] Thermal printers are widely used in ticket printing, barcode printing, label printing and other occasions. Its working principle is to control the temperature of the heating element of the thermal print head to conduct heat with the thermal paper, produce a chemical reaction and display the image and text. Most existing thermal printers use a simple constant temperature heating control, which cannot dynamically adjust the heating intensity according to the different requirements of the printing content. This method can easily lead to unsatisfactory printing effects, especially when high-precision image printing, problems such as blurred images, overheating damage to the print head, or paper discoloration. In the prior art, there are still many deficiencies in flexible heating control for different printing needs. Especially when the printing content is complex or different types of thermal paper are used, how to effectively control the balance between the accuracy and power consumption of the heating process has become a difficulty in the technical field. Summary of the invention
[0003] The present application provides a heating control method, device, and electronic device for a thermal printer, which can solve the technical problem in the related art that the heating accuracy of each pixel on the printing paper cannot be accurately controlled.
[0004] In a first aspect, an embodiment of the present application provides a heating control method for a thermal printer, the method comprising:
[0005] Determining the heating energy level of each pixel in the line to be printed according to the dot matrix data of the line to be printed and at least one target line, wherein the target line is adjacent to the line to be printed and there are multiple heating energy levels;
[0006] Determining the heating time of each pixel based on the heating energy level of each pixel;
[0007] Each of the above-mentioned pixel points on the printing paper is heated according to the heating time corresponding to each pixel point.
[0008] In some feasible embodiments of the present application, the above-mentioned determination of 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, the thermal history data being used to characterize whether each pixel in the row to be printed needs to be heated at each heating energy level; 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 feasible embodiments of the present application, the above-mentioned determination of the thermal history data corresponding to each heating energy level includes: calculating the dot matrix data of the above-mentioned to-be-printed line and at least one target line 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.
[0010] In some feasible embodiments of the present application, the heating energy level of each pixel in the to-be-printed row is determined based on the thermal history data corresponding to each heating energy level, including: determining the target heating energy level that needs to be heated corresponding to each pixel in the to-be-printed row based on the thermal history data corresponding to each heating energy level; and determining the target heating energy level with the longest heating time corresponding to each pixel as the heating energy level of each pixel.
[0011] In some feasible embodiments of the present application, the at least one target row is the first N rows and the last M rows corresponding to the row to be printed, N and M are non-negative integers and N and M are not 0 at the same time; the number of pixels of the target row in the dot matrix data is greater than or equal to the row to be printed.
[0012] In some feasible embodiments of the present application, the above method also includes: allocating heating time to each heating energy level according to a preset method.
[0013] In some feasible embodiments of the present application, the above-mentioned pixel points on the printing paper are heated according to the heating time corresponding to each pixel point, including: starting to heat each pixel point at the same time, and controlling the total heating time of each pixel point according to the heating time corresponding to each pixel point.
[0014] In some feasible embodiments of the present application, the above-mentioned allocating heating time to each heating energy level in a preset manner includes: determining at least one target heating energy level that needs to be adjusted for heating time and an adjustment method for each target heating energy level according to the position pattern of the pixel points corresponding to each heating energy level in the content to be printed; and increasing or decreasing the heating time of each target heating energy level according to the adjustment method of each target heating energy level.
[0015] In some feasible embodiments of the present application, the amplitude of the above-mentioned increase and the above-mentioned decrease in duration does not exceed a preset proportion of the original heating duration.
[0016] In some feasible embodiments of the present application, the above-mentioned target heating energy level requiring heating time adjustment and the adjustment method of each target heating energy level are determined according to the position regularity of the pixel points corresponding to each heating energy level in the content to be printed, including: judging whether the heating energy of the pixel points corresponding to each heating energy level needs to be reduced according to the position of the pixel points corresponding to each heating energy level in the content to be printed, and if so, determining that the heating energy level is the first target heating energy level requiring heating time reduction; judging whether the heating energy of the pixel points corresponding to each heating energy level needs to be increased according to the position of the pixel points corresponding to each heating energy level in the content to be printed, and if so, determining that the heating energy level is the second target heating energy level requiring heating time increase.
[0017] In some feasible embodiments of the present application, the above-mentioned increasing or decreasing the heating time of each target heating energy level includes: reducing the heating time of the first target heating energy level, determining the reduced total heating time t d , t d Assigned to each second target heating energy level.
[0018] In some feasible embodiments of the present application, the above-mentioned increasing or decreasing the heating time of each target heating energy level includes: determining the heating time t required to be increased for the second target heating energy level with the highest energy level i , t i Allocate to other second target heating energy levels.
[0019] In some feasible embodiments of the present application, the above-mentioned dot matrix data is binary data, and the pixel points that need to be heated in the above-mentioned binary data are represented by a bit value of 1, and the pixel points that do not need to be heated are represented by a bit value of 0.
[0020] In some feasible embodiments of the present application, before determining the heating energy level of each pixel in the line to be printed based on the dot matrix data of the line to be printed and at least one target line, it also includes: receiving the dot matrix data of the content to be printed, where the content to be printed is edited by the user; obtaining the dot matrix data of the line to be printed and at least one target line from the dot matrix data of the content to be printed.
[0021] In a second aspect, an embodiment of the present application provides a heating control device for a thermal printer, the device comprising:
[0022] An energy level acquisition module, used to determine the heating energy level of each pixel in the line to be printed based on the dot matrix data of the line to be printed and at least one target line, wherein the target line is adjacent to the line to be printed and there are multiple heating energy levels;
[0023] A heating calculation module, used to determine the heating time of each pixel point based on the heating energy level of each pixel point;
[0024] The pixel heating module is used to heat each of the above-mentioned pixel points on the printing paper according to the heating time corresponding to each pixel point.
[0025] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the steps of the method.
[0026] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is suitable for being loaded by the processor and executing the steps of the method.
[0027] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:
[0028] The present application provides a heating control method for a thermal printer, which determines the heating energy level of each pixel in the line to be printed according to the dot matrix data of the line to be printed and at least one target line, wherein the target line is adjacent to the line to be printed and has multiple heating energy levels; determines the heating time of each pixel based on the heating energy level of each pixel; and heats each pixel on the printing paper according to the heating time corresponding to each pixel. When heating the pixel, the present application combines the dot matrix data of the current line and the adjacent lines to determine the heating energy level of each pixel in the line to be printed, and further configures the heating time of each pixel according to the heating energy level required by the pixel, and uses the appropriate heating time to heat each pixel. In this way, the heat energy existing in the surrounding environment of the line to be printed can be analyzed from the dot matrix data of the adjacent lines, and the heating energy level required by each pixel in the line to be printed can be more accurately determined by analyzing the heat energy situation of the line to be printed itself and the surroundings as a whole, thereby more accurately controlling the heating time of each pixel, and realizing the fine control of the heating energy at the pixel level, so that the printing effect of each pixel is clearer in the end, and the overall printing quality is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present application 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 application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0030] Figure 1 An exemplary system architecture diagram of a heating control method for a thermal printer provided in an embodiment of the present application;
[0031] Figure 2 A schematic flow chart of a heating control method for a thermal printer provided in an embodiment of the present application;
[0032] Figure 3 An example diagram of dot matrix data of a line to be printed and a target line provided in an embodiment of the present application;
[0033] Figure 4 An example diagram of the distribution of heating time for each heating energy level provided in an embodiment of the present application;
[0034] Figure 5 A schematic flow chart of a heating control method for a thermal printer provided in an embodiment of the present application;
[0035] Figure 6 An example diagram of setting the heating energy level of each pixel provided in an embodiment of the present application;
[0036] Figure 7 An example diagram of calculation results of a heating energy level of a hot pixel provided in an embodiment of the present application;
[0037] Figure 8 A schematic flow chart of a heating control method for a thermal printer provided in an embodiment of the present application;
[0038] Fig. 9 An example diagram of fine-tuning the heating time of each heating energy level provided in an embodiment of the present application;
[0039] Fig.10 A structural block diagram of a heating control device for a thermal printer provided in an embodiment of the present application;
[0040] Fig.11 A schematic diagram of the structure of an electronic device provided in 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 clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0042] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims. And in the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" refers to two or more than two.
[0043] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0044] The working principle of thermal printers is based on the heating elements inside the thermal print head, which can quickly adjust to a specific temperature according to the input printing signal. When the heating element comes into contact with the special thermal paper, the special coating on the thermal paper will react chemically through heat conduction, showing clear graphic information. This process does not require traditional ink or ribbon, 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 adapt well to the diverse and high-precision printing needs. Specifically, it cannot flexibly adjust the heating intensity according to the specific characteristics of the printed content (such as the thickness of the text, the density change of the image, etc.), but maintains a constant heating level. When the heating points at the same position are continuously heated, the accumulated heat is too large, resulting in reduced printing effect, which is mainly manifested in the appearance of connected strokes in fonts with dense strokes, barcode connection, and melting of the paper surface when printing black blocks.
[0045] Therefore, an embodiment of the present application provides a heating control method for a thermal printer. When heating pixels, the heating energy level of each pixel in the line to be printed is determined by combining multiple lines of dot matrix data of the current line and adjacent lines, and the heating time of each pixel is further configured according to the heating energy level required by the pixel. Each pixel is heated using an appropriate heating time to solve the above-mentioned technical problems.
[0046] See also Figure 1 , Figure 1 An exemplary system architecture diagram of a heating control method for a thermal printer provided in an embodiment of the present application.
[0047] like Figure 1 As shown, the system architecture may include an electronic device 101, a network 102 and a terminal 103, wherein the electronic device 101 may be a thermal printer, or other devices with a thermal printing function. The electronic device 101 may specifically include a control module, an execution module, and an acquisition module. The control module may include various integrated circuits and circuit boards such as a single-chip microcomputer, a processor, and a system on a chip (System on Chip SoC). The execution module may include components such as a print head, a motor, a paper feed mechanism, and a paper return mechanism that specifically perform printing. The acquisition module may include a touch panel, various sensors, and a communication chip, etc., for collecting and acquiring various external data information.
[0048] The terminal 103 may be any terminal device that transmits printed content to the electronic device 101, such as a mobile phone, a tablet computer, a portable digital camera, a media player, a portable game device, a desktop computer, a laptop computer, etc. The network 102 may include various types of wired communication links or wireless communication links, for example, the wired communication link includes at least a USB data line, and the wireless communication link includes a Bluetooth communication link, a Wireless-Fidelity (Wi-Fi) communication link, etc.
[0049] The electronic device 101 can interact with the terminal 103 through the network 102 to receive messages from the terminal 103 or send messages to the terminal 103, or the electronic device 101 can interact with the terminal 103 through the network 102 to receive messages or data sent by other users to the terminal 103. The network 102 is used to provide a medium for a communication link between the electronic device 101 and the terminal 103. The messages and data transmitted between the electronic device 101 and the terminal 103 can be content to be printed, processed data to be printed, printing result report information, etc., and the application does not specifically limit the types of information and data.
[0050] In an embodiment of the present 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 line to be printed based on the dot matrix data of the line to be printed and at least one target line, wherein the target line is adjacent to the line to be printed and there are multiple heating energy levels; further, the electronic device 101 can determine the heating time 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 time corresponding to each pixel, thereby realizing the printing of the line to be printed, and performing the above steps for each line in the content to be printed, thereby completing the complete printing of the content to be printed.
[0051] It should be understood that Figure 1The number of electronic devices, networks and terminals in the figure is only illustrative, and any number of electronic devices, networks and terminals may be used according to implementation requirements.
[0052] See also Figure 2 , Figure 2 A flowchart of a heating control method for a thermal printer provided in an embodiment of the present application. The execution subject of the embodiment of the present application can be an electronic device that executes the heating control of the thermal printer, or a processor in an electronic device that executes the heating control method of the thermal printer, or a heating control service of the thermal printer in an 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 being a processor in an electronic device as an example.
[0053] like Figure 2 As shown, the embodiment of the present application is described by taking the electronic device as a thermal printer as an example, and the heating control method of the thermal printer may at least include:
[0054] S202, determining a heating energy level of each pixel in the line to be printed according to dot matrix data of the line to be printed and at least one target line, wherein the target line is adjacent to the line to be printed and has multiple heating energy levels.
[0055] Optionally, before performing a thermal printing operation, the thermal printer needs to obtain dot matrix data of the content to be printed. The dot matrix data of the content to be printed is obtained after processing various data information such as the content to be printed, the size of the thermal paper, and the configuration information of the print head, and is used to indicate whether each pixel needs to be heated. When the thermal printer performs thermal printing on the content to be printed, it heats the pixels on the thermal paper row by row in sequence according to the dot matrix data of the content to be printed.
[0056] Specifically, the dot matrix data received by the thermal printer is binary data. The pixels that need to be heated in the binary data are represented by bit value 1, and the pixels that do not need to be heated are represented by bit value 0. Each line on the thermal paper is divided into multiple bytes with 8 pixels as one byte. The thermal printer usually calculates each line of printing in bytes. Please refer to Figure 3 , Figure 3 This is an example diagram of dot matrix data of a line to be printed and a target line provided in an embodiment of the present application. Figure 3 As shown, 8 pixels in the row to be printed are taken as an example for description, wherein the dot matrix data of the 8 pixels in the row to be printed (that is, the current row) is 11111110, which means that the first 7 pixels need to be heated, but the last pixel does not.
[0057] In a possible implementation, before determining the heating energy level of each pixel in the line to be printed based on the dot data of the line to be printed and at least one target line, the thermal printer may receive the dot data of the content to be printed edited by the user. The content to be printed may be in various forms such as text and pictures. When the thermal printer obtains the dot data, it may be that the client operated by the user generates the dot data for the content to be printed and sends it to the thermal printer, or it may be that the client sends the content to be printed to the thermal printer and then the thermal printer generates the dot data. When generating the dot data, if the user has specific processing requirements for the content to be printed (such as color adjustment operations, brightness adjustment operations, font size adjustment operations, etc.), the content to be printed may be processed accordingly according to the user's specific processing requirements, and then the corresponding dot data is generated for the processing results to ensure that the printing effect is consistent with the user's expectations.
[0058] Optionally, during the printing process, after the print head heats the pixel, there will be a certain amount of residual heat in the pixel, and this residual heat will diffuse to the surrounding of the pixel. Then when there are multiple pixels that need to be heated around a pixel that needs to be heated, in addition to the heat energy applied to it by the print head, the pixel will also be affected by the diffused heat energy of the surrounding pixels, resulting in heat overflow. Finally, the pixel may have a heavier printing effect than expected due to excessive heat energy. Such pixels are likely to cause the final print results to have dense strokes, barcode connections, and even melting of the paper surface. Correspondingly, for the pixel to be heated that has no other heated pixels around it, its surroundings remain in a cool state without any excess heat energy, then the pixel may have a lighter imprint effect when printing, resulting in unclear final print results.
[0059] Based on this, in an embodiment of the present application, in order to achieve a more accurate printing effect, the heating conditions of the pixels of the line to be printed itself and the heating conditions of the pixels in the surrounding adjacent rows can be combined to perform an overall analysis of the thermal energy of the line to be printed itself and the surroundings. Then determine the heating energy required for each pixel in this line, and perform heating control according to the heating energy required for each pixel, so that the content to be printed can be printed completely and clearly. In the specific implementation process, the dot matrix data of the line to be printed itself and the dot matrix data of at least one target line adjacent to the line to be printed can be determined, and the heating energy required for the pixels of the line to be printed can be analyzed based on multiple lines of dot matrix data. This analysis not only takes into account the heating requirements of the pixels themselves, but also fully considers the thermal energy influence of the pixels around them, including the heating status of adjacent pixels in adjacent rows, the thermal energy diffusion, etc.
[0060] In a possible implementation, at least one adjacent target row selected for the row to be printed may be the first N rows and the last M rows corresponding to the row to be printed, where N and M are non-negative integers and are not 0 at the same time. That is, starting from the rows adjacent to the row to be printed, at least one row is selected as the target row. At the same time, considering that the pixel point is not only affected by the heat directly above and below, but also the overflow heat from the upper and lower sides will also affect the total amount of heat received by the pixel point, the number of pixels in the target row can be made greater than or equal to the row to be printed in the dot matrix data. Please continue to refer to Figure 3 Taking N=2 and M=1 as an example, the previous row, the previous two rows and the future row of the row to be printed (that is, the current row) are selected as target rows, and one more pixel point is selected on the left and right of the previous row. That is, when determining the heating energy level of the 8 pixels in the current row, the 8 pixels of the current row (the dot matrix is 11111110), the 10 pixels of the previous row (the dot matrix is 0000111111), the 8 pixels of the previous two rows (the dot matrix is 00000010), and the 8 pixels of the future row (the dot matrix is 10000001) are selected to form the dot matrix data required for the calculation.
[0061] It should be noted that the selection scheme of the target row and the number of pixels 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 are not limited to this.
[0062] Furthermore, in order to more systematically control the heating energy received by the pixel points, several heating energy levels can be divided according to the heating capacity of the print head, and each heating energy level corresponds to a different heating energy. That is, in the embodiment of the present application, according to the dot matrix data of the line to be printed and at least one target line, a suitable heating energy level can be allocated to each pixel point in the line to be printed, ensuring that each pixel point in the printing obtains the appropriate heating energy, thereby avoiding the problem of overheating or insufficient heating of each pixel point, making the content to be printed more accurate in detail.
[0063] S204: Determine the heating time of each pixel based on the heating energy level of each pixel.
[0064] Optionally, considering that the heating time is directly related to the total amount of energy actually applied and is a key factor in controlling the accuracy of the printing effect, after determining the heating energy level of each pixel in the line to be printed, the heating time of each pixel is further determined according to the heating energy level, so that each pixel can obtain the heating energy corresponding to its own heating energy level through a suitable heating time.
[0065] S206 , heating each pixel on the printing paper according to the heating time corresponding to each pixel.
[0066] Optionally, the thermal printer will perform the heating operation strictly according to the heating time calculated for each pixel. This is usually achieved through a series of heating elements (such as tiny heating points in a thermal print head), which can respond quickly and accurately to instructions to heat the corresponding pixels on the printing paper. The synchronization and accuracy of each heating element are maintained during this process to ensure uniformity and consistency across the entire printed surface. By combining multiple lines of dot matrix data of the current row and adjacent rows to determine the heating energy level of each pixel in the row to be printed, and accurately configuring the heating time, fine control of heating energy at the pixel level is achieved.
[0067] In an embodiment of the present application, a heating control method for a thermal printer is provided. According to the dot matrix data of the line to be printed and at least one target line, the heating energy level of each pixel in the line to be printed is determined, and the target line is adjacent to the line to be printed and there are multiple heating energy levels; the heating time of each pixel is determined based on the heating energy level of each pixel; and each pixel on the printing paper is heated according to the heating time corresponding to each pixel. When heating the pixel, the present application combines the dot matrix data of the current line and the adjacent lines to determine the heating energy level of each pixel in the line to be printed, and further configures the heating time of each pixel according to the heating energy level required by the pixel, and uses the appropriate heating time to heat each pixel. In this way, the heat energy existing in the surrounding environment of the line to be printed can be analyzed from the dot matrix data of the adjacent lines. By analyzing the heat energy conditions of the line to be printed itself and the surroundings as a whole, the heating energy level required by each pixel in the line to be printed can be more accurately determined, thereby more accurately controlling the heating time of each pixel, and realizing fine control of the heating energy at the pixel level, so that the printing effect of each pixel is clearer in the end, and the overall printing quality is improved.
[0068] In order to facilitate determining the heating time of each pixel point according to the heating energy level of each pixel point, it is necessary to pre-set the heating time corresponding to each heating energy level. Therefore, in some embodiments of the present application, the heating control method of the thermal printer may at least include:
[0069] The heating time is allocated to each heating energy level according to the preset method.
[0070] Optionally, for the heating distribution scheme of several heating energy levels, in order to facilitate calculation and control, it can be set from the first energy level to the Xth energy level, where 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 method and heating time can be selected and allocated according to actual needs in practical applications. The embodiment of the present application does not limit the preset method, nor does it limit the specific heating time for each heating energy level.
[0072] Further, based on the heating time allocated to each heating energy level, in the heating control method of the thermal printer, step S206 may further specifically include the following steps:
[0073] At the same time, each pixel point starts to be heated, and the total heating time of each pixel point is controlled according to the heating time corresponding to each pixel point.
[0074] Optionally, considering that the heating time increases with the increase of energy level, the heating time of the higher energy level must also include the heating time of the lower energy level. Therefore, for the sake of heating efficiency, it is not necessary to heat each level in sequence, but to start heating each pixel at the same time, and control the total heating time of each pixel according to the heating time corresponding to each pixel. That is, for the A pixel that needs to be heated at the first energy level and the B pixel that needs to be heated at the second energy level, start heating at the same time. After the heating time of the first energy level ends, the A pixel stops heating, and the B pixel continues to heat until the heating time of the second energy level ends.
[0075] Specifically, take X=7 as an example. Figure 4 , Figure 4 This is an example diagram of the distribution of heating time for each heating energy level provided in an embodiment of the present application. Figure 4 As shown, we can first assume that the longest heating time of a pixel is the heating time of the highest energy level, that is, the heating time of the seventh energy level is t, and the total heating time is divided into 7 parts. The heating time of each level is t / 7 more than the heating time of the previous level. By analogy, the heating time of each level of data is: 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 calculating the heating energy level of each pixel in the line to be printed, start heating each pixel at the same time and stop heating the pixel after the heating time of the corresponding heating energy level ends. Figure 4 The blank cells in the heating time of each level indicate the heating time that has been completed, and the blue cells indicate that the heating time required for this energy level is longer than that for the lower energy level.
[0076] In an embodiment of the present application, by reasonably allocating the heating time of the heating energy levels and performing simultaneous heating control on each pixel point, the total heating time required to print each line is at most the heating time of the highest heating energy level, thereby improving the heating control efficiency and printing efficiency during the printing process.
[0077] In some embodiments of the present application, the specific implementation of step S202 can refer to the following embodiments. Figure 5The flowchart of a heating control method of a thermal printer is shown in FIG. Figure 2 The detailed description of step S202 in the heating control method of the thermal printer shown in the corresponding embodiment, in the heating control method of the thermal printer, step S202 may further specifically include the following steps:
[0078] S502: Determine thermal history data corresponding to each heating energy level according to the dot matrix data of the line to be printed and at least one target line, wherein the thermal history data is used to indicate whether each pixel in the line to be printed needs to be heated at each heating energy level.
[0079] S504 , determining the heating energy level of each pixel 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 for each pixel point in the line to be printed, the thermal history data corresponding to each heating energy level can be calculated for the line to be printed first, that is, it is calculated whether each pixel point in the line to be printed needs to be heated at each heating energy level, and then the corresponding heating energy level is determined for each pixel point according to the thermal history data corresponding to each heating energy level.
[0081] For example, if there are two heating energy levels, namely the first energy level and the second energy level, then there are two pieces of thermal history data for each heating energy level corresponding to the line to be printed. The thermal history data of the first energy level indicates which pixels in the line to be printed need heating at the first energy level and which pixels do not need heating at the first energy level. Similarly, the thermal history data of the second energy level also indicates which pixels in the line to be printed need heating at the second energy level and which pixels do not need heating at the second energy level. Then, based on the thermal history data, it can be determined whether each pixel needs to be heated at each heating energy level, and then the heating energy level corresponding to each pixel in the line to be printed can be determined.
[0082] Specifically, the embodiment of the present application constructs a corresponding heating energy level for each pixel to be heated in advance according to the surrounding thermal energy information of the pixel to be heated. Figure 6 , Figure 6 This is an example diagram of setting the heating energy level of each pixel provided in an embodiment of the present application. Figure 6 As shown, taking the setting of a total of 7 heating energy levels as an example, each heating energy level is represented in turn 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 for the convenience of description.
[0083] Furthermore, according to the exemplary heating time setting method in the above embodiment, it can be obtained that the heating time of the seventh energy level is the longest and the heating time of the first energy level is the shortest. Figure 6It can be seen that, considering the actual printing effect, the pixels to be heated at different positions should be adaptively set to different heating energy levels due to the different influences of the surrounding heat energy. If the pixels to be heated are not heated by the surrounding pixels (that is, there is no excess heat energy), then the pixel to be heated should be set to a heating energy level with a longer heating time, such as setting its heating energy level to the seventh energy level, so that the pixel to be heated itself has enough heat energy to achieve the expected printing effect; similarly, for the pixel to be heated that has more heating pixels around it (that is, there is more overflow heat energy), a heating energy level with a shorter heating time should be set, such as setting its heating energy level to the first energy level, so that the pixel to be heated will not be overheated and affect the printing effect.
[0084] It should be noted that the pixel situations corresponding to each heating energy level set in actual situations are not limited to the above examples. The above only lists one or two possibilities for each level, and there may be multiple corresponding pixel situations for each level in actual settings. In addition, the pixel situation corresponding to each heating energy level can also be set according to business experience and actual needs, and is not limited to the examples given in the above embodiments. The embodiments of this application do not limit the setting method of the heating energy level.
[0085] Based on the matching relationship between the above-mentioned pre-set 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-mentioned 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 line and the target line 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 embodiment of the present application, the dot matrix data of the line to be printed (current line) is represented as cur, the dot matrix data of the previous line is represented as pre1, the dot matrix data of the first two lines is represented as pre2, and the dot matrix data of the future line is represented as fut. And if the number of pixels in a certain target line is greater than that of the current line, it is also necessary to split the target line with more pixels into multiple dot matrix data with the same number of pixels as the current line. For example, if the current line has 8 pixels, if the left and right sides of the previous line have one more pixel than the current line, for a total of 10 pixels, then the previous line also needs to determine the dot matrix data of 1 to 8 pixels as pre1_left and the dot matrix data of 3 to 10 pixels as pre1_right, so as to realize binary calculation between multiple equal dot matrix data.
[0087] Based on the above data, the thermal history algorithm formulas for heating energy levels 1 to 7 can be converted according to the setting of the heating energy level:
[0088] 7-level thermal history algorithm formula:
[0089] his7=cur&(~pre1)&(~pre1_left)&(~pre1_righ)&(~pre2)&fut;
[0090] 6-level thermal history algorithm formula: his6=his7|
[0091] cur&(~pre1)&(~pre1_left)&(~pre1_righ)&(~pre2)&(~fut);
[0092] 5-level thermal history algorithm formula: his5=his6|
[0093] cur&(~pre1)&(~pre1_left)&(pre1_righ)&(~pre2)&(~fut);
[0094] Level 4 thermal history algorithm formula: his4=his5|
[0095] cur&(pre1)&(~pre1_left)&(~pre1_righ)&(~pre2)&(~fut);
[0096] Level 3 thermal history algorithm formula: his3=his4|
[0097] cur&(pre1)&(pre1_left)&(~pre1_righ)&(~pre2)&(~fut)|
[0098] cur&(pre1)&(~pre1_left)&(pre1_righ)&(~pre2)&(~fut);
[0099] Level 2 thermal history algorithm formula: his2=his3|
[0100] cur&(pre1)&(pre1_left)&(pre1_righ)&(~pre2)&(~fut);
[0101] Level 1 thermal history algorithm formula: his1=his2|
[0102] cur&(pre1)&(pre1_left)&(pre1_righ)&(pre2)&(~fut);
[0103] Among them, for the operators in the formula, "&" represents the bitwise AND operation, "|" represents the bitwise OR operation, and "~" represents the bitwise inversion operation.
[0104] Further, continue with Figure 3 The calculation is illustrated by using the dot matrix data example in Figure 3 From the dot matrix data table in, we can get that the dot matrix data of the line to be printed (current line) is: cur=11111110=0xFE; the dot matrix data of the previous line is: pre1=00011111=0x1F; the dot matrix data on the left of the previous line is: pre1_left=00001111=0x0F; the dot matrix data on the right of the previous line is: pre1_right=00111111=0x3F; the dot matrix data of the first two lines is: pre2=00000010=0x02; the dot matrix data of the future line is: fut=10000001=0x81. According to the thermal history algorithm formula corresponding to each heating energy level, these dot matrix data are calculated, and the thermal history data of each heating energy level corresponding to the line to be printed can be calculated:
[0105] The 7th level thermal history data is: Grade7 = 10000000 = 0x80;
[0106] The grade 6 thermal history data is: Grade6 = 11000000 = 0xC0;
[0107] The level 5 thermal history data is: Grade5 = 11100000 = 0xE0;
[0108] The level 4 thermal history data is: Grade4 = 11100000 = 0xE0;
[0109] The level 3 thermal history data is: Grade3 = 11110000 = 0xF0;
[0110] The level 2 thermal history data is: Grade2 = 11111100 = 0xFC;
[0111] The level 1 thermal history data is: Grade1=11111110=0xFE.
[0112] It can be seen that in each level of thermal history data, 1 is used to indicate that the pixel in the line to be printed needs to be heated, and 0 is used to indicate that the pixel in the line to be printed does not need to be heated. Among the 8 pixels in the example, the first pixel is 1 in all levels 1 to 7 of thermal history data, which means that the first pixel needs a heating energy level of 1 to 7; the second pixel is 1 in all levels 1 to 6 of thermal history data, and 0 in level 7 of thermal history data, which means that the second pixel needs a heating energy level of 1 to 6, and does not need to be heated at level 7; the third pixel is 1 in all levels 1 to 5 of thermal history data, and 0 in levels 6 and 7 of thermal history data, which means that the third pixel needs a heating energy level of 1 to 5, and does not need to be heated at levels 6 and 7.
[0113] Based on this, when determining the heating level corresponding to each pixel, the target heating level that needs to be heated for each pixel in the row to be printed can be determined first according to the thermal history data corresponding to each heating level. For example, in the above example, the target heating levels that need to be heated for the first pixel are all levels from the first to the seventh, and the target heating levels that need to be heated for the second pixel are all levels from the first to the sixth. Since the heating time increases with the increase of the level, the heating time of the higher level must have passed through the heating time of the lower level. Therefore, the target heating level with the longest heating duration corresponding to each pixel can be directly determined as the heating level of each pixel, and then the heating time of each pixel can be determined according to the heating level corresponding to each pixel.
[0114] Taking the example, the target heating level with the longest heating time for the first pixel is the seventh level, so the heating level of the first pixel is the seventh level; the target heating level with the longest heating time for the second pixel is the sixth level, so the heating level of the second pixel is the sixth level; correspondingly, the level of the third pixel is the fifth level; the level of the fourth pixel is the third level; the levels of the fifth and sixth pixels are both the second level; the level of the seventh pixel is the first level; the eighth pixel has no heating level that needs to be heated, that is, no heating is required.
[0115] In a possible embodiment, please refer to Figure 7 , Figure 7 which is an example diagram of the calculation result of the heating level of a thermal pixel provided by the embodiment of the present application. Taking the character '中' as an example, the heating levels corresponding to each pixel as shown in Figure 7 can be calculated.
[0116] In the embodiment of the present application, a heating control method for a thermal printer is provided. According to the heating information of the pixel itself and the thermal energy information existing around it, multiple heating levels with different heating times and the thermal history algorithm formula corresponding to each heating level are set. Thus, during the actual printing process, the printing system of the thermal printer can perform binary bit operations on the binary dot matrix data of the row to be printed and the target row to obtain the thermal history data corresponding to each heating level, and then obtain the heating level corresponding to each pixel according to the thermal history data at each level. Since the calculation process not only considers the thermal energy requirements of the pixel itself, but also fully considers the possible influence of the thermal energy of other pixels in the surrounding environment on its heating effect. Therefore, the determined heating level is more in line with the actual printing requirements and can ensure the clarity and accuracy of the printing effect.
[0117] In order to achieve a more accurate printing effect, the heating time of the pixels can be fine-tuned based on the location characteristics of each pixel in the content to be printed, based on the heating time allocated to the pixels according to the heating energy level. For example, for the pixels at the edge, there is no heat energy next to them, so they can compensate a small amount of heating time to ensure that they get enough heat energy, thereby avoiding unclear printing of the pixels; for the pixels in the last row, the future rows do not need to be heated, so they need to reduce the heating time appropriately to avoid the tailing effect.
[0118] Therefore, in some embodiments of the present application, when executing the step of allocating the heating time for each heating energy level in a preset manner, the following steps may also be specifically performed: Figure 8 The flow chart of a heating control method of a thermal printer is shown. In the heating control method of a thermal printer, the step: allocating heating time to each heating energy level according to a preset method can also specifically include the following steps:
[0119] S802: Determine at least one target heating energy level for which heating time adjustment is required and an adjustment method for each target heating energy level according to a position rule of pixel points corresponding to each heating energy level in the content to be printed.
[0120] S804: Increase or decrease the heating time of each target heating energy level according to the adjustment method of each target heating energy level.
[0121] In the embodiment of the present application, by setting each heating energy level, it can be determined that the pixel points of each heating energy level have a certain position regularity in the content to be printed. Then, according to the position regularity of the pixel points 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 in a position with a lot of overflow heat energy around, at least one target heating energy level that needs to be adjusted for heating time and the adjustment method of each target heating energy level can be 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 points of each heating energy level, it can be determined whether the pixel points corresponding to each heating energy level need to reduce the heating energy. If so, the heating energy level is determined to be the first target heating energy level for reducing the heating time; and it can be determined whether the pixel points corresponding to each heating energy level need to increase the heating energy. If so, the heating energy level is determined to be the second target heating energy level for increasing the heating time.
[0123] For example, from Figure 7From the heating levels of each pixel in the character "中", it can be seen that the second and third levels have a greater impact on the vertical line part of the 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 so that the content of the vertical line can be printed more clearly, but it should not be too large to prevent obvious trailing due to heat overflow. The seventh and first levels have a greater impact on the horizontal line part. The seventh level generally appears at the beginning of heating and requires a relatively large 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 excessive adjustment of the duration and破坏 the duration control balance between each heating level.
[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 t i is re-allocated to other lower second target heating levels. In this way, based on the total extended and reduced duration, the duration of each heating level is fine-tuned, which can control the overall heating duration to be maintained within a suitable range.
[0126] Exemplarily, please refer to Fig. 9 , Fig. 9 , which is a fine-tuning example diagram of the heating duration of each heating level provided by the embodiment 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 Fig. 9 , one adjustment method is to compensate the reduced heating time t d of the first level to the second and third levels. 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 distribution of t for the third and second energy levels d The coefficient of is, that is, a+b=1. Fig. 9 As shown in (B), if the reduced heating time of the first energy level is not enough to compensate for the second and third energy levels, the extended time t of the seventh energy level can be i A portion of the compensation is also given to the second and third energy levels, so that the heating time of levels 1 to 7 is 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] In an embodiment of the present application, a heating control method for a thermal printer is provided. On the basis of allocating heating time to pixels by heating energy levels, the heating time of the pixels is carefully fine-tuned according to the position characteristics of each pixel in the content to be printed. Each pixel will obtain a slightly longer or shorter standard heating time set based on the heating energy level according to its specific position attribute. Through such a method, the present application can not only make more flexible and fine adjustments to the heating time of each heating energy level, but also make the heating control of each pixel more precise. This refined heating fine-tuning strategy improves the quality of the printed output.
[0128] See also Fig.10 , Fig.10 This is a structural block diagram of a heating control device for a thermal printer provided in an embodiment of the present application. Fig.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 line to be printed based on the dot matrix data of the line to be printed and at least one target line, where the target line is adjacent to the line to be printed and has multiple heating energy levels;
[0130] A heating calculation module 1020, used to determine the heating time of each pixel point based on the heating energy level of each pixel point;
[0131] The pixel heating module 1030 is used to heat each pixel on the printing paper according to the heating time corresponding to each pixel.
[0132] Optionally, the energy level acquisition module 1010 is also used 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, and 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; the heating energy level of each pixel in the row to be printed is determined based on the thermal history data corresponding to each heating energy level.
[0133] Optionally, the energy level acquisition module 1010 is further used to calculate the dot matrix data of the to-be-printed line and at least one target line according to the thermal history algorithm formula corresponding to each heating energy level, so as to obtain the thermal history data corresponding to each heating energy level.
[0134] Optionally, the energy level acquisition module 1010 is also used to determine the target heating energy level that needs to be heated for each pixel in the line to be printed based on the thermal history data corresponding to each heating energy level; and determine the target heating energy level with the longest heating time corresponding to each pixel as the heating energy level of each pixel.
[0135] Optionally, at least one target row is the first N rows and the last M rows corresponding to the row to be printed, N and M are non-negative integers and N and M are not 0 at the same time; the number of pixels in the target row in the dot matrix data is greater than or equal to the row to be printed.
[0136] Optionally, the heating control device 1000 of the thermal printer further includes: a heating time configuration module, which is used to allocate the heating time for each heating energy level according to a preset method.
[0137] Optionally, the pixel heating module 1030 is also used to start heating each pixel point at the same time, and control the total heating time of each pixel point according to the heating time corresponding to each pixel point.
[0138] Optionally, the heating time configuration module is also used to determine at least one target heating energy level that needs to be adjusted for heating time and an adjustment method for each target heating energy level based on the position pattern of the pixel points corresponding to each heating energy level in the content to be printed; and increase or decrease the heating time of each target heating energy level according to the adjustment method of each target heating energy level.
[0139] Optionally, the increase and decrease in duration does not exceed a preset proportion of the original heating duration.
[0140] Optionally, the heating time configuration module is also used to judge whether the heating energy of the pixels corresponding to each heating energy level needs to be reduced according to the positions of the pixels corresponding to each heating energy level in the content to be printed, and if so, determine that the heating energy level is the first target heating energy level for which the heating time needs to be reduced; judge whether the heating energy of the pixels corresponding to each heating energy level needs to be increased according to the positions of the pixels corresponding to each heating energy level in the content to be printed, and if so, determine that the heating energy level is the second target heating energy level for which the heating time needs to be increased.
[0141] Optionally, the heating time configuration module is further used to reduce the heating time for the first target heating energy level and determine the reduced total heating time t d , t d Assigned to each second target heating energy level.
[0142] Optionally, the heating time configuration module is further used to determine the heating time t that needs to be increased for the second target heating energy level with the highest energy level. i , t i Allocate to other second target heating energy levels.
[0143] Optionally, the dot matrix data is binary data, in which the pixel points that need to be heated are represented by a bit value of 1, and the pixel points that do not need to be heated are represented by a bit value of 0.
[0144] Optionally, the heating control device 1000 of the thermal printer further includes: a printing content receiving module, configured to receive dot matrix data of content to be printed, where the content to be printed is edited by a user; and to obtain dot matrix data of a line to be printed and at least one target line from the dot matrix data of the content to be printed.
[0145] See also Fig.11 , Fig.11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.11 As shown, the electronic device 1100 may 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 used to realize the connection and communication between these components.
[0147] The user interface 1103 may include a display screen (Display) and a camera (Camera), and the optional user interface 1103 may also include a standard wired interface and a wireless interface.
[0148] The network interface 1104 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0149] Among them, the processor 1101 may include one or more processing cores. The processor 1101 uses various interfaces and lines to connect various parts within the entire electronic device 1100, and executes various functions and processes data of the electronic device 1100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1105, and calling data stored in the memory 1105. Optionally, the processor 1101 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 1101 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1101, and it can be implemented separately through a chip.
[0150] Among them, the memory 1105 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory, ROM). Optionally, 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 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1105 may also be optionally at least one storage device located away from the aforementioned processor 1101. As Fig.11 As shown, the memory 1105 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a heating control program of a thermal printer.
[0151] exist Fig.11In the electronic device 1100 shown, the user interface 1103 is mainly used to provide an input interface for the user and obtain the 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] Determining a heating energy level of each pixel in the line to be printed according to dot matrix data of the line to be printed and at least one target line, wherein the target line is adjacent to the line to be printed and has multiple heating energy levels;
[0153] Determining the heating time of each pixel based on the heating energy level of each pixel;
[0154] Each pixel on the printing paper is heated according to the heating time corresponding to each pixel.
[0155] In some embodiments, when the processor 1101 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, it specifically performs the following steps: 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 being used to characterize whether each pixel in the row to be printed needs to be heated at each heating energy level; determine 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.
[0156] In some embodiments, when the processor 1101 determines the thermal history data corresponding to each heating energy level, it specifically performs the following steps: according to the thermal history algorithm formula corresponding to each heating energy level, the dot matrix data of the to-be-printed line and at least one target line are calculated to obtain the thermal history data corresponding to each heating energy level.
[0157] In some embodiments, when the processor 1101 determines 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, it specifically performs the following steps: based on the thermal history data corresponding to each heating energy level, determine the target heating energy level that needs to be heated corresponding to each pixel in the row to be printed; and determine the target heating energy level with the longest heating time corresponding to each pixel as the heating energy level of each pixel.
[0158] In some embodiments, at least one target row is the first N rows and the last M rows corresponding to the row to be printed, N and M are non-negative integers and N and M are not 0 at the same time; the number of pixels in the target row in the dot matrix data is greater than or equal to the row to be printed.
[0159] In some embodiments, the processor 1101 further specifically performs the following steps: allocating heating time to each heating energy level according to a preset method.
[0160] In some embodiments, when the processor 1101 heats each pixel on the printing paper according to the heating time corresponding to each pixel, it specifically performs the following steps: starts heating each pixel at the same time, and controls the total heating time of each pixel according to the heating time corresponding to each pixel.
[0161] In some embodiments, when the processor 1101 allocates heating time to each heating energy level in a preset manner, it specifically performs the following steps: according to the position pattern of the pixel points 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 time and the adjustment method of each target heating energy level; according to the adjustment method of each target heating energy level, increase or decrease the heating time of each target heating energy level.
[0162] In some embodiments, the increase and decrease in duration does not exceed a preset proportion of the original heating duration.
[0163] In some embodiments, when the processor 1101 determines the target heating energy level that needs to be adjusted for heating time and the adjustment method of each target heating energy level according to the position rule of the pixel points corresponding to each heating energy level in the content to be printed, it specifically performs the following steps: judging whether the heating energy of the pixel points corresponding to each heating energy level needs to be reduced according to the position of the pixel points corresponding to each heating energy level in the content to be printed, and if so, determining that the heating energy level is the first target heating energy level for which the heating time needs to be reduced; judging whether the heating energy of the pixel points corresponding to each heating energy level needs to be increased according to the position of the pixel points corresponding to each heating energy level in the content to be printed, and if so, determining that the heating energy level is the second target heating energy level for which the heating time needs to be increased.
[0164] In some embodiments, when the processor 1101 increases or decreases the heating time of each target heating energy level, the processor 1101 specifically performs the following steps: reducing the heating time of the first target heating energy level, determining the reduced total heating time t d , t d Assigned to each second target heating energy level.
[0165] In some embodiments, when the processor 1101 increases or decreases the heating time of each target heating energy level, the processor 1101 specifically performs the following steps: determining the heating time t that needs to be increased for the second target heating energy level with the highest energy level; i , t i Allocate to other second target heating energy levels.
[0166] In some embodiments, the dot matrix data is binary data, in which the pixel points that need to be heated are represented by a bit value of 1, and the pixel points that do not need to be heated are represented by a bit value of 0.
[0167] In some embodiments, before determining the heating energy level of each pixel in the line to be printed based on the dot matrix data of the line to be printed and at least one target line, the processor 1101 also specifically performs the following steps: receiving the dot matrix data of the content to be printed, where the content to be printed is edited by the user; and obtaining the dot matrix data of the line to be printed and at least one target line from the dot matrix data of the content to be printed.
[0168] An embodiment of the present application further provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded by a processor and executing the steps of any method in the above embodiments.
[0169] Among them, the device, computer-readable storage medium, computer program product or electronic device provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0170] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0171] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0172] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The above computer program product includes one or more computer instructions. When the above computer program instructions are loaded and executed on a computer, the above process or function according to the embodiment of this specification is generated in whole or in part. 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 a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The above computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more available media integrated. The above-mentioned available media can be magnetic media (for example, floppy disks, hard disks, tapes), optical media (for example, digital versatile discs (DVD)), or semiconductor media (for example, solid state drives (SSD)), etc.
[0173] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0174] In addition, it should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used 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 relevant 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 recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0176] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0177] The above is a description of a heating control method, device and electronic device for a thermal printer provided in the present application. For technicians in this field, according to the ideas of the embodiments of the present application, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A heating control method for a thermal printer, characterized in that: The method comprises: Determining a heating energy level of each pixel in the line to be printed according to dot matrix data of the line to be printed and at least one target line, wherein the target line is adjacent to the line to be printed and there are multiple heating energy levels; Determining the heating time of each pixel based on the heating energy level of each pixel; Each pixel point on the printing paper is heated according to the heating time corresponding to each pixel point.
2. The method according to claim 1, characterized in that The step of determining the heating energy level of each pixel in the line to be printed according to the dot matrix data of the line to be printed and at least one target line comprises: Determine, according to the dot matrix data of the line to be printed and at least one target line, thermal history data corresponding to each heating energy level, wherein the thermal history data is used to characterize whether each pixel in the line to be printed needs to be heated at each heating energy level; The heating energy level of each pixel in the to-be-printed row is determined according to the thermal history data corresponding to each heating energy level.
3. The method according to claim 2, characterized in that The step of determining the thermal history data corresponding to each heating energy level includes: The dot matrix data of the to-be-printed row and at least one target row are calculated according to the thermal history algorithm formula corresponding to each heating energy level, so as to obtain the thermal history data corresponding to each heating energy level.
4. The method according to claim 2, characterized in that: The step of determining the heating energy level of each pixel in the to-be-printed row according to the thermal history data corresponding to each heating energy level includes: Determine 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; The target heating energy level with the longest heating time corresponding to each pixel is determined as the heating energy level of each pixel.
5. The method according to claim 1, characterized in that The at least one target row is the first N rows and the last M rows corresponding to the row to be printed, N and M are non-negative integers and N and M are not 0 at the same time; the number of pixels of the target row in the dot matrix data is greater than or equal to the row to be printed.
6. The method according to claim 1, characterized in that The method further comprises: The heating time is allocated to each heating energy level according to the preset method.
7. The method according to claim 1 or 6, characterized in that: The step of heating each pixel on the printing paper according to the heating time corresponding to each pixel includes: At the same time, each pixel point starts to be heated, and the total heating time of each pixel point is controlled according to the heating time corresponding to each pixel point.
8. The method according to claim 6, characterized in that The allocating heating time to each heating energy level in a preset manner includes: Determining at least one target heating energy level for which heating time adjustment is required and an adjustment method for each target heating energy level according to a position rule of pixel points corresponding to each heating energy level in the content to be printed; According to the adjustment method of each target heating energy level, the heating time of each target heating energy level is increased or decreased.
9. The method according to claim 8, characterized in that The increase and decrease in duration do not exceed a preset ratio of the original heating duration.
10. The method according to claim 8 or 9, characterized in that: The method of determining the target heating energy level for which the heating time duration needs to be adjusted and the adjustment method of each target heating energy level according to the position regularity of the pixel points corresponding to each heating energy level in the content to be printed includes: Determine whether the pixel points corresponding to each heating energy level need to reduce heating energy according to the positions of the pixel points corresponding to each heating energy level in the content to be printed, and if so, determine that the heating energy level is the first target heating energy level for which the heating time needs to be reduced; Whether the pixel points corresponding to each heating energy level need to increase heating energy is determined according to the position of the pixel points corresponding to each heating energy level in the content to be printed. If so, the heating energy level is determined to be the second target heating energy level for which the heating time needs to be increased.
11. The method according to claim 8, characterized in that The increasing or decreasing the heating time of each target heating energy level includes: The heating time is reduced for the first target heating energy level, and the reduced total heating time t is determined d , t d Assigned to each second target heating energy level.
12. The method according to claim 8 or 11, characterized in that: The increasing or decreasing the heating time of each target heating energy level includes: Determine the additional heating time t required for the second target heating energy level with the highest energy level i , t i Allocate to other second target heating energy levels.
13. The method according to claim 1, characterized in that The dot matrix data is binary data, in which the pixel points that need to be heated are represented by a bit value of 1, and the pixel points that do not need to be heated are represented by a bit value of 0.
14. The method according to claim 1, characterized in that Before determining the heating energy level of each pixel in the line to be printed according to the dot matrix data of the line to be printed and at least one target line, the method further includes: Receiving dot matrix data of content to be printed, wherein the content to be printed is edited by a user; The dot matrix data of the to-be-printed line and at least one target line are acquired from the dot matrix data of the to-be-printed content.
15. A heating control device for a thermal printer, characterized in that: The device comprises: An energy level acquisition module, used to determine the heating energy level of each pixel in the line to be printed based on the dot matrix data of the line to be printed and at least one target line, wherein the target line is adjacent to the line to be printed and there are multiple heating energy levels; A heating calculation module, used to determine the heating time of each pixel point based on the heating energy level of each pixel point; The pixel heating module is used to heat each pixel on the printing paper according to the heating time corresponding to each pixel.
16. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, which are suitable for being loaded by a processor and executing the steps of the method according to any one of claims 1 to 14.
17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 14 are implemented.
18. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the steps of the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Printing method of thermal printer, thermal printer and storage medium
CN109353127A
Printer heating operation processing method based on inverted sequence logic control
CN114889347A
Thermal printing method and device capable of dynamically adjusting heating duration, equipment and medium
CN115071300A
Printing control method, system and device
CN117984675A
Thermal printing method, micro-processing chip, system and equipment
CN118144451A
Cited By
Printhead heating control method and related device
WO2026124233A1