CN111857608A - Printing method, printing device, terminal equipment and storage medium - Google Patents

Printing method, printing device, terminal equipment and storage medium Download PDF

Info

Publication number
CN111857608A
CN111857608A CN202010499984.8A CN202010499984A CN111857608A CN 111857608 A CN111857608 A CN 111857608A CN 202010499984 A CN202010499984 A CN 202010499984A CN 111857608 A CN111857608 A CN 111857608A
Authority
CN
China
Prior art keywords
printing
time
parameter
preset
speed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010499984.8A
Other languages
Chinese (zh)
Other versions
CN111857608B (en
Inventor
董时舫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
PAX Computer Technology Shenzhen Co Ltd
Original Assignee
PAX Computer Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by PAX Computer Technology Shenzhen Co Ltd filed Critical PAX Computer Technology Shenzhen Co Ltd
Priority to CN202010499984.8A priority Critical patent/CN111857608B/en
Publication of CN111857608A publication Critical patent/CN111857608A/en
Application granted granted Critical
Publication of CN111857608B publication Critical patent/CN111857608B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/121Facilitating exception or error detection and recovery, e.g. fault, media or consumables depleted
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B41PRINTING; LINING MACHINES; TYPEWRITERS; STAMPS
    • B41JTYPEWRITERS; SELECTIVE PRINTING MECHANISMS, i.e. MECHANISMS PRINTING OTHERWISE THAN FROM A FORME; CORRECTION OF TYPOGRAPHICAL ERRORS
    • B41J29/00Details of, or accessories for, typewriters or selective printing mechanisms not otherwise provided for
    • B41J29/38Drives, motors, controls or automatic cut-off devices for the entire printing mechanism
    • B41J29/393Devices for controlling or analysing the entire machine ; Controlling or analysing mechanical parameters involving printing of test patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1259Print job monitoring, e.g. job status

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Accessory Devices And Overall Control Thereof (AREA)

Abstract

The application is applicable to the technical field of printing, and provides a printing method, a printing device, terminal equipment and a computer readable storage medium, wherein the method comprises the following steps: obtaining the current monitoring time tiFirst printing parameters D in corresponding time windowiWherein the current monitoring time tiThe corresponding time window is the current monitoring time tiIn the previous preset time period, i is more than or equal to 2, and i is a positive integer; according to a first printing parameter D in the time windowiAdjusting the printing speed; the method and the device can solve the problems that the hardware cost needs to be increased and the error is large when the printing is controlled in the existing printing method.

Description

Printing method, printing device, terminal equipment and storage medium
Technical Field
The present application relates to the field of printing technologies, and in particular, to a printing method, a printing apparatus, a terminal device, and a computer-readable storage medium.
Background
The printing module is an important module in financial payment equipment or other electronic equipment needing to output documents. When the printing module continuously prints at high speed, the temperature of printing related devices is increased, which may cause the printing function to malfunction and even damage the printing related devices.
Currently, some printing methods control the printing speed by acquiring the temperature of the print-related device and based on the temperature of the print-related device. However, this requires adding a temperature sensor and related circuits to the hardware, which increases the hardware cost; and because the temperature sensor is easy to age under the high-temperature environment, the error in printing control is also increased.
Disclosure of Invention
In view of this, embodiments of the present application provide a printing method, a printing apparatus, a terminal device, and a computer-readable storage medium, so as to solve the problems that the existing printing method needs to increase hardware cost and has a large error when controlling printing.
A first aspect of an embodiment of the present application provides a printing method, including:
obtaining the current monitoring time tiFirst printing parameters D in corresponding time windowiWherein the current monitoring time tiThe corresponding time window is the current monitoring time tiIn the previous preset time period, i is more than or equal to 2, and i is a positive integer;
according to a first printing parameter D in the time windowiAnd adjusting the printing speed.
A second aspect of an embodiment of the present application provides a printing apparatus including:
a total print parameter acquisition unit for acquiring the current monitoring time t iFirst printing parameters D in corresponding time windowiWherein the current monitoring time tiThe corresponding time window is the current monitoring time tiIn the previous preset time period, i is more than or equal to 2, and i is a positive integer;
a printing speed adjusting unit for adjusting the printing speed according to the first printing parameter D in the time windowiAnd adjusting the printing speed.
A third aspect of an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method provided in the first aspect of the embodiment of the present application when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium storing a computer program which, when executed by one or more processors, performs the steps of the method provided by the first aspect of embodiments of the present application.
A fifth aspect of embodiments of the present application provides a computer program product comprising a computer program that, when executed by one or more processors, performs the steps of the method provided by the first aspect of embodiments of the present application.
The embodiment of the application provides a printing method, which can set monitoring time when printing is carried out, can acquire printing parameters of a preset time period before the current monitoring time at each monitoring time, and adjust the printing speed based on the printing parameters of the preset time period before the monitoring time; the printing speed is adjusted each time according to the printing parameters of a certain time period before the monitoring time, and the temperature of the printing related device at the monitoring time is related to the printing parameters of the certain time period before the monitoring time, so that the subsequent printing speed can be determined according to the printing parameters of the certain time period before the monitoring time related to the printing related device, the problem that the temperature of the printing related device is too high to improve the printing speed is avoided, or the problem that the printing speed is controlled to be too low to prevent the temperature of the printing related device from being too high is avoided, the printing speed can be accurately controlled, and the printing method provided by the embodiment of the application is a method for controlling the printing speed in a software mode, does not need to increase hardware, and also avoids the problem that errors are large due to hardware aging.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flow chart illustrating an implementation of a printing method according to an embodiment of the present application;
FIG. 2 is a logic diagram illustrating various parameters of a printing method according to an embodiment of the present disclosure;
FIG. 3 is a schematic flow chart illustrating another implementation of a printing method according to an embodiment of the present disclosure;
FIG. 4 is a schematic block diagram of a printing apparatus provided in an embodiment of the present application;
fig. 5 is a schematic block diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Fig. 1 is a schematic flow chart of an implementation of a printing method provided in an embodiment of the present application, and as shown in the figure, the method may include the following steps:
Step S101, obtaining the current monitoring time tiFirst printing parameters D in corresponding time windowiWherein the current monitoring time tiThe corresponding time window is the current monitoring time tiIn the previous preset time period, i is more than or equal to 2, and i is a positive integer.
In the embodiment of the present application, a plurality of monitoring times t may be setiFor example, a plurality of monitoring times may be generated in a preset time period T, for example, the 1 st monitoring time T12 nd monitoring time t2… … th monitoring time t of i-1 sti-1I th monitoring time ti. The time difference between adjacent monitoring instants being the time period T, i.e. T2-t1=T,ti-ti-1=T。
Each monitoring time corresponds to a time window, which may be monitoring time tiThe first N time periods. As an example, the time window of the 12 th monitoring time may be a time range represented by 6 time periods before the 12 th monitoring time, i.e. a time range between the 6 th monitoring time and the 12 th monitoring time.
Of course, in practical applications, the time period T may be preset, and the number of time periods included in the time window may also be preset, and the above example is only used to illustrate the relationship between the monitoring time and the time window, and does not represent any limitation. At the ith monitoring time t iFirst printing parameters D in corresponding time windowiFor the i-N monitoring time ti-NTo the ith monitoring time tiTotal print parameters in this time frame. By way of example, when the first print parameter is the number of print dots, the ith monitoring time tiFirst printing parameters D in corresponding time windowiFor the i-N monitoring time ti-NTo the ith monitoring time tiTotal beats in this time rangeAnd (7) printing points. When the printing parameter is the number of printing lines, the ith monitoring time tiFirst printing parameters D in corresponding time windowiFor the i-N monitoring time ti-NTo the ith monitoring time tiThe total number of printed lines in this time frame.
Therefore, the first printing parameter DiIndicating the monitoring time tiTotal print parameters within the corresponding time window. The first printing parameter may subsequently also be represented by the total printing parameter. As another embodiment of the present application, the i-N monitoring times t are obtainedi-NTo the ith monitoring time tiFirst printing parameter D in this time rangeiThe i-N monitoring time t can be seti-NTo the ith monitoring time tiAnd accumulating the second printing parameters d in a single time period corresponding to each monitoring moment determined by each monitoring moment in the time range.
By way of example, assume that the monitoring time t iCorresponding current time period TiA second printing parameter of di,TiFor the purpose of monitoring the time t from the lasti-1To the current monitoring time tiTime range of (d). At the i-N monitoring time ti-NTo the ith monitoring time tiFirst printing parameter D in this time rangeiAnd accumulating the second printing parameters in the time period corresponding to each monitoring moment in the time range: di-N+1+……+di=Di
Therefore, the second printing parameter diIndicating the slave monitoring time ti-1To monitoring time tiWithin a time range (i.e. a single time period T)i) The individual printing parameters of (1). The second print parameter may also be subsequently represented by a single print parameter.
As described above, since the time window is preset to be N time periods T, the first printing parameters in the time window corresponding to each monitoring time are the accumulation of N second printing parameters from the nth monitoring time, however, it is clear that the first printing parameters D in the time window corresponding to the 1 st monitoring time are the accumulation of N second printing parameters1Only 1 second printing parameter d is added up (d)1) (ii) a First printing parameter D in time window corresponding to 2 nd monitoring moment2Only 2 second printing parameters d are added up (d)1And d2) (ii) a First printing parameter D in time window corresponding to the N-1 th monitoring time N-1Only N-1 d accumulations (d)1、d2… … and dN-1). Although d is to be notediAnd DiAre all printing parameters, however, diRepresenting a single printing parameter within a time period T before the ith monitoring instant, DiThe total print parameters are shown N time periods T before the ith monitoring instant.
Referring to fig. 2, fig. 2 is a relationship among monitoring time, time window and printing parameters provided by the embodiment of the present application, as shown in the figure, to monitor time tiFor example, diFor monitoring the time tiCorresponding time period TiSecond printing parameter of DiFor monitoring the time tiCorresponding time window (N time periods T, or T)i-NTo ti) First printing parameter (d)i-N+1+……+di)。
As another embodiment of the present application, may also be according to Di=Di-1-di-N+diCalculating the monitoring time tiFirst printing parameters D in corresponding time windowi
Wherein D isiFor monitoring the time tiFirst printing parameters in corresponding time windows, Di-1For monitoring the time ti-1Obtained first printing parameters, di-NFor monitoring the time ti-1The earliest monitoring time t in the corresponding time windowi-NSecond printing parameter of, ti-N=ti-NT,diFor monitoring the time tiThe second printing parameter of (1).
In the embodiment of the present application, in addition to the monitoring time tiSumming the second printing parameters monitored at all the monitoring moments in the corresponding time window to obtain a first printing parameter, and utilizing the first printing parameter D calculated last time i-1And (4) obtaining.
First, D is obtained from the drawing shown in FIG. 2i-1,Di-1For monitoring the time ti-N-1To monitoring time ti-1Total number of printed dots in between, Di-1=di-N+……+di-1As described above, Di=di-N+1+……+diTherefore, Di=Di-1-di-N+di
Step S102, according to the first printing parameter D in the time windowiAnd adjusting the printing speed.
In the embodiment of the present application, as described above, the first printing parameter D within the time windowiThe number of print dots may be used, or the number of print lines may be used. For the convenience of distinction, the total number of printing points in the time window is recorded as Di1Recording the total number of printing lines in the time window as Di2Correspondingly, monitoring the time tiTime period T ofiThe number of individual print points in is noted as di1Monitoring time tiTime period T ofiInner single number of printing lines is recorded as di2
Can be the total printing point number Di1Setting an upper limit value and a lower limit value of the number of dots, or setting a total printing line number Di2And setting a line number upper limit value and a line number lower limit value.
If the first printing parameter DiContaining only one parameter, e.g. only the total number of printed dots Di1Or only the total number of printing lines Di2According to the first printing parameters D in the time windowiAdjusting the print speed comprises:
when the first printing parameter is smaller than the corresponding lower limit value (meeting a first preset condition) and the printing mode is a low-speed printing mode, adjusting the printing mode to a high-speed printing mode;
And when the first printing parameter is larger than the corresponding upper limit value (the second preset condition is met) and the printing mode is the high-speed printing mode, adjusting the printing mode to be the low-speed printing mode.
If the first printing parameter DiInvolving a plurality of parameters, e.g. including the total number of printed dots Di1And the total number of printing lines Di2According to the first printing parameters D in the time windowiAdjusting the print speed comprises:
the total printing number Di1Less than the lower limit value of dot number and/or the total number of printing lines Di2When the number of lines is less than the lower limit value (first preset condition) and the printing mode is a low-speed printing mode, adjusting the printing mode to a high-speed printing mode;
the total printing number Di1Greater than the upper limit value of dot number and/or the total number of printing lines Di2And when the number of dots is larger than the upper limit value of the number of dots (second preset condition) and the printing mode is the high-speed printing mode, adjusting the printing mode to be the low-speed printing mode.
In practical application, the lower limit value of the number of points may be recorded as a first preset value, the lower limit value of the number of lines may be recorded as a second preset value, the upper limit value of the number of points may be recorded as a third preset value, and the upper limit value of the number of lines may be recorded as a fourth preset value. Correspondingly, the first preset value is smaller than the third preset value, and the second preset value is smaller than the fourth preset value.
According to the printing method provided by the embodiment of the application, monitoring time can be set when printing is carried out, at each monitoring time, the printing parameters of the preset time period before the current monitoring time can be obtained, and the printing speed is adjusted based on the printing parameters of the preset time period before the monitoring time; since each time the printing speed is adjusted, it is determined based on the printing parameters a certain period of time before the monitoring time, and the temperature of the print-related device at the monitoring time is related to the print parameter at a time period prior to the monitoring time, therefore, the subsequent printing speed can be determined by the printing parameters of a certain time period before the monitoring time related to the printing related devices, thereby avoiding the problem of overhigh temperature of the printing related devices caused by pursuing the printing speed, or the problem of preventing the temperature of the printing-related device from being excessively high and the printing speed from being controlled excessively low is avoided, so that the printing speed can be accurately controlled, and, the printing method provided by the embodiment of the application is a method for controlling the printing speed in a software form, does not need to increase hardware, and also avoids the problem of larger error caused by hardware aging. In practical application, the subsequent printing mode is determined by setting the upper limit value and the lower limit value corresponding to the printing parameters and the current printing mode, so that the problem of overhigh temperature of printing related devices caused by overhigh speed during printing is avoided, and the problem of low printing efficiency caused by keeping low-speed printing for limiting the temperature of the printing related devices is also avoided; the printing speed is determined according to the printing parameters (printing load) in a certain time window before, the printing speed can be flexibly adjusted according to the printing load, the printing efficiency is improved, and the overhigh temperature of relevant printing devices is avoided. In general, short-time printing transactions are abundant, and thus, these conventional prints can be performed in a high-speed manner.
Fig. 3 is a schematic flow chart of another implementation of the printing method provided in the embodiment of the present application, which describes how to adjust the printing speed according to the total printing parameters in the time window in terms of data storage. As shown, the method may include the steps of:
step S301, a timed service process is called with a preset time period T.
In the embodiment of the application, a timing service process can be set, and the timing service process is hung in a timing interrupt service program or a timing task of a system. Thus, the timed service process may be invoked at an agreed time period. The timing service process is used for periodically maintaining the element updating process of the ring array.
By way of example, the time period during which the timing service process is invoked is denoted as T.
Step S302, when the timing service process runs, the storage position c of the annular structure array is obtainedi%NValue d of element(s) in (1)i-N,i>N, wherein N is more than or equal to 2 and is a positive integer, the annular structure array is provided with N storage positions, each storage position of the annular structure array stores a second printing parameter d of a time period T, and% represents a modular division operation.
In the embodiment of the present application, a plurality of variables may be set in advance. For example:
A variable C of an annular structure array for recording a second printing parameter, each element of the array being a counting structure unit, and including two elements, for continuously recording and indicating the number of single printing dots and the number of single printing lines (second printing parameter) in an appointed latest time period T, the annular structure array having N storage units (storage locations), and each storage location C being capable of storing two elements: the number of single printing points and the number of single printing lines, correspondingly, the annular structure array variable has N storage positions which are respectively c1、c2、……、cN
An indication variable i for indicating a current operation element of the ring structure array;
counting variable Di1The system is used for recording the sum of the printing points in all elements of the structure array variable, namely the total printing points (first printing parameters) in the total printing duration;
counting variable Di2The total of the number of paper feeding lines in all the elements of the variable of the structure array, that is, the total number of paper feeding lines (first printing parameter) in the total printing duration is recorded.
When printing is started, first, the element, the indication variable i, and the count variable D in each storage position C of the structure array variable C need to be seti1Counting variable Di2Are all cleared.
As an example, the ring structure array includes a plurality of units, and since each unit stores the second printing parameter in one time period, the storage location of the ring structure array stores the second printing parameters in the plurality of time periods, and assuming that N is 180 units in the ring structure array, the storage location of the ring structure array stores the total printing parameter of 180 time periods, that is, the first printing parameter.
The indication variable i is increased by 1 once each time the timing service process is called, since the ring structure array is stored in the N storage positions in the form of a ring queue, namely, the second printing parameter is stored in the last storage position c of the ring structure arrayNThen, the next time will beTwo printing parameters are stored in the first storage position c of the ring structure array1In (1). Therefore, after the indicator variable i is increased by 1, N needs to be further divided modulo to determine whether the indicator variable indicates an element in the fourth cell of the ring structure array or indicates the fourth storage location of the ring structure array.
Suppose that the ith monitoring time t is currentlyiThen the currently called period T of the service process is timediThe indication variable i indicates the storage location ci%NLast monitoring time ti-1The indicating variable i indicates c(i-1)%N
Step S303, the last monitoring time ti-1The obtained first printing parameter Di-1Minus di-NObtaining Di"-1And the position c in the ring structure arrayi%NValue d of element(s) in (1)i-NAnd (5) deleting.
In the embodiment of the present application, as shown in fig. 1 and 2, the current monitoring time t is calculatediIs calculated at the current monitoring time t iThe sum of the second printing parameters in the previous N time periods, therefore, the monitoring time t needs to be obtained firsti-1First printing parameter Di-1First printing parameter Di-1I.e. the monitoring time ti-1The sum of the values of all elements in the corresponding array of ring structures, i.e. Di-1=di-N+……+di-1For the same reason, the first printing parameter DiI.e. the monitoring time tiThe sum of the values of all elements in the corresponding array of ring structures, i.e. Di=di-N+1+……+diThus, Di=Di-1-di-N+diI.e. monitoring the time tiWithin a time window ofiAccording to the acquired monitoring time ti-1Within a time window ofi-1Monitoring time ti-NAcquired second printing parameter di-NAnd a monitoring time tiAcquired second printing parameter diThe operation process in the above steps. Is equivalent toIn the fixed time span of the time window, with one time of calling the timing service process, the time window needs to be moved backward for a time period on the time axis, and the first printing parameter of the time window at the current monitoring time subtracts the earliest second printing parameter from the first printing parameter in the time window at the last monitoring time, and adds the newly calculated second printing parameter.
Therefore, it is necessary to acquire the position c last stored in the ring structure array (i-1)%NNext storage location ci%NValue d of element(s) in (1)i-NSo as to subtract this value.
Of course, if the ring structure array is initialized to 0 when the second printing parameter D is filled in the first round of the ring structure array or the first printing parameter D is calculated in the first round, the first printing parameter D in the time window corresponding to the 1 st monitoring time is as described above1Only 1 second printing parameter d is added up (d)1) (ii) a First printing parameter D in time window corresponding to 2 nd monitoring moment2Only 2 second printing parameters d are added up (d)1And d2) (ii) a First printing parameter D in time window corresponding to the N-1 th monitoring timeN-1Only N-1 d accumulations (d)1、d2… … and dN-1). Therefore, the position c in the ring structure array does not exist from the 1 st monitoring time to the Nth monitoring timei%NValue d of element(s) in (1)i-NThe step of deleting, because now the storage location c of the array of ring structuresi%NStored therein is an initialized element value of 0, there is no value of di-N
By way of example, in the above description of the ring structure array C, C corresponds to N storage locations, and is C respectively1、c2、……、cNAt the Nth monitoring moment, the position c is stored1、c2、……、cNStored therein are the element values: d 1、d2、……、dN(ii) a At the N +1 th monitoring time, the storage position c is stored due to existence1Element d in (1)1Delete, andwill be element dN+1Is stored in a storage location c1Operation of, storing location c1、c2、……、cNThe element values stored in (a) are respectively: dN+1、d2、……、dN. As can be seen from the above description, the storage location of each element in the array is always unchanged, and the new element completes storage by replacing the old element location (i.e., deleting and being overwritten). Of course, since the storage position in the ring structure array provided by the present application is not changed, only with the monitoring time tiExtending and generating new element value di,diAre sequentially stored in N storage positions of the ring structure array according to the sequence, and when the element obtained last time is stored in the storage position cNThen the element obtained at the current time needs to be stored in the storage location c1Thereby implementing ring storage.
To facilitate the current monitoring time tiAcquired second printing parameter diStored in an array of ring structures at the last monitoring time ti-1The obtained first printing parameter Di-1Minus di-NThen, the position c in the ring structure array is determinedi%NValue d of element(s) in (1)i-NAnd (5) deleting.
In addition, it should be noted that the second printing parameter diIs related to the monitoring time tiCorrespondingly, for example, when N is 3, the time t is monitored 8The corresponding second printing parameter is d8D is required to be8Is stored in a storage location c8%3(c2) However, since last at storage location c2Stored therein as the monitoring time t5Corresponding second printing parameter d5Therefore, it is necessary to acquire the storage location c8%3Value d of element(s) in (1)8-3And c is8%3Element d in (1)5Clearing is 0 to facilitate subsequent d8Is stored in c8%3(c2) I.e. the process is to8Covered off d5For d, for1、d2、d3In other words, the store time covers the initialized 0 in the ring structure array.
Step S304, monitoring the current time period TiSecond printing parameter diWherein, TiFor the purpose of monitoring the time t from the lasti-1To the current monitoring time tiTime range of (d).
Step S305, the second printing parameter diStoring the storage positions c in the ring structure array according to the sequencei%NIn (1).
In the embodiment of the application, the monitoring time t is obtainediAcquired printing parameter diThen, the printing parameter d needs to be setiCell c stored in ring structure arrayi%NIn the above, as mentioned previously, the cell c of the ring structure array has been already formedi%NValue d of element (1)i-NDeleted, so the currently obtained value d can be usediCell c stored in ring structure arrayi%NThereby realizing that d is iCovering off the storage position c of the ring structure arrayi%NElement d in (1)i-N
Step S306, the timing service process is suspended.
In the embodiment of the application, in order to ensure atomicity of operations on the ring structure array and the pointer variable i and avoid data errors caused by access contention, the timing service needs to be suspended. The method can be performed by adopting common control technologies such as closing corresponding timed interrupt, setting control variable or acquiring semaphore. And will not be described in detail herein.
Step S307, obtaining Di"-1Plus diThe obtained current monitoring time tiPrinting parameter D in corresponding time windowi
In the embodiment of the application, after the timing service process is suspended, data confusion or errors caused by access competition are avoided. Therefore, the last monitoring time t can be seti-1The obtained first printing parameter Di-1Minus a second printing parameter di-NThen, the second printing parameter d is subtractedi-NThe latter first printing parameter Di-1Plus the current monitoring time tiSecond printing parameter diThus, the current monitoring time t can be obtainediFirst printing parameters D in corresponding time windowi
Step S308, the timing service process is opened.
In the embodiment of the application, the current monitoring time t is calculated after ensuring iFirst printing parameters D in corresponding time windowiThereafter, the timed service process may continue to be opened.
Subsequently, the loop execution of steps S301 to S308 is continued.
In the embodiment of the application, the printing method is described from the data storage perspective, the second printing parameter D is stored in the annular structure array, and the number of units in the annular structure array can be preset, so that the time length of the time window is determined, and the error in calculating the first printing parameter D based on the stored data in the annular structure array is avoided through the timing service process in the calculating process.
The method for adjusting the printing speed according to the first printing parameter D may refer to the description in the embodiment shown in fig. 1, and will not be described herein again.
As an application scenario of the present application, at the beginning of printing, the low-speed printing mode may be preset, because the elements in the storage location of the structure array variable C, the indication variable i, and the count variable Di1Counting variable Di2If all the printing parameters are zero-cleared, the first printing parameters D in the time window are smaller (corresponding to the accumulation of a plurality of second printing parameters D with the value of 0), so that any one of the first printing parameters can be determined to be smaller than the corresponding lower limit value, and therefore, the high-speed mode can be adjusted until any one of the first printing parameters D in the time window corresponding to the monitoring time is larger than the corresponding upper limit value, and then the low-speed printing mode is adjusted.
As another application scenario of the present application, at the beginning of printing, a high-speed printing mode may be set in advance, because the elements in the storage location of the structure array variable C, the indication variable i, and the count variable Di1Counting variable Di2All zero clearing is carried out, the first printing parameter D in the time window is smaller (equivalent to thatMany second printing parameters D with the value of 0 are accumulated), so that it can be determined that any one of the first printing parameters is smaller than the corresponding lower limit value, and therefore, the printing mode does not need to be adjusted until any one of the first printing parameters D in the time window corresponding to the monitoring time is larger than the corresponding upper limit value, and then the printing mode is adjusted to the low-speed printing mode.
It can be seen from the above two application scenarios that, in fact, no matter whether the low-speed printing mode or the high-speed printing mode is set at the beginning, the embodiment of the present application is not affected, and certainly, in order to obtain the current printing mode in time, a printing mode variable may be set in advance, for example, when the variable is 0, the variable represents the low-speed printing mode, and when the variable is 1, the variable represents the high-speed printing mode, and when the printing mode is switched, the variable is correspondingly switched to a value together.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 4 is a schematic block diagram of a printing apparatus according to an embodiment of the present application, and only a part related to the embodiment of the present application is shown for convenience of explanation.
The printing device 4 may be a software unit, a hardware unit, or a combination of software and hardware unit built in a terminal device such as a mobile phone, a tablet computer, a notebook computer, a POS machine, or a printer, may be integrated into a terminal device such as a mobile phone, a tablet computer, a notebook computer, a POS machine, or a printer as an independent pendant, or may exist as an independent terminal device.
The printing apparatus 4 includes:
a total print parameter acquisition unit 41 for acquiring the current monitoring time tiFirst printing parameters D in corresponding time windowiWherein the current monitoring time tiThe corresponding time window is the current monitoring time tiIn the previous preset time period, i is more than or equal to 2, and i is a positive integer;
a printing speed adjusting unit 42 for adjusting the printing speed according to the received dataA first printing parameter D in the time windowiAnd adjusting the printing speed.
As another embodiment, the printing apparatus 4 further includes:
a single print parameter acquisition unit 43 for acquiring the current monitoring time tiFirst printing parameters D in corresponding time window iPreviously, the current time period T is monitored by a preset time period TiSecond printing parameter diWherein, TiFor the purpose of monitoring the time t from the lasti-1To the current monitoring time tiThe preset time period is N time periods T, N is more than or equal to 2, and N is a positive integer.
As another embodiment, the printing apparatus 4 further includes:
a data storage unit 44 for monitoring the current time period T at a preset time period TiSecond printing parameter diThen, the second printing parameter d is setiSequentially storing the data in the storage positions c of the preset ring structure arrayi%NWherein,% represents a modulo division operation, the annular configuration array having N storage locations, each storage location of the annular configuration array storing a second printing parameter d for a time period T.
As another embodiment, the printing apparatus 4 further includes:
a timed service process calling unit 45, configured to call a timed service process at a preset time period T;
acquiring the storage position c of the annular structure array when the timing service process runsi%NValue d of element(s) in (1)i-NWherein i is>N;
The last monitoring time ti-1The obtained first printing parameter Di-1Minus di-NObtaining D i"-1And the position c in the ring structure arrayi%NValue d of element(s) in (1)i-NAnd (5) deleting.
As another embodiment, the total printing parameter acquiring unit 41 is further configured to:
suspending the timed service process;
d to be obtainedi"-1Adding a second printing parameter diObtaining the current monitoring time tiFirst printing parameters D in corresponding time windowi
And opening the timing service process.
As another embodiment, the printing speed adjusting unit 42 is further configured to:
when the first printing parameter DiWhen a first preset condition is met and the printing mode is a low-speed printing mode, adjusting the printing mode to be a high-speed printing mode;
when the first printing parameter DiAnd when a second preset condition is met and the printing mode is a high-speed printing mode, adjusting the printing mode to be a low-speed printing mode.
As another example, the first printing parameter DiThe method comprises the following steps: total number of printing dots Di1And/or the total number of printing lines Di2
When the first printing parameter DiThe method comprises the following steps: total number of printing dots Di1And the total number of printing lines Di2While, the first printing parameter DiSatisfying the first preset condition includes: the total printing point number is smaller than a first preset value and/or the total printing line number is smaller than a second preset value; the first printing parameter D iSatisfying the second preset condition includes: the total printing point number is larger than a third preset value and/or the total printing line number is larger than a fourth preset value;
wherein the first preset value is smaller than the third preset value, and the second preset value is smaller than the fourth preset value.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of each functional unit is illustrated, and in practical applications, the above-mentioned functional allocation may be performed by different functional units or modules according to requirements, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the above-mentioned apparatus may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Fig. 5 is a schematic block diagram of a terminal device according to an embodiment of the present application. As shown in fig. 5, the terminal device 5 of this embodiment includes: one or more processors 50, a memory 51 and a computer program 52 stored in said memory 51 and executable on said processors 50. The processor 50, when executing the computer program 52, implements the steps in the various method embodiments described above, such as the steps S101 to S102 shown in fig. 1. Alternatively, the processor 50, when executing the computer program 52, implements the functions of the modules/units in the above-described apparatus embodiments, such as the functions of the modules 41 to 42 shown in fig. 4.
Illustratively, the computer program 52 may be partitioned into one or more modules/units, which are stored in the memory 51 and executed by the processor 50 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 52 in the terminal device 5. For example, the computer program 52 may be divided into an overall printing parameter acquisition unit, a printing speed adjustment unit, exemplarily:
A total print parameter acquisition unit for acquiring the current monitoring time tiWhen corresponding toFirst printing parameter D in the windowiWherein the current monitoring time tiThe corresponding time window is the current monitoring time tiIn the previous preset time period, i is more than or equal to 2, and i is a positive integer;
a printing speed adjusting unit for adjusting the printing speed according to the first printing parameter D in the time windowiAnd adjusting the printing speed.
Other units or modules can be referred to the description of the embodiment shown in fig. 4, and are not described again here.
The terminal device includes, but is not limited to, a processor 50 and a memory 51. It will be understood by those skilled in the art that fig. 5 is only one example of a terminal device 5, and does not constitute a limitation to the terminal device 5, and may include more or less components than those shown, or combine some components, or different components, for example, the terminal device 5 may further include an input device, an output device, a network access device, a bus, etc.
The Processor 50 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may be an internal storage unit of the terminal device 5, such as a hard disk or a memory of the terminal device 5. The memory 51 may also be an external storage device of the terminal device 5, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the terminal device 5. The memory 51 is used for storing the computer program and other programs and data required by the terminal device 5. The memory 51 may also be used to temporarily store data that has been output or is to be output.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed terminal device, apparatus and method may be implemented in other ways. For example, the above-described terminal device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical function division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the method embodiments described above when the computer program is executed by one or more processors.
Also, as a computer program product, when the computer program product runs on a terminal device, the terminal device is enabled to implement the steps in the above-mentioned method embodiments when executed.
Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, etc. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method of printing, comprising:
obtaining the current monitoring time tiFirst printing parameters D in corresponding time windowiWherein the current monitoring time tiThe corresponding time window is the current monitoring time tiIn the previous preset time period, i is more than or equal to 2, and i is a positive integer;
according to a first printing parameter D in the time windowiAnd adjusting the printing speed.
2. The printing method of claim 1, wherein the current monitoring time t is acquirediFirst printing parameters D in corresponding time windowiBefore, still include:
monitoring the current time period T by a preset time period T iSecond printing parameter diWherein, TiFor the purpose of monitoring the time t from the lasti-1To the current monitoring time tiThe preset time period is N time periods T, N is more than or equal to 2, and N is a positive integer.
3. A printing method according to claim 2, wherein the current time period T is monitored at a preset time period TiSecond printing parameter diThen, the method further comprises the following steps:
the second printing parameter diSequentially storing the data in the storage positions c of the preset ring structure arrayi%NWherein,% represents a modulo division operation, the annular configuration array having N storage locations, each storage location of the annular configuration array storing a second printing parameter d for a time period T.
4. A printing method according to claim 3, wherein the current time period T is monitored at a preset time period TiSecond printing parameter diBefore, still include:
calling a timing service process according to a preset time period T;
acquiring the storage position c of the annular structure array when the timing service process runsi%NValue d of element(s) in (1)i-NWherein i is>N;
The last monitoring time ti-1The obtained first printing parameter Di-1Minus di-NObtaining D ″) i-1And the position c in the ring structure arrayi%NValue d of element(s) in (1)i-NAnd (5) deleting.
5. The printing method of claim 4, wherein said obtaining a current monitoring time tiFirst printing parameters D in corresponding time windowiThe method comprises the following steps:
suspending the timed service process;
d' to be obtainedi-1Adding a second printing parameter diObtaining the current monitoring time tiFirst printing parameters D in corresponding time windowi
And opening the timing service process.
6. The printing method of claim 1, wherein said first printing parameter D is dependent on said time windowiAdjusting the print speed comprises:
when the first printing parameter DiWhen a first preset condition is met and the printing mode is a low-speed printing mode, adjusting the printing mode to be a high-speed printing mode;
when the first printing parameter DiAnd when a second preset condition is met and the printing mode is a high-speed printing mode, adjusting the printing mode to be a low-speed printing mode.
7. As in claimThe printing method as claimed in claim 6, wherein said first printing parameter DiThe method comprises the following steps: total number of printing dots Di1And/or the total number of printing lines Di2
When the first printing parameter DiIncluding the total number of printed dots D i1And the total number of printing lines Di2While, the first printing parameter DiSatisfying the first preset condition includes: the total printing point number is smaller than a first preset value and/or the total printing line number is smaller than a second preset value; the first printing parameter DiSatisfying the second preset condition includes: the total printing point number is larger than a third preset value and/or the total printing line number is larger than a fourth preset value;
wherein the first preset value is smaller than the third preset value, and the second preset value is smaller than the fourth preset value.
8. A printing apparatus, comprising:
a total print parameter acquisition unit for acquiring the current monitoring time tiFirst printing parameters D in corresponding time windowiWherein the current monitoring time tiThe corresponding time window is the current monitoring time tiIn the previous preset time period, i is more than or equal to 2, and i is a positive integer;
a printing speed adjusting unit for adjusting the printing speed according to the first printing parameter D in the time windowiAnd adjusting the printing speed.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by one or more processors, implements the steps of the method according to any one of claims 1 to 7.
CN202010499984.8A 2020-06-04 2020-06-04 Printing method, printing device, terminal equipment and storage medium Active CN111857608B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010499984.8A CN111857608B (en) 2020-06-04 2020-06-04 Printing method, printing device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010499984.8A CN111857608B (en) 2020-06-04 2020-06-04 Printing method, printing device, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111857608A true CN111857608A (en) 2020-10-30
CN111857608B CN111857608B (en) 2024-01-26

Family

ID=72985463

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010499984.8A Active CN111857608B (en) 2020-06-04 2020-06-04 Printing method, printing device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111857608B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005128135A (en) * 2003-10-22 2005-05-19 Kyocera Mita Corp Image forming apparatus and control program for the same
US20060075909A1 (en) * 2004-10-13 2006-04-13 Tohoku Ricoh Co., Ltd. Printer
JP2007055238A (en) * 2005-07-25 2007-03-08 Seiko Epson Corp Thermal printer, control method of thermal printer and printing system
JP2007055239A (en) * 2005-07-25 2007-03-08 Seiko Epson Corp Thermal printer and its control method
CN103568592A (en) * 2012-08-02 2014-02-12 东芝泰格有限公司 Electronic device and control method thereof
US20140168704A1 (en) * 2012-12-19 2014-06-19 Konica Minolta, Inc. Image forming apparatus
JP2016031602A (en) * 2014-07-28 2016-03-07 キヤノン株式会社 Server, printer, and control method thereof, and program
US20190091996A1 (en) * 2017-09-27 2019-03-28 Casio Computer Co., Ltd. Printing device, printing method, and storage medium
CN110442311A (en) * 2019-06-14 2019-11-12 厦门汉印电子技术有限公司 A kind of adaptive Method of printing, device and printer

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005128135A (en) * 2003-10-22 2005-05-19 Kyocera Mita Corp Image forming apparatus and control program for the same
US20060075909A1 (en) * 2004-10-13 2006-04-13 Tohoku Ricoh Co., Ltd. Printer
JP2007055238A (en) * 2005-07-25 2007-03-08 Seiko Epson Corp Thermal printer, control method of thermal printer and printing system
JP2007055239A (en) * 2005-07-25 2007-03-08 Seiko Epson Corp Thermal printer and its control method
CN103568592A (en) * 2012-08-02 2014-02-12 东芝泰格有限公司 Electronic device and control method thereof
US20140168704A1 (en) * 2012-12-19 2014-06-19 Konica Minolta, Inc. Image forming apparatus
JP2014119676A (en) * 2012-12-19 2014-06-30 Konica Minolta Inc Image forming apparatus
JP2016031602A (en) * 2014-07-28 2016-03-07 キヤノン株式会社 Server, printer, and control method thereof, and program
US20190091996A1 (en) * 2017-09-27 2019-03-28 Casio Computer Co., Ltd. Printing device, printing method, and storage medium
CN110442311A (en) * 2019-06-14 2019-11-12 厦门汉印电子技术有限公司 A kind of adaptive Method of printing, device and printer

Also Published As

Publication number Publication date
CN111857608B (en) 2024-01-26

Similar Documents

Publication Publication Date Title
US9462091B2 (en) Information processing apparatus, communication method and storage medium
CN108711047B (en) Automatic repayment method, system and terminal equipment
US20130091311A1 (en) Device management using a dedicated management interface
CN107580071A (en) Master-slave equipment upgrade method, device and its equipment
CN109445954B (en) Timing task execution method, terminal device and storage medium
CN102608923B (en) Control system and SOE device
EP0079698B1 (en) Data processing system with apparatus for controlling program interrupts
KR20030021409A (en) cpu task occupation ratio testing equipment of the realtime system
US20100306430A1 (en) Bus control system and semiconductor integrated circuit
CN111857608A (en) Printing method, printing device, terminal equipment and storage medium
US20100312924A1 (en) Network processor, reception controller and data reception processing method performing direct memory access transfer
CN114174939B (en) Programmable logic controller, setting tool, and recording medium
CN111367494B (en) Serial data frame receiving method and device
CN205608739U (en) RFID read -write system who possesses receiving and dispatching beacon function
CN111680289B (en) Chained hash stack operation method and device
CN111061518B (en) Data processing method, system, terminal equipment and storage medium based on drive node
CN111950879A (en) Queuing arbitration method and device for processes and terminal equipment
US8564465B2 (en) Analog to digital conversion apparatus with a reduced number of ADCs
CN111722671B (en) Timing method, timing device, terminal equipment and storage medium
CN108700874A (en) A kind of graphic display method of data flow, system and automotive diagnostic installation
CN114928378B (en) Single-wire signal transmission method and device and electronic equipment
US3483328A (en) Method for registering signal pulses occurring on a signal line in random sequence
CN108536618B (en) Thickness data filtering method, system, device and computer readable storage medium
JP2527066B2 (en) Reception queue processor
CN107798041A (en) Declaration form date storage method, device and terminal device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant