A thermal printing control method
By constructing a heating behavior distribution map group and correcting the segment boundary position, the heating rhythm is dynamically adjusted, solving the problem that the heat scheduling distribution in the existing technology cannot cover the real image structure features. This achieves local refinement and energy consumption balance in thermal printing, improving print quality and energy efficiency.
Patent Information
- Application Number
- CN202511105309.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-08-07
AI Technical Summary
Existing thermal printing control methods struggle to accurately identify local structural changes when faced with printing data exhibiting significant structural differences or drastic distribution fluctuations. This results in thermal scheduling distribution failing to cover the true structural features of the image, leading to quality risks such as blurred printing boundaries, uneven electrothermal load, and overall structural resolution deviations.
By obtaining the index of the points to be executed in the printing task, a continuous sequence is constructed, the location of structural mutation is extracted, the printing behavior is divided into multiple segments, a heating behavior distribution map group is generated, the segment boundary position is corrected, a representative point activation relationship table is established, and the heating rhythm and power-on duration are dynamically adjusted to achieve local fine-tuning of heat input and energy consumption balance.
It enhances the clarity of printed images in changing areas and the adaptability of the overall thermal control strategy, thereby improving print quality and energy efficiency.
Smart Images

Figure CN120588656B_ABST
Abstract
Description
[0001] A thermal printing control method Technical Field
[0002] This invention relates to the field of thermal printing control technology, and more particularly to a thermal printing control method. Background Technology
[0003] The field of thermal printing control technology involves achieving a dynamic balance between printing accuracy, stability, and energy efficiency through temperature management and heating method optimization of thermal elements. Core aspects include printhead heating control strategies, heating time and voltage adjustment mechanisms, segmented management and compensation calculation of print data, and the acquisition and application of thermal compensation coefficients. The overall technical solution typically combines printed dot matrix image information, ambient temperature feedback, thermistor characteristics, and logic control methods to dynamically schedule the printhead heating process. This technology is widely used in label printers, receipt printing terminals, and industrial embedded printing devices. Traditional thermal printing control methods directly control the heating state of thermal dots based on image data. These methods often employ fixed heating current, constant heating time, or line-by-line scanning to process image data. During processing, pulse width or voltage is calculated based on the data density of the printing lines, and thermal compensation values are set using lookup tables. Linear or segmented calculations are performed on the printed dots before each heating cycle to adapt to the image structure.
[0004] Existing technologies directly control the heating state of thermal points based on image data, often relying on fixed parameter settings for thermal compensation. During the processing, the overall density or preset segments are often used as a reference. When faced with print data with significant structural differences or drastic distribution fluctuations, it is difficult to accurately identify local structural change points. This results in the thermal scheduling distribution failing to cover the true structural features of the image. In typical scenarios, such as areas with alternating high and low density or abrupt changes in the scanning path, problems such as control lag and unbalanced heat distribution can easily occur, further leading to quality risks such as blurred print boundaries, uneven electrothermal load, and overall structural resolution deviation. Summary of the Invention
[0005] The purpose of this invention is to address the shortcomings of existing technologies by proposing a thermal printing control method.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: a thermal printing control method, comprising the following steps:
[0007] S1: Obtain the index of the point to be executed in the printing task, construct a continuous sequence according to the scanning direction, traverse the index difference of adjacent points, extract the difference as the difference marker value, determine the jump position, mark it as the potential point of inter-segment boundary change, and obtain the set of structural mutation positions.
[0008] S2: Divide the printing behavior into multiple segments according to the set of structural mutation locations, collect the activation sequence and electric heating channel number of the points, count the trigger frequency, multiply the frequency of each point by the electric heating channel number and sum them to form the cumulative value of heat intensity, and obtain the heating behavior distribution map group within the segment;
[0009] S3: Based on the heat density trend of the heating behavior distribution map group in the section, screen the segment boundary with prominent frequency gradient changes, extract the frequency sequence of points on both sides of the boundary, calculate the total frequency difference and determine whether it is consistent with the direction of heat density change. If it is consistent, the boundary is shifted one position to the frequency decreasing side; otherwise, it remains unchanged, forming a corrected segment boundary position sequence.
[0010] S4: Based on the corrected segment boundary position sequence, sort the points within the segment according to the heating frequency, extract the middle and symmetrical points of the sorting, record the electric heating channel number and activation order, form a representative point set, establish a mapping with the segment number, organize it into an index format, and generate a representative point activation relationship table.
[0011] As a further aspect of the present invention, the set of structural abrupt change locations in the printed line includes a jump point location index, inter-segment boundary candidate points, and abrupt change segment identification information; the heating behavior distribution map group within the segment includes a trigger frequency statistical map, an electric heating channel number distribution, and a cumulative heat intensity value map; the corrected segment boundary position sequence includes the final index value of the boundary point, frequency difference comparison data, and boundary adjustment direction markers; and the representative point activation relationship table includes a representative point number index, segment number mapping relationship, and heating frequency sorting position.
[0012] As a further aspect of the present invention, the activation sequence and the heating channel number refer to the set of heating element numbers corresponding to the printing points activated in chronological order, reflecting the heating execution process of the printing task.
[0013] The frequency gradient refers to the variation in activation frequencies between adjacent segment boundary points, measuring the degree of drastic change in heat density distribution.
[0014] As a further aspect of the present invention, the specific steps of S1 are as follows:
[0015] S101: Obtain the position index of all points to be executed in the thermal printing task, arrange them in order according to the scanning direction, calculate the index difference between adjacent points in sequence, establish the index distance value data of the continuous point sequence, and generate the index distance value sequence.
[0016] S102: Call the index distance value sequence, compare each difference with the previous one, determine whether the difference change exceeds the set jump judgment threshold, extract the change position as a jump mark, and obtain the jump behavior point index set;
[0017] S103: Based on the jump behavior point index set, filter the positions where the index difference is greater than the structural change boundary value as the basis for the segment boundary, locate the structural change area in the printed line, and generate a set of structural change positions in the printed line.
[0018] As a further aspect of the present invention, the specific steps of S2 are as follows:
[0019] S201: Call the set of structural mutation locations in the printed line, divide the current printed line position index into continuous paragraphs according to the order of mutation points in the index sequence, extract the corresponding point index data, and generate a paragraph point distribution sequence;
[0020] S202: Based on the segment point distribution sequence, extract the activation sequence and electrothermal channel number corresponding to all points in each segment, and count the trigger frequency of the points according to the activation sequence order to obtain the point trigger frequency dataset.
[0021] S203: Call the trigger frequency dataset of the points, multiply the trigger frequency of each point in each segment by the electric heating channel number, sum them up, and summarize them into a heat value set according to the segment order to generate a distribution map group of heating behavior in the segment.
[0022] As a further aspect of the present invention, the specific steps of S3 are as follows:
[0023] S301: Based on the heat distribution density trend recorded in the heating behavior distribution map group within the section, extract the end of each section and the beginning of the adjacent section as candidate boundary points, calculate the heat density change gradient value, filter the positions in the difference gradient sequence that are greater than the density abrupt judgment threshold, and obtain the heat density abrupt boundary index sequence.
[0024] S302: Call the thermal density mutation boundary index sequence, extract the trigger frequency value sequence of continuous points on both sides of each candidate boundary point, calculate the total frequency value difference of the points on both sides respectively, determine whether the positive or negative sign of the difference is consistent with the direction of the thermal density gradient before and after the segment, and generate frequency difference trend matching result.
[0025] S303: Based on the frequency difference trend matching result, shift the boundary points of positions with consistent trends to the side with decreasing frequency by one point index, and keep the original boundary point index unchanged for positions with inconsistent trends. Integrate the adjustment results of all boundary points to generate a corrected paragraph boundary position sequence.
[0026] As a further aspect of the present invention, the specific steps of S4 are as follows:
[0027] S401: Based on the corrected paragraph boundary position sequence, extract all point indexes and heating frequency values corresponding to the paragraph, sort them from high to low heating frequency, calculate the point index index of the middle position of the sorting, and extract the same number of point indexes to both sides at symmetrical distances to obtain the paragraph representative point index set.
[0028] S402: Call the paragraph representative point index set, extract the electric heating channel number and activation sequence value corresponding to each point, and group the corresponding number information according to the paragraph number to construct the representative point structure within the paragraph and generate representative point activation attribute group;
[0029] S403: Based on the representative point activation attribute group, construct a key-value mapping relationship between the number and the corresponding representative point electrothermal channel number and activation order, organize the data into a standard index structure, and generate a representative point activation relationship table.
[0030] As a further aspect of the present invention, the method further includes:
[0031] S5: Read the representative point activation relationship table, collect the thermal trigger status of the representative points in the current printing task and compare and record it. If the thermal trigger value exceeds the upper limit of the internal reference range, reduce the heating speed and extend the power-on time; otherwise, keep it unchanged, record the adjustment status, and complete the thermal printing control scheme.
[0032] As a further aspect of the present invention, the thermal printing control scheme includes heating speed adjustment parameters, power-on time adjustment records, and thermal trigger state comparison results.
[0033] As a further aspect of the present invention, the specific steps of S5 are as follows:
[0034] S501: Read the representative point number recorded in the representative point activation relationship table, sequentially collect the hot trigger status value of the corresponding point in the current printing task, extract the current trigger value of each representative point and the recorded value in the previous and next two trigger cycles, form a continuous three-frame dataset, and generate a hot trigger record set.
[0035] S502: Call the thermal trigger record set, compare the current thermal trigger value of each representative point with the upper limit of the internal thermal reference interval. If the trigger value is higher than the upper limit of the interval, mark the heating state as needing to be adjusted. If it is not higher, mark it as maintaining the status unchanged, and generate a segment heating adjustment identifier set.
[0036] S503: Based on the segment heating adjustment identifier set, reduce the heating speed value of the segment that needs to be lowered by a set ratio and extend the power-on time synchronously. The unmarked segments maintain the original parameters, record the current adjustment execution status, and generate a thermal printing control scheme.
[0037] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0038] In this invention, structural transition boundaries are constructed by extracting differences in point indexes. A heating distribution map group is generated by combining the trigger frequency and the electric heating channel number. The segment boundary position is corrected according to the heat density gradient trend. Symmetrical representative points are extracted by frequency sorting to establish an activation index table. Then, the thermal state of the representative points is compared with the thermal reference interval. The heating rhythm and energizing time are dynamically adjusted to achieve local refinement of heat input control, rhythm self-matching of structural segments, and dynamic balanced distribution of point energy consumption. This enhances the clear expression of printed images in changing areas and the adaptability of the overall thermal control strategy. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is a schematic diagram of the steps of the present invention;
[0041] Figure 2 This is a flowchart of steps S1 of the present invention;
[0042] Figure 3 This is a flowchart of steps S2 of the present invention;
[0043] Figure 4 This is a flowchart of steps S3 of the present invention;
[0044] Figure 5 This is a flowchart of step S4 of the present invention;
[0045] Figure 6 This is a flowchart of steps S5 of the present invention. Detailed Implementation
[0046] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0047] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.
[0048] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning.
[0049] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.
[0050] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0051] Please see Figure 1 A thermal printing control method includes the following steps:
[0052] S1: Obtain the position index of all points to be executed in the thermal printing task, establish a continuous point sequence according to the scanning direction, traverse the index difference between continuous points one by one, take the index distance between each point and its previous point as the difference mark value, determine the position where the jump behavior occurs in the difference mark value, mark these jump positions as potential positions of inter-segment boundary changes, and obtain the set of structural change positions in the printed line.
[0053] S2: Call the set of structural mutation locations in the printed line, divide the current printed line into several continuous segments according to the mutation point order, collect the activation sequence and electric heating channel number of all points in each segment, count the number of triggering frequencies according to the activation sequence order, multiply the total number of triggering frequencies of points in each segment by its electric heating channel number and sum them to form the cumulative value of heat intensity, and obtain the distribution map group of heating behavior in the segment;
[0054] S3: Based on the heat distribution density trend of each segment recorded in the heating behavior distribution map group within the segment, screen the segment boundary positions with prominent changes in heat frequency fluctuation gradient, extract the heat trigger frequency value sequence of continuous points on both sides of each candidate boundary position, calculate the total frequency difference between the points on both sides of the boundary point and determine whether its trend direction is consistent with the density change direction of heat frequency in adjacent segments. If consistent, shift the boundary point one position to the frequency decreasing side; otherwise, retain the original boundary to form a corrected segment boundary position sequence.
[0055] S4: Based on the structure of each paragraph formed in the corrected paragraph boundary position sequence, sort the points inside each paragraph according to the heating frequency, extract the middle points and their left and right symmetrical points, record their electric heating channel numbers and activation order as the content of the representative point set of the paragraph, establish a mapping key-value relationship between each group of representative points and the paragraph number and organize it into an index format to form a representative point activation relationship table.
[0056] S5: Read the set of representative point numbers marked in the representative point activation relationship table, collect the thermal trigger status of the representative points in the current printing task and compare it with the previous and previous trigger records, determine whether the thermal trigger value exceeds the upper limit of the set internal thermal reference range, if it exceeds, the heating speed of the segment is adjusted downward and the power-on time is appropriately extended, if it does not exceed, it remains unchanged, record the adjustment status of each segment, and obtain the thermal printing control scheme.
[0057] The set of structural abrupt change locations in the printed line includes the jump point location index, inter-segment boundary candidate points, and abrupt change segment identification information. The heating behavior distribution map group within the segment includes the trigger frequency statistics, the distribution of electric heating channel numbers, and the cumulative heat intensity value spectrum. The corrected segment boundary position sequence includes the final index value of the boundary point, frequency difference comparison data, and boundary adjustment direction markers. The representative point activation relationship table includes the representative point number index, segment number mapping relationship, and heating frequency sorting position. The thermal printing control scheme includes heating speed adjustment parameters, power-on time adjustment records, and thermal trigger status comparison results.
[0058] Please see Figure 2 The specific steps of S1 are as follows:
[0059] S101: Obtain the position index of all points to be executed in the thermal printing task, arrange them in order according to the scanning direction, calculate the index difference between adjacent points in sequence, establish the index distance value data of the continuous point sequence, and generate the index distance value sequence.
[0060] First, the line data instructions for the current print job need to be read from the print control module. Each instruction contains the index information of the hotspots to be activated in that line. Taking a common 384-dot printhead as an example, the activation point index range is usually from 0 to 383. In actual reading, the valid bits set in each byte are identified one by one by parsing the bytes, and the corresponding index number is recorded. If the scan direction is set from left to right, the index numbers are sorted in ascending order. For example, if the extracted activation point index is [12, 3, 7, 15], it will be sorted as [3, 7, 12, 15]. If the scan direction is from right to left, the numbers will be sorted in descending order as [15, 12, 7, 3]. Then, the sorted... The adjacent point indices are subtracted to obtain the distance difference between each adjacent point. Taking the sorted sequence [3, 7, 12, 15] as an example, the adjacent difference calculation results are 4, 5, and 3. The entire row of data is traversed to form a complete difference sequence list. If there are multiple consecutive point indices such as [50, 51, 52, 53, 54], the difference is 1. If the index jumps directly from 54 to 80, the difference is 26. Such differences should be completely retained in the list to ensure that subsequent steps can use the real inter-point interval data. The entire process is repeated until all point indices in the current row are calculated and a difference sequence is formed. This sequence completely reflects the relative distance between points in the scanning path.
[0061] S102: Call the index distance value sequence, compare each difference with the previous one, determine whether the difference change exceeds the set jump judgment threshold, extract the change position as a jump mark, and obtain the jump behavior point index set;
[0062] Based on the generated index distance sequence, each difference in the sequence is compared with the previous difference in absolute value. If the absolute difference exceeds the set transition threshold Tthres, the position is marked as a transition point. The setting of Tthres depends on the actual physical structure of the print head and the complexity of the printed content. Typically, it is set between 5 and 10 when printing plain text, and between 15 and 20 when printing complex images or QR codes. The setting process refers to the historical statistics of the print job, such as a certain print job. The average difference in historical task statistics fluctuates between 3 and 5, with the maximum difference being 18. Therefore, Tthres can be set to 10. In actual execution, if the difference sequence is [1, 1, 2, 1, 15, 1], the difference between the 5th and 4th items is 14, which is significantly greater than Tthres=10. This is determined to be a jump position. This logic is applicable to the traversal of the entire sequence. Finally, the index number of each jump position is recorded in the jump behavior point index set. At the same time, the specific physical location of these jump points is mapped in combination with the scan path to facilitate the identification of subsequent structural changes.
[0063] S103: Based on the point index set of jump behavior, filter the positions with index differences greater than the structural change boundary value as the basis for inter-segment boundaries, locate the structural change area in the printed line, and generate a set of structural change positions in the printed line.
[0064] For the obtained set of indexes of transition points, each point needs to be mapped to the original index difference to further filter the boundary points that satisfy the structural change. This needs to be determined based on the structural change limit value Dlimit. Dlimit is set according to the printing task type and the density of points. If the printing task is mainly text, Dlimit is generally set between 20 and 30. If it is an image task, Dlimit can be set between 40 and 60. When setting, the point difference of the sample printing task is analyzed. If the difference of more than 35 in the sample data frequently corresponds to the switching between graphics and blank, then Dlimit can be set to 35. During the filtering process, the difference corresponding to the transition point is traversed. For example, if the transition point index is in [12, 45, 78], and its difference is 5, 38 and 12 respectively, then only the difference of 38 corresponding to index 45 exceeds Dlimit=35. This index is filtered and retained as the inter-segment boundary, and other transition points are ignored. Finally, the set of inter-segment boundary point indexes selected is used as the set of structural change locations. At the same time, the physical location coordinates of the corresponding points are recorded to facilitate the subsequent adjustment of printing parameters or data marking for the change area.
[0065] Please see Figure 3 The specific steps of S2 are as follows:
[0066] S201: Call the set of structural mutation locations in the printed line, divide the current printed line position index into continuous paragraphs according to the order of mutation points in the index sequence, extract the corresponding point index data, and generate a paragraph point distribution sequence;
[0067] When retrieving the set of structural mutation locations in a printed line, it is necessary to first read all the mutation point index numbers recorded in the set. Assuming the current set data is [60, 140, 210, 300], the total index range of the current printed line (0 to 383) is then segmented: the first segment is 0 to 59, the second is 60 to 139, the third is 140 to 209, the fourth is 210 to 299, and the fifth is 300 to 383. During segmentation, the starting point of each segment is the first index after the previous mutation point, and the ending point is the index of the next mutation point minus one. The point index data of the printed line is obtained by reading the set of active points within the current printed line. For example, if the total index set is [5, 10, 20, 61, 70, 150, 160, 220, 310],
[320] , then the indexes [5, 10, 20] are extracted from the first segment, [61, 70] from the second segment, [150, 160] from the third segment,
[220] from the fourth segment, and [310, 320] from the fifth segment. During the extraction process, it is necessary to ensure that each point index is accurately assigned to its corresponding segment. The corresponding scanning direction is read by the preset parameters of the printing device. If the scanning direction set by the device is left to right, the point indexes in the segment are arranged in ascending order. If it is right to left, they need to be arranged in reverse order. For example, the original order of segment 2 [61, 70] is retained in the left to right direction. If it is right to left, it is adjusted to [70, 61]. By extracting and organizing all segments in sequence, a segment point distribution sequence containing all point indices is formed to ensure that each segment of data is complete and continuous in both logical and physical location.
[0068] S202: Based on the distribution sequence of points in the paragraph, extract the activation sequence and electrothermal channel number corresponding to all points in each paragraph, and count the trigger frequency of the points in the order of the activation sequence to obtain the point trigger frequency dataset.
[0069] Based on the paragraph point distribution sequence, all points need to be traversed segment by segment. For each point index, its activation record in the print job is retrieved. The activation record is obtained by counting the actual activation times of that point in the print control commands. Let the first segment index [5, 10, 20] have activation times of 3, 5, and 2 respectively; the second segment index [61, 70] have activation times of 6 and 4; the third segment index [150, 160] have activation times of 8 and 7; the fourth segment index
[220] has activation times of 5; and the fifth segment index [310, 320] has activation times of 2 and 3. After recording, the activation frequency sequence of each segment is formed. Then, for each point... The position is called by its heating channel number, which is obtained according to the fixed mapping relationship between the position index and the physical channel of the print head. Assuming that the number is the index value divided by 10 and rounded down, for example, position 5 corresponds to number 0, 10 corresponds to number 1, and 20 corresponds to number 2. The heating channel numbers are marked one by one, such as the first segment [0, 1, 2], the second segment [6, 7]. By matching the activation number with the heating channel number, a position trigger frequency dataset for each segment is formed. For example, the first segment is matched as [(3, 0), (5, 1), (2, 2)], and the remaining segments are similar. The statistical frequency and channel number are all recorded to form a complete position trigger frequency dataset, covering all segments and positions.
[0070] S203: Call the point trigger frequency dataset, multiply the trigger frequency of each point in each segment by the electric heating channel number, sum them up, and summarize them into a heat value set according to the segment order to generate a distribution map group of heating behavior in the segment;
[0071] The trigger frequency dataset is retrieved, and for each point within each segment, its trigger frequency is directly multiplied by the corresponding electric heating channel number. For example, in the first segment, point 5 has a frequency of 3, multiplied by channel number 0, resulting in 0; point 10 has a frequency of 5, multiplied by 1, resulting in 5; and point 20 has a frequency of 2, multiplied by 2, resulting in 4. Then, all the product results for this segment are summed. The result for the first segment is 0 + 5 + 4 = 9. The frequency of the second segment [6, 4] is calculated by multiplying it by channel number [6, 7], resulting in 66 = 36, 47 = 28, and a total of 64. This process is repeated for the third, fourth, and fifth segments. For the third segment, 815 = 120, 716 = 112. The sum of the first three segments is 232, the fourth segment is 522=110, the fifth segment is 231=62, 3*32=96, and the total is 158. The sum of the above segments is the calorific value of each segment. The resulting set of calorific values is [9, 64, 232, 110, 158]. After arranging them in the order of the segments, a set of heating behavior distribution maps within the segments is drawn based on this set. The horizontal axis is the segment number 1 to 5, and the vertical axis is the corresponding calorific value 9, 64, 232, 110, 158. The curve formed by connecting the data points shows the total heating energy distribution of each segment, thus completing the generation of the set of heating behavior distribution maps within the segments.
[0072] Please see Figure 4The specific steps of S3 are as follows:
[0073] S301: Based on the heat distribution density trend recorded in the heating behavior distribution map group within the section, extract the end of each section and the start of the adjacent section as candidate boundary points, calculate the gradient value of heat density change, filter the positions in the difference gradient sequence that are greater than the density change judgment threshold, and obtain the heat density change boundary index sequence.
[0074] The specific formula for calculating the gradient value of thermal density change is as follows:
[0075] ;
[0076] in, Representing the Segment and adjacent number The gradient value of heat density change between segments, Representing the The sum of calorific values in the distribution diagram of segment heating behavior. Representing the The sum of calorific values in the distribution diagram of segment heating behavior. Representing the Paragraph index width of the segment. Representing the Paragraph index width of the segment. Representing the Section and the The average width of all paragraph indexes between paragraphs. Indicates from the first Section to the first The sum of the absolute values of the differences between the width of each paragraph and the average width. This is the counting index of the paragraphs within the interval. Represents the sequence number of the current segment. Representative and the The sequence number of the next adjacent segment;
[0077] Parameter description and acquisition method:
[0078] : No. The total calorific value of a segment is obtained by summing the products of the heating frequency of all representative points within the segment and their channel numbers. For example, if segment k has 5 representative points with frequencies of [12, 15, 10, 9, 13] and channel numbers of [2, 3, 1, 2, 3], then...
[0079] ;
[0080] : No. The total calorific value of the segments, calculated in the same way as... If they are the same, for example, the frequency [20, 18, 14, 17, 16] and the channel number [2, 3, 2, 1, 3], then...
[0081] ;
[0082] :paragraph The index width is equal to the difference between the start and end indices of the segment plus 1. For example, if the index range is [0, 59], then... ;
[0083] :paragraph The index width, for example, the index range [60, 119], then ;
[0084] : interval to The average width of all paragraph indexes; in this example, there are only two paragraphs: 60 and 60, therefore... ;
[0085] From the first Section to the first The sum of the absolute values of the differences between the width of all paragraphs and their average width is calculated. In this example, both paragraphs are 60, so this term is 0.
[0086] Operators and their logical explanations:
[0087] Molecular part This indicates the difference in absolute heating amount constructed by linking calorific value with paragraph span;
[0088] The square root term in the denominator Used for standardization adjustments to prevent amplification due to extreme values;
[0089] Summation term Used to penalize and correct paragraph width fluctuations;
[0090] The outer absolute value sign ensures that a positive result indicates the intensity of the change, regardless of the direction of the change.
[0091] Table 1: Data Examples and Parameter Input Calculations
[0092]
[0093] As shown in Table 1, all parameters are directly calculated from the representative point data of the sampled segment and the index interval, which is both operable and stable.
[0094] Substitute actual values into the calculation:
[0095] The molecular part is: ;
[0096] The denominator is:
[0097] √ item: ;
[0098] The summation term is 0;
[0099] The overall calculation result is as follows:
[0100] ;
[0101] Comparison and derivation of results:
[0102] If the current threshold for judging abrupt changes in heat density is set to 0.25 (based on the statistical analysis of variation characteristics of previous sample segments, taking all segments), The average value plus 0.05), then
[0103] ;
[0104] The result indicates a paragraph and If the change in thermal density between the two exceeds the judgment threshold, it needs to be marked as a thermal density mutation boundary index and enter the subsequent boundary identification processing flow.
[0105] Explanation of Formula Innovation:
[0106] The advantage of the formula is that it introduces the paragraph index width. , As a calorific value adjustment factor, a segment width fluctuation penalty term is added to the denominator. This enables coordinated control of heat distribution intensity and regional fluctuations, avoiding one-sided misjudgments of dense heat but extremely narrow or excessively wide ranges, thereby enhancing the stability and accuracy of heat density change gradient judgment.
[0107] S302: Call the thermal density mutation boundary index sequence, extract the trigger frequency value sequence of continuous points on both sides of each candidate boundary point, calculate the total frequency value difference of the points on both sides, determine whether the positive or negative sign of the difference is consistent with the direction of the thermal density gradient before and after, and generate frequency difference trend matching results.
[0108] After calling the heat density abrupt change boundary index sequence, the trigger frequency value sequence is extracted for each consecutive point on both sides of each boundary point. Taking index 120 as an example, the trigger frequencies of the previous 5 consecutive index points are taken, assuming they are 10, 9, 11, 8, and 12 respectively, for a total frequency of 50. The frequencies of the next 5 consecutive index points after index 120 are taken, assuming they are 20, 22, 19, 21, and 18 respectively, for a total frequency of 100. The difference between the sums of the frequencies on both sides is calculated. 100 minus 50 equals 50, which is positive, indicating that the total frequency on the latter side is greater than that on the former side. Then, the direction of heat density change in the two segments where the boundary point is located is determined. The 120 corresponds to the area... The calorific value of the first segment is 58, and the calorific value of the next segment is 185. The density change is increasing, and the signs are both positive, so it is considered to be consistent in trend. Continuing to process the 189 index, the frequencies of the first 5 points are 23, 20, 21, 19, and 22, with a total of 105. The frequencies of the next 5 points are 14, 12, 13, 11, and 15, with a total of 65. The difference 65 minus 105 equals -40, which is negative. The calorific value changes from 185 to 95, and the direction of change is negative. The signs of both are consistent, so it is also determined that the trends are consistent. All candidate boundary points have completed the sign consistency determination of frequency difference and thermal density change direction, and the frequency difference trend matching result is obtained.
[0109] S303: Based on the frequency difference trend matching results, shift the boundary points of positions with consistent trends to the side with decreasing frequency by one point index, and keep the original boundary point index unchanged for positions with inconsistent trends. Integrate the adjustment results of all boundary points to generate a corrected paragraph boundary position sequence.
[0110] Based on the frequency difference trend matching results, the boundary points with consistent trends are shifted one point to the side with decreasing frequency. The frequency difference at index 120 is positive, the total frequency is less than the back side on the front side, and the frequency decreasing direction is in the front segment, so 120 is shifted forward to 119. The frequency difference at index 189 is negative, and the frequency decreasing direction is in the back segment, so 189 is shifted backward to 190. If there are inconsistent points, they are kept unchanged. Finally, they are integrated to form a corrected paragraph boundary position sequence. In this example, the corrected index positions are 119 and 190, replacing the original positions 120 and 189. After merging all boundary points with and without shifts, a complete corrected paragraph boundary position sequence is formed.
[0111] Please see Figure 5 The specific steps of S4 are as follows:
[0112] S401: Based on the corrected paragraph boundary position sequence, extract all point indexes and heating frequency values corresponding to the paragraph, sort them from high to low heating frequency, calculate the point index index of the middle position of the sorting, and extract the same number of point indexes to both sides at a symmetrical distance to obtain the paragraph representative point index set.
[0113] The specific formula for calculating the index of the middle position in the sorting is as follows:
[0114] ;
[0115] in, This represents the index of the middle position in the sorting. This represents the total number of points in the current paragraph. Representing the Heating frequency at each point Representing the The index of each point after sorting. This represents the average of all sorted position indices in the current paragraph. This represents the sum of squares of the heating frequencies at all points in the current paragraph. This represents the sum of the products of the heating frequency of all points and the absolute value of their location index and the average location difference;
[0116] The parameters and calculation logic within the formula are explained below: This indicates the index of the central position in the sorting, used to determine the central position of the representative point. The number of points in the current paragraph is obtained by directly counting the total number of extracted point indexes. For example, the number of points recorded in the paragraph count counter is the same as the number of points in the paragraph. , It is the first The heating frequency of each location is actually obtained by recording and counting the cumulative number of times that location is activated within the current task cycle through printed task logs. For the sorted number The index position number of each point is automatically recorded after being sorted based on the heating frequency. This represents the average of the sorted point indices, calculated as follows: Summation symbol Indicates all Each point is executed sequentially, symbol The absolute value operation measures the deviation of each point's location from the average index. This represents the weighted offset of the positional deviation under the weight of heating frequency. This is the sum of squares of frequencies, used to measure the overall level of frequency and normalize the numerator. The frequency weights are standardized using square root operations, and the outer layer is multiplied by... To ensure that the results are inversely proportional to the paragraph size, and to avoid the influence of paragraph point count on the median index shift, Rounding down ensures that the index value is an integer.
[0117] To obtain the actual values, the specific assignments and data are shown in Table 2.
[0118] Table 2 Paragraph Point Parameter Table
[0119]
[0120] As shown in Table 2 , .
[0121] Calculate in sequence :
[0122] ;
[0123] corresponding :
[0124] 15×4.5=67.5, 12×3.5=42, 20×2.5=50, 10×1.5=15, 18×0.5=9, 9×0.5=4.5, 8×1.5=12, 14×2.5=35, 11×3.5=38.5, 13×4.5=58.5;
[0125] Summation:
[0126] ;
[0127] Recalculate:
[0128]
[0129] Take the square root:
[0130] ;
[0131] Substitute into the formula:
[0132] ;
[0133] The result indicates that the index of the central location point is 0, which, after rounding by the logical factor, is also 0. In practical applications, the minimum benchmark value can be set to 1 to prevent errors in subsequent representative point extraction caused by setting it to 0. Therefore, the final... .
[0134] The advantage of the formula is that, through the dual-layer weight control of frequency sum-of-squares standardization and weighted offset, combined with the normalization of the number of paragraph points, the central position index does not shift excessively with the total number of points or frequency range changes, thus ensuring the balance and concentration of representative point selection.
[0135] S402: Call the paragraph representative point index set, extract the electric heating channel number and activation order value corresponding to each point, and group the corresponding number information according to the paragraph number to construct the representative point structure within the paragraph and generate the representative point activation attribute group.
[0136] The process involves calling a set of point indexes representing paragraphs, iterating through each point index, and extracting the heating channel number and activation sequence value for each point. The heating channel number is directly read from the printhead's channel mapping table using the point index. For example, point 12 maps to channel number 1, point 5 to channel number 0, point 28 to channel number 2, point 50 to channel number 4, point 58 to channel number 5, point 8 to channel number 0, and point 35 to channel number 3. Then, the activation sequence value is extracted for each point. This activation sequence value is obtained by querying the print job's activation log, recording the point's position in the job. The specific round sequence number of the activation is as follows: for example, the activation sequence of point 12 is 7, 5 is 4, 28 is 9, 50 is 12, 58 is 14, 8 is 5, and 35 is 10. After extraction, the electric heating channel number is paired with the activation sequence value and categorized by paragraph number. The pairing of representative points under paragraph 1 is [(1,7), (0,4), (2,9), (4,12), (5,14), (0,5), (3,10)]. This operation is repeated for each subsequent paragraph to complete the pairing and grouping of the representative point activation attributes of all paragraphs, forming the corresponding representative point activation attribute group for each paragraph.
[0137] S403: Based on the representative point activation attribute group, construct a key-value mapping relationship between the number and the corresponding representative point electrothermal channel number and activation order, organize the data into a standard index structure, and generate a representative point activation relationship table.
[0138] Based on the representative point activation attribute group, a key-value mapping relationship needs to be established for each representative point in each segment attribute group, from its number to the electrothermal channel number and activation order. Specifically, this involves mapping the composite identifier composed of each segment number and point index to its corresponding channel number and activation order value. For example, point 12 in segment 1 is mapped to segment 1_12, with a corresponding key value of (1, 7); point 5 is mapped to segment 1_5, with a corresponding key value of (0, 4), and so on for the remaining points. Segment 1_28 is (2, 9), segment 1_50 is (4, 12), and segment 1_58 is (4, 12). (5, 14), segment 1_8 is (0, 5), segment 1_35 is (3, 10). After forming complete key-value pairs in this format, the same mapping needs to be performed on all segments to form a unified data structure. All segment mapping data is finally organized into a standard index structure to ensure that each combination of segment number and point number accurately corresponds to the channel number and activation order value. After completion, a representative point activation relationship table is formed. Each record in the table uses segment number_point number as the index, and the channel number and activation order value are the corresponding content, completely covering all segments and representative points.
[0139] Please see Figure 6 The specific steps of S5 are as follows:
[0140] S501: Read the representative point number recorded in the representative point activation relationship table, sequentially collect the hot trigger status value of the corresponding point in the current printing task, extract the current trigger value of each representative point and the recorded values in the two preceding and following trigger cycles, form a continuous three-frame dataset, and generate a hot trigger record set;
[0141] Read all representative point numbers recorded in the representative point activation relationship table. For each number, sequentially retrieve the real-time monitoring data of the current printing task to determine the physical point index corresponding to that number. Then, retrieve the hot trigger status value of the corresponding point in the current trigger cycle. For example, the point index 12 corresponding to number segment 1_12 has a current cycle trigger value of 75. Next, continue reading the historical records of the same physical point in the previous two cycles. If the trigger value in the previous cycle was 70 and the cycle before that was 68, then three consecutive frames of data for that representative point are formed [68, 70, 75]. Perform the same operation on all representative points. Segment 1_28 corresponds to point index 28, and the three frames read are [82, 84, 88]. Segment 1_5 corresponds to index 5 and the records are [60, 65, 67]. During the collection process, it is necessary to ensure that the period interval is constant, for example, each period interval is 50 milliseconds, to avoid the data continuity being affected by time differences. After completion, the three frames of data of each representative point are uniformly mapped and stored with the representative point number, segment number, and physical index, and summarized to form a complete hot trigger record set. This record set is grouped by segment number, and each group records the three consecutive hot trigger states of all representative points, forming a segment-level dataset structure.
[0142] S502: Call the thermal trigger record set, compare the current thermal trigger value of each representative point with the upper limit of the internal thermal reference interval. If the trigger value is higher than the upper limit of the interval, mark the heating status as needing to be adjusted. If it is not higher, mark it as maintaining the status unchanged, and generate a segment heating adjustment flag set.
[0143] The thermal trigger record set is invoked. For each representative point within the record set, the thermal trigger value for the current period is first extracted. Then, the upper limit of the preset internal thermal reference range under the corresponding material type and printing conditions is read. The upper limit is jointly determined by the printing consumable specifications and printhead characteristics. For example, the upper limit for ordinary thermal paper is 80, while the upper limit for label thermal paper is 85. If the device printing parameters are marked as ordinary thermal paper, then 80 is used as the reference upper limit for all representative points. Subsequently, the current trigger value of each representative point is compared with this upper limit. If the current value is greater than 80, the point is marked as needing to be adjusted downwards. Otherwise, it is marked as unchanged. For example, if the current value of segment 1_12 is 75, which is lower than 80, it is marked as unchanged; if the current value of segment 1_28 is 88, which is higher than 80, it is marked as needing to be adjusted; if the current value of segment 1_5 is 67, which is lower than 80, it is marked as unchanged. The marking results of all representative points are statistically analyzed within their respective segments. If any representative point in a segment is marked as needing to be adjusted, then the entire segment is marked as needing to be adjusted; otherwise, it is marked as unchanged. After this round of statistical analysis of all segments, a segment heating adjustment flag set is formed, and the marking status of each segment is clearly marked as needing to be adjusted or remaining unchanged.
[0144] S503: Based on the segment heating adjustment flag set, reduce the heating speed value of the segment that needs to be adjusted by a set ratio and extend the power-on time synchronously. Unmarked segments maintain the original parameters, record the current adjustment execution status, and generate a thermal printing control scheme.
[0145] Based on the segment heating adjustment flag set, for all segments marked as needing adjustment, their current heating speed value and power-on time are extracted. Each segment is then adjusted according to the set speed reduction ratio and power-on time extension ratio. The heating speed reduction ratio is set based on the characteristics of the thermal material and printhead; for ordinary thermal paper, the reduction ratio is generally set to 10%, while for special materials such as label paper, it is set to 5%. The power-on time extension ratio is determined in conjunction with the speed reduction ratio. For example, if the speed is reduced by 10%, the power-on time extension ratio is 5%. For instance, if segment 1 currently has a heating speed of 100mm / s and a power-on time of 0.9ms... After adjustment, the speed was changed to 90mm / s and the power-on time was changed to 0.945ms. For unmarked segments, the heating speed and power-on time remained unchanged from the original settings. During the adjustment process, the original parameters and adjusted parameters of each segment must be recorded one by one, including the segment number, original speed, adjusted speed, original power-on time, and adjusted power-on time. The timestamp and operation type of each adjustment operation must also be recorded completely. Finally, all adjustment records and original settings are archived together to form a thermal printing control scheme, ensuring that the parameter adjustment of each segment in the scheme has a clear basis and complete adjustment traces.
[0146] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A thermal printing control method, characterized in that, Includes the following steps: S1: Obtain the index of the point to be executed in the printing task, construct a continuous sequence according to the scanning direction, traverse the index difference of adjacent points, extract the difference as the difference marker value, determine the jump position, mark it as the potential point of inter-segment boundary change, and obtain the set of structural mutation positions. S2: Divide the printing behavior segments according to the set of structural mutation locations, collect the activation sequence and electric heating channel number of the points, count the trigger frequency, multiply the frequency of each point by the electric heating channel number and sum them to form the cumulative value of heat intensity, and obtain the heating behavior distribution map group within the segment; The heating channel number is obtained based on the fixed mapping relationship between the point index and the physical channel of the print head; the heating channel number is obtained by dividing the index value by 10 and rounding down; S3: Based on the heat density trend of the heating behavior distribution map group in the section, screen the section boundary with prominent changes in heat density gradient value, extract the frequency sequence of points on both sides of the boundary, calculate the total frequency difference and determine whether it is consistent with the direction of heat density change. If it is consistent, the boundary is shifted one position to the frequency decreasing side; otherwise, it remains unchanged, forming a corrected section boundary position sequence. S4: Based on the corrected paragraph boundary position sequence, sort the points within the paragraph according to the heating frequency, extract the sorted middle and symmetrical points, record the electric heating channel number and activation order, form a representative point set, establish a mapping with the paragraph number, organize it into an index format, and generate a representative point activation relationship table. S5: Read the representative point activation relationship table, collect the thermal trigger status of the representative points in the current printing task and compare and record it. If the thermal trigger value exceeds the upper limit of the internal reference range, reduce the heating speed and extend the power-on time; otherwise, keep it unchanged, record the adjustment status, and complete the thermal printing control scheme.
2. The thermal printing control method according to claim 1, characterized in that, The set of structural mutation locations in the printed line includes jump point location index, inter-segment boundary candidate points, and mutation segment identification information. The heating behavior distribution map group within the segment includes trigger frequency statistics, electric heating channel number distribution, and cumulative heat intensity value spectrum. The corrected segment boundary location sequence includes the final index value of the boundary point, frequency difference comparison data, and boundary adjustment direction mark. The representative point activation relationship table includes representative point number index, segment number mapping relationship, and heating frequency sorting position.
3. The thermal printing control method according to claim 1, characterized in that, The activation sequence and heating channel number refer to the set of heating element numbers corresponding to the printing points activated in chronological order, reflecting the heating execution process of the printing task.
4. The thermal printing control method according to claim 1, characterized in that, The specific steps of S1 are as follows: S101: Obtain the position index of all points to be executed in the thermal printing task, arrange them in order according to the scanning direction, calculate the index difference between adjacent points in sequence, establish the index distance value data of the continuous point sequence, and generate the index distance value sequence. S102: Call the index distance value sequence, compare each difference with the previous one, determine whether the difference change exceeds the set jump judgment threshold, extract the change position as a jump mark, and obtain the jump behavior point index set; S103: Based on the jump behavior point index set, filter the positions where the index difference is greater than the structural change boundary value as the basis for the segment boundary, locate the structural change area in the printed line, and generate a set of structural change positions in the printed line.
5. The thermal printing control method according to claim 1, characterized in that, The specific steps of S2 are as follows: S201: Call the set of structural mutation locations in the printed line, divide the current printed line position index into continuous paragraphs according to the order of mutation points in the index sequence, extract the corresponding point index data, and generate a paragraph point distribution sequence; S202: Based on the segment point distribution sequence, extract the activation sequence and electrothermal channel number corresponding to all points in each segment, and count the trigger frequency of the points according to the activation sequence order to obtain the point trigger frequency dataset. S203: Call the trigger frequency dataset of the points, multiply the trigger frequency of each point in each segment by the electric heating channel number, sum them up, and summarize them into a heat value set according to the segment order to generate a distribution map group of heating behavior in the segment.
6. The thermal printing control method according to claim 1, characterized in that, The specific steps for S3 are as follows: S301: Based on the heat distribution density trend recorded in the heating behavior distribution map group within the section, extract the end of each section and the beginning of the adjacent section as candidate boundary points, calculate the heat density change gradient value, filter the positions in the difference gradient sequence that are greater than the density abrupt judgment threshold, and obtain the heat density abrupt boundary index sequence. S302: Call the thermal density mutation boundary index sequence, extract the trigger frequency value sequence of continuous points on both sides of each candidate boundary point, calculate the total frequency value difference of the points on both sides respectively, determine whether the positive or negative sign of the difference is consistent with the direction of the thermal density gradient before and after the segment, and generate frequency difference trend matching result. S303: Based on the frequency difference trend matching result, shift the boundary points of positions with consistent trends to the side with decreasing frequency by one point index, and keep the original boundary point index unchanged for positions with inconsistent trends. Integrate the adjustment results of all boundary points to generate a corrected paragraph boundary position sequence.
7. The thermal printing control method according to claim 1, characterized in that, The specific steps of S4 are as follows: S401: Based on the corrected paragraph boundary position sequence, extract all point indexes and heating frequency values corresponding to the paragraph, sort them from high to low heating frequency, calculate the point index index of the middle position of the sorting, and extract the same number of point indexes to both sides at symmetrical distances to obtain the paragraph representative point index set. S402: Call the paragraph representative point index set, extract the electric heating channel number and activation sequence value corresponding to each point, and group the corresponding number information according to the paragraph number to construct the representative point structure within the paragraph and generate representative point activation attribute group; S403: Based on the representative point activation attribute group, construct a key-value mapping relationship between the number and the corresponding representative point electrothermal channel number and activation order, organize the data into a standard index structure, and generate a representative point activation relationship table.
8. The thermal printing control method according to claim 1, characterized in that, The thermal printing control scheme includes heating speed adjustment parameters, power-on time adjustment records, and thermal trigger state comparison results.
9. The thermal printing control method according to claim 1, characterized in that, The specific steps of S5 are as follows: S501: Read the representative point number recorded in the representative point activation relationship table, sequentially collect the hot trigger status value of the corresponding point in the current printing task, extract the current trigger value of each representative point and the recorded value in the previous and next two trigger cycles, form a continuous three-frame dataset, and generate a hot trigger record set. S502: Call the thermal trigger record set, compare the current thermal trigger value of each representative point with the upper limit of the internal thermal reference interval. If the trigger value is higher than the upper limit of the interval, mark the heating state as needing to be adjusted. If it is not higher, mark it as maintaining the status unchanged, and generate a segment heating adjustment identifier set. S503: Based on the segment heating adjustment identifier set, reduce the heating speed value of the segment that needs to be lowered by a set ratio and extend the power-on time synchronously. The unmarked segments maintain the original parameters, record the current adjustment execution status, and generate a thermal printing control scheme.
Citation Information
Patent Citations
Two-dimension code, decode method thereof and printing publication used the same
CN1963843A
Image forming method
JP2004364008A