A red-black dual-color thermal paper printing control method, system, device and medium

By using environmentally adaptive heating baseline calculation and staggered heating control of red heating point groups, the problem of heat superposition in two-color thermal printing is solved, achieving stable print quality and color purity, and meeting the temperature control and color separation requirements of high-quality two-color printing.

CN121742780BActive Publication Date: 2026-05-22BEIJING SHUOFANG INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING SHUOFANG INFORMATION TECH CO LTD
Filing Date
2026-02-27
Publication Date
2026-05-22

Smart Images

  • Figure CN121742780B_ABST
    Figure CN121742780B_ABST
Patent Text Reader

Abstract

The application provides a red and black dual-color thermal paper printing control method, system, device and medium, and relates to the technical field of thermal printing. The method comprises the following steps: obtaining printing requirements of to-be-printed data, separating the to-be-printed data into red printing data and black printing data; combining environmental parameters and the printing requirements to calculate a heating reference value of a print head; assigning adjacent red heating points in the red printing data to different groups to generate a plurality of red heating point groups; generating a printing control waveform, based on the heating reference value, outputting a black heating signal in a first group of heating wave bands in a plurality of PWM heating wave bands when printing the black printing data, outputting a red heating signal in a second group of heating wave bands in the plurality of PWM heating wave bands when printing the red printing data, controlling the red heating point groups to heat at different times, and controlling the red printing density by adjusting the duty cycle of the second group of heating wave bands. The application has the technical effect of improving the printing quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of thermal printing technology, specifically to a red and black dual-color thermal paper printing control method, system, equipment, and medium. Background Technology

[0002] With the rapid development of applications such as label printing, invoice printing, and packaging printing, two-color thermal printing technology has attracted much attention due to its ability to print red and black simultaneously on a single sheet of paper. Two-color thermal paper typically employs a double-layer coating structure: a red thermal coating on top and a black thermal coating on the bottom. Specific colors are selectively activated by controlling different heating temperatures. However, in actual printing, when adjacent red heating points are activated simultaneously, a heat superposition effect can easily occur, causing local temperatures to exceed the activation threshold of the black coating. This results in unexpected black color development in the red printing area, severely affecting print quality and color purity. Therefore, effectively avoiding heat interference from adjacent heating points while ensuring normal red and black color development has become a core technical challenge for two-color thermal printing technology.

[0003] Currently, the main methods to alleviate heat accumulation issues are reducing the red heating power or extending the red heating interval. While these methods can reduce heat interference to some extent, they cannot be dynamically adjusted according to actual environmental conditions and printing requirements. This leads to problems such as insufficient red color development or accidental black activation at different temperature environments, making it difficult to guarantee print quality. Summary of the Invention

[0004] This application provides a red and black dual-color thermal paper printing control method, system, device, and medium for improving print quality.

[0005] In a first aspect, this application provides a method for controlling the printing of red and black dual-color thermal paper. The method includes: acquiring printing requirements of data to be printed, and separating the data to be printed into red printing data and black printing data; acquiring environmental parameters, and calculating a heating reference value for the print head based on the environmental parameters and the printing requirements; assigning adjacent red heating points in the red printing data to different groups to generate multiple red heating point groups; generating a printing control waveform, the printing control waveform including multiple PWM heating bands and a cooling band; based on the heating reference value, when printing the black printing data, outputting a black heating signal in a first group of heating bands among the multiple PWM heating bands, and controlling the black printing density by adjusting the duty cycle of the first group of heating bands; when printing the red printing data, outputting a red heating signal in a second group of heating bands among the multiple PWM heating bands, controlling the staggered heating of each group of red heating points, and controlling the red printing density by adjusting the duty cycle of the second group of heating bands.

[0006] By adopting the above technical solution and establishing an environmentally adaptive heating baseline calculation mechanism, the heating intensity of the printhead can be dynamically adjusted according to actual environmental parameters and printing requirements, ensuring stable print quality under different temperature conditions. By assigning adjacent red heating points to different red heating point groups and implementing staggered heating control in the second heating band, the heat superposition effect when adjacent heating points are activated simultaneously is effectively avoided, fundamentally eliminating the problem of accidental activation of the black coating in the red printing area. Simultaneously, the separate design of the first and second heating bands ensures complete temporal isolation between the red and black heating processes. Precise control of red and black printing density is achieved through independent duty cycle adjustments, significantly improving the color purity, color uniformity, and overall print quality of two-color thermal printing. This meets the stringent requirements of high-quality two-color printing for temperature control accuracy and color separation, thus improving print quality.

[0007] Secondly, this application provides a red-black dual-color thermal paper printing control system, the system comprising: a first acquisition module, a second acquisition module, a first generation module, a second generation module, a first printing module, and a second printing module; wherein,

[0008] The first acquisition module is used to acquire the printing requirements of the data to be printed and separate the data to be printed into red printing data and black printing data. The second acquisition module is used to acquire environmental parameters and calculate the heat reference value of the print head by combining the environmental parameters and the printing requirements. The first generation module is used to assign adjacent red heat points in the red printing data to different groups to generate multiple red heat point groups. The second generation module is used to generate a printing control waveform, which includes multiple PWM heating bands and a cooling band. The first printing module is used to output a black heating signal in the first group of heating bands in the multiple PWM heating bands when printing the black printing data based on the heat reference value, and control the black printing density by adjusting the duty cycle of the first group of heating bands. The second printing module is used to output a red heating signal in the second group of heating bands in the multiple PWM heating bands when printing the red printing data, control the staggered heating of each red heat point group, and control the red printing density by adjusting the duty cycle of the second group of heating bands.

[0009] Thirdly, this application provides an electronic device that adopts the following technical solution: it includes a processor, a memory, a user interface, and a network interface. The memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory to enable the electronic device to execute a computer program of any of the red and black dual-color thermal paper printing control methods described above.

[0010] Fourthly, this application provides a computer-readable storage medium that employs the following technical solution: storing a computer program capable of being loaded by a processor and executing any of the aforementioned red and black dual-color thermal paper printing control methods.

[0011] In summary, this application includes at least one of the following beneficial technical effects:

[0012] By establishing an environmentally adaptive heating baseline calculation mechanism, the printing head's heating intensity can be dynamically adjusted according to actual environmental parameters and printing requirements, ensuring stable print quality under different temperature conditions. By assigning adjacent red heating points to different red heating point groups and implementing staggered heating control within the second heating band, the heat superposition effect when adjacent heating points are activated simultaneously is effectively avoided, fundamentally eliminating the problem of accidental activation of the black coating by the red printing area. Simultaneously, the separate design of the first and second heating bands ensures complete temporal isolation between the red and black heating processes. Precise control of red and black printing density is achieved through independent duty cycle adjustments, significantly improving the color purity, color uniformity, and overall print quality of two-color thermal printing. This meets the stringent requirements of high-quality two-color printing for temperature control accuracy and color separation, thus enhancing print quality. Attached Figure Description

[0013] Figure 1 This is a flowchart illustrating a red and black dual-color thermal paper printing control method provided in an embodiment of this application;

[0014] Figure 2 This is a schematic diagram of a red and black dual-color thermal paper printing control system provided in an embodiment of this application;

[0015] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0016] Explanation of reference numerals in the attached figures: 1000, electronic device; 1001, processor; 1002, communication bus; 1003, user interface; 1004, network interface; 1005, memory. Detailed Implementation

[0017] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0018] In the description of the embodiments in this application, words such as "illustrative," "for example," or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "illustrative," "for example," or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Rather, the use of words such as "illustrative," "for example," or "for example" is intended to present the relevant concepts in a specific manner.

[0019] Figure 1 This is a schematic flowchart of a red and black dual-color thermal paper printing control method provided in an embodiment of this application. Figure 1 As shown, the method includes S101-S106:

[0020] S101, obtain the printing requirements of the data to be printed, and separate the data to be printed into red printing data and black printing data.

[0021] The system first receives the data to be printed from the host computer or application program. This data is typically label data containing mixed content such as text, images, or barcodes. Since traditional thermal printers can only output a single black color, and red-black dual-color thermal paper has two different thermal coatings (a bottom layer of high-temperature developing black coating and a top layer of low-temperature developing red coating), the raw data needs to be separated according to the color development temperature requirements of different colors to achieve precise dual-color printing control.

[0022] While acquiring the data to be printed, the system also needs to parse the printing requirements contained within it. These requirements include parameters such as print density settings, print speed, paper type identification, and color distribution instructions. Printing requirements are typically embedded in the print data as metadata or transmitted to the printer via separate control commands. For example, when printing a product label, the price might need to be highlighted in red, while the product name and barcode might be printed in black; this color allocation information is included in the printing requirements.

[0023] During the data separation process, the system employs a color mapping algorithm to analyze the data to be printed pixel by pixel. Specifically, the system first converts the received color or grayscale image data into binary dot matrix data, and then assigns each printing dot to either red or black printing data according to preset color separation rules. Red printing data refers to the set of pixels that need to activate the red coating under low-temperature conditions, while black printing data refers to the set of pixels that need to activate the black coating under high-temperature conditions. The key to this separation process is ensuring that pixels at the same location are not simultaneously assigned to both color data, thus avoiding color aliasing.

[0024] To achieve accurate data separation, the system establishes a color priority mechanism. When a location in the original data contains both red and black information, the system selects the appropriate color based on preset priority rules. Red typically has higher priority because the red layer is located at the top layer and, once activated, will cover the underlying black layer. Simultaneously, the system also considers the color distribution of adjacent pixels and optimizes color boundary processing through a neighborhood analysis algorithm, ensuring that the printed image has clear color boundaries and good visual effects.

[0025] S102: Obtain environmental parameters, and calculate the printhead's heat reference value based on the environmental parameters and printing requirements.

[0026] The system collects environmental parameters in real time through a built-in sensor module. These parameters mainly include three key indicators: battery voltage, ambient temperature, and printhead temperature. Since the color rendering effect of thermal printing directly depends on the actual temperature of the printhead when it comes into contact with the thermal paper, and this temperature is affected by a variety of external factors, an environmentally adaptive heat control mechanism must be established to ensure consistent print quality under different operating conditions.

[0027] The system first reads the real-time value from the battery voltage sensor, which directly affects the actual power output of the printhead's thermal resistor. When the battery is fully charged, the voltage is high, allowing the thermal resistor to quickly reach the target temperature. Conversely, when the battery is low, the voltage drops, requiring a longer heating time or a larger duty cycle to achieve the same heating effect. The ambient temperature sensor monitors the external temperature conditions around the printer, as ambient temperature affects the initial temperature of the thermal paper and its heat dissipation rate, thus influencing the actual amount of heat required for color development. The printhead temperature sensor is mounted on the base plate of the thermal printhead to monitor the current temperature of the printhead in real time, which is crucial for temperature accumulation control during continuous printing.

[0028] After acquiring complete environmental parameters, the system uses a weighted fusion algorithm to calculate the overall temperature parameter. Specifically, the system weights the ambient temperature and printhead temperature according to preset weighting coefficients, with the printhead temperature typically having a higher weight because it more directly reflects the current thermal state of the heating resistor. The formula for calculating the overall temperature is: Overall Temperature = Ambient Temperature × Ambient Weighting Coefficient + Printhead Temperature × Printhead Weighting Coefficient. This weighted calculation method comprehensively considers both the external environment and the device's own thermal state, providing a more accurate temperature reference for subsequent heat generation calculations.

[0029] Next, the system determines a voltage compensation coefficient based on the current battery voltage. This coefficient corrects for differences in heat generation power under different voltage conditions. The system has a built-in voltage compensation lookup table that establishes the correspondence between battery voltage and the compensation coefficient. When the battery voltage is at the standard operating voltage, the compensation coefficient is 1.0. When the voltage is low, the compensation coefficient is greater than 1.0 to enhance the heating effect; when the voltage is high, the compensation coefficient is less than 1.0 to avoid overheating. The system then calculates the heating baseline parameter by combining the temperature and the voltage compensation coefficient. This parameter reflects the basic heat output required for the printhead to achieve standard heating performance under the current environmental conditions.

[0030] Based on the obtained heating reference parameters, the system further refines the adjustments by combining the printing requirement information parsed in step S101. The system analyzes the density distribution of heating points in the current data to be printed. When there are many heating points in a certain row, the actual temperature will be higher than the temperature when heating individually due to the heat superposition effect. Therefore, the heating reference parameters need to be reduced accordingly, with the reduction amount being directly proportional to the number of heating points. Conversely, when there are few heating points, the heat is dispersed and dissipates quickly, so the heating reference parameters need to be appropriately increased to ensure sufficient color rendering. The increase amount is inversely proportional to the number of heating points.

[0031] The system also considers the impact of the distribution ratio of red and black heat-generating points within the same row on heating requirements. Since red requires a lower temperature to develop, while black requires a higher temperature, when red heat-generating points dominate in a row, the system adjusts the heating baseline parameters accordingly to prevent overheating of the red area from affecting color purity. Through this color distribution-based correction mechanism, the system can generate optimal heating baseline values ​​for each row of printed data.

[0032] Based on the above embodiments, as an optional implementation, in S102, the environmental parameters include battery voltage, ambient temperature, and printhead temperature. Calculating the printhead's heat reference value, considering both environmental parameters and printing requirements, specifically includes S21-S23:

[0033] S21 calculates the combined temperature by weighting the ambient temperature and the printhead temperature.

[0034] The system weighted and fused data collected by the ambient temperature sensor and the printhead temperature sensor to generate a comprehensive temperature parameter that reflects the current thermal state. Since the printhead temperature directly affects the initial thermal state of the heating resistor, while the ambient temperature affects the heat dissipation rate and the initial temperature of the thermal paper, both significantly impact the final color development effect. Therefore, a scientific fusion mechanism is essential. The system employs a weighted average algorithm, assigning a weighting coefficient of 0.7 to the printhead temperature and 0.3 to the ambient temperature. The calculation formula is: Comprehensive Temperature = Printhead Temperature × 0.7 + Ambient Temperature × 0.3. This weighting distribution highlights the dominant role of the printhead's own thermal state while considering the influence of the external environment on heat dissipation, providing an accurate temperature benchmark for subsequent heat generation calculations.

[0035] S22, determine the voltage compensation coefficient based on the battery voltage, and compensate the overall temperature based on the voltage compensation coefficient to obtain the heating reference parameter.

[0036] The system determines the corresponding voltage compensation coefficient based on the current battery voltage state and uses this coefficient to compensate and correct the overall temperature, generating a heating reference parameter. The battery voltage directly determines the actual power output capability of the heating resistor. When the voltage is too low, the heating time needs to be extended or the duty cycle increased to maintain the same heating effect; when the voltage is too high, the heating intensity needs to be appropriately reduced to avoid overheating. The system has a built-in voltage compensation lookup table that establishes the correspondence between battery voltage and the compensation coefficient: when the battery voltage is the standard voltage of 12V, the compensation coefficient is 1.0; when the voltage drops to 10.5V, the compensation coefficient increases to 1.15; and when the voltage rises to 13.5V, the compensation coefficient decreases to 0.9. The system calculates the overall temperature using the voltage compensation coefficient: Heating Reference Parameter = Overall Temperature × Voltage Compensation Coefficient. This compensation mechanism ensures a consistent heating effect under different battery conditions.

[0037] S23, adjust the heating reference parameters according to the printing requirements to generate the heating reference value.

[0038] The system refines the heating baseline parameters based on the printing requirement information parsed in step S101, ultimately generating a heating baseline value suitable for the current printing task. The system first analyzes the density distribution of heating points in the current print line. When the number of heating points exceeds a preset threshold, the actual temperature will be higher than the temperature of a single heating point due to the heat aggregation effect. Therefore, the heating baseline parameters need to be reduced accordingly, with the reduction calculated based on the ratio of the number of heating points to the threshold. When the number of heating points is small, the heat is dispersed and dissipates quickly, so the system appropriately increases the heating baseline parameters to ensure sufficient color development. Simultaneously, the system considers the distribution ratio of red and black heating points. When red heating points dominate, the heating intensity is appropriately reduced to avoid overheating and affecting red purity; when black heating points dominate, the heating intensity is maintained or slightly increased to ensure black density. After these comprehensive adjustments, the system generates the final heating baseline value, which accurately reflects the standard heating level that the printhead should achieve under the current environmental conditions and printing requirements.

[0039] Based on the above embodiments, as an optional implementation, in S23, adjusting the heating reference parameters according to printing requirements to generate the heating reference value specifically includes S231-S232:

[0040] S231, according to the printing requirements, divide the data to be printed into multiple rows, and obtain the number of heat points in each row and the color distribution of the data in each row.

[0041] Based on the printing requirement information obtained in step S101, the system divides the data to be printed into multiple print rows according to the physical structure characteristics of the printer. Each print row corresponds to the data range processed by one horizontal scan of the print head. The system performs detailed data analysis on each print row, counting the total number of heat points in that row. Heat points refer to the pixel positions that need to be heated by the print head's heating resistor, including red and black heat points. Simultaneously, the system analyzes the color distribution characteristics of each row of data, calculating the ratio of red to black heat points. This ratio information is crucial for subsequent differentiated heating control. The system stores the number of heat points and color distribution data for each row in a temporary cache, providing a data foundation for subsequent parameter adjustments.

[0042] S232, when the number of heat points in the current row is greater than the preset threshold, the heat reference parameter is reduced, where the reduction is proportional to the number of heat points; when the number of heat points in the current row is not greater than the preset threshold, the heat reference parameter is increased, where the increase is inversely proportional to the number of heat points; and the adjusted heat reference parameter is corrected according to the ratio of red heat points to black heat points in the color distribution of the current row to generate a heat reference value.

[0043] The system intelligently adjusts the heating baseline parameters based on the density and color distribution characteristics of the heat points in each row. First, the system sets a preset threshold for the number of heat points. This threshold is typically determined based on the printhead's heat capacity and heat dissipation characteristics, with a typical value being 60% of the total number of heat points in the printhead. When the system detects that the number of heat points in the current row exceeds the preset threshold, it indicates a high-density heating requirement in that row. The simultaneous operation of multiple adjacent heat points will generate a heat superposition effect, causing the actual temperature to exceed the expected temperature for single-point heating. To compensate for this heat superposition effect, the system will correspondingly reduce the heating baseline parameters. The reduction amount is calculated using the formula: Reduction Amount = (Number of Heat Points in Current Row - Preset Threshold) / Preset Threshold × Basic Adjustment Coefficient. The basic adjustment coefficient is typically set between 0.1 and 0.2 to ensure that the adjustment amount is proportional to the number of heat points.

[0044] When the system detects that the number of heat points in the current row is not greater than the preset threshold, it indicates that the heat density of that row is relatively low, the thermal interference between heat points is small, and the heat dissipation is sufficient. At this time, it is necessary to appropriately increase the heat reference parameter to ensure that each heat point can obtain sufficient heat to achieve full color development. The system adopts an inverse proportional adjustment strategy, and the formula for calculating the increase is: Increase = Base adjustment coefficient × (Preset threshold - Number of heat points in the current row) / Number of heat points in the current row. This inverse proportional relationship ensures that the fewer the number of heat points, the greater the increase in heat intensity, effectively compensating for the insufficient color development problem that may occur when the heat density is low.

[0045] After initial adjustments based on heating point density, the system further refines the adjusted heating baseline parameters according to the color distribution characteristics of the current row. The system calculates the ratio of red to black heating points. When the proportion of red heating points is high, the system appropriately lowers the heating baseline parameters to avoid excessive heating that could negatively impact red purity, as red requires a relatively lower temperature to develop. The correction factor is typically set between 0.9 and 0.95. When the proportion of black heating points is high, the system correspondingly increases the heating baseline parameters to ensure sufficient development of black areas, as black requires a higher activation temperature. The correction factor is typically set between 1.05 and 1.1. When the proportions of red and black heating points are relatively balanced, the system maintains the adjusted heating baseline parameters unchanged to ensure a balanced effect in two-color printing.

[0046] After adjusting the density of heating points and correcting the color distribution, the system generates the final heating baseline value, which accurately reflects the specific characteristics and heating requirements of the current printed line.

[0047] S103, assign adjacent red hot spots in the red printed data to different groups to generate multiple red hot spot groups.

[0048] The system intelligently groups the red printing data obtained in step S101. The core purpose of this step is to solve the problem of heat accumulation that may occur when red heat-generating points are densely distributed. Because the color development temperature of the red thermal coating is relatively low, when multiple adjacent red heat-generating points are heated simultaneously, heat conduction between them can lead to excessively high local temperatures. This can not only activate the underlying black coating, causing color crosstalk, but also affect the uniformity and clarity of the red color development. Therefore, it is necessary to stagger the heating processes of adjacent heat-generating points through timing control to avoid excessive heat concentration in space and time.

[0049] The system first scans and analyzes the red printed data in each row to identify continuously distributed groups of red heat-generating points. These red heat-generating points are pixels marked as needing activation in the red printed data; these points physically correspond to the heating resistor units on the print head. When the system detects two or more red heat-generating points arranged adjacently in the printing direction, it considers a potential risk of thermal interference. To quantify adjacency relationships, the system employs a neighborhood detection algorithm, considering not only direct horizontal adjacency but also diagonal proximity, because thermal conduction spreads radially across a two-dimensional plane.

[0050] After identifying adjacent red hotspots, the system employs a round-robin allocation strategy for group processing. Specifically, the system pre-defines multiple red hotspot groups, each corresponding to an independent heat generation time window. Starting from the beginning of each line of red printed data, the system scans each red hotspot sequentially from left to right, assigning the first hotspot to the first group, the second to the second, and so on. Once all pre-define groups have been assigned a hotspot, the system returns to the first group to assign the next hotspot. This cyclical allocation mechanism ensures that adjacent red hotspots are distributed across different red hotspot groups, thus achieving staggered heat generation processes over time.

[0051] To further optimize the grouping effect, the system also introduces a load balancing mechanism. After the initial allocation, the system detects the distribution of heat points in each red heat point group. When the number of heat points in a certain red heat point group significantly exceeds that of other groups, it will cause the heating time of that group to be too long, affecting the overall printing speed. The system sets a preset upper limit on the number of heat points. When a red heat point group exceeds this upper limit, the system will automatically redistribute the excess heat points to other red heat point groups with fewer heat points, while ensuring that the redistributed heat points remain in different groups from other heat points in their original neighborhood.

[0052] After grouping and assigning the heat points, the system assigns a different heating sequence to each red heat point group. These heating sequences correspond to different time periods in the subsequent PWM waveform control, ensuring that the heat points in each group are activated at different times. For example, when the system creates five red heat point groups, the first group heats up in the second band of the PWM waveform, the second group heats up in the fourth band, the third group heats up in the fifth band, the fourth group heats up in the seventh band, and the fifth group heats up in the eighth band. Through this timing arrangement, adjacent red heat points that might have heated up simultaneously are dispersed and activated in different time windows.

[0053] The system also establishes a dynamic grouping adjustment mechanism, dynamically determining the optimal number of groups based on the specific distribution pattern of the red heat spots in the current row. When the red heat spots are relatively dispersed, the system can reduce the number of groups to improve printing efficiency; when the red heat spots are highly concentrated, the system increases the number of groups to achieve better heat separation. This adaptive grouping strategy finds the optimal balance between print quality and print speed by analyzing the density and clustering of heat spots.

[0054] Based on the above embodiments, as an optional implementation, in S103, assigning adjacent red heat spots in the red printed data to different groups to generate multiple red heat spot groups specifically includes S31-S33:

[0055] S31, according to the preset grouping rules, assign adjacent red hot spots in a row of red printed data to different red hot spot groups in sequence.

[0056] The system employs a round-robin allocation algorithm to initially group the red hot spots in each line of red printed data. Red hot spots are pixel locations marked as requiring activation in the red printed data; these locations correspond to specific heating resistor units on the print head. The system pre-defines five red hot spot groups as the basic grouping architecture, using a cyclic allocation pattern: starting from the beginning of each line of red printed data, the system sequentially identifies each red hot spot from left to right, assigning the first hot spot to the first red hot spot group, the second to the second, and so on until the fifth hot spot is assigned to the fifth red hot spot group, then returning to the first group to assign the sixth hot spot. This round-robin allocation mechanism ensures that horizontally adjacent red hot spots are automatically distributed into different red hot spot groups, thus achieving spatial separation of adjacent hot spots and laying the foundation for subsequent timing-staggered control.

[0057] S32, detect the distribution of the number of hot spots in each red hot spot group. When the number of hot spots in a certain red hot spot group exceeds the preset upper limit, the excess hot spots are redistributed to other hot spot groups.

[0058] The system performs load balancing optimization on the initial grouping results to prevent any single red heat point group from bearing excessive heat-generating tasks and impacting overall printing efficiency. The system sets a preset upper limit on the number of heat points, typically determined by the duration of a single PWM heating band and the response characteristics of the heating resistor; a typical value is a maximum of 30% of the total number of red heat points in the current row per group. When the system detects that the number of heat points in a red heat point group exceeds the preset upper limit, it initiates a redistribution mechanism, transferring the excess heat points to other red heat point groups with a relatively smaller number of heat points. During redistribution, the system follows the neighborhood separation principle, ensuring that the transferred heat points remain in different red heat point groups from their original neighborhood, preventing the redistribution process from disrupting the separation effect of adjacent heat points. This dynamic load balancing mechanism not only ensures a balanced workload among the red heat point groups but also ensures that each red heat point group completes its heat-generating task within a predetermined time window, improving overall printing speed.

[0059] S33 assigns different heating sequences to each red heating point group, generating multiple red heating point groups.

[0060] The system assigns a dedicated heating sequence to each red heat source group after group optimization, establishing a correspondence between the red heat source group and the PWM heating band. The system maps the first red heat source group to the second PWM heating band, the second to the fourth, the third to the fifth, the fourth to the seventh, and the fifth to the eighth. This timing allocation strategy ensures that the red heat source groups are activated completely out of time, with only one group active at any given time, thus achieving staggered control of adjacent red heat sources heating at different times. After timing allocation, the system generates multiple red heat source groups with both spatial separation and temporal staggering characteristics. Each red heat source group has an independent heating sequence identifier and a clearly defined list of heat source members.

[0061] S104 generates a printing control waveform, which includes multiple PWM heating bands and one cooling band.

[0062] Based on the heating reference value and the red heating point group allocation results obtained in the aforementioned steps, the system constructs a refined printing control waveform, which is the core execution mechanism of the entire two-color thermal printing control system. Since red and black thermal papers have different color development temperature thresholds and there is thermal interference between adjacent heating points, the traditional single PWM control method cannot meet the requirements of precise two-color separation printing. Therefore, it is necessary to design a composite waveform control strategy that can achieve timing separation, precise temperature control, and heat management.

[0063] The system first determines the overall time structure of the printing control waveform, which consists of multiple consecutive time segments, each corresponding to a specific control function. The printing control waveform includes multiple PWM heating bands and one cooling band. The PWM heating bands refer to the time segments during which the heating resistor is switched on and off using pulse width modulation technology. The heating power and heating time are precisely controlled by adjusting the duty cycle of the PWM signal. The standard printing control waveform designed by the system contains nine PWM heating bands, each with independently adjustable duration and power characteristics, providing ample flexibility for differentiated control of different colors.

[0064] In the design of the PWM heating bands, the system adopts a segmented function allocation strategy, dividing the nine heating bands into two functional groups: the first group and the second group. The first group of heating bands, including bands 1, 3, 6, and 9, is specifically used for heating control of black printing data. This intermittent distribution helps to evenly distribute the heat output of black throughout the printing cycle, avoiding accidental activation of the red coating by instantaneous high temperatures. The second group of heating bands, including bands 2, 4, 5, 7, and 8, is specifically used for heating control of red printing data. These bands are staggered with the first group in time, ensuring that the heating processes of red and black are completely separated in time, fundamentally eliminating mutual interference between the heating processes of different colors.

[0065] When generating each PWM heating band, the system determines the basic PWM parameters based on the heating reference value calculated in step S102. The carrier frequency of each PWM heating band is uniformly set to a fixed value to ensure control accuracy, while the duty cycle is dynamically adjusted according to specific printing requirements and color requirements. For the black heating band, the system sets a relatively large basic duty cycle based on the high temperature requirements for black color development to ensure sufficient heat is provided to activate the underlying black coating. For the red heating band, considering the low-temperature characteristics of red color development, the system adopts a relatively small basic duty cycle, and at the same time, uses the red heating point group allocation scheme generated in step S103 to assign different red heating point groups to different red heating bands.

[0066] At the end of the print control waveform, the system incorporates a dedicated cooling band, which executes after all PWM heating bands have completed. The primary function of this cooling band is to provide the print head with an active temperature recovery time. During this period, all heating resistors cease operation, allowing the print head temperature to naturally decrease to a lower level, preparing it for the next line of data. The duration of the cooling band is dynamically adjusted based on the current print head temperature, ambient temperature, and the heat density of the next line of data to be printed. When the print head temperature is high or the heat density of the next line is high, the system automatically extends the cooling time to ensure sufficient heat dissipation.

[0067] The system also integrates a temperature feedback control mechanism into the printing control waveform, dynamically adjusting the parameters of each PWM heating band by monitoring printhead temperature changes in real time. When the system detects that the printhead temperature rises too quickly during a certain heating band, it automatically reduces the duty cycle of subsequent bands to avoid overheating; when the temperature rise is insufficient, it appropriately increases the duty cycle to ensure adequate color development. This real-time feedback adjustment mechanism allows the printing control waveform to adaptively optimize heating parameters during the printing process, ensuring that each heating point receives the most suitable heating conditions.

[0068] To improve printing efficiency, the system also implements waveform pre-calculation and caching mechanisms. Upon receiving a print job, the system pre-calculates all the print control waveform parameters required for the complete print job based on current environmental parameters and print data characteristics, and stores these parameters in a high-speed cache. When actually printing, the system directly reads the pre-calculated waveform parameters from the cache, greatly reducing the time overhead of real-time calculation and improving print response speed and overall printing efficiency.

[0069] S105, based on the heating reference value, when printing black printing data, outputs a black heating signal in the first group of heating bands among multiple PWM heating bands, and controls the black printing density by adjusting the duty cycle of the first group of heating bands.

[0070] The system implements precise heat control specifically for the black printing data separated in step S101, a crucial step in achieving high-quality black color development. Since the black coating of the red-black dual-color thermal paper is located at the bottom layer, a higher activation temperature is required for full color development. Furthermore, the density of the black printing directly affects the clarity and readability of text and barcodes. Therefore, a dedicated black heat control mechanism must be established to ensure ideal black printing results without interfering with the red coating.

[0071] When executing black printing control, the system selects the first group of heating bands from the printing control waveform generated in step S104 as the dedicated heating period for black. The first group of heating bands includes four PWM heating bands: bands 1, 3, 6, and 9. These bands are distributed at intervals throughout the printing control waveform. The core consideration of this design is to distribute the black heating process across multiple time windows, avoiding excessively concentrated heat output in a single period. This intermittent heating pattern not only facilitates uniform heat diffusion but also provides sufficient temperature adjustment time for the print head, preventing localized overheating from accidentally activating the red coating.

[0072] In the specific implementation of heat control, the system determines the basic PWM parameters for each black heat-generating band based on the heat-generating reference value calculated in step S102. The heat-generating reference value serves as a standard reference point, providing an environmentally adaptive power reference for black heat control. The system converts the heat-generating reference value into a corresponding PWM duty cycle reference value. This conversion process considers multiple technical parameters, such as the power characteristics of the printhead's thermal resistance, thermal conductivity, and the color rendering characteristics of the black coating. After the reference duty cycle is determined, the system uniformly outputs a black heat-generating signal during each time period of the first set of heat-generating bands, ensuring that all heat-generating points marked as black prints receive sufficient heat input.

[0073] To achieve precise control over black printing density, the system introduces the concept of a black density adjustment coefficient. This coefficient is a configurable parameter used for fine-tuning based on a baseline duty cycle to meet the personalized needs of different application scenarios regarding the depth of black. When a deep black effect is required, the system increases the density adjustment coefficient, correspondingly increasing the duty cycle of each black heating band, extending the heating time, and enhancing the heating power. When a lighter black or gray effect is required, the system decreases the density adjustment coefficient, reducing the heating intensity to achieve a relatively lighter color rendering effect.

[0074] When adjusting the duty cycle of the first set of heating bands, the system employs a dynamic allocation strategy to optimize the heating effect. Specifically, the system dynamically adjusts the duty cycle allocation of each heating band based on the distribution density of heating points in the current row of black printed data. When the density of black heating points in a certain row is high, the system appropriately reduces the duty cycle of the earlier bands (bands 1 and 3) while correspondingly increasing the duty cycle of the later bands (bands 6 and 9). This low-to-high heating pattern helps avoid heat accumulation caused by excessive heating in the early stages, while ensuring that the overall heat output meets the requirements for black color development. When the density of black heating points is low, the system adopts a relatively uniform duty cycle allocation to provide stable and consistent heating power within each heating band.

[0075] The system also achieves precise timing control of the black heating signal, ensuring complete temporal isolation between the black and red heating processes. During the operation of the first set of heating bands, the second set remains completely off, preventing any red heating points from being activated. This strict timing separation mechanism fundamentally eliminates thermal interference between the red and black signals. Simultaneously, the system monitors the time intervals between each black heating band, ensuring sufficient time for heat diffusion and temperature regulation between consecutive heating bands, preventing excessive heat accumulation over time.

[0076] To further improve the quality and stability of black printing, the system has established an adaptive power adjustment mechanism. During the black printing process, the system monitors the temperature trend of the printhead in real time. When it detects that the temperature rise is too rapid, it automatically reduces the duty cycle of subsequent black printing bands to prevent overheating; when the temperature rise is insufficient, it appropriately increases the duty cycle to ensure sufficient color development. This closed-loop feedback control mechanism ensures that the black printing process is always kept within the optimal temperature range, guaranteeing not only sufficient black color development but also avoiding the adverse effects of excessive heat on the entire printing system.

[0077] Based on the above embodiments, as an optional implementation, in S105, when printing black printing data, a black heating signal is output in the first group of heating bands among multiple PWM heating bands, and the black printing density is controlled by adjusting the duty cycle of the first group of heating bands, specifically including S51-S53:

[0078] S51, select the first group of heating bands from the multiple PWM heating bands of the printing control waveform for black printing. The first group of heating bands consists of multiple PWM bands distributed at intervals.

[0079] The system precisely selects the first set of heating bands from the print control waveform generated in step S104 as the dedicated time window for black printing. The first set of heating bands includes four PWM heating bands: bands 1, 3, 6, and 9. These bands exhibit an intermittent distribution along the time axis of the entire print control waveform; that is, they are not arranged adjacently in a continuous PWM band sequence but are separated by other bands. The core consideration of this intermittent distribution design is to disperse the black heating process across different time periods, avoiding instantaneous temperature peaks caused by continuous, concentrated high-intensity heating, while providing the print head with sufficient time for heat diffusion and temperature regulation. The intermittent distribution also ensures complete temporal separation between the black and red heating processes, as bands 2, 4, 5, 7, and 8 are specifically allocated for red printing. This strict temporal division fundamentally eliminates mutual interference between the heating processes of different colors.

[0080] S52, based on the heating reference value, outputs black heating data in each band of the first group of heating bands.

[0081] Based on the heating reference value calculated in step S102, the system uniformly outputs black heating data within each time window of the first heating band. Black heating data refers to the control signals of all heating points marked as black prints; these signals control the on / off state and heating intensity of the corresponding heating resistors. The system converts the heating reference value into corresponding PWM control parameters, including the base duty cycle and heating duration, ensuring that each black heating point receives sufficient heat input to activate the underlying black coating. During band 1, the system outputs a uniform heating signal to all black heating points; the same applies during bands 3, 6, and 9. This strategy of repeated output across multiple bands not only provides sufficient heating time but also achieves uniform heat distribution through intermittent heating, avoiding the uneven temperature gradient problem that may occur with prolonged single heating.

[0082] S53 adjusts the duty cycle of each band in the first group of heating bands according to the preset black density adjustment coefficient to control the depth of black printing.

[0083] The system finely adjusts the duty cycle of each band in the first group of heating bands according to a preset black density adjustment coefficient to achieve precise control over the depth of black printing. The black density adjustment coefficient is a configurable parameter, typically set between 0.8 and 1.2, used for adjustment based on standard heating intensity. When the user needs to print a deep black effect, the system sets the black density adjustment coefficient to a value greater than 1.0, correspondingly increasing the duty cycle of each black heating band, extending the conduction time of the heating resistor, and enhancing heating power. When a lighter black or gray effect is needed, the system sets the coefficient to a value less than 1.0, reducing the duty cycle to achieve a relatively lighter color rendering effect. The system also considers the coordination between different bands during the adjustment process, typically employing a progressive heating mode with a slightly lower duty cycle in the early bands and a slightly higher duty cycle in the later bands. This distributed power allocation helps avoid heat accumulation caused by excessive initial heating, while ensuring that the overall heat output meets the requirements for black rendering.

[0084] S106, when printing red printing data, outputs a red heating signal in the second group of heating bands among multiple PWM heating bands, controls the staggered heating of each red heating point group, and controls the red printing density by adjusting the duty cycle of the second group of heating bands.

[0085] The system implements a specialized heat control strategy for the red printing data separated in step S101. The core challenge of this process lies in the temperature sensitivity of the red thermal coating and the thermal interference between adjacent heating points. Because the red coating is located on the surface of the thermal paper and has a relatively low color development temperature, when multiple adjacent red heating points are activated simultaneously, the localized heat accumulation can easily cause the temperature to exceed the activation threshold of the black coating, resulting in color crosstalk and severely affecting the purity and visual effect of the red print. Therefore, a precise timing-staggered control mechanism must be established to ensure that the red heating process achieves sufficient color development while avoiding accidental activation of the underlying black coating.

[0086] When executing red printing control, the system selects the second group of heating bands from the printing control waveform generated in step S104 as the dedicated heating period for red. The second group of heating bands includes five PWM heating bands: the 2nd, 4th, 5th, 7th, and 8th. These bands are completely staggered in time from the first group of heating bands, ensuring that the heating processes for red and black do not overlap in timing. The number of heating bands in the second group is set to five. This design fully considers the maximum demand for grouping red heating points in step S103, providing sufficient time window allocation space for staggered heating of different red heating point groups.

[0087] The system assigns the multiple red heat point groups generated in step S103 to different PWM bands within the second set of heating bands, establishing a one-to-one correspondence between the red heat point groups and the heating time sequence. Specifically, the first red heat point group is assigned to band 2, the second to band 4, the third to band 5, the fourth to band 7, and the fifth to band 8. This allocation scheme ensures that adjacent red heat points that might otherwise heat up simultaneously are activated across different time periods, thus achieving complete separation of the heating process in the time dimension. When the number of heat point groups in a row of red printed data is less than five, the system automatically skips the corresponding heating band, improving printing efficiency.

[0088] In the specific red heating signal output process, the system determines the basic power parameters of red heating based on the heating reference value calculated in step S102. Since the temperature required for red color development is much lower than the black color development temperature, the system applies a red temperature correction coefficient to the heating reference value, converting the standard black heating power into a heating power suitable for red color development. The red temperature correction coefficient is typically set between 0.6 and 0.8, and this coefficient is determined based on the difference in color development temperature and thermal conductivity between the red and black coatings. The corrected heating power ensures that the red heating point can reach the minimum temperature required for full color development, while avoiding exceeding the activation temperature threshold of the black coating.

[0089] The system sequentially outputs red heating signals corresponding to the red heating point groups within each time window of the second heating band, achieving staggered control of adjacent red heating points heating at different times. During the second band, only the heating points in the first red heating point group are activated, while other red heating points remain off; during the fourth band, only the second red heating point group is activated, and so on. This strict timing control mechanism ensures that no adjacent red heating points will work simultaneously at any time, fundamentally eliminating the risk of temperature exceeding limits due to heat superposition. Simultaneously, the time interval between each red heating band provides ample time for the natural dissipation of local heat, further reducing the possibility of thermal interference.

[0090] To achieve precise control over the red printing density, the system introduces the concept of a red density adjustment coefficient. This coefficient is used to fine-tune the base heating power to meet different red depth requirements. The adjustment range of the red density adjustment coefficient is typically set between 0.7 and 1.3. When a lighter red effect is needed, the system decreases the coefficient, correspondingly reducing the duty cycle of each red heating band; when a darker red effect is needed, the system increases the coefficient, appropriately increasing the heating intensity within a safe temperature range. The system dynamically adjusts the duty cycle of each band in the second group of heating bands based on the red density adjustment coefficient, ensuring that each group of red heating points receives precise heat output matching the expected density.

[0091] The system also implements an intelligent power allocation mechanism based on the density of heat-generating points, dynamically adjusting the heating parameters of the corresponding band according to the actual number of heat-generating points contained in each red heat-generating point group. When a red heat-generating point group contains a large number of heat-generating points, the system will appropriately reduce the duty cycle of the corresponding band to prevent overheating, as the heat generated between the heat-generating points will have a certain degree of mutual reinforcement effect. When a red heat-generating point group contains a small number of heat-generating points, the system will correspondingly increase the duty cycle to ensure sufficient color rendering. This adaptive power allocation strategy ensures that red heat-generating point groups of different densities can obtain the most suitable heating conditions, guaranteeing the consistency and uniformity of the red color rendering effect.

[0092] Based on the above embodiments, as an optional implementation, in S106, when printing red printing data, a red heating signal is output in the second group of heating bands among multiple PWM heating bands to control the staggered heating of each red heating point group, and the red printing density is controlled by adjusting the duty cycle of the second group of heating bands, specifically including S61-S64:

[0093] S61, select the second group of heating bands from the multiple PWM heating bands of the printing control waveform for red printing, the second group of heating bands does not completely overlap with the first group of heating bands.

[0094] The system selects the second set of heating bands from the printing control waveform generated in step S104 as the dedicated time window for red printing. The second set of heating bands includes five PWM heating bands: the 2nd, 4th, 5th, 7th, and 8th. These bands do not completely overlap with the first set of heating bands in terms of time distribution; that is, no two sets of heating bands have identical time intervals, ensuring complete separation of the red and black heating processes in timing. The number of heating bands in the second set is set to five. This configuration fully considers the maximum requirement for red heating point grouping in step S103, providing sufficient time windows for staggered activation of different red heating point groups. The principle of non-overlapping design ensures that red and black heating operations will never occur simultaneously, fundamentally eliminating mutual interference and heat cross-influence between different color heating processes.

[0095] S62, based on the heating reference value, assigns each group of red heating points to a different PWM band in the second group of heating bands.

[0096] Based on the heating reference value calculated in step S102, the system establishes a correspondence between the red heating point group and each PWM band in the second heating band. The system maps the first red heating point group to the 2nd PWM band, the second to the 4th PWM band, the third to the 5th PWM band, the fourth to the 7th PWM band, and the fifth to the 8th PWM band. This one-to-one correspondence ensures that each red heating point group has its own dedicated heating time window, avoiding competition for heating resources among multiple groups within the same time period. The system calculates suitable heating parameters for red color rendering based on the heating reference value. Since the activation temperature of the red coating is relatively low, the system applies a red temperature correction coefficient, typically set to around 0.7, to ensure that the red heating intensity achieves sufficient color rendering without exceeding the activation threshold of the black coating.

[0097] S63, in the corresponding band of the second group of heating bands, sequentially outputs the red heating signal of each red heating point group, so that adjacent red heating points heat up at different times.

[0098] The system sequentially outputs the red heating signals of each red heating point group within the corresponding time window of the second heating band, achieving staggered control of adjacent red heating points heating at different times. During the second band, the system only activates the heating points in the first red heating point group, while all other red heating points remain off; during the fourth band, only the second red heating point group is activated; and during the fifth, seventh, and eighth bands, the corresponding third, fourth, and fifth red heating point groups are activated, respectively. This strict timing control mechanism ensures that no adjacent red heating points operate simultaneously at any given moment, thus completely eliminating the risk of local overheating caused by heat superposition. The time interval between each heating band provides sufficient buffer time for the natural dissipation of local heat, further reducing the thermal interference effect between adjacent heating points and ensuring that each red heating point can complete the color development process in a relatively independent thermal environment.

[0099] S64, according to the preset red concentration adjustment coefficient, adjusts the duty cycle of each band in the second group of heating bands to control the depth of red printing.

[0100] The system finely adjusts the duty cycle of each band in the second group of heating bands based on a preset red concentration adjustment coefficient to achieve precise control over the depth of red printing. The red concentration adjustment coefficient is a configurable parameter, typically set between 0.8 and 1.2, used for fine-tuning based on the standard red heating intensity. When a deeper red effect is needed, the system sets the red concentration adjustment coefficient to a value greater than 1.0, appropriately increasing the duty cycle of each red heating band within a safe temperature range; when a lighter red effect is needed, the system sets the coefficient to a value less than 1.0, correspondingly reducing the heating intensity to achieve a lighter color rendering effect. The system also makes differentiated adjustments based on the actual number of heating points contained in each red heating point group. When a red heating point group contains many heating points, the duty cycle of the corresponding band is appropriately reduced to prevent overheating; when there are few heating points, the duty cycle is increased to ensure sufficient color rendering. This adaptive adjustment strategy ensures color consistency in red areas of different densities.

[0101] Based on the above embodiments, as an optional implementation, the method further includes: obtaining material identification information of the two-color thermal paper to be printed; obtaining the corresponding red heating temperature threshold and black heating temperature threshold from a preset material parameter library according to the material identification information; adjusting the basic heating power of the first group of heating bands and the second group of heating bands respectively according to the red heating temperature threshold and the black heating temperature threshold; and dynamically adjusting the relative ratio of red printing density and black printing density according to the ratio of red heating temperature threshold to black heating temperature threshold.

[0102] Based on the above method, this application also discloses a mold state data acquisition system, such as... Figure 2 As shown, Figure 2 This is a schematic diagram of a mold status data acquisition system provided in an embodiment of this application. The system includes: a first acquisition module, a second acquisition module, a first generation module, a second generation module, a first printing module, and a second printing module; wherein,

[0103] The first acquisition module acquires the printing requirements of the data to be printed, separating the data into red and black print data. The second acquisition module acquires environmental parameters and, based on these parameters and printing requirements, calculates the printhead's heating reference value. The first generation module assigns adjacent red heating points in the red print data to different groups, generating multiple red heating point groups. The second generation module generates a printing control waveform, which includes multiple PWM heating bands and a cooling band. The first printing module, based on the heating reference value, outputs a black heating signal in the first group of heating bands among the multiple PWM heating bands when printing black print data, and controls the black print density by adjusting the duty cycle of the first group of heating bands. The second printing module, when printing red print data, outputs a red heating signal in the second group of heating bands among the multiple PWM heating bands, controlling the staggered heating of each red heating point group, and controlling the red print density by adjusting the duty cycle of the second group of heating bands.

[0104] It should be noted that the system provided in the above embodiments is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0105] Please see Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 3 As shown, the electronic device 1000 may include: at least one processor 1001, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002.

[0106] The communication bus 1002 is used to realize the connection and communication between these components.

[0107] The user interface 1003 may include a display screen and a camera. Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface.

[0108] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0109] The processor 1001 may include one or more processing cores. The processor 1001 connects to various parts of the server using various interfaces and lines, and performs various server functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 1005, and by calling data stored in the memory 1005. Optionally, the processor 1001 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 1001 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content to be displayed on the screen; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 1001 and may be implemented as a separate chip.

[0110] The memory 1005 may include random access memory (RAM) or read-only memory. Optionally, the memory 1005 may include a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 1005 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 touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. Figure 3 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an application program for a red and black dual-color thermal paper printing control method.

[0111] exist Figure 3 In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and to obtain the user input data; while the processor 1001 can be used to call an application program stored in the memory 1005 for a red and black dual-color thermal paper printing control method. When executed by one or more processors, the electronic device performs one or more of the methods described in the above embodiments.

[0112] An electronic device readable storage medium stores instructions that, when executed by one or more processors, cause the electronic device to perform one or more of the methods described in the above embodiments.

[0113] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0114] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0115] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some service interfaces; indirect couplings or communication connections between devices or units may be electrical or other forms.

[0116] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0117] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0118] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, portable hard drives, magnetic disks, or optical disks.

[0119] The foregoing description is merely an exemplary embodiment of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Other embodiments of this disclosure will be readily apparent to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described herein. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.

Claims

1. A method for controlling printing on red and black dual-color thermal paper, characterized in that, The method includes: Obtain the printing requirements of the data to be printed, and separate the data to be printed into red printing data and black printing data; Obtain environmental parameters, and calculate the printhead's heat reference value based on the environmental parameters and the printing requirements; The adjacent red hot spots in the red printed data are assigned to different groups to generate multiple red hot spot groups; Generate a printing control waveform, which includes multiple PWM heating bands and one cooling band; Based on the heating reference value, when printing the black printing data, a black heating signal is output in the first group of heating bands among the multiple PWM heating bands, and the black printing density is controlled by adjusting the duty cycle of the first group of heating bands. When printing the red printing data, a red heating signal is output in the second group of heating bands among the multiple PWM heating bands to control the staggered heating of each group of red heating points, and the red printing density is controlled by adjusting the duty cycle of the second group of heating bands.

2. The red and black dual-color thermal paper printing control method according to claim 1, characterized in that, The environmental parameters include battery voltage, ambient temperature, and printhead temperature. The calculation of the printhead's heat reference value, combining these environmental parameters and the printing requirements, includes: The ambient temperature and the printhead temperature are weighted and calculated to obtain the overall temperature; A voltage compensation coefficient is determined based on the battery voltage, and the overall temperature is compensated based on the voltage compensation coefficient to obtain the heating reference parameter; According to the printing requirements, the heating reference parameters are adjusted to generate heating reference values.

3. The red and black dual-color thermal paper printing control method according to claim 2, characterized in that, The step of adjusting the heating reference parameters according to the printing requirements to generate a heating reference value includes: According to the printing requirements, the data to be printed is divided into multiple rows, and the number of heat points in each row and the color distribution of the data in each row are obtained. When the number of heat points in the current row is greater than a preset threshold, the heat reference parameter is decreased, wherein the decrease is proportional to the number of heat points; when the number of heat points in the current row is not greater than the preset threshold, the heat reference parameter is increased, wherein the increase is inversely proportional to the number of heat points; and the adjusted heat reference parameter is corrected according to the ratio of red heat points to black heat points in the color distribution of the current row to generate a heat reference value.

4. The red and black dual-color thermal paper printing control method according to claim 1, characterized in that, The step of assigning adjacent red heat spots in the red printed data to different groups to generate multiple red heat spot groups includes: According to the preset grouping rules, adjacent red hot spots in a row of red printed data are sequentially assigned to different red hot spot groups; The number distribution of heating points in each of the red heating point groups is detected. When the number of heating points in a certain red heating point group exceeds a preset upper limit, the excess heating points are redistributed to other heating point groups. Different heating sequences are assigned to each of the red heating point groups to generate multiple red heating point groups.

5. The red and black dual-color thermal paper printing control method according to claim 1, characterized in that, When printing the black print data, a black heat signal is output in the first group of heat-generating bands among the multiple PWM heat-generating bands, and the black print density is controlled by adjusting the duty cycle of the first group of heat-generating bands, including: In the multiple PWM heating bands of the printing control waveform, the first group of heating bands is selected for black printing. The first group of heating bands consists of multiple PWM bands that are spaced apart. Based on the aforementioned heating reference value, black heating data is output in each band of the first group of heating bands; Based on the preset black density adjustment coefficient, the duty cycle of each band in the first group of heating bands is adjusted to control the depth of black printing.

6. The red and black dual-color thermal paper printing control method according to claim 1, characterized in that, When printing the red print data, a red heat-generating signal is output in the second group of heat-generating bands among the multiple PWM heat-generating bands to control the staggered heating of each group of red heat-generating points, and the red print density is controlled by adjusting the duty cycle of the second group of heat-generating bands, including: In the multiple PWM heating bands of the printing control waveform, the second group of heating bands is selected for red printing, and the second group of heating bands does not completely overlap with the first group of heating bands; Based on the heating reference value, each of the red heating point groups is respectively mapped to different PWM bands in the second group of heating bands; In the corresponding band of the second group of heating bands, the red heating signals of each red heating point group are output sequentially, so that adjacent red heating points heat up at different times. Based on the preset red concentration adjustment coefficient, the duty cycle of each band in the second group of heating bands is adjusted to control the depth of red printing.

7. The red and black dual-color thermal paper printing control method according to claim 1, characterized in that, The method further includes: Obtain the material identification information of the two-color thermal paper to be printed; Based on the material identification information, the corresponding red heating temperature threshold and black heating temperature threshold are obtained from the preset material parameter library; Based on the red heating temperature threshold and the black heating temperature threshold, the basic heating power of the first group of heating bands and the second group of heating bands are adjusted accordingly. The relative ratio of the red printing density to the black printing density is dynamically adjusted based on the ratio of the red heating temperature threshold to the black heating temperature threshold.

8. A red-black dual-color thermal paper printing control system, characterized in that, The system includes: a first acquisition module, a second acquisition module, a first generation module, a second generation module, a first printing module, and a second printing module; wherein, The first acquisition module is used to acquire the printing requirements of the data to be printed and separate the data to be printed into red printing data and black printing data; The second acquisition module is used to acquire environmental parameters and, in combination with the environmental parameters and the printing requirements, calculate the heat reference value of the print head; The first generation module is used to assign adjacent red hot spots in the red printed data to different groups to generate multiple red hot spot groups; The second generation module is used to generate a printing control waveform, which includes multiple PWM heating bands and a cooling band. The first printing module is used to output a black heating signal in the first group of heating bands among the multiple PWM heating bands when printing the black printing data, based on the heating reference value, and to control the black printing density by adjusting the duty cycle of the first group of heating bands. The second printing module is used to output a red heating signal in the second group of heating bands among the multiple PWM heating bands when printing the red printing data, control the staggered heating of each group of red heating points, and control the red printing density by adjusting the duty cycle of the second group of heating bands.

9. An electronic device, characterized in that, The device includes a processor, a memory, a user interface, and a network interface. The memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory to cause the electronic device to perform the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer program is stored that can be loaded by a processor and executed as described in any one of claims 1-7.