CN112799618B - Printer control method, device and equipment - Google Patents
Printer control method, device and equipment Download PDFInfo
- Publication number
- CN112799618B CN112799618B CN202110171372.0A CN202110171372A CN112799618B CN 112799618 B CN112799618 B CN 112799618B CN 202110171372 A CN202110171372 A CN 202110171372A CN 112799618 B CN112799618 B CN 112799618B
- Authority
- CN
- China
- Prior art keywords
- printing
- client
- task
- state
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 238000007639 printing Methods 0.000 claims abstract description 140
- 230000008569 process Effects 0.000 claims description 14
- 238000004590 computer program Methods 0.000 claims description 7
- 238000010276 construction Methods 0.000 claims description 6
- 238000001514 detection method Methods 0.000 claims description 4
- 230000001360 synchronised effect Effects 0.000 abstract description 3
- 230000006870 function Effects 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 238000003491 array Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010586 diagram 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
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 device and 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 operation state is in the non-printing operation state, an asynchronous thread is established; and receiving the print tasks sent by the client, and sequentially sending the print tasks to a processing queue of an asynchronous thread for printing. Therefore, the synchronous execution of the printing work and the non-printing work of the printer can be realized, the operation time is saved, and the working efficiency of operators is effectively improved.
Description
Technical Field
The present application relates to the field of printer control technologies, and in particular, to a method, an apparatus, and a device for controlling a printer.
Background
With the rapid development of printing technology, printers with various functions are also being layered endlessly.
At present, most printers used by logistics workers are Bluetooth printers, and operations such as collecting a record list, scanning and printing an express bill can be performed by utilizing the Bluetooth printers. However, when printing using a bluetooth printer, the logistics staff needs to wait until the printing task ends to perform other operations. Due to the time required for printing, the logistics staff is easy to wait for a long time during printing, and especially when the printing task amount is large, the work efficiency of the logistics staff is seriously affected.
Disclosure of Invention
In view of the above, the present application aims to overcome the shortcomings of the prior art, and provide a method, a device and equipment for controlling a printer.
In order to achieve the above purpose, the application adopts the following technical scheme:
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 operation state is in the non-printing operation state, an asynchronous thread is established;
And receiving the print tasks sent by the client, and sequentially sending the print tasks to the processing queue of the asynchronous thread in sequence for printing.
Optionally, the sending the print tasks to the processing queue of the asynchronous thread in sequence 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 detecting that the current print task is finished, sending a callback instruction to process the next print task until the print task in the processing queue is processed.
Optionally, the obtaining the corresponding print data and printing according to the current print task includes:
According to the current print task, calling print data corresponding to the current print task from the client;
And if the call is successful, caching the printing data into the processing queue for printing.
Optionally, after the retrieving, from the client, the print data corresponding to the current print job, the method further includes:
If the calling fails, marking the current printing task as printing failure, and ending the current printing task.
Optionally, after detecting that the current print job ends, sending a callback instruction, including:
If the successful completion of the current printing task is detected, a successful callback instruction is sent to the client;
If the current print task is not successfully completed, acquiring a failure reason, and sending the failure reason and a failed callback instruction to the client so that the client can upload the failure reason to a server and display the failure reason to a user.
Optionally, the method further comprises:
receiving a print job interrupt request sent by the client;
Searching a print task corresponding to the print task interrupt request from the processing queue, and detecting the processing state of the corresponding print task;
If the processing state is the 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 component-seizing state.
Optionally, after receiving the print job sent by the client, the method further includes:
and acquiring the processing state of the print task and updating the processing state to the client.
A second aspect of the present application provides a control device of a printer, comprising:
The first construction module is used for receiving a network connection request sent by a client and establishing 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 or not;
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 adapted 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:
In the scheme of the application, a network connection relation is established with the client according to the received network connection request sent by the client, so as to lay a network foundation for realizing data interaction with the client. After receiving a print request sent by a client, detecting whether the current running state is in a non-print work state so as to confirm whether other works are being performed while no print work is currently performed. If the printing job is currently in a non-printing job state, i.e., while no printing job is currently being performed, other jobs are being performed, at this time, an asynchronous thread is established so that the printing job can be performed while the other jobs are not being affected. After receiving the print tasks sent by the client, the print tasks are sequentially sent to a processing queue of an asynchronous thread for printing. Therefore, the synchronous execution of the printing work and the non-printing work of the printer can be realized, the operation time is saved, and the working efficiency of operators is effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
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 view of a control apparatus 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 will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, based on the examples herein, which are within the scope of the application as defined by the claims, will be within the scope of the application as defined by the claims.
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 specifically includes 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 the implementation, the printer may be used as an execution body, and the network connection between the printer and the client may be realized by receiving the network connection signal sent by the client. For example, the printer is a bluetooth printer, and the user can utilize the mobile phone as a client to establish connection with the bluetooth printer through bluetooth, so that the bluetooth printer and the mobile phone can perform data interaction.
Step 12, receiving a print request sent by the client, and detecting whether the current running state is in a non-print working state.
After establishing a network connection with the client, a print request sent by the client may be received, and when the print request is received, it is detected whether the current running state is in a print state and whether the current running state is in other working states. The detection in this case may 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 current printer is executing the printing function, the received printing request can be processed according to the existing printing processing mode; if the printer is in an operating state in which other non-printing functions are being performed, step 13 is performed.
The non-print job status may include a scan status and a cable status, among others.
And 13, establishing an asynchronous thread.
In order to enable the printer to still perform printing work when the printer is 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 the asynchronous threads to process subsequent printing tasks. Thus, the main thread can continue to execute the non-printing work, and the asynchronous thread is specially used for processing the printing work, so that the printing and other operations can be synchronously performed.
And 14, receiving the print tasks sent by the client, and sequentially sending the print tasks to a processing queue of an asynchronous thread for printing.
When implemented, the print job may be multiple. During the period of establishing the network connection relation with the client, once the print task sent by the client is received, the received print task is sent to a processing queue of an asynchronous thread to be sequenced and waited until being printed.
In this embodiment, a network connection relationship is established with the client according to a received network connection request sent by the client, so as to lay a network foundation for realizing data interaction with the client. After receiving a print request sent by a client, detecting whether the current running state is in a non-print work state so as to confirm whether other works are being performed while no print work is currently performed. If the printing job is currently in a non-printing job state, i.e., while no printing job is currently being performed, other jobs are being performed, at this time, an asynchronous thread is established so that the printing job can be performed while the other jobs are not being affected. After receiving the print tasks sent by the client, the print tasks are sequentially sent to a processing queue of an asynchronous thread for printing. Therefore, the synchronous execution of the printing work and the non-printing work of the printer can be realized, the operation time is saved, and the working efficiency of operators is effectively improved.
In particular, the main body of execution 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 progress of the print job in real time, in some embodiments, after receiving the print job sent by the client, the control method of the printer may further include: and acquiring the processing state of the print task and updating the processing state to the client.
In particular, in printing a plurality of print jobs, the printer can only process one print job at a time, so that the plurality of print jobs in the processing queue are ordered and waiting. After the processing states of the plurality of printing tasks are acquired, the processing states can be updated to the client in real time, and the display interface of the client can display the printing information of each printing task. The printing 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 print task in real time according to the print information updated to the client, and the logistic staff can check the print tasks more conveniently.
In some embodiments, when the print tasks are sequentially sent to the processing queue of the asynchronous thread for printing, the method specifically may 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 detecting that the current print task is finished, sending a callback instruction to process the next print task until the print task in the processing queue is processed.
When the problem of asynchronous threads is solved, a scheme of multi-core threads in a control method of the printer can be realized based on a multithreading optimization technology (GRAND CENTRAL DISPATCH, GCD) packaged by a C language. GCD is mainly used for optimizing concurrent tasks which can be executed in a thread pool mode by a program supporting multi-core processor. After determining to use the GCD, since the print jobs placed in the processing queue are essentially combined data, which is composed of CPCL instructions, the printer can be used as the execution body to make the corresponding print operation by recognizing these CPCL instructions, and the processing queue needs to process one print job and throw the callback instructions after the printer processes the next print job. Since callbacks are themselves asynchronous, in order to enable the processing queue to process the printer's callbacks one by one, a semaphore mechanism in the GCD can be introduced. Similar to the semaphore consuming mechanism in an operating system, when implemented, a semaphore is created first and then the print job is allowed to consume the created semaphore. In the process of consuming the semaphore, other print tasks always wait for the semaphore to be consumed until the print tasks consume the semaphore, so that the problem that the processing queue in the asynchronous thread executes the print work is solved, and the effective and independent execution of the print work is ensured.
In some embodiments, when acquiring corresponding print data and printing according to the current print job, the following steps may be specifically performed: according to the current print task, calling print data corresponding to the current print task from the client; if the call is successful, the print data is cached in the processing queue for printing.
When the printer is used for printing, the printer firstly acquires corresponding printing data from a client establishing a network link relation according to the current printing task, and caches the acquired printing data in the processing queue for printing.
However, under the influence of multiple factors from the outside, there may be a case where the printer fails to acquire print data. To this end, the control method of the printer may further include: if the calling fails, marking the current printing task as printing failure, and ending the current printing task. So as to continuously process the subsequent printing tasks, and ensure the printing efficiency while not affecting the whole printing process.
Accordingly, after the end of the current print job is detected, the completion condition of the print job can be detected. If the successful completion of the current print task is detected, a successful callback instruction can be sent to the client to inform the client of completing the current print task, and meanwhile, preparation can be made for next step of retrieving the print data. If the current print task is not successfully completed, acquiring the failure reason, and sending the failure reason and a failed callback instruction to the client so that the client can upload the failure reason to the server and display the failure reason to the user, so that the user can be reminded when the server performs backup work, and the user can conveniently respond according to the failure reason.
In some embodiments, the control method of the printer may further include: receiving a print job interrupt request sent by a client; searching a print task corresponding to the print task interrupt request from the processing queue, and detecting the processing state of the corresponding print task; if the processing state is the state to be printed, deleting the corresponding printing task from the processing queue; if the processing state is the printing state, stopping printing the current printing task and ending the current printing task. Thus, after the user sends out the print job, the user can interrupt some or all of the print jobs according to the own demand.
In addition, the client can end the print task by interrupting the network connection. When the printer is implemented, after the client interrupts the currently established network connection relationship, the printer cannot acquire the print data from the client through the print task in the processing queue, and the print data acquisition fails, and the print task is ended.
Likewise, accidents such as the APP being killed, the printer being powered off, abnormal or irregular operation of the printer system, etc. may also cause the printing to be interrupted, which may result in 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 acquires the print task, the printer can immediately call the corresponding print data, and the print task 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 construction 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 running state is in a non-print working state; a second construction module 203, configured to establish an asynchronous thread when detecting that the current running state is in a non-printing working state; the print processing module 204 is configured to receive a print job sent by the client, and sequentially send the print job to a processing queue of an asynchronous thread for print processing.
The non-print job status may include a scan status and a cable status, among others.
Optionally, the print tasks are sequentially sent to the processing queue of the asynchronous thread to perform 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 detecting that the current print task is finished, sending a callback instruction to process the next print task until the print task in the processing queue is processed.
Optionally, according to the current print job, the print processing module 204 may specifically be configured to obtain and print the corresponding print data: according to the current print task, calling print data corresponding to the current print task from the client; if the call is successful, the print data is cached in the processing queue for printing.
Optionally, after retrieving the print data corresponding to the current print job from the client, the print processing module 204 may be further configured to: if the call of the print data corresponding to the current print task from the client fails, marking the current print task as the print failure, and ending the current print task.
Optionally, after detecting that the current print job ends, a callback instruction is sent, and the print processing module 204 may specifically be configured to: if the successful completion of the current printing task is detected, a successful callback instruction is sent to the client; and if the current print task is detected to be not completed successfully, acquiring the failure reason, and sending the failure reason and a failed callback instruction to the client so that the client can upload the failure reason to the server and display 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 print job interrupt request sent by a client; searching a print task corresponding to the print task interrupt request from the processing queue, and detecting the processing state of the corresponding print task; if the processing state is the state to be printed, deleting the corresponding printing task from the processing queue; 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 print task and updating the processing state to the client.
The specific implementation manner of the control device of the printer provided in this embodiment may refer to the implementation manner of the control method of the printer described in any embodiment, and will not be described herein.
Based on the same technical concept, the present embodiment provides a control apparatus of a printer, as shown in fig. 3, which may specifically include: a processor 301 and a memory 302 connected to the processor 301; the memory 302 is used for storing a computer program; the processor 301 is used to call and execute a computer program in the memory 302 to perform the control method of the printer as described in any of the above embodiments.
The specific implementation manner of the control device of the printer provided in this embodiment may refer to the implementation manner of the control method of the printer described in any embodiment, which is not described herein.
An embodiment of the present application provides 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 to be understood that the same or similar parts in the above embodiments may be referred to each other, and that in some embodiments, the same or similar parts in other embodiments may be referred to.
It should be noted that in the description of the present application, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Furthermore, in the description of the present application, unless otherwise indicated, the meaning of "plurality" means at least two.
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 further implementations are included within the scope of the preferred embodiment of the present application 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 is to be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," 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 present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present application have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the application, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the application.
Claims (9)
1. A control method of a printer, 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; wherein the non-printing working state comprises a scanning state and a component-seizing state;
if the printing operation state is in the non-printing operation state, an asynchronous thread is established;
And receiving the print tasks sent by the client, and sequentially sending the print tasks to the processing queue of the asynchronous thread in sequence for printing.
2. The control method of the printer according to claim 1, wherein 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 detecting that the current print task is finished, sending a callback instruction to process the next print task until the print task in the processing queue is processed.
3. The method for controlling a printer according to claim 2, wherein the acquiring and printing the corresponding print data according to the current print job comprises:
According to the current print task, calling print data corresponding to the current print task from the client;
And if the call is successful, caching the printing data into the processing queue for printing.
4. A control method of a printer according to claim 3, wherein after retrieving print data corresponding to a current print job from the client, the method further comprises:
If the calling fails, marking the current printing task as printing failure, and ending the current printing task.
5. The method according to claim 2, wherein the step of issuing a callback instruction after detecting that the current print job ends, comprises:
If the successful completion of the current printing task is detected, a successful callback instruction is sent to the client;
If the current print task is not successfully completed, acquiring a failure reason, and sending the failure reason and a failed callback instruction to the client so that the client can upload the failure reason to a server and display the failure reason to a user.
6. The control method of the printer according to claim 1, characterized by further comprising:
receiving a print job interrupt request sent by the client;
Searching a print task corresponding to the print task interrupt request from the processing queue, and detecting the processing state of the corresponding print task;
If the processing state is the 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 the printer according to claim 1, wherein after the receiving the print job sent by the client, the method further comprises:
and acquiring the processing state of the print task and updating the processing state to the client.
8. A control device of a printer, comprising:
The first construction module is used for receiving a network connection request sent by a client and establishing 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 or not; wherein the non-printing working state comprises a scanning state and a component-seizing 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.
9. 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 of claims 1-7.
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 CN112799618A (en) | 2021-05-14 |
CN112799618B true 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) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113312014B (en) * | 2021-06-04 | 2024-03-22 | 上海汉图科技有限公司 | Printing method and device |
Family Cites Families (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 |
CN100342321C (en) * | 2005-06-14 | 2007-10-10 | 迈普(四川)通信技术有限公司 | Network printing system and method |
US8072630B2 (en) * | 2006-05-10 | 2011-12-06 | Ricoh Production Print Solutions LLC | Integration of job control and synchronization with printer controller data exchanges |
JP4977643B2 (en) * | 2008-03-10 | 2012-07-18 | 株式会社リコー | Print item setting system, server apparatus, and print item setting method |
JP6315965B2 (en) * | 2013-12-10 | 2018-04-25 | キヤノン株式会社 | Information processing apparatus, program, and control method |
CN108460078B (en) * | 2018-01-08 | 2020-10-13 | 平安科技(深圳)有限公司 | Auxiliary function execution method and device, storage medium and terminal |
-
2021
- 2021-02-04 CN CN202110171372.0A patent/CN112799618B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN112799618A (en) | 2021-05-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20210182136A1 (en) | Fault Processing Method, Related Apparatus, and Computer | |
CN105357038B (en) | Monitor the method and system of cluster virtual machine | |
US9335998B2 (en) | Multi-core processor system, monitoring control method, and computer product | |
US8867063B2 (en) | Information processing device, method and record medium for implementing status monitor | |
CN111782360A (en) | Distributed task scheduling method and device | |
US20170132063A1 (en) | Information system fault scenario information collecting method and system | |
CN112799618B (en) | Printer control method, device and equipment | |
CN110659142A (en) | Message queue processing method and device, electronic equipment and storage medium | |
EP2336872B1 (en) | Information processing apparatus and method | |
CN111427521B (en) | Electronic face sheet printing method, server, system and equipment | |
CN109144428A (en) | Garbage recycling method, device and medium applied to solid state disk | |
CN114691407A (en) | Method and device for acquiring vehicle log, electronic equipment and storage medium | |
JP3489846B2 (en) | Remote printing system | |
JP3019306B2 (en) | Printing device | |
CN107967176A (en) | A kind of Samba multi-threaded architectures abnormality eliminating method and relevant apparatus | |
US20160094748A1 (en) | Information processing system, image processing apparatus and information processing method | |
CN110188008B (en) | Job scheduling master-slave switching method and device, computer equipment and storage medium | |
CN112231601B (en) | Link management method, device, equipment and computer storage medium | |
US9207889B2 (en) | Information processing apparatus, information processing method, and storage medium | |
CN114281389A (en) | Method and device for upgrading SOC (system on chip) and automatic driving vehicle | |
JPH10161824A (en) | Printing controller | |
JP2503663B2 (en) | Hot standby system | |
JP4791846B2 (en) | Mobile agent movement acceleration method, mobile agent movement acceleration system | |
JP2656643B2 (en) | Log data collection method and device | |
JP2006092055A (en) | Computer system |
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 |