CN112799618A - Control method, device and equipment of printer - Google Patents
Control method, device and equipment of printer Download PDFInfo
- Publication number
- CN112799618A CN112799618A CN202110171372.0A CN202110171372A CN112799618A CN 112799618 A CN112799618 A CN 112799618A CN 202110171372 A CN202110171372 A CN 202110171372A CN 112799618 A CN112799618 A CN 112799618A
- Authority
- CN
- China
- Prior art keywords
- printing
- client
- task
- current
- processing
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 55
- 238000007639 printing Methods 0.000 claims abstract description 202
- 230000008569 process Effects 0.000 claims description 14
- 238000004590 computer program Methods 0.000 claims description 7
- 238000001514 detection method Methods 0.000 claims description 4
- 238000010276 construction Methods 0.000 claims description 3
- 230000001360 synchronised effect Effects 0.000 abstract description 3
- 230000006870 function Effects 0.000 description 8
- 230000003993 interaction Effects 0.000 description 3
- 230000003139 buffering effect Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1202—Dedicated interfaces to print systems specifically adapted to achieve a particular effect
- G06F3/1211—Improving printing performance
- G06F3/1215—Improving printing performance achieving increased printing speed, i.e. reducing the time between printing start and printing end
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1223—Dedicated interfaces to print systems specifically adapted to use a particular technique
- G06F3/1237—Print job management
- G06F3/1259—Print job monitoring, e.g. job status
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1223—Dedicated interfaces to print systems specifically adapted to use a particular technique
- G06F3/1237—Print job management
- G06F3/126—Job scheduling, e.g. queuing, determine appropriate device
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1278—Dedicated interfaces to print systems specifically adapted to adopt a particular infrastructure
- G06F3/1279—Controller construction, e.g. aspects of the interface hardware
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1278—Dedicated interfaces to print systems specifically adapted to adopt a particular infrastructure
- G06F3/1285—Remote printer device, e.g. being remote from client or server
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5018—Thread allocation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Software Systems (AREA)
- Accessory Devices And Overall Control Thereof (AREA)
Abstract
The application relates to a control method, a control device and control equipment of a printer, wherein the control method of the printer comprises the following steps: receiving a network connection request sent by a client, and establishing network connection with the client according to the network connection request; receiving a printing request sent by a client, and detecting whether the current running state is in a non-printing working state; if the printing machine is in a non-printing working state, establishing an asynchronous thread; and receiving the printing tasks sent by the client, and sequentially sending the printing tasks to the processing queue of the asynchronous thread for printing processing according to the sequence. Therefore, the synchronous operation of the printing work and the non-printing work of the printer can be realized, the operation time is saved, and the work efficiency of operators is effectively improved.
Description
Technical Field
The application relates to the technical field of printer control, in particular to a control method, device and equipment of a printer.
Background
With the rapid development of printing technology, printers with various functions are also in the coming stage.
At present, the printer that logistics worker used is mostly bluetooth printer, utilizes bluetooth printer to take the operation such as a receipt, scanning and printing express delivery list. However, when the logistics worker uses the bluetooth printer to print, the logistics worker needs to wait for the printing task to be finished before performing other operations. Due to the time required for printing, logistics workers are prone to wait for a long time during printing, and especially when the printing task amount is large, the work efficiency of the logistics workers can be seriously affected.
Disclosure of Invention
In view of the above, an object of the present application is to overcome the deficiencies of the prior art and to provide a method, an apparatus and a device for controlling a printer.
In order to achieve the purpose, the following technical scheme is adopted in the application:
a first aspect of the present application provides a control method of a printer, including:
receiving a network connection request sent by a client, and establishing network connection with the client according to the network connection request;
receiving a printing request sent by the client, and detecting whether the current running state is in a non-printing working state;
if the printing machine is in a non-printing working state, establishing an asynchronous thread;
and receiving the printing tasks sent by the client, and sequentially sending the printing tasks to the processing queue of the asynchronous thread for printing processing.
Optionally, the sequentially sending the print jobs to the processing queue of the asynchronous thread for print processing includes:
determining a current print job in the processing queue;
acquiring corresponding printing data according to the current printing task and printing;
and after the current printing task is detected to be finished, sending a call-back instruction to process the next printing task until the printing tasks in the processing queue are processed.
Optionally, the obtaining and printing corresponding print data according to the current print task includes:
according to the current printing task, calling printing data corresponding to the current printing task from the client;
and if the calling is successful, caching the printing data into the processing queue for printing.
Optionally, after the print data corresponding to the current print job is called from the client, the method further includes:
and if the calling fails, marking the current printing task as printing failure, and finishing the current printing task.
Optionally, after detecting that the current print task is ended, sending a callback instruction includes:
if the current printing task is successfully completed, sending a successful callback instruction to the client;
and if the current printing task is not successfully completed, acquiring a failure reason, and sending the failure reason and the failed callback instruction to the client so that the client uploads the failure reason to a server and displays the failure reason to a user.
Optionally, the method further includes:
receiving a printing task interruption request sent by the client;
searching a print task corresponding to the print task interruption request from the processing queue, and detecting the processing state of the corresponding print task;
if the processing state is a state to be printed, deleting the corresponding printing task from the processing queue; and if the processing state is the printing state, stopping printing the current printing task and ending the current printing task.
Optionally, the non-printing working state includes a scanning state and a pull-up state.
Optionally, after receiving the print job sent by the client, the method further includes:
and acquiring the processing state of the printing task and updating the processing state to the client.
A second aspect of the present application provides a control apparatus of a printer, comprising:
the first building module is used for receiving a network connection request sent by a client and building network connection with the client according to the network connection request;
the detection module is used for receiving the printing request sent by the client and detecting whether the current running state is in a non-printing working state;
the second construction module is used for establishing an asynchronous thread when the current running state is detected to be in a non-printing working state;
and the printing processing module is used for receiving the printing tasks sent by the client and sequentially sending the printing tasks to the processing queue of the asynchronous thread for printing processing.
A third aspect of the present application provides a control apparatus of a printer, comprising:
a processor, and a memory coupled to the processor;
the memory is used for storing a computer program;
the processor is configured to invoke and execute the computer program in the memory to perform the method according to the first aspect of the application.
The technical scheme provided by the application can comprise the following beneficial effects:
according to the scheme, the network connection relation is established between the received network connection request sent by the client and the client, and a network foundation is laid for realizing data interaction with the client. After a printing request sent by a client is received, whether the current running state is in a non-printing working state is detected, so that whether other work is carried out while the current non-printing working is confirmed. If the printing job is currently in a non-printing job state, namely other jobs are executed although no printing job is currently performed, at this time, an asynchronous thread is established so that the printing job can be executed while the execution of other jobs is not affected. And after receiving the printing tasks sent by the client, sequentially sending the printing tasks to a processing queue of the asynchronous thread in sequence for printing processing. Therefore, the synchronous operation of the printing work and the non-printing work of the printer can be realized, the operation time is saved, and the work efficiency of operators is effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a control method of a printer according to an embodiment of the present application.
Fig. 2 is a schematic structural diagram of a control device of a printer according to another embodiment of the present application.
Fig. 3 is a schematic structural diagram of a control device of a printer according to another embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail below. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a flowchart of a control method of a printer according to an embodiment of the present application. The embodiment provides a control method of a printer, and as shown in the figure, the method may specifically include the following steps:
and step 11, receiving a network connection request sent by the client, and establishing network connection with the client according to the network connection request.
In implementation, the printer may be used as an execution body, and network connection between the printer and the client is realized by receiving a network connection signal sent by the client. For example, the printer is a bluetooth printer, and the user can use the mobile phone as a client to establish a connection with the bluetooth printer through bluetooth, so that the bluetooth printer and the mobile phone can perform data interaction.
And step 12, receiving a printing request sent by the client, and detecting whether the current running state is in a non-printing working state.
After establishing network connection with the client, a print request sent by the client may be received, and when the print request is received, whether the current operating state is in a print state and whether the current operating state is in other operating states may be detected. The detection in this case can confirm whether the printer is currently executing the printing function on the one hand and whether the printer is executing other non-printing functions on the other hand.
If the printer is currently being executed with the print function, the received print request may be processed in an existing print processing manner; if the printer is in an operating state to perform other non-printing functions, step 13 is performed.
The non-printing working state can comprise a scanning state and a pulling state.
And step 13, establishing an asynchronous thread.
In order to make the printer still able to print when in other working states, after confirming that the printer is in a non-printing working state, a queue of asynchronous threads can be created by establishing asynchronous threads to process the subsequent printing tasks. In this way, the main thread can continue to execute non-print jobs, while the asynchronous thread is dedicated to processing print jobs, enabling printing to proceed synchronously with other operations.
And step 14, receiving the printing tasks sent by the client, and sequentially sending the printing tasks to a processing queue of the asynchronous thread for printing processing.
In practice, the print job may be plural. During the network connection relation with the client, once the print tasks sent by the client are received, the received print tasks are sent to a processing queue of an asynchronous thread for sequencing and waiting until being printed and processed.
In the embodiment, the network connection relation is established with the client according to the received network connection request sent by the client, so that a network foundation is laid for realizing data interaction with the client. After a printing request sent by a client is received, whether the current running state is in a non-printing working state is detected, so that whether other work is carried out while the current non-printing working is confirmed. If the printing job is currently in a non-printing job state, namely other jobs are executed although no printing job is currently performed, at this time, an asynchronous thread is established so that the printing job can be executed while the execution of other jobs is not affected. And after receiving the printing tasks sent by the client, sequentially sending the printing tasks to a processing queue of the asynchronous thread in sequence for printing processing. Therefore, the synchronous operation of the printing work and the non-printing work of the printer can be realized, the operation time is saved, and the work efficiency of operators is effectively improved.
In specific implementation, the execution main body of the control method of the printer may be the printer, or may be a functional module based on software and/or hardware in the printer, or may be another device, or the like.
In order to facilitate the user to know the printing process of the printing task in real time, in some embodiments, after receiving the printing task sent by the client, the method for controlling the printer may further include: and acquiring the processing state of the printing task and updating the processing state to the client.
In a specific implementation, during the process of printing a plurality of print jobs, the printer can only process one print job at a time, so the plurality of print jobs in the processing queue need to be ordered and wait. After the processing states of the plurality of print tasks are acquired, the processing states can be updated to the client in real time, and a display interface of the client can display the print information of each print task. The print information may include: identification information of the print job, processing status, and time of print job setup. Wherein each print job has its unique identification information. Therefore, the user can know the processing condition of each printing task in real time according to the printing information updated to the client, and logistics workers can check the printing tasks more conveniently.
In some embodiments, when sequentially sending print jobs to a processing queue of an asynchronous thread for print processing, the method may specifically include the following steps: determining a current print job in a processing queue; acquiring corresponding printing data according to the current printing task and printing; and after the current printing task is detected to be finished, sending a callback instruction to process the next printing task until the printing tasks in the processing queue are processed.
When the problem of asynchronous threads is solved, a scheme of multi-core threads in the control method of the printer can be realized based on a multi-thread optimization (GCD) of a C language package. The GCD is mainly used for optimizing concurrent tasks which can be executed by a program supporting a multi-core processor in a thread pool mode. After the GCD is determined to be used, since the print jobs placed in the processing queue are substantially combined data combined by CPCL instructions, the printer as an execution subject can make corresponding print operations by recognizing the CPCL instructions, and what the processing queue needs to do is to process the next print job after the printer has processed one print job and thrown a callback instruction. Since callbacks are asynchronous in nature, a semaphore mechanism in the GCD may be introduced in order to enable the processing queue to process the printer's callbacks one by one. Similar to the semaphore consumption mechanism in an operating system, in practice, a semaphore is first created and the print job is then allowed to consume the created semaphore. In the process of consuming the semaphore, other print tasks wait for the semaphore to be consumed until the print task consumes the semaphore, so that the problem that the processing queue executes the print work in the asynchronous thread is solved, and the print work is effectively and independently performed.
In some embodiments, when acquiring and printing corresponding print data according to a current print job, the following steps may be specifically performed: according to the current printing task, calling printing data corresponding to the current printing task from the client; and if the calling is successful, buffering the printing data into a processing queue for printing.
When the printing tasks are printed, the printer firstly acquires corresponding printing data from a client end establishing a network link relation according to the current printing task and caches the acquired printing data in the processing queue for printing.
However, due to external multiple factors, a failure of the printer to acquire print data may occur. For this, the control method of the printer may further include: and if the calling fails, marking the current printing task as printing failure, and finishing the current printing task. Therefore, subsequent printing tasks can be processed continuously, and the printing efficiency is ensured while the whole printing process is not influenced.
Accordingly, after the end of the current print job is detected, the completion condition of the print job can be detected. If the current printing task is successfully completed, a successful callback instruction can be sent to the client so as to inform the client of completing the current printing task and prepare for next-step calling of printing data. If the current printing task is not successfully completed, the failure reason is obtained, and the failure reason and the failure callback instruction are sent to the client side, so that the client side uploads the failure reason to the server and displays the failure reason to the user.
In some embodiments, the control method of the printer may further include: receiving a printing task interruption request sent by a client; searching a print task corresponding to the print task interruption request from the processing queue, and detecting the processing state of the corresponding print task; if the processing state is a state to be printed, deleting the corresponding printing task from the processing queue; and if the processing state is the printing state, stopping printing the current printing task and ending the current printing task. Therefore, after the user sends the printing tasks, the user can also interrupt some or all printing tasks according to the requirement of the user.
In addition, the client may also end the print job by interrupting the network connection. In implementation, after the client interrupts the currently established network connection relationship, the printer cannot acquire the print data from the client through the print tasks in the processing queue, and the acquisition of the print data fails and the print task ends.
Similarly, the occurrence of unexpected situations, such as APP being killed, printer power failure, abnormal or irregular operation of the printer system, etc., may also cause printing to be interrupted, which in turn causes printing failure. In order to cope with such unexpected situations, the print data of the client may be backed up in advance and synchronously backed up to the corresponding server, so as to facilitate the loss of the print data. Or, after the printer obtains the print job, the corresponding print data can be called immediately, and the print job and the corresponding print data are put into a processing queue for printing processing.
Based on the same technical concept, the present embodiment provides a control device of a printer, as shown in fig. 2, the device may specifically include: a first building module 201, configured to receive a network connection request sent by a client, and establish a network connection with the client according to the network connection request; the detection module 202 is configured to receive a print request sent by a client, and detect whether a current operating state is in a non-print working state; the second construction module 203 is used for establishing an asynchronous thread when the current running state is detected to be in a non-printing working state; and the print processing module 204 is configured to receive print tasks sent by the client, and sequentially send the print tasks to the processing queue of the asynchronous thread in sequence for print processing.
The non-printing working state can comprise a scanning state and a pulling state.
Optionally, the print jobs are sequentially sent to the processing queue of the asynchronous thread for print processing, and the print processing module 204 may be configured to: determining a current print job in a processing queue; acquiring corresponding printing data according to the current printing task and printing; and after the current printing task is detected to be finished, sending a callback instruction to process the next printing task until the printing tasks in the processing queue are processed.
Optionally, the corresponding print data is acquired and printed according to the current print task, and the print processing module 204 may be specifically configured to: according to the current printing task, calling printing data corresponding to the current printing task from the client; and if the calling is successful, buffering the printing data into a processing queue for printing.
Optionally, after the print data corresponding to the current print job is called from the client, the print processing module 204 may be further configured to: and if the printing data corresponding to the current printing task is not retrieved from the client, marking the current printing task as printing failure, and ending the current printing task.
Optionally, after detecting that the current print task is ended, a callback instruction is sent, and the print processing module 204 may be specifically configured to: if the current printing task is successfully completed, sending a successful callback instruction to the client; similarly, if the current printing task is not successfully completed, the failure reason is obtained, and the failure reason and the failure callback instruction are sent to the client, so that the client uploads the failure reason to the server and displays the failure reason to the user.
Optionally, the control device of the printer may further include an interrupt processing module, where the interrupt processing module is configured to: receiving a printing task interruption request sent by a client; searching a print task corresponding to the print task interruption request from the processing queue, and detecting the processing state of the corresponding print task; if the processing state is a state to be printed, deleting the corresponding printing task from the processing queue; and if the processing state is the printing state, stopping printing the current printing task and ending the current printing task.
Optionally, after receiving the print job sent by the client, the print processing module 204 may be further configured to: and acquiring the processing state of the printing task and updating the processing state to the client.
For a specific implementation of the control apparatus of the printer provided in this embodiment, reference may be made to the implementation of the control method of the printer described in any of the above embodiments, and details are not described here again.
Based on the same technical concept, the present embodiment provides a control device of a printer, as shown in fig. 3, the device may specifically include: a processor 301, and a memory 302 connected to the processor 301; the memory 302 is used to store computer programs; the processor 301 is configured to call and execute a computer program in the memory 302 to execute the control method of the printer according to any of the above embodiments.
For a specific implementation of the control device of the printer provided in this embodiment, reference may be made to the implementation of the control method of the printer described in any of the above embodiments, and details are not described here again.
Embodiments of the present application provide a storage medium storing a computer program which, when executed by a processor, implements the steps of the control method of a printer as described in any of the above embodiments.
It is understood that the same or similar parts in the above embodiments may be mutually referred to, and the same or similar parts in other embodiments may be referred to for the content which is not described in detail in some embodiments.
It should be noted that, in the description of the present application, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present application, the meaning of "a plurality" means at least two unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.
Claims (10)
1. A control method of a printer, characterized by comprising:
receiving a network connection request sent by a client, and establishing network connection with the client according to the network connection request;
receiving a printing request sent by the client, and detecting whether the current running state is in a non-printing working state;
if the printing machine is in a non-printing working state, establishing an asynchronous thread;
and receiving the printing tasks sent by the client, and sequentially sending the printing tasks to the processing queue of the asynchronous thread for printing processing.
2. The method for controlling a printer according to claim 1, wherein said sending the print jobs to the processing queue of the asynchronous thread in sequence for print processing comprises:
determining a current print job in the processing queue;
acquiring corresponding printing data according to the current printing task and printing;
and after the current printing task is detected to be finished, sending a call-back instruction to process the next printing task until the printing tasks in the processing queue are processed.
3. The method for controlling a printer according to claim 2, wherein the acquiring and printing corresponding print data according to the current print job comprises:
according to the current printing task, calling printing data corresponding to the current printing task from the client;
and if the calling is successful, caching the printing data into the processing queue for printing.
4. The method of controlling a printer according to claim 3, wherein after the retrieving of the print data corresponding to the current print job from the client, the method further comprises:
and if the calling fails, marking the current printing task as printing failure, and finishing the current printing task.
5. The method for controlling a printer according to claim 2, wherein said issuing a callback instruction after detecting that the current print job is ended comprises:
if the current printing task is successfully completed, sending a successful callback instruction to the client;
and if the current printing task is not successfully completed, acquiring a failure reason, and sending the failure reason and the failed callback instruction to the client so that the client uploads the failure reason to a server and displays the failure reason to a user.
6. The method of controlling a printer according to claim 1, further comprising:
receiving a printing task interruption request sent by the client;
searching a print task corresponding to the print task interruption request from the processing queue, and detecting the processing state of the corresponding print task;
if the processing state is a state to be printed, deleting the corresponding printing task from the processing queue; and if the processing state is the printing state, stopping printing the current printing task and ending the current printing task.
7. The control method of a printer according to claim 1, wherein the non-printing operation state includes a scanning state and a blanket state.
8. The method for controlling a printer according to claim 1, wherein after receiving the print job transmitted from the client, the method further comprises:
and acquiring the processing state of the printing task and updating the processing state to the client.
9. A control device for a printer, comprising:
the first building module is used for receiving a network connection request sent by a client and building network connection with the client according to the network connection request;
the detection module is used for receiving the printing request sent by the client and detecting whether the current running state is in a non-printing working state;
the second construction module is used for establishing an asynchronous thread when the current running state is detected to be in a non-printing working state;
and the printing processing module is used for receiving the printing tasks sent by the client and sequentially sending the printing tasks to the processing queue of the asynchronous thread for printing processing.
10. A control apparatus of a printer, characterized by comprising:
a processor, and a memory coupled to the processor;
the memory is used for storing a computer program;
the processor is configured to invoke and execute the computer program in the memory to perform the method of any one of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110171372.0A CN112799618B (en) | 2021-02-04 | 2021-02-04 | Printer control method, device and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110171372.0A CN112799618B (en) | 2021-02-04 | 2021-02-04 | Printer control method, device and equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112799618A true CN112799618A (en) | 2021-05-14 |
CN112799618B CN112799618B (en) | 2024-08-09 |
Family
ID=75814757
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110171372.0A Active CN112799618B (en) | 2021-02-04 | 2021-02-04 | Printer control method, device and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112799618B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113312014A (en) * | 2021-06-04 | 2021-08-27 | 上海汉图科技有限公司 | Printing method and device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4839741A (en) * | 1987-12-07 | 1989-06-13 | Xerox Corporation | Image reproducing apparatus with CCD scanner and bubble jet printer simultaneously driven by a common belt in opposite directions and operated asynchronously |
CN1710531A (en) * | 2005-06-14 | 2005-12-21 | 迈普(四川)通信技术有限公司 | Network printing system and method |
US20070263245A1 (en) * | 2006-05-10 | 2007-11-15 | Carney Dennis M | Integration of Job Control and Synchronization With Printer Controller Data Exchanges |
US20090225366A1 (en) * | 2008-03-10 | 2009-09-10 | Ricoh Company, Ltd. | Print-item setting server apparatus, print-item setting method, and computer program product |
US20150160894A1 (en) * | 2013-12-10 | 2015-06-11 | Canon Kabushiki Kaisha | Information processing apparatus, recording medium, and control method |
CN108460078A (en) * | 2018-01-08 | 2018-08-28 | 平安科技(深圳)有限公司 | Execution method, apparatus, storage medium and the terminal of miscellaneous function |
-
2021
- 2021-02-04 CN CN202110171372.0A patent/CN112799618B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4839741A (en) * | 1987-12-07 | 1989-06-13 | Xerox Corporation | Image reproducing apparatus with CCD scanner and bubble jet printer simultaneously driven by a common belt in opposite directions and operated asynchronously |
CN1710531A (en) * | 2005-06-14 | 2005-12-21 | 迈普(四川)通信技术有限公司 | Network printing system and method |
US20070263245A1 (en) * | 2006-05-10 | 2007-11-15 | Carney Dennis M | Integration of Job Control and Synchronization With Printer Controller Data Exchanges |
US20090225366A1 (en) * | 2008-03-10 | 2009-09-10 | Ricoh Company, Ltd. | Print-item setting server apparatus, print-item setting method, and computer program product |
US20150160894A1 (en) * | 2013-12-10 | 2015-06-11 | Canon Kabushiki Kaisha | Information processing apparatus, recording medium, and control method |
CN108460078A (en) * | 2018-01-08 | 2018-08-28 | 平安科技(深圳)有限公司 | Execution method, apparatus, storage medium and the terminal of miscellaneous function |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113312014A (en) * | 2021-06-04 | 2021-08-27 | 上海汉图科技有限公司 | Printing method and device |
CN113312014B (en) * | 2021-06-04 | 2024-03-22 | 上海汉图科技有限公司 | Printing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN112799618B (en) | 2024-08-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111782360A (en) | Distributed task scheduling method and device | |
US8867063B2 (en) | Information processing device, method and record medium for implementing status monitor | |
EP2626786A1 (en) | Multicore processor system, method of monitoring control, and monitoring control program | |
CN110659142A (en) | Message queue processing method and device, electronic equipment and storage medium | |
JPH1153130A (en) | Printing system, state monitoring method for printing system, and computer-readable storage medium storage with program | |
CN112799618A (en) | Control method, device and equipment of printer | |
CN114691407A (en) | Method and device for acquiring vehicle log, electronic equipment and storage medium | |
JP5335552B2 (en) | Information processing apparatus, control method therefor, and computer program | |
US20160011922A1 (en) | Information processing apparatus, information processing method, and information processing program | |
CN107967176A (en) | A kind of Samba multi-threaded architectures abnormality eliminating method and relevant apparatus | |
JP3019306B2 (en) | Printing device | |
CN110188008B (en) | Job scheduling master-slave switching method and device, computer equipment and storage medium | |
CN116090780A (en) | Control method, device, equipment and medium of weather forecast flow | |
CN114281389A (en) | Method and device for upgrading SOC (system on chip) and automatic driving vehicle | |
JPH10161824A (en) | Printing controller | |
JPH08263393A (en) | Printer device and its control method | |
JP2005107757A (en) | Method and device for detecting runaway of program | |
JP5997005B2 (en) | Information processing apparatus, process normal end determination method, and program | |
US20120257242A1 (en) | Information processing apparatus, information processing method, and storage medium | |
JP4791846B2 (en) | Mobile agent movement acceleration method, mobile agent movement acceleration system | |
CN110134453B (en) | Server configuration overloading method and server | |
CN114020357B (en) | Starting method, device, system and medium of naminode node | |
KR100332050B1 (en) | Real Time Processing Apparatus And Method Of A System Command In Application Program | |
US20220164219A1 (en) | Processing system, processing method, higher-level system, lower-level system, higher-level program, and lower-level program | |
CN118838859A (en) | Data transmission method, product, equipment and medium |
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 |