Data printing method, device, equipment and readable storage medium
By collecting and buffering printing data, and formulating appropriate heating strategies based on heating power, the power supply abnormalities and motor lag of thermal printers under high power conditions is solved, and the stability and accuracy of high-density and high-power data printing is achieved. .
Patent Information
- Application Number
- CN202110772754.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-08
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-07-08
AI Technical Summary
Existing thermal printers are prone to power supply abnormalities and motor stuttering under high power conditions, resulting in high printing noise and data misprinting, and fail to formulate appropriate heating strategies for different data streams, affecting measurement results and case analysis.
By collecting print data, buffering and sampling, different heating strategies are formulated according to the heating power, including point-by-point heating, segmented time-sharing and point-drawing processing, ensuring that the printing power is within the safe range and avoiding the motor being stuck while waiting for data.
It reduces the power consumption of the printer, extends the printing time, realizes high-density and high-power data printing, protects the print head, prevents the heating plate from overheating and burning, and ensures the stability and accuracy of the printing system.
Smart Images

Figure CN114706539B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of printing processing technology, and in particular to a data printing method, device, equipment and readable storage medium. Background Art
[0002] A dot matrix thermal recorder is a device that uses semiconductor heating points sintered on a ceramic substrate to heat and print graphics and characters on thermal paper that turns color when heated.
[0003] Thermal printers are used in point-of-sales (POS) machines, supermarket checkout lists, and other medical equipment, especially electrocardiographs. Thermal printers are also a common printing method.
[0004] At present, dot matrix thermal recorders need to be equipped with corresponding print heads. In existing printing devices, especially the print heads of electrocardiographs, the heating current is limited only by hardware protection, or simple time-sharing and segmented heating is used. The above two methods often greatly increase the probability of system downtime when the power is too large, and the data stream is not processed. When reading data, the motor is prone to jamming while waiting for data, resulting in high printing noise, and different heating strategies are not formulated for different data streams. If a simple sampling process is performed on the data to be printed, however, a whole line of data to be printed will be completely missed and not printed out, affecting the measurement results and case analysis. In summary, reducing the power consumption of printers, extending the printing time, and realizing the need for high-density and high-power data printing methods are important issues that need to be urgently addressed in the industry. Summary of the invention
[0005] The present invention provides a data printing method, device, equipment and readable storage medium, which are used to solve the defects in the prior art that excessive printing power causes abnormal power supply of the printing system, motor jams during printing, and data is completely missed and not printed out, so as to achieve high-density and high-power data printing, and can limit the excessive printing power of the printer to avoid abnormal power supply of the printing system caused by excessive printing power of the entire machine.
[0006] The present invention provides a data printing method, comprising the following steps:
[0007] Collecting print data and buffering the print data in a buffer area;
[0008] Sampling print data from the buffer area, and acquiring heating power of the sampled print data;
[0009] According to the heating power, a heating strategy corresponding to the sampled printing data is formulated;
[0010] Latch the sampled print data into the latch area;
[0011] The sampled printing data is read from the latch area, and the sampled printing data is printed according to the heating strategy.
[0012] According to the data printing method provided by the present invention, sampling the printing data from the buffer area and obtaining the heating power of the sampled printing data specifically comprises the following steps:
[0013] Sampling the print data within a preset buffer window width from the buffer area to obtain a plurality of columns of sampled data;
[0014] Get the number of print dots corresponding to each column of print data;
[0015] The heating power corresponding to each column of printing data is obtained according to the number of printing dots.
[0016] According to the data printing method provided by the present invention, obtaining the heating power corresponding to each column of printing data according to the number of printing dots specifically comprises the following steps:
[0017] The single point heating power corresponding to the number of printing dots is obtained through the printing dot number parameters; wherein the printing dot number parameters include the internal resistance of the driving integrated circuit, the strobe pulse width, the printing voltage, the resistance of the heating element and the common electrode voltage drop;
[0018] The single-point heating powers of all printing dots in each column of printing data are accumulated to obtain the heating power corresponding to each column of printing data.
[0019] According to the data printing method provided by the present invention, formulating a heating strategy corresponding to the sampled printing data according to the heating power specifically comprises the following steps:
[0020] Obtaining intervals of heating power distribution; wherein the intervals include a first interval, a second interval, a third interval, a fourth interval and a fifth interval, the heating strategies include a first strategy, a second strategy, a third strategy, a fourth strategy and a fifth strategy, and the heating powers corresponding to the first interval, the second interval, the third interval, the fourth interval and the fifth interval are set in a step-by-step increasing manner;
[0021] If the heating power distribution is within the first interval, the first strategy is formulated; wherein the first strategy is to heat all the currently sampled printing data point by point;
[0022] If the heating power distribution is within the second interval, the second strategy is formulated; wherein the second strategy is to heat the current sampled printing data in sections and in time;
[0023] If the heating power is distributed in the third interval, the third strategy is formulated; wherein the third strategy is to heat the current sampled print data in sections and in time, and adopt different sampling methods for the current sampled print data according to the distribution parameters of the sampled print data of the subsequent buffer window width obtained, the distribution parameters include the number of column print data corresponding to the instantaneous impact and the intermediate value area power respectively, the instantaneous impact is the heating power distribution of the column print data in the third range, the low threshold power is the heating power distribution of the column print data in the first range, the intermediate value area power is the heating power distribution of the column print data in the second range, and the heating powers corresponding to the first range, the second range and the third range are set in a step-by-step increasing manner;
[0024] If the heating power distribution is in the fourth interval, the fourth strategy is formulated; wherein the fourth strategy is to adjust the printing duration to the first duration, and the current sampled printing data is heated in sections and time-divided, and different sampling methods are adopted for the current sampled printing data according to the distribution parameters of the sampled printing data of the subsequent buffer window width obtained;
[0025] If the heating power distribution is in the fifth interval, the fifth strategy is formulated; wherein the fifth strategy is to adjust the printing time to the second time, and the current sampled printing data is heated in segments and time-divided, and according to the distribution parameters of the sampled printing data of the subsequent buffer window width obtained, different sampling methods are adopted for the current sampled printing data.
[0026] According to the data printing method provided by the present invention, if the heating power is distributed in the third interval, formulating the third strategy specifically includes the following steps:
[0027] If the heating power is distributed in the third interval, obtaining the number of instantaneous impacts;
[0028] If the number of instantaneous impacts is not greater than the first number, the number of powers in the intermediate value area is obtained; if the number of powers in the intermediate value area is less than the second number, the current sampled print data is heated in sections and in time; if the number of powers in the intermediate value area is not less than the second number, the current sampled print data is heated in sections and in time, and a sampling method of two out of one is adopted for the current sampled print data, and the sampling of two adjacent columns of print data is staggered;
[0029] If the number of instantaneous impacts is greater than the first number, the currently sampled printing data is heated in sections and in time, and a sampling method of two out of one is adopted for the currently sampled printing data.
[0030] According to the data printing method provided by the present invention, if the heating power is distributed in the fourth interval, formulating the fourth strategy specifically includes the following steps:
[0031] If the heating power is distributed in the fourth interval, the printing duration is adjusted to the first duration and the number of instantaneous impacts is obtained;
[0032] If the number of instantaneous impacts is not greater than the third number, the number of powers in the intermediate value region is obtained; if the number of powers in the intermediate value region is less than the fourth number, the current sampled print data is heated in sections and time-sharing, and a sampling method of two out of one is adopted for the current sampled print data; if the number of powers in the intermediate value region is not less than the fourth number, the current sampled print data is heated in sections and time-sharing, and a sampling method of three out of one is adopted for the current sampled print data;
[0033] If the number of instantaneous impacts is greater than the third number, the currently sampled print data is heated in sections and in time, and a sampling method of three out of one is adopted for the currently sampled print data, and the sampling of two adjacent columns of print data is staggered.
[0034] According to the data printing method provided by the present invention, if the heating power is distributed in the fifth interval, formulating the fifth strategy specifically includes the following steps:
[0035] If the heating power is distributed in the fifth interval, the printing duration is adjusted to the second duration and the number of instantaneous impacts is obtained;
[0036] If the number of instantaneous impacts is not greater than the third number, the number of powers in the intermediate value area is obtained; if the number of powers in the intermediate value area is less than the fourth number, the current sampled print data is heated in sections and in time; if the number of powers in the intermediate value area is not less than the fourth number, the current sampled print data is heated in sections and in time, and a sampling method of two out of one is adopted for the current sampled print data;
[0037] If the number of instantaneous impacts is greater than the third number, the currently sampled printing data is heated in sections and in time, and a sampling method of three out of one is adopted for the currently sampled printing data.
[0038] The present invention also provides a data printing device, comprising:
[0039] A data cache module, used for collecting print data and caching the print data in a cache area;
[0040] A data sampling module, used for sampling printing data from the buffer area and obtaining the heating power of the sampled printing data;
[0041] A strategy formulation module, used for formulating a heating strategy corresponding to the sampled printing data according to the heating power;
[0042] A data latch module, used for latching the sampled printing data into a latch area;
[0043] The data printing module is used to read the sampled printing data from the latch area and print the sampled printing data according to the heating strategy.
[0044] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-mentioned data printing methods when executing the program.
[0045] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned data printing methods are implemented.
[0046] The present invention provides a data printing method, device, equipment and readable storage medium, which is a thermal printing method, device, equipment and readable storage medium based on power distribution prediction. The data stream is processed from the source, and the pre-printed printing data transmitted by the host computer is cached and latched. While heating, the next column of data is processed instead of printing when the motor rotates. This ensures that the printer motor can always have data to print, rather than waiting for printing data during the rotation process, and formulates corresponding different heating strategies according to different distribution intervals of heating power. Thereby ensuring that the printing power limit is within the power limit range of the entire system, that is, controlling the heating power not to exceed the maximum power threshold of the heating system, thereby protecting the print head, preventing the print head from being burned due to excessive power, and extending the printing time of the printing system. In this way, the power consumption of the printer can be reduced, the printing time can be extended, high-density and high-power data printing can be achieved, and the excessive printing power of the printer can be limited to avoid abnormal power supply of the printing system due to excessive printing power of the whole machine, and preventing the current flowing through the heating plate from being too large, the temperature of the heating plate from being too high, and the heating plate from being burned. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 It is a flow chart of the data printing method provided by the present invention;
[0049] Figure 2 It is a schematic diagram of collecting printing data in step S100 and storing data in step S400 in the data printing method provided by the present invention;
[0050] Figure 3It is a schematic diagram of data caching in step S100 of the data printing method provided by the present invention;
[0051] Figure 4 It is a schematic diagram of the printing data of the sampling buffer area in the data printing method provided by the present invention;
[0052] Figure 5 It is a specific flow chart of step S200 in the data printing method provided by the present invention;
[0053] Figure 6 It is a specific flow chart of step S230 in the data printing method provided by the present invention;
[0054] Figure 7 It is a specific flow chart of step S300 in the data printing method provided by the present invention;
[0055] Figure 8 It is a specific flow chart of step S340 in the data printing method provided by the present invention;
[0056] Fig. 9 is a specific flow chart of step S350 in the data printing method provided by the present invention;
[0057] Fig.10 is a specific flow chart of step S360 in the data printing method provided by the present invention;
[0058] Fig.11 It is a structural schematic diagram of a data printing device provided by the present invention;
[0059] Fig.12 It is a specific structural diagram of a data sampling module in the data printing device provided by the present invention;
[0060] Fig.13 is a specific structural schematic diagram of the third sampling unit in the data printing device provided by the present invention;
[0061] Fig.14 It is a specific structural diagram of the strategy formulation module in the data printing device provided by the present invention;
[0062] Fig.15 It is a specific structural schematic diagram of the fourth formulation unit in the data printing device provided by the present invention;
[0063] Fig.16 It is a specific structural schematic diagram of the fifth formulation unit in the data printing device provided by the present invention;
[0064] Fig.17 It is a specific structural schematic diagram of the sixth formulation unit in the data printing device provided by the present invention;
[0065] Fig.18 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0067] At present, dot matrix thermal recorders need to be equipped with a print head. Existing printing equipment, especially the print head of an electrocardiograph, generally protects the heating system by optimizing the circuit design, such as only using hardware protection to control the current flowing through the heating plate in the entire circuit, and the software method is just a simple time-sharing and segmented heating. There is no real power prediction based on the data stream to formulate a corresponding heating strategy, which often greatly increases the probability of the printing system crashing when the power is too large. Moreover, the data stream is not processed. When reading data, the motor is prone to jamming while waiting for data, resulting in a problem of high printing noise, and different heating strategies are not formulated for different data streams.
[0068] In the prior art, there is also a method of uniformly and simply processing the data in a certain cache area, that is, each column of data in the entire cache area is processed in the same way, that is, a simple sampling process is performed when it is greater than a preset threshold. However, this method may result in a situation where a whole row of data that is to be printed is missed and not printed, affecting the measurement results and case analysis.
[0069] In summary, in view of the above shortcomings in the prior art, the data printing method of the present invention aims to formulate different heating strategies based on the current printing column heating power without affecting the rotation of the printer motor, so as to reduce the power consumption of the printer and extend the printing time. It can realize high-density and high-power data printing processing, limit the excessive printing power of the printer, avoid abnormal power supply of the printing system due to excessive printing power of the whole machine, and prevent excessive current flowing through the heating plate, excessive temperature of the heating plate, and burning of the heating plate.
[0070] Combine the following Figures 1 to 4 The data printing method of the present invention is described, and the method comprises the following steps:
[0071] S100, collecting printing data, and buffering the printing data in a buffer area.
[0072] In step S100 , when the microcontroller unit (MCU) receives the printing data transmitted by the host computer, it first puts the printing data into a buffer for caching, so as to facilitate the storage of the printing data and the subsequent power prediction.
[0073] S200: Sample print data from the buffer area, and obtain heating power of the sampled print data.
[0074] S300, formulate a heating strategy corresponding to the sampled print data according to the heating power, and formulate different heating strategies for the sampled print data according to different distribution intervals of the heating power, so as to ensure that the print power does not exceed the maximum power threshold of the entire printing system, so as to protect the printing system. According to the heating power of the print data sampled in the buffer area, the print power of the remaining print data in the buffer area and the print data of the entire buffer area can be predicted, so as to know the heating power of the subsequent print data.
[0075] S400, latching the sampled print data into the latch area. In this embodiment, a latch can be used to latch the print data. In this way, the printing system can separate the motor rotation and the print data reading. While heating, the next column of data can be processed instead of executing the printing process while the motor is rotating. This makes it unnecessary for the motor to wait for the print data while printing, thus preventing the motor from jamming and causing high printing noise.
[0076] S500 , reading sampled printing data from the latch area, and printing the sampled printing data according to the heating strategy.
[0077] See also Figures 2 to 4 After receiving the serial port command sent by the host computer, the MCU starts to receive the print data through the serial peripheral interface (SPI). In this embodiment, the transmission method is direct memory access (DMA). The DMA method does not occupy the microcontroller thread, speeds up the data reading speed, and prevents the printer from freezing when waiting for data. After the MCU processes the print data (obtaining the heating power, predicting the heating power, and formulating the heating strategy), it transmits a series of processed print data to the print head for processing. Similarly, the transmission is also transmitted through the SPI interface in DMA mode.
[0078] The data printing method of the present invention is a thermal printing method based on power distribution prediction. It processes from the source of the data stream, caches and latches the pre-printed printing data transmitted by the host computer, and processes the next column of data while heating, rather than performing printing processing when the motor rotates, so as to ensure that the printer motor can always have data to print, rather than waiting for printing data during the rotation process, and formulate corresponding different heating strategies according to the distribution intervals of different heating powers. Thereby ensuring that the printing power limit is within the power limit range of the entire system, that is, controlling the heating power not to exceed the maximum power threshold of the heating system, thereby protecting the print head, preventing the power from burning the print head and extending the printing time of the printing system. In this way, the power consumption of the printer can be reduced, the printing time can be extended, high-density and high-power data printing can be realized, and the excessive printing power of the printer can be limited, so as to avoid abnormal power supply of the printing system caused by excessive printing power of the whole machine, and prevent the current flowing through the heating plate from being too large, the temperature of the heating plate from being too high, and the heating plate from being burned.
[0079] Combine the following Figure 5 Describing the data printing method of the present invention, step S200 specifically includes the following steps:
[0080] S210 , sampling print data within a preset buffer window width from the buffer area to obtain a plurality of columns of sampled data.
[0081] In step S210, specifically, print data of a certain buffer window width is read backward from the print index position, ie, the print start position. In this embodiment, the buffer range of the buffer area is set to 100 columns of print data, and the buffer window width is set to 32 columns.
[0082] S220, obtaining the number of printing dots corresponding to each column of printing data.
[0083] According to step S210 and step S220, taking a 12-channel electrocardiograph as an example, the print sequence is 216 bytes, each byte has 8 points, then a
[32] is the array data of [(216×8),32], that is, 32 columns, each column has 1728 points of data, and a[n] is the array data of [(216×8),n], that is, each column has 1728 points of data, that is:
[0084] a[1728,32]={a[0],a[1],a[2],...,a[n],...a
[31] },(n<32)
[0085] S230, obtaining the heating power corresponding to each column of printing data according to the number of printing dots.
[0086] More specifically, the following Figure 6 Describing the data printing method of the present invention, step S230 specifically includes the following steps:
[0087] S231, obtaining the single point heating power corresponding to the printing point number through the printing point number parameters, wherein the printing point number parameters include the internal resistance of the driving integrated circuit, the strobe pulse width, the printing voltage, the resistance of the heating element, and the voltage drop of the common electrode.
[0088] Single point printing power:
[0089] Among them, R ic =125Ω is the internal resistance of the driver integrated circuit (IC), t s is the strobe pulse width (heating time), VH is the printing voltage, is the resistance of the heating element, V com =0.5 V is the common electrode voltage drop. It should be noted that the heating power refers to the energy generated during the heating process.
[0090] S232, accumulating the single-point heating powers of all printing dots in each column of printing data to obtain the heating power corresponding to each column of printing data, that is, the heating power of a column of printing data is the number of printing dots multiplied by the single-point heating power of the printing dots.
[0091] Heating power for each column of printed data:
[0092] Wherein, N(n) is the number of print dots in each column of print data.
[0093] It can be understood that since the number of print dots in each column of print data is at most 1728 print dots, and the heating power of a column of print data is the heating power of the column of print data, that is, the number of print dots multiplied by the single-point heating power of the print dots, therefore, according to the heating power of the current print data, the power of subsequent print data can be predicted, and then different heating strategies can be formulated according to the different distribution ranges of the heating power.
[0094] Combine the following Figure 7 Describing the data printing method of the present invention, step S300 specifically includes the following steps:
[0095] S310, obtaining intervals of heating power distribution; wherein the intervals include a first interval, a second interval, a third interval, a fourth interval and a fifth interval, and the heating strategies include a first strategy, a second strategy, a third strategy, a fourth strategy and a fifth strategy.
[0096] S320, if the heating power distribution is in the first interval, formulate a first strategy, wherein the first strategy is that all the current sampled print data are heated point by point, and the first strategy means that the current print column power is within the power limit range, so the current sampled print data can be heated point by point.
[0097] S330, if the heating power is distributed in the second interval, formulate a second strategy. The second strategy is to heat the current sampled printing data in sections and in time. For example, if the heating head has 4 sections, the heating head is divided into two sections for section and time heating. In this way, when the heating power of the whole column is not very large, the heating is divided into two sections for section heating, which ensures sufficient heating time and also ensures that the printing power is limited within the power range.
[0098] S340, if the heating power distribution is in the third interval, formulate a third strategy. The third strategy is to heat the current sampled print data in sections and in time, and adopt different sampling methods for the current sampled print data according to the distribution parameters of the sampled print data of the subsequent buffer window width obtained, the distribution parameters include the number of column print data corresponding to the instantaneous impact, the low threshold power and the intermediate value area power, the instantaneous impact is the heating power distribution of the column print data in the third range, the low threshold power is the heating power distribution of the column print data in the first range, the intermediate value area power is the heating power distribution of the column print data in the second range, and the corresponding heating powers in the first range, the second range and the third range are set in a step-by-step increasing manner.
[0099] In this embodiment, the instantaneous impact, the low threshold power and the intermediate value area power are all the heating power E of the print data within the buffer window width (32 print data columns). a[n] Preferably, the instantaneous impact is the heating power E of the column printing data. a[n] Greater than 1000 joules, the low threshold power is the heating power E of the column print data a[n] Less than 300 joules, the power in the middle value area is the heating power E of the column printing data a[n] Greater than 300 joules and less than 1000 joules.
[0100] It should be noted that when the heating power distribution of the column printing data is in the first range, that is, it belongs to low power, there is no need to perform segmented and time-sharing heating, and a conventional heating method can be used, which will not be elaborated in detail here.
[0101] S350: If the heating power distribution is in the fourth interval, formulate a fourth strategy, wherein the fourth strategy is to adjust the printing duration to the first duration, and heat the current sampled printing data in sections and time, and adopt different sampling methods for the current sampled printing data according to the distribution parameters of the sampled printing data of the subsequent buffer window width obtained.
[0102] S360: If the heating power distribution is in the fifth interval, formulate a fifth strategy. The fifth strategy is to adjust the printing duration to the second duration, and heat the current sampled printing data in sections and time periods, and adopt different sampling methods for the current sampled printing data according to the distribution parameters of the sampled printing data of the subsequent buffer window width obtained;
[0103] The first duration is 500 μs, the second duration is 460 μs, and the heating powers corresponding to the first interval, the second interval, the third interval, the fourth interval, and the fifth interval are set to increase step by step. Preferably, the first interval is E a[n] ∈[0, 300E0], the second interval is E a[n] ∈(300E0, 500E0], the third interval is E a[n] ∈(500E0, 1000E0], the fourth interval is E a[n] ∈(1000E0, 1500E0], the fifth interval is E a[n] ∈(1500E0, 1728E0].
[0104] Combine the following Figure 8 Describing the data printing method of the present invention, step S340 specifically includes the following steps:
[0105] S341: If the heating power distribution is in the third interval, obtain the number of instantaneous impacts.
[0106] S342, if the number of instantaneous impacts is not greater than the first number, the number of powers in the intermediate value area is obtained; if the number of powers in the intermediate value area is less than the second number, the current sampled print data is heated in sections and in time; if the number of powers in the intermediate value area is not less than the second number, the current sampled print data is heated in sections and in time, and a sampling method of two out of one is adopted for the current sampled print data, and the sampling of two adjacent columns of print data is staggered, that is:
[0107] a[n]=a[n]×[1,0,1,0,1,0...1,0]
[0108] Among them, [1,0,1,0,1,0...1,0] is 1728 bits (216 bytes * 8 bits).
[0109] In order to avoid missing the situation where the entire row of print data is sampled, the next column of print data is sampled in a two-out-of-one sampling mode and is staggered with the previous column of print data, that is:
[0110] a[n+1]=a[n+1]×[0,1,0,1,0...1,0,1]
[0111] S343: If the number of instantaneous impacts is greater than the first number, the current sampled print data is heated in sections and in time, and a sampling method of two out of one is adopted for the current sampled print data.
[0112] In this embodiment, the first number is 3 and the second number is 25.
[0113] Combine the following Fig. 9 Describing the data printing method of the present invention, step S350 specifically includes the following steps:
[0114] S351: If the heating power distribution is in the fourth interval, the printing duration is adjusted to the first duration and the number of instantaneous impacts is obtained.
[0115] S352. If the number of instantaneous impacts is not greater than the third number, the number of powers in the intermediate value area is obtained. If the number of powers in the intermediate value area is less than the fourth number, the current sampled printing data is heated in segments and time-sharing, and a two-out-of-one sampling method is adopted for the current sampled printing data. If the number of powers in the intermediate value area is not less than the fourth number, the current sampled printing data is heated in segments and time-sharing, and a three-out-of-one sampling method is adopted for the current sampled printing data.
[0116] S353, if the number of instantaneous impacts is greater than the third number, the current sampled print data is heated in sections and in time, and a sampling method of three out of one is adopted for the current sampled print data, and the sampling of two adjacent columns of print data is staggered, that is:
[0117] a[n]=a[n]×[1,0,0,1,0,0...1,0,0]
[0118] Among them, [1, 0, 0, 1, 0, 0...1, 0, 0] is 1728 columns (216 bytes * 8 bits).
[0119] In order to avoid missing the situation where the entire row of print data is sampled, the next column of print data is sampled in a three-sample-one manner and is staggered with the previous column of print data, that is:
[0120] a[n]=a[n]×[1,0,0,1,0,0...1,0,0]
[0121] a[n+1]=a[n]×[0,1,0,0,1,0...0,1,0]
[0122] a[n+2]=a[n+2]×[0,0,1,0,0,1...0,0,1]
[0123] In this embodiment, the third number is 8 and the fourth number is 20.
[0124] Combine the following Fig.10 Describing the data printing method of the present invention, step S360 specifically includes the following steps:
[0125] S361: If the heating power distribution is in the fifth interval, the printing duration is adjusted to the second duration and the number of instantaneous impacts is obtained.
[0126] S362. If the number of instantaneous impacts is not greater than the third number, obtain the number of powers in the intermediate value area. If the number of powers in the intermediate value area is less than the fourth number, the current sampled printing data is heated in segments and time-sharing. If the number of powers in the intermediate value area is not less than the fourth number, the current sampled printing data is heated in segments and time-sharing, and a two-to-one sampling method is adopted for the current sampled printing data.
[0127] S363: If the number of instantaneous impacts is greater than the third number, the current sampled printing data is heated in sections and in time, and a sampling method of three out of one is adopted for the current sampled printing data.
[0128] Regarding the processing of ECG pacing signals, based on a speed of 12.5 mm / s and 800 columns printed in 1 second, it is impossible for more than two pacing signals to appear in the buffer window width (32 columns of printed data). For such short-term instantaneous high power, the hardware circuit stores electrical energy through a large capacitor and can heat the entire section of the pacing signal without the need for sampling processing.
[0129] The data printing device provided by the present invention is described below. The data printing device described below and the data printing method described above can be referred to each other.
[0130] In view of the above-mentioned shortcomings in the prior art, the data printing device of the present invention is designed to formulate different heating strategies based on the current printing column heating power without affecting the rotation of the printer motor, so as to reduce the power consumption of the printer and extend the printing time. It can realize high-density and high-power data printing processing, limit the excessive printing power of the printer, avoid abnormal power supply of the printing system due to excessive printing power of the whole machine, and prevent excessive current flowing through the heating plate, excessive temperature of the heating plate, and burning of the heating plate.
[0131] Combine the following Fig.11 The data printing device of the present invention is described, and the device comprises:
[0132] The data cache module 100 is used to collect print data and cache the print data in a cache area.
[0133] The data sampling module 200 is used to sample the printing data from the buffer area and obtain the heating power of the sampled printing data.
[0134] The strategy formulation module 300 is used to formulate a heating strategy corresponding to the sampled print data according to the heating power, and formulate different heating strategies for the sampled print data according to different distribution intervals of the heating power, so as to ensure that the print power does not exceed the maximum power threshold of the entire printing system, so as to protect the printing system. According to the heating power of the print data sampled in the buffer area, the print power of the remaining print data in the buffer area and the print data of the entire buffer area can be predicted, so as to know the heating power of the subsequent print data.
[0135] The data latch module 400 is used to latch the sampled printing data into the latch area. In this embodiment, a latch can be used to latch the printing data. In this way, the printing system can separate the motor rotation and the printing data reading. While heating, the next column of data can be processed instead of executing the printing process while the motor is rotating. This makes it unnecessary for the motor to wait for the printing data while printing, thus preventing the motor from jamming and causing high printing noise.
[0136] The data printing module 500 is used to read the sampled printing data from the latch area and print the sampled printing data according to the heating strategy.
[0137] After receiving the serial port command sent by the host computer, the MCU starts to receive the print data through the serial peripheral interface (SPI). In this embodiment, the transmission method is direct memory access (DMA). The DMA method does not occupy the microcontroller thread, speeds up the data reading speed, and prevents the printer from freezing when waiting for data. After the MCU processes the print data (obtaining the heating power, predicting the heating power, and formulating the heating strategy), it transmits a series of processed print data to the print head for processing. Similarly, the transmission is also transmitted through the SPI interface in DMA mode.
[0138] The data printing device of the present invention is a thermal printing device based on power distribution prediction. It processes from the source of the data stream, caches and latches the pre-printed printing data transmitted by the host computer, and processes the next column of data while heating, rather than performing printing processing when the motor rotates. This ensures that the printer motor can always have data to print, rather than waiting for printing data during the rotation process, and formulates corresponding different heating strategies according to different distribution intervals of heating power. Thereby ensuring that the printing power limit is within the power limit range of the entire system, that is, controlling the heating power not to exceed the maximum power threshold of the heating system, thereby protecting the print head, preventing the print head from being burned due to excessive power, and extending the printing time of the printing system. In this way, the power consumption of the printer can be reduced, the printing time can be extended, high-density and high-power data printing can be achieved, and the excessive printing power of the printer can be limited to avoid abnormal power supply of the printing system due to excessive printing power of the whole machine, and preventing the current flowing through the heating plate from being too large, the temperature of the heating plate from being too high, and the heating plate from being burned.
[0139] Combine the following Fig.12 Describing the data printing device of the present invention, the data module 200 specifically includes:
[0140] The first sampling unit 210 is used to sample the print data within a preset buffer window width from the buffer area to obtain a plurality of columns of sampled data.
[0141] In the first sampling unit 210, specifically, print data of a certain buffer window width is read backward from the print index position, ie, the print start position. In this embodiment, the buffer range of the buffer area is set to 100 columns of print data, and the buffer window width is set to 32 columns.
[0142] The second sampling unit 220 is used to obtain the number of printing dots corresponding to each column of printing data.
[0143] According to the first sampling unit 210 and the second sampling unit 220, taking a 12-channel electrocardiograph as an example, the printed data series is 216 bytes, each byte is 8 points, then a
[32] is the array data of [(216×8),32], that is, 32 columns, each column has 1728 points of data, and a[n] is the array data of [(216×8),n], that is, each column has 1728 points of data, that is:
[0144] a[1728,32]={a[0],a[1],a[2],...,a[n],...a
[31] },(n<32)
[0145] The third sampling unit 230 is used to obtain the heating power corresponding to each column of printing data according to the number of printing dots.
[0146] More specifically, the following Fig.13Describing the data printing device of the present invention, the third sampling unit 230 specifically includes:
[0147] The first processing unit 231 is used to obtain the single point heating power corresponding to the printing point through the printing point number parameters, wherein the printing point number parameters include the internal resistance of the driving integrated circuit, the strobe pulse width, the printing voltage, the resistance of the heating element and the voltage drop of the common electrode.
[0148] Single point printing power:
[0149] Among them, R ic =125Ω is the internal resistance of the driver integrated circuit (IC), t s is the strobe pulse width (heating time), VH is the printing voltage, is the resistance of the heating element, V com =0.5V is the common electrode voltage drop.
[0150] The second processing unit 232 is used to accumulate the single-point heating powers of all printing dots in each column of printing data to obtain the heating power corresponding to each column of printing data, that is, the number of printing dots contained in a column of printing data is equal to the number of printing dots multiplied by the single-point heating power of the printing dots.
[0151] Heating power for each column of printed data:
[0152] Wherein, N(n) is the number of print dots in each column of print data.
[0153] It can be understood that since the number of print dots in each column of print data is at most 216 print dots, and the heating power of a column of print data is the heating power of the column of print data, that is, the number of print dots multiplied by the single-point heating power of the print dots, therefore, according to the heating power of the current print data, the power of subsequent print data can be predicted, and then different heating strategies can be formulated according to the different distribution ranges of the heating power.
[0154] Combine the following Fig.14 Describing the data printing device of the present invention, the strategy formulation module S300 specifically includes:
[0155] The first formulation unit 310 is used to obtain the intervals of the heating power distribution; wherein the intervals include a first interval, a second interval, a third interval, a fourth interval and a fifth interval, and the heating strategies include a first strategy, a second strategy, a third strategy, a fourth strategy and a fifth strategy.
[0156] The second formulation unit 320 is used to formulate a first strategy if the heating power distribution is in the first interval. The first strategy is that all the current sampled print data are heated point by point. The first strategy indicates that the current print column power is within the power limit range, so the current sampled print data can be heated point by point.
[0157] The third formulation unit 330 is used to formulate a second strategy if the heating power is distributed in the second interval. The second strategy is to heat the current sampled printing data in sections and in time. For example, if the heating head has 4 sections, the heating head is divided into two sections for section and time heating. In this way, when the heating power of the whole column is not very large, the heating is carried out in two sections, which ensures sufficient heating time and also ensures that the printing power is limited within the power range.
[0158] The fourth formulation unit 340 is used to formulate a third strategy if the heating power distribution is in the third interval. The third strategy is to heat the current sampled print data in sections and in time, and adopt different sampling methods for the current sampled print data according to the distribution parameters of the sampled print data of the subsequent buffer window width obtained, the distribution parameters include the number of column print data corresponding to the instantaneous impact, the low threshold power and the intermediate value area power, the instantaneous impact is the heating power distribution of the column print data in the third range, the low threshold power is the heating power distribution of the column print data in the first range, the intermediate value area power is the heating power distribution of the column print data in the second range, and the corresponding heating powers in the first range, the second range and the third range are set in a step-by-step increasing manner.
[0159] In this embodiment, the instantaneous impact, the low threshold power and the intermediate value area power are all the heating power E of the print data within the buffer window width (32 print data columns). a[n] Preferably, the instantaneous impact is the heating power E of the column printing data. a[n] Greater than 1000 joules, the low threshold power is the heating power E of the column print data a[n] Less than 300 joules, the power in the middle value area is the heating power E of the column printing data a[n] Greater than 300 joules and less than 1000 joules.
[0160] The fifth formulation unit 350 is used to formulate a fourth strategy if the heating power distribution is in the fourth interval. The fourth strategy is to adjust the printing duration to the first duration, and the current sampled printing data is heated in sections and time, and different sampling methods are adopted for the current sampled printing data according to the distribution parameters of the sampled printing data of the subsequent buffer window width obtained.
[0161] The sixth formulation unit 360 is used to formulate a fifth strategy if the heating power distribution is in the fifth interval. The fifth strategy is to adjust the printing duration to the second duration, and the current sampled printing data is heated in sections and time, and different sampling methods are adopted for the current sampled printing data according to the distribution parameters of the sampled printing data of the subsequent buffer window width obtained;
[0162] The first duration is 500 μs, the second duration is 460 μs, and the heating powers corresponding to the first interval, the second interval, the third interval, the fourth interval, and the fifth interval are set to increase step by step. Preferably, the first interval is E a[n] ∈[0, 300E0], the second interval is E a[n] ∈(300E0, 500E0], the third interval is E a[n] ∈(500E0, 1000E0], the fourth interval is E a[n] ∈(1000E0, 1500E0], the fifth interval is E a[n] ∈(1500E0, 1728E0].
[0163] Combine the following Fig.15 Describing the data printing device of the present invention, the fourth formulation unit 340 specifically includes:
[0164] The third processing unit 341 is used to distribute the heating power in the third interval and obtain the number of instantaneous impacts.
[0165] The fourth processing unit 342 is used to obtain the number of intermediate value area powers if the number of instantaneous impacts is not greater than the first number. If the number of intermediate value area powers is less than the second number, the current sampled print data is heated in sections and in time. If the number of intermediate value area powers is not less than the second number, the current sampled print data is heated in sections and in time, and a two-out-of-one sampling method is adopted for the current sampled print data, and two adjacent columns of print data are staggered in sampling, that is:
[0166] Right now:
[0167] a[n]=a[n]×[1,0,1,0,1,0...1,0]
[0168] Among them, [1, 0, 1, 0, 1, 0...1, 0] is 1728 bits (216 bytes * 8 bits).
[0169] In order to avoid missing the situation where the entire row of print data is sampled, the next column of print data is sampled in a two-out-of-one sampling mode and is staggered with the previous column of print data, that is:
[0170] a[n+1]=a[n+1]×[0,1,0,1,0...1,0,1]
[0171] The fifth processing unit 343 is used for, if the number of instantaneous impacts is greater than the first number, heating the current sampled printing data in sections and in time, and adopting a sampling method of two out of one for the current sampled printing data.
[0172] In this embodiment, the first number is 3 and the second number is 25.
[0173] Combine the following Fig.16 Describing the data printing device of the present invention, the fifth formulation unit S350 specifically includes:
[0174] The sixth processing unit 351 is configured to adjust the printing duration to the first duration and obtain the number of instantaneous impacts if the heating power distribution is in the fourth interval.
[0175] The seventh processing unit 352 is used to obtain the amount of power in the intermediate value area if the amount of instantaneous impact is not greater than the third amount; if the amount of power in the intermediate value area is less than the fourth amount, the current sampled printing data is heated in segments and time-sharing, and a two-out-of-one sampling method is adopted for the current sampled printing data; if the amount of power in the intermediate value area is not less than the fourth amount, the current sampled printing data is heated in segments and time-sharing, and a three-out-of-one sampling method is adopted for the current sampled printing data.
[0176] The eighth processing unit 353 is used for, if the number of instantaneous impacts is greater than the third number, heating the current sampled print data in sections and in time, and adopting a sampling method of three out of one for the current sampled print data, and staggering the sampling of two adjacent columns of print data, that is:
[0177] a[n]=a[n]×[1,0,0,1,0,0...1,0,0]
[0178] Among them, [1,0,0,1,0,0...1,0,0] is 1728 columns (216 bytes * 8 bits).
[0179] In order to avoid missing the situation where the entire row of print data is sampled, the next column of print data is sampled in a three-sample-one manner and is staggered with the previous column of print data, that is:
[0180] a[n]=a[n]×[1,0,0,1,0,0...1,0,0]
[0181] a[n+1]=a[n]×[0,1,0,0,1,0...0,1,0]
[0182] a[n+2]=a[n+2]×[0,0,1,0,0,1...0,0,1]
[0183] In this embodiment, the third number is 8 and the fourth number is 20.
[0184] Combine the following Fig.17 Describing the data printing device of the present invention, the sixth formulation unit S360 specifically includes:
[0185] The ninth processing unit 361 is configured to adjust the printing duration to the second duration and obtain the number of instantaneous impacts if the heating power distribution is in the fifth interval.
[0186] The tenth processing unit 362 is used to obtain the amount of power in the intermediate value area if the amount of instantaneous impact is not greater than the third amount. If the amount of power in the intermediate value area is less than the fourth amount, the current sampled printing data is heated in segments and time-sharing. If the amount of power in the intermediate value area is not less than the fourth amount, the current sampled printing data is heated in segments and time-sharing, and a two-to-one sampling method is adopted for the current sampled printing data.
[0187] The eleventh processing unit 363 is used for, if the number of instantaneous impacts is greater than the third number, heating the current sampled printing data in sections and in time, and adopting a sampling method of three out of one for the current sampled printing data.
[0188] Regarding the processing of ECG pacing signals, based on a speed of 12.5 mm / s and 800 columns printed in 1 second, it is impossible for more than two pacing signals to appear in the buffer window width (32 columns of printed data). For such short-term instantaneous high power, the hardware circuit stores electrical energy through a large capacitor and can heat the entire section of the pacing signal without the need for sampling processing.
[0189] Fig.18 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.18 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the data printing method, and the data printing method includes the following steps:
[0190] S100, collecting printing data, and buffering the printing data in a buffer area;
[0191] S200, sampling print data from the buffer area, and obtaining heating power of the sampled print data;
[0192] S300, formulating a heating strategy corresponding to the sampled printing data according to the heating power;
[0193] S400, latching the sampled printing data into a latch area;
[0194] S500 , reading sampled printing data from the latch area, and printing the sampled printing data according to the heating strategy.
[0195] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0196] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, the computer can execute the data printing method provided by the above methods, the data printing method comprising the following steps:
[0197] S100, collecting printing data, and buffering the printing data in a buffer area;
[0198] S200, sampling print data from the buffer area, and obtaining heating power of the sampled print data;
[0199] S300, formulating a heating strategy corresponding to the sampled printing data according to the heating power;
[0200] S400, latching the sampled printing data into a latch area;
[0201] S500 , reading sampled printing data from the latch area, and printing the sampled printing data according to the heating strategy.
[0202] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the computer program is implemented to perform the above-mentioned data printing method, and the data printing method comprises the following steps:
[0203] S100, collecting printing data, and buffering the printing data in a buffer area;
[0204] S200, sampling print data from the buffer area, and obtaining heating power of the sampled print data;
[0205] S300, formulating a heating strategy corresponding to the sampled printing data according to the heating power;
[0206] S400, latching the sampled printing data into a latch area;
[0207] S500 , reading sampled printing data from the latch area, and printing the sampled printing data according to the heating strategy.
[0208] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0209] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data printing method, characterized in that: The following steps are involved: Collecting print data and buffering the print data in a buffer area; Sampling print data from the buffer area, and acquiring heating power of the sampled print data; According to the heating power, a heating strategy corresponding to the sampled printing data is formulated; Latch the sampled print data into the latch area; Reading the sampled print data from the latch area, and printing the sampled print data according to the heating strategy; Wherein, formulating a heating strategy corresponding to the sampled printing data according to the heating power specifically includes the following steps: Obtaining intervals of heating power distribution; wherein the intervals include a first interval, a second interval, a third interval, a fourth interval and a fifth interval, the heating strategies include a first strategy, a second strategy, a third strategy, a fourth strategy and a fifth strategy, and the heating powers corresponding to the first interval, the second interval, the third interval, the fourth interval and the fifth interval are set in a step-by-step increasing manner; If the heating power distribution is within the first interval, the first strategy is formulated; wherein the first strategy is to heat all the currently sampled printing data point by point; If the heating power distribution is within the second interval, the second strategy is formulated; wherein the second strategy is to heat the current sampled printing data in sections and in time; If the heating power is distributed in the third interval, the third strategy is formulated; wherein the third strategy is to heat the current sampled print data in sections and in time, and adopt different sampling methods for the current sampled print data according to the distribution parameters of the sampled print data of the subsequent buffer window width obtained, the distribution parameters include the number of column print data corresponding to the instantaneous impact, the low threshold power and the intermediate value area power respectively, the instantaneous impact is that the heating power of the column print data is distributed in the third range, the low threshold power is that the heating power of the column print data is distributed in the first range, the intermediate value area power is that the heating power of the column print data is distributed in the second range, and the heating powers corresponding to the first range, the second range and the third range are set in a step-by-step increasing manner; If the heating power distribution is in the fourth interval, the fourth strategy is formulated; wherein the fourth strategy is to adjust the printing duration to the first duration, and the current sampled printing data is heated in sections and time-divided, and different sampling methods are adopted for the current sampled printing data according to the distribution parameters of the sampled printing data of the subsequent buffer window width obtained; If the heating power distribution is in the fifth interval, the fifth strategy is formulated; wherein the fifth strategy is to adjust the printing time to the second time, and the current sampled printing data is heated in segments and time-divided, and according to the distribution parameters of the sampled printing data of the subsequent buffer window width obtained, different sampling methods are adopted for the current sampled printing data.
2. The data printing method according to claim 1, characterized in that: Sampling the print data from the buffer area and obtaining the heating power of the sampled print data specifically includes the following steps: Sampling the print data within a preset buffer window width from the buffer area to obtain a plurality of columns of sampled data; Get the number of print dots corresponding to each column of print data; The heating power corresponding to each column of printing data is obtained according to the number of printing dots.
3. The data printing method according to claim 2, characterized in that: Obtaining the heating power corresponding to each column of printing data according to the number of printing dots specifically comprises the following steps: The single point heating power corresponding to the number of printing dots is obtained through the printing dot number parameters; wherein the printing dot number parameters include the internal resistance of the driving integrated circuit, the strobe pulse width, the printing voltage, the resistance of the heating element and the common electrode voltage drop; The single-point heating powers of all printing dots in each column of printing data are accumulated to obtain the heating power corresponding to each column of printing data.
4. The data printing method according to claim 1, characterized in that: If the heating power is distributed in the third interval, formulating the third strategy specifically includes the following steps: If the heating power is distributed in the third interval, obtaining the number of instantaneous impacts; If the number of instantaneous impacts is not greater than the first number, the number of powers in the intermediate value area is obtained; if the number of powers in the intermediate value area is less than the second number, the current sampled print data is heated in sections and in time; if the number of powers in the intermediate value area is not less than the second number, the current sampled print data is heated in sections and in time, and a sampling method of two out of one is adopted for the current sampled print data, and the sampling of two adjacent columns of print data is staggered; If the number of instantaneous impacts is greater than the first number, the currently sampled printing data is heated in sections and in time, and a sampling method of two out of one is adopted for the currently sampled printing data.
5. The data printing method according to claim 4, characterized in that: If the heating power is distributed in the fourth interval, formulating the fourth strategy specifically includes the following steps: If the heating power is distributed in the fourth interval, the printing duration is adjusted to the first duration and the number of instantaneous impacts is obtained; If the number of instantaneous impacts is not greater than the third number, the number of powers in the intermediate value region is obtained; if the number of powers in the intermediate value region is less than the fourth number, the current sampled print data is heated in sections and time-sharing, and a sampling method of two out of one is adopted for the current sampled print data; if the number of powers in the intermediate value region is not less than the fourth number, the current sampled print data is heated in sections and time-sharing, and a sampling method of three out of one is adopted for the current sampled print data; If the number of instantaneous impacts is greater than the third number, the currently sampled print data is heated in sections and in time, and a sampling method of three out of one is adopted for the currently sampled print data, and the sampling of two adjacent columns of print data is staggered.
6. The data printing method according to claim 5, characterized in that: If the heating power is distributed in the fifth interval, formulating the fifth strategy specifically includes the following steps: If the heating power is distributed in the fifth interval, adjusting the printing time to the second time and obtaining the number of instantaneous impacts; If the number of instantaneous impacts is not greater than the third number, the number of powers in the intermediate value area is obtained; if the number of powers in the intermediate value area is less than the fourth number, the current sampled print data is heated in sections and in time; if the number of powers in the intermediate value area is not less than the fourth number, the current sampled print data is heated in sections and in time, and a sampling method of two out of one is adopted for the current sampled print data; If the number of instantaneous impacts is greater than the third number, the currently sampled printing data is heated in sections and in time, and a sampling method of three out of one is adopted for the currently sampled printing data.
7. A data printing device, characterized in that: include: A data cache module (100), used for collecting print data and caching the print data in a cache area; A data sampling module (200), used for sampling printing data from the buffer area and obtaining the heating power of the sampled printing data; A strategy formulation module (300), used to formulate a heating strategy corresponding to the sampled printing data according to the heating power; A data latch module (400), used for latching the sampled printing data into a latch area; A data printing module (500) is used to read the sampled printing data from the latch area and print the sampled printing data according to the heating strategy; Wherein, formulating a heating strategy corresponding to the sampled printing data according to the heating power specifically includes the following steps: Obtaining intervals of heating power distribution; wherein the intervals include a first interval, a second interval, a third interval, a fourth interval and a fifth interval, the heating strategies include a first strategy, a second strategy, a third strategy, a fourth strategy and a fifth strategy, and the heating powers corresponding to the first interval, the second interval, the third interval, the fourth interval and the fifth interval are set in a step-by-step increasing manner; If the heating power distribution is within the first interval, the first strategy is formulated; wherein the first strategy is to heat all the currently sampled printing data point by point; If the heating power distribution is within the second interval, the second strategy is formulated; wherein the second strategy is to heat the current sampled printing data in sections and in time; If the heating power is distributed in the third interval, the third strategy is formulated; wherein the third strategy is to heat the current sampled print data in sections and in time, and adopt different sampling methods for the current sampled print data according to the distribution parameters of the sampled print data of the subsequent buffer window width obtained, the distribution parameters include the number of column print data corresponding to the instantaneous impact, the low threshold power and the intermediate value area power respectively, the instantaneous impact is that the heating power of the column print data is distributed in the third range, the low threshold power is that the heating power of the column print data is distributed in the first range, the intermediate value area power is that the heating power of the column print data is distributed in the second range, and the heating powers corresponding to the first range, the second range and the third range are set in a step-by-step increasing manner; If the heating power distribution is in the fourth interval, the fourth strategy is formulated; wherein the fourth strategy is to adjust the printing duration to the first duration, and the current sampled printing data is heated in sections and time-divided, and different sampling methods are adopted for the current sampled printing data according to the distribution parameters of the sampled printing data of the subsequent buffer window width obtained; If the heating power distribution is in the fifth interval, the fifth strategy is formulated; wherein the fifth strategy is to adjust the printing time to the second time, and the current sampled printing data is heated in segments and time-divided, and according to the distribution parameters of the sampled printing data of the subsequent buffer window width obtained, different sampling methods are adopted for the current sampled printing data.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the data printing method according to any one of claims 1 to 6 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the data printing method according to any one of claims 1 to 6 are implemented.
