Thermal printing method and system of thermal printer
By dividing and controlling the heating parameters of the sub-printing area in the thermal printer, the problem of unstable printing effect coefficient in the prior art is solved, and a more efficient and stable printing effect is achieved.
Patent Information
- Application Number
- CN202510225200.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-06-06
AI Technical Summary
During the printing process, existing thermal printers cannot accurately control the number of heating wheels in each sub-printing area, resulting in unstable printing effect coefficient.
By determining the thermal printing area based on the content to be printed and the printing paper in the thermal printer, it is further divided into a plurality of sub-print areas, and the number of heating points thereof is determined based on the area, number of rows and printing range of the thermal print head. Then, the number of heating wheels for each sub-printing area of the thermal print head is calculated based on the number of heating spots, heating temperature and printing time, and the printing effect coefficient of each sub-printing area is finally determined. If the printing effect coefficient of a sub-printing area is lower than the preset value, it is optimized by detecting abnormal factors and applying a backup heating mechanism.
Accurate control of the number of heating wheels in each sub-printing area is achieved, the stability of the printing effect coefficient is improved, and the overall printing effect of the thermal printer is improved through the optimization mechanism.
Smart Images

Figure CN120096222A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of thermal printers, and in particular to a thermal printing method and system of a thermal printer. Background Art
[0002] With the development of science and technology, thermal printers are gradually used in people's lives, and thermal printing is performed on printing paper. In the existing technology, the thermal printing area is collected and the thermal printing area is controlled as a whole, but each sub-printing area is not controlled in a targeted manner, and the accuracy of the number of heating rounds of the thermal print head for each sub-printing area cannot be guaranteed, thereby affecting the printing effect coefficient of each sub-printing area. Summary of the invention
[0003] The purpose of the present invention is to overcome the deficiencies of the prior art. The present invention provides a thermal printing method and system for a thermal printer.
[0004] An embodiment of the present invention provides a thermal printing method of a thermal printer, comprising: in the thermal printer, determining a thermal printing area based on content to be printed and printing paper; determining a plurality of sub-printing areas based on the thermal printing area, the heating time of the thermal printing head, and the moving speed of the thermal printing head; Determining the number of heating points of each sub-printing area according to the area of the multiple sub-printing areas, the number of rows of the multiple sub-printing areas, and the printing range of the thermal print head; Determine the number of heating rounds of the thermal print head for each sub-printing area based on the number of heating points of each sub-printing area, the heating temperature of the thermal print head, and the printing time of the thermal print head; Determine the printing effect coefficient of each sub-printing area based on the number of heating wheels of each sub-printing area, the printing content of each sub-printing area, and the number of heating points of each sub-printing area; If the printing effect coefficient of a sub-printing area is lower than the preset printing effect coefficient, multiple abnormal factors are determined based on the detection of the sub-printing area, and the corresponding backup heating mechanism is determined according to the multiple abnormal factors, the printing range of the thermal print head and the service life of the thermal print head to optimize the sub-printing area.
[0005] An embodiment of the present invention provides a thermal printing system of a thermal printer, the thermal printing system of the thermal printer is applied to the thermal printing method of the thermal printer, and the thermal printing system of the thermal printer includes: A thermal printing area module, used to determine a thermal printing area based on the content to be printed and the printing paper in a thermal printer; A sub-printing area module, for determining a plurality of sub-printing areas based on the thermal printing area, the heating time of the thermal printing head, and the moving speed of the thermal printing head; A heating point number module, used to determine the number of heating points of each sub-printing area according to the area of the multiple sub-printing areas, the number of rows of the multiple sub-printing areas and the printing range of the thermal print head; A heating round number module, used to determine the number of heating rounds of the thermal print head for each sub-printing area based on the number of heating points in each sub-printing area, the heating temperature of the thermal print head, and the printing time of the thermal print head; A printing effect coefficient module, used to determine the printing effect coefficient of each sub-printing area based on the number of heating rounds of each sub-printing area, the printing content of each sub-printing area and the number of heating points of each sub-printing area; The optimization module is used to determine multiple abnormal factors based on the detection of a sub-printing area if the printing effect coefficient of the sub-printing area is lower than the preset printing effect coefficient, and determine the corresponding backup heating mechanism according to the multiple abnormal factors, the printing range of the thermal print head and the service life of the thermal print head to optimize the sub-printing area.
[0006] In an embodiment of the present invention, through the method in the embodiment of the present invention, in a thermal printer, a thermal printing area is determined based on the content to be printed and the printing paper; a plurality of sub-printing areas are determined based on the thermal printing area, the heating time of the thermal print head and the moving speed of the thermal print head; the number of heating points of each sub-printing area is determined according to the area area of the plurality of sub-printing areas, the number of rows of the plurality of sub-printing areas and the printing range of the thermal print head; the number of heating rounds of the thermal print head for each sub-printing area is determined based on the number of heating points of each sub-printing area, the heating temperature of the thermal print head and the printing time of the thermal print head, which is compatible with the overall consideration of the number of heating points of each sub-printing area, the heating temperature of the thermal print head and the printing time of the thermal print head, and ensures the accuracy of the number of heating rounds of the thermal print head for each sub-printing area.
[0007] Furthermore, the printing effect coefficient of each sub-printing area is determined based on the number of heating wheels of each sub-printing area, the printing content of each sub-printing area and the number of heating points of each sub-printing area. The printing effect coefficient of each sub-printing area is introduced to accurately control the printing effect coefficient of each sub-printing area.
[0008] Therefore, if the printing effect coefficient of a sub-printing area is lower than the preset printing effect coefficient, multiple abnormal factors are determined based on the detection of the sub-printing area, and the corresponding backup heating mechanism is determined according to the multiple abnormal factors, the printing range of the thermal print head and the service life of the thermal print head to optimize the sub-printing area, thereby realizing the optimization of the sub-printing area by the backup heating mechanism, and further controlling the sub-printing area to improve the thermal printing effect of the thermal printer. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1A schematic diagram of an application scenario of a thermal printing method of a thermal printer in one embodiment; Figure 2 is a schematic flow chart of a thermal printing method of a thermal printer in an embodiment of the present invention; Figure 3 Schematic diagram of the structure of a thermal printing system of a thermal printer in an embodiment of the present invention; Figure 4 The figure is a hardware diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0010] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Embodiment 1
[0011] The thermal printing method of the thermal printer provided in the present application can be applied to Figure 1 In the application environment shown, the computer 102 communicates with the server 104 through a network. The terminal 102 can be, but is not limited to, various personal computers, servers, and thermal printers, and the server 104 can be implemented as an independent server or a server cluster composed of multiple servers. Embodiment 2
[0012] See also Figures 1 to 4 , a thermal printing method of a thermal printer, applied to a thermal printing scenario of a thermal printer; the thermal printing method of a thermal printer comprises: Step S11: In the thermal printer, determining a thermal printing area based on the content to be printed and the printing paper; Step S12: determining a plurality of sub-printing areas based on the thermal printing area, the heating time of the thermal printing head, and the moving speed of the thermal printing head; Step S13: determining the number of heating points of each sub-printing area according to the area of the sub-printing areas, the number of rows of the sub-printing areas and the printing range of the thermal print head; Step S14: determining the number of heating rounds of the thermal print head for each sub-printing area based on the number of heating points of each sub-printing area, the heating temperature of the thermal print head, and the printing time of the thermal print head; Step S15: determining the printing effect coefficient of each sub-printing area based on the number of heating rounds of each sub-printing area, the printing content of each sub-printing area, and the number of heating points of each sub-printing area; Step S16: If the printing effect coefficient of a sub-printing area is lower than the preset printing effect coefficient, multiple abnormal factors are determined based on the detection of the sub-printing area, and the corresponding backup heating mechanism is determined according to the multiple abnormal factors, the printing range of the thermal print head and the service life of the thermal print head to optimize the sub-printing area.
[0013] In step S11, in the thermal printer, a thermal printing area is determined based on the content to be printed and the printing paper; In the specific implementation process of the present invention, the specific steps are: S111: In the thermal printer, collecting content to be printed; S112: Positioning the printing paper space of the thermal printer; S113: determining the printing paper according to the detection of the printing paper space of the thermal printer; S114: determining a printed area of the printing paper and an area to be printed of the printing paper based on the traversal of the printing paper; S115: Determine a thermal printing area according to the content to be printed and the area to be printed on the printing paper.
[0014] In an embodiment of the present application, in a thermal printer, the content to be printed is collected and introduced.
[0015] Specifically, thermal printers are introduced and controlled. Thermal printers are usually equipped with multiple input interfaces, such as USB, network, Bluetooth, serial port, etc., for receiving the content to be printed. These interfaces ensure that the printer can communicate with various external devices (such as computers, mobile phones, tablets, POS machines, etc.) or systems (such as cash register systems, management software, etc.). The content to be printed is usually sent to the printer in a specific data format, such as text, images, barcodes, QR codes, etc., and these formats of data need to be correctly recognized and processed by the printer.
[0016] After the printer receives the content to be printed, it will store it in the internal memory (such as cache, flash memory, etc.) so that it can be called and processed in the subsequent printing process. Before formal printing, the printer will pre-process the received content, such as parsing the format, adjusting the layout, optimizing the display effect, etc.
[0017] Furthermore, the printing paper space of the thermal printer is positioned; the printing paper is determined based on the detection of the printing paper space of the thermal printer, thereby realizing the detection of the printing paper space of the thermal printer and ensuring the accuracy of the printing paper.
[0018] At this time, the thermal printer is controlled, and the printing paper space of the thermal printer is positioned based on the control of the thermal printer, thereby achieving the positioning of the printing paper space of the thermal printer. At the same time, the printing paper space of the thermal printer is detected.
[0019] Specifically, thermal printers are usually able to identify multiple types of printing paper, including different sizes, materials, and thermal coatings. This identification process usually relies on the printing paper identification system inside the printer.
[0020] At this time, the thermal printer determines the size of the printing paper by detecting its width and length. This can be achieved by measuring the distance between the edge of the printing paper and the sensor, or by identifying specific marks on the printing paper. In addition to the size, the thermal printer can also identify the printing paper based on the material and characteristics of the thermal coating. For example, printing papers of different materials and coatings will produce different color changes or reaction speeds when heated. Then the thermal printer can determine the type of printing paper based on the actual characteristics of the printing paper. After determining the type of printing paper, the thermal printer will automatically adjust the printing parameters (such as heating temperature, printing speed, etc.) to ensure the best printing effect and quality.
[0021] At the same time, the printed area of the printing paper and the area to be printed of the printing paper are determined based on the traversal of the printing paper, and the printed area of the printing paper and the area to be printed of the printing paper are introduced to control the printed area of the printing paper and the area to be printed of the printing paper.
[0022] Specifically, the printing paper is traversed to determine the printed area based on the printed content presented in the printing paper. Optionally, the thermal printer uses a built-in counter or sensor to track the movement distance of the printing paper. After each printing operation, the counter is updated to reflect the used portion of the printing paper. At the same time, the thermal printer also identifies the location of the printed content by scanning a specific mark (such as a barcode or a QR code) on the printing paper.
[0023] Meanwhile, once the printed area is determined, the thermal printer can calculate the area to be printed by subtracting the printed area from the total length or width of the printing paper, where the area to be printed is the space where the printing operation is to be performed.
[0024] Optionally, if this is the first time the paper roll has been used, the printer will assume that the entire paper roll is the printable area. However, if the printer has a paper memory function and has printed some labels before, it will start calculating the printed area from where it last stopped. The printer determines the remaining printable area by measuring the total length of the paper and the length of the printed area. In this example, assuming the total length of the paper is 100 meters and the printed area is 20 meters, the printable area is 80 meters.
[0025] Therefore, determining the thermal printing area according to the content to be printed and the area to be printed of the printing paper takes into account the overall consideration of the content to be printed and the area to be printed of the printing paper, thereby ensuring the accuracy of the thermal printing area.
[0026] At this time, the thermal printer will first analyze the size, shape and layout requirements of the content to be printed, including the size and position of elements such as text, images, and barcodes. According to the requirements of the content to be printed, the printer will allocate appropriate space in the area to be printed, which involves operations such as scaling, rotating, and aligning the content to ensure that the printing effect meets the preset requirements. In order to avoid incomplete or damaged cropping caused by printing too close to the edge of the printing paper, the printer usually sets a certain margin, which can be adjusted according to user needs.
[0027] Once the content analysis and space allocation are completed, the printer can determine the thermal printing area, which is the area on the printing paper that is actually heated to form the image or text. Finally, the printer will perform printing operations according to the determined thermal printing area and accurately present the content to be printed on the printing paper.
[0028] Optionally, the printer allocates space for each element in the area to be printed according to the preset label format and layout requirements, and sets appropriate margins to avoid cropping problems. Once the content layout and space allocation are completed, the printer can determine the thermal printing area.
[0029] In this example, assuming that the size of each label is 10cm x 5cm and the margin is 0.5cm, the thermal printing area is the area inside the label minus the margin. Finally, the printer starts printing the express label according to the determined thermal printing area. It will form clear images and texts on the paper according to the preset heating temperature and printing speed.
[0030] In step S12, a plurality of sub-printing areas are determined based on the thermal printing area, the heating time of the thermal printing head, and the moving speed of the thermal printing head; In the specific implementation process of the present invention, the specific steps are: S121: Acquire thermal printing area; S122: determining each primary estimation area according to the thermal printing area and the model of the thermal print head; S123: Associating each primary estimation area, the heating time of the thermal print head, and the moving speed of the thermal print head; S124: determining a first area coefficient according to each primary estimation area and a heating time of the thermal print head; determining a second area coefficient according to each primary estimation area and a moving speed of the thermal print head; S125: Determine a plurality of sub-printing areas based on the first area coefficient, the second area coefficient, and the thermal printing area.
[0031] In an embodiment of the present application, a thermal printing area is obtained; and each primary estimation area is determined according to the thermal printing area and the model of the thermal print head, thereby ensuring the accuracy of each primary estimation area.
[0032] Among them, the thermal printing area is obtained and further controlled. At the same time, the specific size, shape and position of the thermal printing area are introduced. This is the basis for determining the primary estimation area. The content density and complexity in the thermal printing area are considered so that the heating time and movement speed can be reasonably allocated in the subsequent steps. At the same time, the model of the thermal print head is familiar, including the arrangement, quantity, size, etc. of its heating elements. According to the size and shape of the thermal printing area and the arrangement of the heating elements of the thermal print head, the thermal printing area is divided into several smaller primary estimation areas.
[0033] The size and shape of these primary estimation areas should match the heating elements of the thermal print head as much as possible to ensure uniform heating efficiency and print quality. When dividing the primary estimation areas, the content density and complexity should also be considered to enable more refined control in subsequent steps. According to the actual performance of the thermal print head, the primary estimation areas should be appropriately adjusted and optimized. For example, if the thermal print head has a heating unevenness problem, this can be taken into account when dividing the primary estimation areas, and the impact of heating unevenness can be reduced by adjusting the area size and shape.
[0034] Specifically, suppose there is a thermal printing area with a width of 20 cm and a length of 30 cm, and a complex express label containing text, images and barcodes needs to be printed. The thermal print head model used is TH-120, whose heating elements are arranged linearly, with a total of 120 heating points, and the width of each heating point is 0.2 cm. The size of the thermal printing area is 20 cm (width) × 30 cm (length). The TH-120 thermal print head has 120 linearly arranged heating points. The width of each heating point is 0.2 cm, so the heating width of the entire thermal print head is 24 cm (120 heating points × 0.2 cm / point).
[0035] Taking into account the heating width and content complexity of the thermal print head, the thermal printing area is divided into 6 longitudinal primary estimation areas. The width of each area is half of the heating width of the thermal print head (i.e. 12 cm) and the length is 5 cm. This division can ensure that each primary estimation area can be completely covered by the heating element of the thermal print head, and at the same time facilitate more precise control of different areas in subsequent steps.
[0036] Furthermore, each primary estimation area, the heating time of the thermal print head and the moving speed of the thermal print head are associated; the first area coefficient is determined according to each primary estimation area and the heating time of the thermal print head; the second area coefficient is determined according to each primary estimation area and the moving speed of the thermal print head, and the first area coefficient and the second area coefficient are introduced.
[0037] Specifically, each primary estimation area, the heating time of the thermal print head, and the moving speed of the thermal print head are introduced, and each primary estimation area, the heating time of the thermal print head, and the moving speed of the thermal print head are associated.
[0038] At the same time, for each primary estimation area, the appropriate heating time needs to be determined based on factors such as the content density and color depth of the area. The setting of the heating time needs to ensure that the print medium can fully receive heat and develop color, while avoiding overheating that may cause damage to the print medium or color distortion.
[0039] The moving speed of the thermal print head also needs to be adjusted according to the content of the primary estimation area. A faster moving speed can improve printing efficiency, but it will lead to a decrease in printing quality, such as uneven colors, blurred handwriting, etc. A slower moving speed can achieve better printing quality, but it will sacrifice a certain amount of printing efficiency.
[0040] When associating the heating time and the moving speed, it is necessary to comprehensively consider the printing quality, efficiency and characteristics of the printing medium, so as to determine the optimal heating time and moving speed combination for different primary estimation areas.
[0041] Optionally, assume that there is a thermal printer for printing a courier label containing text and images. The printing area has been divided into several primary estimation areas, and the content density and color depth of each area have been determined.
[0042] For the text area, since the content is relatively simple and the color depth is consistent, a shorter heating time and a moderate moving speed can be set to ensure printing efficiency and clarity.
[0043] For the image area, due to the different shades of color and rich details, it is necessary to set a longer heating time and a slower moving speed to obtain better printing quality and color reproduction.
[0044] Further, two area coefficients, a first area coefficient and a second area coefficient, are determined according to the heating time and the moving speed.
[0045] First area coefficient: The first area coefficient is related to the heating time and is used to reflect the difference in heating time requirements of different primary estimation areas. The heating time of each primary estimation area and the thermal print head determines the first area coefficient, which is usually proportional to the length of the heating time.
[0046] Second area coefficient: The second area coefficient is related to the moving speed and is used to reflect the difference in moving speed requirements of different primary estimation areas. The second area coefficient is determined according to each primary estimation area and the moving speed of the thermal print head, and is usually inversely proportional to the moving speed.
[0047] Optionally, for the text area, due to the short heating time and moderate movement speed, a smaller first area coefficient and a moderate second area coefficient can be set. For the image area, due to the long heating time and slow movement speed, a larger first area coefficient and a smaller second area coefficient can be set.
[0048] At the same time, multiple sub-printing areas are determined based on the first area coefficient, the second area coefficient and the thermal printing area, which is compatible with the multi-dimensional control of the first area coefficient, the second area coefficient and the thermal printing area, and ensures the accuracy of multiple sub-printing areas.
[0049] Specifically, a first area coefficient, a second area coefficient and a thermal printing area are introduced, and are further subdivided into a plurality of sub-printing areas, so as to ensure that each sub-printing area can obtain the best printing effect.
[0050] By analyzing the first area coefficient and the second area coefficient, you can start to determine the boundaries of the sub-printing area, which usually involves drawing dividing lines within the thermal printing area to divide the area into smaller parts. The location and number of dividing lines will depend on the specific values of the coefficients and the shape and size of the thermal printing area. After the sub-printing areas are initially determined, these areas need to be further optimized, which includes adjusting the size, shape or boundary position of the area to ensure that they better meet the needs of the printed content while improving printing efficiency and quality.
[0051] Assume that there is a thermal printer for printing labels with complex patterns and text. The thermal printing area, the first area coefficient, and the second area coefficient have been determined according to the previous steps. Assume that it is a rectangular area with a width of 10 cm and a length of 20 cm. In the thermal printing area, different parts have different shades of color, so the first area coefficients are also different. Assume that in the darker area, the first area coefficient is larger; in the lighter area, the first area coefficient is smaller. Similarly, due to the different densities of text and patterns in the printed content, the second area coefficient is also different. In the area with dense text, the second area coefficient is smaller (because a slower movement speed is required to ensure clarity); in the area with sparse patterns, the second area coefficient is larger (because a faster movement speed can improve printing efficiency).
[0052] In areas with darker colors and dense text, a smaller sub-printing area can be divided and a longer heating time and a slower moving speed can be set, which can ensure a clear printing effect in this area. In areas with lighter colors and sparse patterns, a larger sub-printing area can be divided and a shorter heating time and a faster moving speed can be set, which can improve printing efficiency and avoid unnecessary heat waste.
[0053] Optionally, a large amount of historical printing data is collected, including images of different thermal printing areas, the corresponding first area coefficients, the second area coefficients and the final sub-printing area division results. These data will be used to train the sub-printing area model. Features are extracted from the collected data, including the pixel values, color distribution, texture information, etc. of the thermal printing area, as well as the specific values of the first area coefficients and the second area coefficients. These features will serve as inputs to the sub-printing area models. These sub-printing area models can learn and predict the division of sub-printing areas based on the input features.
[0054] In addition, the matching table lists different combinations of first area coefficients and second area coefficients and corresponding sub-printing area division rules. For a new thermal printing task, the specific values or ranges of the first area coefficients and the second area coefficients are first determined. A division rule matching the determined coefficient range is searched in the matching table, which usually involves interpolation or approximate matching of the coefficient values. According to the division rule found, the thermal printing area is divided to obtain multiple sub-printing areas.
[0055] In step S13, the number of heating points of each sub-printing area is determined according to the area of the sub-printing areas, the number of rows of the sub-printing areas, and the printing range of the thermal print head; In the specific implementation process of the present invention, the specific steps are: S131: Acquire multiple sub-printing areas; S132: determining the area of the plurality of sub-printing areas based on the area detection of the plurality of sub-printing areas; S133: determining the number of rows of the plurality of sub-printing areas according to scanning of the plurality of sub-printing areas; S134: performing multiple interactions on the area of the plurality of sub-printing areas, the number of rows of the plurality of sub-printing areas, and the printing range of the thermal print head; S135: Determine the number of heating points of each sub-printing area according to multiple interactions of the area of the sub-printing areas, the number of rows of the sub-printing areas, and the printing range of the thermal print head.
[0056] In an embodiment of the present application, a plurality of sub-printing areas are acquired; and the area of the plurality of sub-printing areas is determined based on the area detection of the plurality of sub-printing areas, thereby achieving precise control of the area of the plurality of sub-printing areas.
[0057] At this time, a plurality of sub-printing areas are acquired and introduced, and at the same time, area detection is performed on the plurality of sub-printing areas, and the area areas of the plurality of sub-printing areas are determined based on the area detection of the plurality of sub-printing areas.
[0058] Specifically, the thermal printer needs to detect and calculate the area of each sub-printing area. By calculating the area of each sub-printing area, the printing requirements of each area can be understood more accurately, and a basis for subsequent printing parameter settings can be provided. At this time, the image of the sub-printing area is converted into a format that is easy to calculate, such as a binary image (containing only black and white colors). The number of black (or target color) pixels in each sub-printing area is counted, which can reflect the area size of the area. Based on the pixel counting results, the area of each sub-printing area is calculated, which requires converting the number of pixels into actual physical dimensions (such as square centimeters). The calculated area information is recorded in a data structure for subsequent use.
[0059] Optionally, the image of each sub-printing area is converted into a binary image, and the number of black pixels in each sub-printing area is counted. For example, sub-printing area 1 has 5000 black pixels, sub-printing area 2 has 3000 black pixels, and so on. Assuming that each pixel corresponds to 0.01 square centimeters (this depends on the resolution of the printer), the area of sub-printing area 1 is about 50 square centimeters, and the area of sub-printing area 2 is about 30 square centimeters.
[0060] Further, the number of rows of the plurality of sub-printing areas is determined according to the scanning of the plurality of sub-printing areas, and the number of rows of the plurality of sub-printing areas is introduced.
[0061] At this point, multiple sub-printing areas are introduced and scanned. At the same time, the media to be printed (such as paper, labels, etc.) is placed in the scanning area and the scanning program is started. The scanning program will capture the image of the entire thermal printing area or multiple sub-printing areas, and pre-process the scanned image, including denoising, binarization, edge enhancement, etc. These operations help to more clearly identify the lines and characters in the image, so as to more accurately determine the number of lines, and apply the selected line number detection algorithm to the pre-processed image. The algorithm will analyze the pixel information in the image, identify the position of each line, and calculate the total number of lines.
[0062] Optionally, it is assumed that there is a thermal printer for printing labels containing texts with different numbers of lines. The thermal printing area has been divided into a plurality of sub-printing areas, and the number of lines of each sub-printing area is to be determined.
[0063] Place the paper to be printed in the scanning area of the printer and start the scanning function. Scan to obtain an image of the entire thermal printing area. Preprocess the scanned image, including denoising and binarization, so that the text lines in the image become clearer.
[0064] An algorithm based on Hough transform is selected to detect the number of lines in the image. The algorithm identifies the location of each line and calculates the total number of lines. For example, sub-printing area 1 has 10 lines of text and sub-printing area 2 has 15 lines of text.
[0065] Manually check the line number detection results and compare them with the expected line number. It is found that the line number detection of sub-printing area 1 is accurate, but the line number detection of sub-printing area 2 is incorrect (actually it should be 16 lines). Adjust the pre-processing parameters and re-run the line number detection algorithm to finally get the correct line number information. Save the detected line number information in the printer's memory and associate it with the corresponding sub-printing area, so that in the subsequent printing process, the printer can optimize the printing effect based on this information.
[0066] Therefore, multiple interactions are performed on the area areas of the multiple sub-printing areas, the number of rows of the multiple sub-printing areas, and the printing range of the thermal print head; the number of heating points of each sub-printing area is determined based on the multiple interactions of the area areas of the multiple sub-printing areas, the number of rows of the multiple sub-printing areas, and the printing range of the thermal print head, thereby ensuring the accuracy of the number of heating points of each sub-printing area.
[0067] At this time, the area, number of lines and printing range of multiple sub-printing areas are comprehensively considered and interacted, and the area and number of lines of each sub-printing area are analyzed to understand their printing requirements and characteristics. Sub-printing areas with larger areas require more heating points to ensure printing quality, while sub-printing areas with more lines require more precise heating control to avoid blurring or overlapping printing. The printing range of the thermal print head refers to the maximum printing area it can cover. The physical limitations of the thermal print head need to be considered to ensure that it does not exceed its printing range during the printing process.
[0068] Assume we have a thermal printer whose thermal print head has a printing range of 80 mm wide. Now we have three sub-printing areas, and their areas and number of lines are as follows: Sub-printing area 1: area 20 square centimeters, number of lines 8.
[0069] Sub-printing area 2: area 30 square centimeters, number of lines 12.
[0070] Sub-printing area 3: area 15 square centimeters, number of lines 6.
[0071] When performing multiple interactions, the system will make the following considerations and adjustments: For the larger sub-printing area 2 (30 square centimeters), the system will allocate more heating points and reduce the printing speed to ensure the printing quality.
[0072] For sub-printing area 2 (12 lines) with a larger number of lines, the system will optimize the distribution of heating points to avoid blurred or overlapping printing.
[0073] Considering the printing range limit of the thermal print head (80 mm width), the system will ensure that the printed content of all sub-printing areas does not exceed this range. If the width of a sub-printing area is close to or exceeds 80 mm, the system will scale or crop it.
[0074] Further, based on the results of multiple interactions, the number of heating points of each sub-printing area is determined. The number of heating points refers to the number of heating elements that the print head needs to activate during the printing process, which directly affects the printing speed and print quality. Optionally, the appropriate number of heating points is calculated based on the area and number of rows of each sub-printing area and the printing range of the thermal print head. After determining the number of heating points, the system also needs to consider the distribution of the heating points. Optimized heating point distribution can improve printing efficiency, reduce wear of the print head, and extend the service life of the printer.
[0075] After multiple interactions, the system determines the following number of heating points for each sub-printing area: Sub-printing area 1: Due to the small area and small number of rows, the system allocates fewer heating points (such as 200).
[0076] Sub-printing area 2: Due to the larger area and more lines, the system allocates more heating points (such as 350) and ensures that the heating points are evenly distributed on the print head to avoid blurred or overlapping printing.
[0077] Sub-printing area 3: The area is moderate and the number of lines is small. The system allocates a moderate number of heating points (such as 250).
[0078] In step S14, the number of heating rounds of the thermal print head for each sub-printing area is determined based on the number of heating points of each sub-printing area, the heating temperature of the thermal print head, and the printing time of the thermal print head; In the specific implementation process of the present invention, the specific steps are: S141: Obtain the number of heating points in each sub-printing area; S142: performing real-time detection on the thermal print head, and determining the heating temperature of the thermal print head according to the real-time detection of the thermal print head; S143: determining the printing time of the thermal print head according to the area of the sub-printing area and the printing range of the thermal print head; S144: performing multiple interactions on the number of heating points of each sub-printing area, the heating temperature of the thermal print head, and the printing time of the thermal print head; S145: Determine the number of heating rounds of the thermal print head for each sub-printing area according to the multiple interactions of the number of heating points in each sub-printing area, the heating temperature of the thermal print head, and the printing time of the thermal print head.
[0079] At this time, the number of heating points in each sub-printing area is obtained; the thermal print head is detected in real time, and the heating temperature of the thermal print head is determined according to the real-time detection of the thermal print head, and the heating temperature of the thermal print head is introduced.
[0080] Specifically, the number of heating points of each sub-printing area is obtained, and at the same time, the thermal print head is detected in real time, so that the real-time detection of the thermal print head is realized, and the heating temperature of the thermal print head is determined according to the real-time detection of the thermal print head.
[0081] Optionally, a sensor is used to detect the temperature of the thermal print head in real time. According to the model of the thermal print head, the current ambient temperature and the requirements of the printing task, a safe heating temperature is determined. If the thermal print head is detected to be overheated or severely worn, the system will reduce the heating temperature or suspend the printing task. Assume that the system detects that the current temperature of the thermal print head is 20°C and determines a safe heating temperature of 220°C to ensure printing quality and speed.
[0082] Furthermore, the printing time of the thermal print head is determined according to the area of the sub-printing area and the printing range of the thermal print head, thereby ensuring the accuracy of the printing time of the thermal print head.
[0083] At this time, the printing time is determined according to the area of the sub-printing area and the printing range of the thermal print head (that is, the printing width that the thermal print head can cover at one time). The printing time refers to the time required for the thermal print head to complete printing of a sub-printing area at a specific temperature and number of heating points.
[0084] Optionally, the print width and length of each sub-printing area are calculated, and the print time of each sub-printing area is determined according to the print speed and print range of the thermal print head, and the necessary adjustments are made considering the influence of the number of heating points and the heating temperature on the print speed. Specifically, assuming that the print speed of the thermal print head is 2 inches per second and the print range is 80 mm wide. The system calculates that the print time of sub-printing area 1 is 5 seconds, sub-printing area 2 is 8 seconds, and sub-printing area 3 is 6 seconds.
[0085] In addition, a large amount of historical printing data is collected, including the area of different sub-printing areas, the printing range of the thermal print head, and the corresponding printing time, etc., and a printing time model is established using machine learning algorithms (such as linear regression, decision tree, random forest, etc.), with the sub-printing area and the printing range of the thermal print head as input features and the printing time as the output target. The printing time model is trained and optimized so that it can accurately predict the printing time given the sub-printing area and the printing range of the thermal print head.
[0086] When you need to calculate the printing time of a new sub-printing area, you only need to input the area of the sub-printing area and the printing range of the thermal print head into the trained printing time model. The printing time model will output the predicted printing time, which can be used to guide the actual printing task scheduling.
[0087] In addition, when the printing time of a new sub-printing area needs to be calculated, it is only necessary to find an entry in the matching table that matches the given sub-printing area and the printing range of the thermal print head. If a completely matching entry is found, the corresponding printing time is directly read. If no completely matching entry is found, the closest entry can be selected for interpolation or approximate calculation.
[0088] The following is an example of a simple match table: We now have a new sub-print area with an area of 1200 mm2 and a thermal print head with a print range of 80 mm. No exact match is found in the match table, but we can interpolate the closest entries (1000 mm2, 80 mm, 20 seconds) and (1500 mm2, 80 mm, 30 seconds). Assuming the interpolation method is linear, the predicted print time is about 25 seconds.
[0089] Furthermore, multiple interactions are performed on the number of heating points in each sub-printing area, the heating temperature of the thermal print head, and the printing time of the thermal print head; the number of heating rounds of the thermal print head for each sub-printing area is determined based on the multiple interactions of the number of heating points in each sub-printing area, the heating temperature of the thermal print head, and the printing time of the thermal print head, thereby achieving precise control of the number of heating rounds of each sub-printing area by the thermal print head.
[0090] At this time, the number of heating points in each sub-printing area, the heating temperature of the thermal print head, and the printing time of the thermal print head are introduced. The number of heating points in each sub-printing area refers to the number of points (or pixels) that the thermal print head needs to heat for each sub-printing area during the thermal printing process, which determines the fineness and clarity of the image. The heating temperature of the thermal print head affects the reaction speed and color depth of the toner or thermal paper. The higher the temperature, the faster the reaction and the darker the color, but it also leads to overheating or reduced print quality. The printing time of the thermal print head is the time the thermal print head stays in each sub-printing area, also known as the "printing cycle". These three parameters are not isolated, but affect and restrict each other. For example, if the number of heating points is increased, a higher heating temperature and longer printing time are required to ensure that each point can be printed correctly; but if the heating temperature is too high or the printing time is too long, the printing material will be damaged or the printing quality will be poor.
[0091] Furthermore, the number of heating rounds of the thermal print head for each sub-printing area refers to the number of times the thermal print head needs to repeat the heating in order to complete the printing task of a sub-printing area, which depends on the combined effect of the number of heating points in each sub-printing area, the heating temperature of the thermal print head and the printing time of the thermal print head mentioned above.
[0092] Suppose we are printing a picture containing different colors and gray levels, and the picture is divided into multiple sub-printing areas.
[0093] Sub-printing area A: mainly black text, with fewer heating points, but requires consistent color depth. Therefore, we can choose a lower heating temperature and a longer printing time to reduce the risk of overheating and ensure clear text. After testing, it is determined that the number of heating rounds is 1.
[0094] Sub-printing area B: contains rich colors and grayscale changes, with more heating points. In order to obtain good color reproduction and grayscale levels, we need to increase the heating temperature and appropriately shorten the printing time to avoid over-saturation of colors. After many attempts, we finally determined that the number of heating rounds is 2 to balance the color and print quality.
[0095] Sub-printing area C: It is the highlight part in the picture, with lighter color and rich details. In order to preserve these details, we choose a lower heating temperature and shorter printing time, and increase the number of heating rounds to 3 times to ensure that each pixel can be printed accurately without overexposure.
[0096] In addition, a table is predefined, the rows of which represent different ranges of heating points in the sub-printing area, and the columns represent different combinations of heating temperature and printing time. The corresponding number of heating rounds is stored in each cell. For example, a cell in the table indicates: "When the number of heating points in the sub-printing area is 100-150, the heating temperature is 200°C, and the printing time is 5 seconds, the number of heating rounds is 3 rounds". In actual applications, the number of heating rounds can be determined by simply finding the corresponding cell in the table according to the current printing task characteristics (number of heating points, heating temperature, printing time).
[0097] Assume there is a simple matching table as follows: Now there is a new print task, which is characterized by: the number of heating points in the sub-printing area is 80, the heating temperature is 180°C, and the printing time is 4 seconds. According to the matching table, the closest row can be found to be "50-100, 180°C, 4 seconds", so the number of heating rounds determined is 2 rounds.
[0098] In step S15, the printing effect coefficient of each sub-printing area is determined based on the number of heating rounds of each sub-printing area, the printing content of each sub-printing area, and the number of heating points of each sub-printing area; In the specific implementation process of the present invention, the specific steps are: S151: Obtain the number of heating wheels for each sub-printing area; S152: performing content detection on each sub-printing area, and determining the printing content of each sub-printing area according to the content detection of each sub-printing area; S153: performing multiple interactions on the number of heating rounds of each sub-printing area, the printing content of each sub-printing area, and the number of heating points of each sub-printing area; S154: determining a first effect coefficient based on the number of heating rounds of each sub-printing area and the interaction of the printing content of each sub-printing area; S155: determining a second effect coefficient according to the interaction between the number of heating rounds of each sub-printing area and the number of heating points of each sub-printing area; S156: Determine a printing effect coefficient of each sub-printing area according to the first effect coefficient, the second effect coefficient and the printing content of each sub-printing area.
[0099] At this time, the number of heating wheels of each sub-printing area is obtained; the content of each sub-printing area is detected, and the printing content of each sub-printing area is determined according to the content detection of each sub-printing area, thereby ensuring the accuracy of the printing content of each sub-printing area.
[0100] Specifically, the number of heating wheels of each sub-printing area is obtained, and at the same time, the content detection of each sub-printing area is realized, so that the printing content of each sub-printing area is determined according to the content detection of each sub-printing area.
[0101] Optionally, the specific location and size of each sub-printing area is clarified to ensure that it is not missed or out of range during detection, and a suitable detection method is selected according to the content type of the sub-printing area (such as text, image, chart, etc.). For example, for text content, OCR (optical character recognition) technology can be used; for image content, image recognition algorithm can be used.
[0102] Each sub-printing area is inspected one by one. This process involves steps such as image processing, feature extraction, and pattern matching, and the detected content is recorded in an appropriate form, such as text, image file, or structured data, for subsequent analysis and processing.
[0103] Furthermore, the detection results of each sub-printing area are analyzed in detail to determine the specific content it contains. For example, for text content, specific words need to be identified; for image content, objects or scenes in the image need to be identified. The detection results are classified and summarized according to the content type (such as text, image, chart, etc.) and content characteristics (such as color, size, shape, etc.). Combined with the specific requirements of the printing task, the final printing content of each sub-printing area is determined. This involves screening, editing or reorganizing the original detection results.
[0104] Suppose we have a print task that contains three sub-printing areas: Sub-print area A: Contains a text content that describes the summary of a report.
[0105] Sub-print area B: Contains a chart showing the changes in sales of a company.
[0106] Sub-print area C: contains an image showing what a product looks like.
[0107] For the sub-printing area A, the OCR technology is selected to recognize the text content.
[0108] For sub-print area B, an image recognition algorithm is selected to recognize data and labels in the chart.
[0109] For sub-printing area C, an image recognition algorithm is selected to recognize the object (ie, the product) in the image.
[0110] Apply OCR technology to sub-print area A and identify the text content: "This report summarizes the sales of XX Company in 2023..." Apply an image recognition algorithm to sub-print area B to identify data points and labels in the chart, such as "Sales in the first quarter of 2023: 1 million yuan."
[0111] An image recognition algorithm is applied to the sub-printing area C to recognize the product name and model in the image.
[0112] Perform a detailed analysis of the detection results of each sub-printing area to confirm the specific content it contains, classify the detection results by content type (text, graphics, images), and summarize them by content characteristics (such as color, size, shape, etc.). Determine the final print content of each sub-printing area based on the specific requirements of the printing task. For example, for sub-printing area A, retain the recognized text content; for sub-printing area B, retain the recognized chart data and labels; for sub-printing area C, retain the recognized product image.
[0113] Furthermore, the first effect coefficient is determined based on the interaction of the number of heating rounds of each sub-printing area and the printing content of each sub-printing area; the second effect coefficient is determined according to the interaction of the number of heating rounds of each sub-printing area and the number of heating points of each sub-printing area, and the first effect coefficient and the second effect coefficient are introduced.
[0114] At this time, the number of heating rounds of each sub-printing area and the printing content of each sub-printing area are introduced, and the number of heating rounds of each sub-printing area and the printing content of each sub-printing area are interacted, so as to clarify the first effect coefficient; The first effect coefficient reflects the combined effect of the number of heating rounds and the print content on the printing effect. It takes into account the relationship between the complexity of the print content and the required heat input. This requires analyzing the printing effect under different combinations of the number of heating rounds and print content, and finding the best parameter combination.
[0115] Optionally, when more heating rounds are used in sub-printing area B, complex text patterns can be printed more clearly. However, if there are too many heating rounds, the printed material may be overheated and deformed. Therefore, we need to find a balance point, that is, determine an optimal first effect coefficient, which reflects the contribution of the number of heating rounds to the printing effect under a given printing content.
[0116] The number of heating wheels of each sub-printing area and the number of heating points of each sub-printing area are introduced, and the number of heating wheels of each sub-printing area and the number of heating points of each sub-printing area are interacted, so as to clarify the second effect coefficient; The second effect coefficient reflects the combined effect of the number of heating wheels and heating points on the printing effect. It takes into account the distribution of heat in the printing area and how this distribution affects the print quality. This usually involves analyzing the printing effects under different combinations of heating wheels and heating points, and finding the best parameter combination.
[0117] Optionally, in sub-printing area C, we need to print detailed images. In order to obtain high-quality printing effects, we may need to use multiple rounds of heating and dense heating points. However, if the number of heating points is too dense, it may cause local overheating, thus affecting the printing quality. Therefore, we need to determine a second effect coefficient, which reflects the contribution of the number of heating points to the printing effect under a given number of heating rounds. Through experiments and analysis, we can find this balance point and optimize the printing parameters to obtain the best printing effect.
[0118] At the same time, the printing effect coefficient of each sub-printing area is determined according to the first effect coefficient, the second effect coefficient and the printing content of each sub-printing area, which is compatible with the overall consideration of the first effect coefficient, the second effect coefficient and the printing content of each sub-printing area, and the accuracy of the printing effect coefficient of each sub-printing area is achieved, thereby preliminarily presenting the printing effect of each sub-printing area.
[0119] At this time, the first effect coefficient, the second effect coefficient and the print content of each sub-printing area are introduced. The first effect coefficient reflects the joint influence of the number of heating rounds and the print content on the print effect. It measures how the number of heating rounds affects the print quality under a given print content. The second effect coefficient reflects the joint influence of the number of heating rounds and the number of heating points on the print effect. It takes into account the distribution of heat in the print area and the contribution of this distribution to the print quality. The print content of each sub-printing area determines the required print quality and details, and is another important factor affecting the print effect coefficient.
[0120] According to actual printing needs and experience, determine the relative importance or weight of the first effect coefficient, the second effect coefficient and the print content in determining the print effect coefficient. This may need to be determined through experiments and analysis, combining the first effect coefficient, the second effect coefficient and the print content (which may be expressed in some quantitative form) to calculate the print effect coefficient of each sub-printing area. This coefficient should be able to reflect the expected level of print quality.
[0121] Specifically, suppose we have a thermal printer that needs to print different contents on three sub-printing areas, and we want to optimize the printing effect of each area.
[0122] Sub-print area A: Simple text information, such as date and time.
[0123] Sub-printing area B: contains complex graphics such as barcodes and QR codes.
[0124] Sub-print area C: Detailed product description and images.
[0125] For sub-printing area A, due to the simple content, we expect that the number of heating rounds and heating points will have little effect on the printing effect, so the first effect coefficient and the second effect coefficient may be relatively low. At the same time, since the text information does not have high requirements for printing quality, the weight of the printing content may also be low.
[0126] For sub-printing area B, barcodes and QR codes require high definition to ensure scanning accuracy, so the distribution of the number of heating rounds and heating points becomes very important. The first effect coefficient and the second effect coefficient may be relatively high, and the weight of the printed content will also increase.
[0127] For sub-printing area C, since it contains detailed descriptions and images, the printing quality requirement is the highest. Therefore, the weights of the first effect coefficient, the second effect coefficient, and the printed content may all reach the highest level.
[0128] Combine the above coefficients to calculate the printing effect coefficient for each sub-printing area. For example, for sub-printing area B, due to the importance of barcodes and QR codes, we may give higher weights to the first effect coefficient and the second effect coefficient, thereby obtaining a higher printing effect coefficient.
[0129] In step S16, if the printing effect coefficient of a sub-printing area is lower than the preset printing effect coefficient, multiple abnormal factors are determined based on the detection of the sub-printing area, and the corresponding backup heating mechanism is determined according to the multiple abnormal factors, the printing range of the thermal print head, and the service life of the thermal print head to optimize the sub-printing area; In the specific implementation process of the present invention, the specific steps are: S161: Collecting printing effect coefficients of multiple sub-printing areas; S162: Acquire a preset printing effect coefficient matched by the sub-printing area, and compare the printing effect coefficients of the multiple sub-printing areas with the preset printing effect coefficient; S163: If the printing effect coefficient of a sub-printing area is lower than a preset printing effect coefficient, triggering abnormality detection of the sub-printing area; S164: determining a plurality of abnormal parameters based on the abnormality detection of the sub-printing area, constructing corresponding abnormal combinations according to the plurality of abnormal parameters, and determining corresponding abnormal factors based on the identification of each abnormal combination, so as to collect the plurality of abnormal factors; S165: interacting with a plurality of abnormal factors, the printing range of the thermal print head, and the service life of the thermal print head, and determining a corresponding backup heating mechanism according to the interaction of the plurality of abnormal factors, the printing range of the thermal print head, and the service life of the thermal print head; S166: triggering online optimization of the sub-printing area according to the backup heating mechanism.
[0130] At this time, the printing effect coefficients of multiple sub-printing areas are collected; the preset printing effect coefficient matching the sub-printing area is obtained, and the printing effect coefficients of multiple sub-printing areas are compared with the preset printing effect coefficient, thereby realizing the comparison of the printing effect coefficients of multiple sub-printing areas with the preset printing effect coefficient.
[0131] Specifically, the preset printing effect coefficient is an expected value preset according to the printer's design specifications, user needs or industry standards. It represents the print quality level that each sub-printing area should achieve under ideal conditions; by comparing the actual collected printing effect coefficient with the preset printing effect coefficient, you can intuitively see whether the print quality of each sub-printing area meets the standard. If the actual coefficient is lower than the preset coefficient, it means that the print quality of the sub-printing area needs to be improved. The comparison results will help us identify the sub-printing areas with poor print quality and further analyze the reasons so that we can take corresponding optimization measures.
[0132] Optionally, the preset print quality factor for this printer is 0.90, which means we expect the print quality of each sub-printing area to reach or exceed this level.
[0133] By comparison, we found that the printing effect coefficient (0.95) of the red sub-printing area is higher than the preset coefficient, indicating that its printing quality is very good; the printing effect coefficient (0.92) of the green sub-printing area is also slightly higher than the preset coefficient, and the printing quality is good; but the printing effect coefficient (0.85) of the blue sub-printing area is lower than the preset coefficient, indicating that there are problems with its printing quality.
[0134] Meanwhile, if the printing effect coefficient of a sub-printing area is lower than the preset printing effect coefficient, the abnormality detection of the sub-printing area is triggered, thereby realizing the abnormality detection of the sub-printing area.
[0135] At this time, the printing effect coefficients of each sub-printing area are collected. The printing effect coefficients of each sub-printing area reflect multiple aspects of print quality, such as clarity, color accuracy, uniformity, etc. The collected printing effect coefficients are compared with the preset printing effect coefficients. The preset values are usually set based on industry standards, user needs, or the recommendations of printer manufacturers, and represent the expected print quality level. If the printing effect coefficient of a sub-printing area is lower than the preset value, the system will automatically determine that there is an abnormality in the area and trigger the abnormality detection process.
[0136] Further, a plurality of abnormal parameters are determined based on the abnormal detection of the sub-printing area, corresponding abnormal combinations are constructed according to the plurality of abnormal parameters, and corresponding abnormal factors are determined based on the identification of each abnormal combination, so as to collect a plurality of abnormal factors.
[0137] At this time, the sub-printing area is fully inspected, and data on its printing quality, speed, stability, etc. are collected and analyzed. By comparing the normal parameter range, it is determined which parameters deviate from the normal value, that is, abnormal parameters. The identified abnormal parameters are classified and analyzed, and different abnormal combinations are constructed according to their correlation and impact. Each abnormal combination represents a possible abnormal pattern or cause. An in-depth analysis is conducted on each abnormal combination, and the specific reasons that may cause these abnormal combinations are inferred by combining the printer's working principle, historical fault records, usage environment and other information. These specific reasons are abnormal factors.
[0138] Specifically, in thermal printers, anomaly detection may involve multiple aspects, including but not limited to: Print head temperature: If the print head temperature is too high or too low, the print quality may be reduced, such as blurred text and unclear images.
[0139] Print speed: Printing too fast may cause unclear print content, while printing too slow may affect printing efficiency.
[0140] Paper Type: Using incompatible or poor quality thermal paper may result in poor printing results.
[0141] Print head cleanliness: After long-term use, the print head may accumulate dust or dirt, affecting the print quality.
[0142] Suppose during the test, we found that the print quality of a certain sub-printing area was significantly reduced, with blurred text and unclear images. Through further testing, we identified the following abnormal parameters: low print head temperature, too fast printing speed, and poor quality thermal paper used.
[0143] By combining and analyzing the above abnormal parameters, we may get the following abnormal combinations: Abnormal combination 1: low print head temperature + too fast print speed Abnormal combination 2: low print head temperature + poor thermal paper quality Abnormal combination three: Printing speed is too fast + thermal paper quality is poor Each anomaly combination represents a possible anomaly pattern or cause, and these combinations help us understand the nature of the anomaly more fully.
[0144] Conduct in-depth analysis on each abnormal combination to determine the specific reasons that lead to these abnormal combinations. Take abnormal combination 1 (low print head temperature + too fast printing speed) as an example: Abnormal factor 1: The print head is aged or damaged, resulting in reduced heating efficiency, which makes the print head temperature low.
[0145] Abnormal factor 2: Printer driver or setting problems cause the printing speed to be too fast, exceeding the processing capacity of the print head.
[0146] Therefore, multiple abnormal factors, the printing range of the thermal print head and the service life of the thermal print head are interacted, and the corresponding backup heating mechanism is determined according to the interaction of multiple abnormal factors, the printing range of the thermal print head and the service life of the thermal print head; the online optimization of the sub-printing area is triggered according to the backup heating mechanism, the optimization of the sub-printing area by the backup heating mechanism is realized, and the sub-printing area is further controlled to improve the thermal printing effect of the thermal printer.
[0147] At this time, a plurality of abnormal factors, the printing range of the thermal print head, and the service life of the thermal print head are introduced, and the plurality of abnormal factors, the printing range of the thermal print head, and the service life of the thermal print head are interacted.
[0148] Optionally, carefully analyze multiple abnormal factors identified in the previous steps, such as print head aging, improper print speed settings, use of incompatible thermal paper, etc. These factors may directly affect the performance and life of the thermal print head. Evaluate whether the current printing range of the thermal print head meets the needs and whether the service life of the thermal print head is close to or exceeds its design life. This information helps to determine whether the thermal print head needs to be replaced or repaired. Based on the above analysis, determine whether an alternative heating mechanism needs to be implemented. Alternative heating mechanisms may include replacing a new print head, adjusting the operating parameters of the print head (such as heating temperature, printing speed, etc.), using more compatible thermal paper, etc. These mechanisms are designed to improve print quality, extend print head life, or solve specific printing problems.
[0149] Suppose we have a thermal printer, and in the previous step we identified the following abnormal factors: the aging of the print head leads to reduced heating efficiency, the print speed is set too high, and incompatible thermal paper is used. At the same time, the evaluation found that the printing range of the thermal print head can no longer meet the current needs, and the service life is close to its design life.
[0150] Based on this information, we decided to implement a backup heating mechanism. This was done by: Replace the new print head to improve heating efficiency and print quality.
[0151] Adjust the printer's driver settings to reduce the print speed to accommodate the new printhead performance.
[0152] Replace with thermal paper that is compatible with this printer to ensure printing results.
[0153] In addition, according to the backup heating mechanism determined in step S165, corresponding hardware replacement, software adjustment or material replacement is performed. After the backup heating mechanism is implemented, immediately start online monitoring of print quality and performance. Use the printer's monitoring function or professional testing tools to collect printing data in real time and analyze indicators such as printing quality, speed, and stability. Based on the online monitoring results, further adjust and optimize the printer's settings or parameters. For example, if the print quality is still poor, it may be necessary to fine-tune the print head heating temperature or printing speed; if problems such as paper jams or paper jams occur during printing, it may be necessary to check the paper delivery system and perform necessary cleaning and maintenance. Embodiment 3
[0154] See also Figure 3 , Figure 3 Schematic diagram of the structure of a thermal printing system of a thermal printer in an embodiment of the present invention.
[0155] like Figure 3 As shown, a thermal printing system of a thermal printer, the thermal printing system of the thermal printer comprises: A thermal printing area module 21, used to determine a thermal printing area based on the content to be printed and the printing paper in a thermal printer; A sub-printing area module 22, for determining a plurality of sub-printing areas based on the thermal printing area, the heating time of the thermal printing head, and the moving speed of the thermal printing head; A heating point number module 23, used to determine the number of heating points of each sub-printing area according to the area of the multiple sub-printing areas, the number of rows of the multiple sub-printing areas and the printing range of the thermal print head; A heating round number module 24, used to determine the number of heating rounds of the thermal print head for each sub-printing area based on the number of heating points in each sub-printing area, the heating temperature of the thermal print head, and the printing time of the thermal print head; A printing effect coefficient module 25, for determining a printing effect coefficient of each sub-printing area based on the number of heating rounds of each sub-printing area, the printing content of each sub-printing area, and the number of heating points of each sub-printing area; The optimization module 26 is used to determine multiple abnormal factors based on the detection of a sub-printing area if the printing effect coefficient of the sub-printing area is lower than the preset printing effect coefficient, and determine the corresponding backup heating mechanism according to the multiple abnormal factors, the printing range of the thermal print head and the service life of the thermal print head to optimize the sub-printing area. Embodiment 4
[0156] In this embodiment, an electronic device is provided. Its internal structure diagram can be shown as follows: Figure 4 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program, and the non-volatile storage medium is deployed with a database, which is used to store user behavior data and user portraits. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with other electronic devices that deploy application software. When the computer program is executed by the processor, a low-altitude patrol method of a drone is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the housing of the electronic device, or an external keyboard, touchpad or mouse.
[0157] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
Claims
1. A thermal printing method for a thermal printer, characterized in that: include: In a thermal printer, a thermal printing area is determined based on the content to be printed and the printing paper; determining a plurality of sub-printing areas based on the thermal printing area, the heating time of the thermal printing head, and the moving speed of the thermal printing head; Determining the number of heating points of each sub-printing area according to the area of the multiple sub-printing areas, the number of rows of the multiple sub-printing areas, and the printing range of the thermal print head; Determine the number of heating rounds of the thermal print head for each sub-printing area based on the number of heating points of each sub-printing area, the heating temperature of the thermal print head, and the printing time of the thermal print head; Determine the printing effect coefficient of each sub-printing area based on the number of heating wheels of each sub-printing area, the printing content of each sub-printing area, and the number of heating points of each sub-printing area; If the printing effect coefficient of a sub-printing area is lower than the preset printing effect coefficient, multiple abnormal factors are determined based on the detection of the sub-printing area, and the corresponding backup heating mechanism is determined according to the multiple abnormal factors, the printing range of the thermal print head and the service life of the thermal print head to optimize the sub-printing area.
2. The thermal printing method of a thermal printer according to claim 1, characterized in that: In the thermal printer, determining the thermal printing area based on the content to be printed and the printing paper includes: In a thermal printer, the content to be printed is collected; Position the printing paper space of the thermal printer; Determining the printing paper based on the detection of the printing paper space of the thermal printer; Determining a printed area of the printing paper and an area to be printed of the printing paper based on the traversal of the printing paper; The thermal printing area is determined according to the content to be printed and the area to be printed of the printing paper.
3. The thermal printing method of a thermal printer according to claim 2, characterized in that: The method of determining a plurality of sub-printing areas based on the thermal printing area, the heating time of the thermal printing head, and the moving speed of the thermal printing head comprises: Get the thermal printing area; Determine each primary estimation area according to the thermal printing area and the model of the thermal print head; associating each of the primary estimation areas, a heating time of the thermal print head, and a moving speed of the thermal print head; Determine a first area coefficient according to each primary estimation area and the heating time of the thermal print head; determine a second area coefficient according to each primary estimation area and the moving speed of the thermal print head; A plurality of sub-printing areas are determined based on the first area coefficient, the second area coefficient, and the thermal printing area.
4. The thermal printing method of a thermal printer according to claim 3, characterized in that: The method of determining the number of heating points of each sub-printing area according to the area of the plurality of sub-printing areas, the number of rows of the plurality of sub-printing areas, and the printing range of the thermal print head comprises: Get multiple sub-printing areas; determining area areas of the plurality of sub-printing areas based on area detection of the plurality of sub-printing areas; Determining the number of rows of the plurality of sub-printing areas according to scanning of the plurality of sub-printing areas; Perform multiple interactions on the area of multiple sub-printing areas, the number of lines of multiple sub-printing areas, and the printing range of the thermal print head; The number of heating points of each sub-printing area is determined according to multiple interactions of the area of the multiple sub-printing areas, the number of rows of the multiple sub-printing areas, and the printing range of the thermal print head.
5. The thermal printing method of a thermal printer according to any one of claims 1 to 4, characterized in that: The method of determining the number of heating rounds of the thermal print head for each sub-printing area based on the number of heating points of each sub-printing area, the heating temperature of the thermal print head, and the printing time of the thermal print head comprises: Get the number of heating points in each sub-printing area; Performing real-time detection on the thermal print head and determining the heating temperature of the thermal print head according to the real-time detection of the thermal print head; Determining the printing time of the thermal print head according to the area of the sub-printing area and the printing range of the thermal print head; Multiple interactions are performed on the number of heating points of each sub-printing area, the heating temperature of the thermal print head, and the printing time of the thermal print head; The number of heating rounds of the thermal print head for each sub-printing area is determined according to the multiple interactions of the number of heating points in each sub-printing area, the heating temperature of the thermal print head and the printing time of the thermal print head.
6. The thermal printing method of a thermal printer according to claim 5, characterized in that: The step of determining the printing effect coefficient of each sub-printing area based on the number of heating rounds of each sub-printing area, the printing content of each sub-printing area, and the number of heating points of each sub-printing area includes: Get the number of heating wheels for each sub-printing area; Performing content detection on each sub-printing area, and determining the printing content of each sub-printing area according to the content detection of each sub-printing area; Multiple interactions are performed on the number of heating wheels of each sub-printing area, the printing content of each sub-printing area, and the number of heating points of each sub-printing area.
7. The thermal printing method of a thermal printer according to claim 6, characterized in that: The step of determining the printing effect coefficient of each sub-printing area based on the number of heating wheels of each sub-printing area, the printing content of each sub-printing area, and the number of heating points of each sub-printing area also includes: Determining a first effect coefficient based on the number of heating rounds of each sub-printing area and the interaction of the printing content of each sub-printing area; Determining a second effect coefficient according to the interaction of the number of heating rounds of each sub-printing area and the number of heating points of each sub-printing area; The printing effect coefficient of each sub-printing area is determined according to the first effect coefficient, the second effect coefficient and the printing content of each sub-printing area.
8. The thermal printing method of a thermal printer according to claim 7, characterized in that: If the printing effect coefficient of a sub-printing area is lower than the preset printing effect coefficient, multiple abnormal factors are determined based on the detection of the sub-printing area, and the corresponding backup heating mechanism is determined according to the multiple abnormal factors, the printing range of the thermal print head and the service life of the thermal print head to optimize the sub-printing area, including: Collecting printing effect coefficients of multiple sub-printing areas; Obtaining a preset printing effect coefficient matched by the sub-printing area, and comparing the printing effect coefficients of the multiple sub-printing areas with the preset printing effect coefficients; If the printing effect coefficient of a sub-printing area is lower than the preset printing effect coefficient, an abnormality detection of the sub-printing area is triggered.
9. The thermal printing method of a thermal printer according to claim 8, characterized in that: If the printing effect coefficient of a sub-printing area is lower than the preset printing effect coefficient, multiple abnormal factors are determined based on the detection of the sub-printing area, and the corresponding backup heating mechanism is determined according to the multiple abnormal factors, the printing range of the thermal print head and the service life of the thermal print head to optimize the sub-printing area, and further includes: Determine a plurality of abnormal parameters based on the abnormal detection of the sub-printing area, construct corresponding abnormal combinations according to the plurality of abnormal parameters, determine corresponding abnormal factors based on the identification of each abnormal combination, and collect the plurality of abnormal factors; Interacting multiple abnormal factors, the printing range of the thermal print head, and the service life of the thermal print head, and determining a corresponding backup heating mechanism according to the interaction of the multiple abnormal factors, the printing range of the thermal print head, and the service life of the thermal print head; An on-line optimization of the sub-printing area is triggered according to the alternative heating mechanism.
10. A thermal printing system for a thermal printer, characterized in that: The thermal printing system of the thermal printer is applied to the thermal printing method of the thermal printer as claimed in any one of claims 1 to 9, and the thermal printing system of the thermal printer comprises: A thermal printing area module, used to determine a thermal printing area based on the content to be printed and the printing paper in a thermal printer; A sub-printing area module, for determining a plurality of sub-printing areas based on the thermal printing area, the heating time of the thermal printing head, and the moving speed of the thermal printing head; A heating point number module, used to determine the number of heating points of each sub-printing area according to the area of the multiple sub-printing areas, the number of rows of the multiple sub-printing areas and the printing range of the thermal print head; A heating round number module, used to determine the number of heating rounds of the thermal print head for each sub-printing area based on the number of heating points in each sub-printing area, the heating temperature of the thermal print head, and the printing time of the thermal print head; A printing effect coefficient module, used to determine the printing effect coefficient of each sub-printing area based on the number of heating rounds of each sub-printing area, the printing content of each sub-printing area and the number of heating points of each sub-printing area; The optimization module is used to determine multiple abnormal factors based on the detection of a sub-printing area if the printing effect coefficient of the sub-printing area is lower than the preset printing effect coefficient, and determine the corresponding backup heating mechanism according to the multiple abnormal factors, the printing range of the thermal print head and the service life of the thermal print head to optimize the sub-printing area.