Printing apparatus, control method thereof, and storage medium
Patent Information
- Application Number
- CN202211484723.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-11-25
- Filing Date
- 2022-11-24
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2042-11-24
AI Technical Summary
结果,不再可能在打印机中正常地进行打印作业的取消操作,并且打印物可能在发生诸如在其上打印的字符串不正确等的异常的情况下被输出
Smart Images

Figure CN116166206B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a printing device, its control method, and a storage medium. Background Technology
[0002] Traditionally, line printer remote (LPR) printing has been proposed, where LPR commands from a host PC are used to instruct a printer running a line printer daemon (LPD) to print. In LPR printing, the host PC is requested to notify the printer of the size information of the print data before sending the print data, utilizing the provisions of Request Annotation (RFC) 1179. A printing system is known to disconnect the communication connection between the host PC and the printer after the transmission of print data from the host PC to the printer has been completed by setting a value in this size information notification that represents a size larger than the actual print data size.
[0003] Regarding data communication between a host PC and a printer, Japanese Patent Application Publication No. 2003-256178 discloses a control method for stopping and resuming printing by setting a timeout shorter than a predetermined timeout time on the printer side than that on the host PC. Furthermore, Japanese Patent Application Publication No. 2011-116083 discloses a control method for notifying the host PC of the size of data that can be received by a receive buffer.
[0004] In printing systems, a data spool mechanism is typically introduced to smoothly receive print data in parallel with the printing operation. The data spool (spool area) includes a pre-defined storage area. Even when print data exceeding the data spool size is sent from the host PC to the printer, the free area of the data spool will not be exhausted as long as the printing operation proceeds smoothly in the printer. However, the free area in the data spool may be exhausted when the printing operation stops due to errors such as paper shortage or paper jam.
[0005] When the free space in the data spool is exhausted, the transmission of print data from the host PC to the printer may stop midway. In this state, a communication connection between the host PC and the printer may be broken if, for example, a transition to sleep or restart occurs in the host PC, or if a transition to sleep (error sleep) occurs in the printer without resolving an error. As a result, it is no longer possible to cancel print jobs normally in the printer, and the printed material may be output with anomalies such as incorrect strings printed on it. Additionally, if the print data size is smaller than the data spool size, the print job may disappear even without cancellation. Summary of the Invention
[0006] Therefore, the present invention provides a technique that allows normal resumption of printing processing even when the printing device stops receiving printing data from an external device midway through printing.
[0007] According to one aspect of the present invention, a printing device is provided that is capable of communicating with an external device, the printing device comprising: an establishment unit configured to establish a connection with the external device according to a predetermined communication protocol; a receiving unit configured to receive printing data transmitted from the external device via the connection and temporarily store the printing data in a spool area; a printing unit configured to perform printing processing based on the printing data stored in the spool area; and a control unit configured to control whether to disconnect the connection with the external device from the printing device side, based on a setting preset by a user operation, if the reception of printing data from the external device is stopped midway and a predetermined time has elapsed while the reception remains stopped.
[0008] According to another aspect of the present invention, a printing apparatus is provided that is capable of communicating with an external device, the printing apparatus comprising: an establishment component for establishing a connection with the external device according to a predetermined communication protocol; a receiving component for receiving printing data transmitted from the external device via the connection and temporarily storing the printing data in a spool area; a printing component for performing printing processing based on the printing data stored in the spool area; and a control component for controlling whether to disconnect the connection with the external device from the printing device side, based on the size of the printing data transmitted from the external device and the size of the spool area, if the reception of printing data from the external device is stopped midway and a predetermined time has elapsed while the reception remains stopped.
[0009] According to another aspect of the present invention, a control method for a printing device is provided, the printing device being capable of communicating with an external device, the control method comprising: establishing a connection with the external device according to a predetermined communication protocol; receiving printing data sent from the external device via the connection and temporarily storing the printing data in a spool area; performing printing processing based on the printing data stored in the spool area; and, if the reception of printing data from the external device is stopped midway and a predetermined time has elapsed in the state of the reception remaining stopped, controlling whether to disconnect the connection with the external device from the printing device side according to a setting pre-made by a user operation.
[0010] According to another aspect of the present invention, a control method for a printing device is provided, the printing device being capable of communicating with an external device, the control method comprising: establishing a connection with the external device according to a predetermined communication protocol; receiving printing data transmitted from the external device via the connection and temporarily storing the printing data in a spool area; performing printing processing based on the printing data stored in the spool area; and, if the reception of printing data from the external device is stopped midway and a predetermined time has elapsed while the reception remains stopped, controlling whether to disconnect the connection with the external device from the printing device side based on the size of the printing data transmitted from the external device and the size of the spool area.
[0011] Further features of the invention will become apparent from the following description of exemplary embodiments (with reference to the accompanying drawings). Attached Figure Description
[0012] Figure 1 An example network configuration is shown;
[0013] Figure 2 This is a block diagram illustrating an exemplary hardware configuration of an MFP;
[0014] Figure 3 This is a block diagram illustrating an exemplary functional configuration of an MFP;
[0015] Figure 4A and 4B This shows a portion of the LPR command specification and an exemplary setup screen of the host PC;
[0016] Figure 5A and 5B An example package related to LPD printing is shown;
[0017] Figure 6 This shows an example setup screen related to LPD in MFP;
[0018] Figure 7 This is a flowchart illustrating the process of receiving and processing print data (first embodiment);
[0019] Figure 8 This is a flowchart illustrating the process of receiving and processing print data (second embodiment); and
[0020] Figure 9 This is a flowchart illustrating the process of receiving and processing print data (third embodiment). Detailed Implementation
[0021] Hereinafter, embodiments will be described in detail with reference to the accompanying drawings. Note that the following embodiments are not intended to limit the scope of the claimed invention. A plurality of features are described in the embodiments, and the invention is not limited to one that requires all of these features, and a plurality of these features may be appropriately combined. Furthermore, in the accompanying drawings, the same reference numerals are assigned to the same or similar configurations, and redundant descriptions thereof are omitted.
[0022] First Embodiment
[0023] Figure 1 illustrates an exemplary wireless network configuration according to the present embodiment. A multifunction peripheral (MFP) 100 is connected to a local area network (LAN) 105. Although the LAN 105 may be configured as a wired LAN, it may also be configured as a wireless LAN. The LAN 105 further has PCs 101 and 102 connected thereto. The MFP 100 can communicate with the PCs 101 and 102 via the LAN 105. The PCs 101 and 102 can cause the MFP 100 to execute a print job by transmitting the print job to the MFP 100 via the LAN 105. The PCs 101 and 102 may also be referred to as client PCs or host PCs.
[0024] <Hardware Configuration of MFP>
[0025] Figure 2 is a block diagram illustrating an exemplary hardware configuration of the MFP 100. The MFP 100 includes a controller (control unit) 200, and an operation unit 220, a printer (printer engine) 221, and a scanner 222 connected to the controller. The controller 200 includes a CPU 201 and is configured to control the overall operation of the MFP 100. The controller 200 further includes the CPU 201, a RAM 202, a ROM 203, a hard disk drive (HDD) 204, an operation unit interface (I / F) 205, a printer I / F 206, a scanner I / F 207, and a LAN I / F 208.
[0026] CPU 201 performs various controls or processes, such as communication control and image processing, by loading control programs stored in ROM 203 or HDD 204 into RAM 202 and reading and executing the loaded control programs. RAM 202 is a volatile storage medium (storage device) that serves as the main memory and working area of CPU 201. HDD 204 is a non-volatile storage medium (storage device). HDD 204, which stores various data and programs, is also used for temporary storage of image data generated during printing or copying processes. Thus, hardware components such as CPU 201, ROM 203, RAM 202, or HDD 204 constitute a so-called computer. Although in the exemplary embodiment of MFP 100 it is assumed that a single CPU 201 uses a control program loaded in a single memory (RAM 202) to execute the various processes shown in the flowcharts described below, other aspects are also contemplated. For example, the various processes shown in the flowcharts described below can also be executed by coordinating multiple processors, memories, and storage devices.
[0027] Printer I / F 206 is an interface configured to connect printer 221 and controller 200. Printer 221 performs printing processing based on image data input from controller 200 via printer I / F 206 to print (form) an image on a sheet fed from a sheet feed unit (not shown), such as a sheet feed cassette. Printer 221 forms the image, for example, using an electrophotographic or inkjet type.
[0028] Scanner I / F 207 is an interface configured to connect scanner 222 and controller 200. Scanner 222 reads an image of a document placed on a document base to generate image data. The image data generated by scanner 222 is input to controller 200 via scanner I / F 207 and can be used for printing by printer 221, stored in HDD 204, or sent to an external device via LAN I / F 208.
[0029] Operation unit I / F 205 is an interface configured to connect operation unit 220 and controller 200. Operation unit 220 accepts user operations (e.g., operations for various settings of MFP 100). For example, operation unit 220 includes a display device (display unit) configured to display a screen and can display the status of MFP 100.
[0030] The LAN I / F 208 is a communication I / F connected to the local area network 105, and can communicate with external devices via the LAN 105. The CPU 201 can, for example, transmit image data generated by the scanner 222 to an external device via the LAN I / F 208, or receive print data including image data to be printed by the printer 221 from an external device. Here, the MFP 100 may further include a wireless LAN I / F that can be connected to a wireless LAN.
[0031] <Functional Configuration of MFP>
[0032] Figure 3 is a block diagram illustrating an exemplary software configuration (functional configuration) of the MFP 100. Figure 3 The functions of the respective blocks (software) shown are implemented in the MFP 100 by the CPU 201 reading out and executing programs stored in the ROM 203 or the HDD 204 to the RAM 202.
[0033] The operation control unit 301 displays a user-oriented screen (operation screen) on the operation unit 220, and accepts user operations via the operation unit 220. The operation control unit 301 performs processing related to a display object (such as a button on the display screen or the like) in accordance with the accepted user operation. In the present embodiment, for example, the operation control unit 301 displays on the operation unit 220 Figure 6 a setting screen 600 shown and described below. In a case where a predetermined time has elapsed in a state where reception of print data from an external device (host PC) is kept stopped, the operation control unit 301 can also accept a setting as to whether to disconnect the connection with the external device from the MFP 100 side.
[0034] Based on requests from respective functional units (control units), the data storage unit 305 stores data such as setting values and the like in the ROM 203 or the HDD 204, and reads out the stored data. For example, when the user desires to change a setting of a certain apparatus, the operation control unit 301 accepts a user's input via the operation unit 220, and requests the data storage unit 305 to store a setting value corresponding to the input content. The data storage unit 305 stores the setting value in the ROM 203 or the HDD 204 in accordance with the request from the operation control unit 301. In addition, the data storage unit 305 secures a spool area (data spool) for temporarily storing print data received from an external device (host PC) in a storage area of a volatile memory such as the RAM 202 or the like, or a non-volatile memory such as the HDD 204 or the like.
[0035] The environment setting unit 306 performs environment settings for the MFP 100 based on the settings stored in the data storage unit 305, either upon system startup or upon detecting a change in settings. Specifically, the environment setting unit 306 performs various network settings, including IP address settings, and various parameter settings for the printing and copying functions included in the MFP 100.
[0036] NW apps 310 to 312 are application modules that operate on the MFP 100 to perform network functions. Although the configuration of these three NW apps operating on the MFP 100 will be described in this embodiment, any number of applications can operate on the MFP 100, as long as these applications are applications that use network functions to implement the functions of the MFP 100.
[0037] NW app 310 is the LPD module corresponding to the Line Printer Daemon (LPD) protocol. The LPD module performs receive processing for receiving print data from external devices such as PC 101 using Line Printer Remote (LPR) commands. Here, the LPD specification is standardized by RFC 1179. NW app 311 is the RAW module. The RAW module performs receive processing for receiving print data from external devices such as PC 102 using TCP / IP port 9100. NW app 312 is an application for managing device information for the MFP 100.
[0038] In response to requests from external devices such as PC 102, NW app 312 collects device configuration and consumable information of MFP 100 and outputs a response including the collected information. In this embodiment, NW app 312 is configured as a Simple Network Management Protocol (SNMP) agent, which outputs device information in the form of a Management Information Base (MIB object) according to SNMP as defined in RFC 1157.
[0039] The network control unit 314 is formed by a protocol stack and is configured as part of the OS of the common control controller 200. Typically, a protocol stack is equivalent to a group of programs with layered software functions, including multiple programs corresponding to protocols used to implement network functions. The protocol stack can be formed by a session layer, transport layer, network layer, and data link layer conforming to the OSI reference model. The session layer performs connection control, etc. The transport layer manages data transmission. The network layer controls address management and path selection. The data link layer identifies and transmits data frames. In this embodiment, the network control unit 314 (protocol stack) also includes a device driver 315 for controlling the LAN I / F 208.
[0040] A network control API 313, which serves as an API library for calling the protocol stack included in the network control unit 314, is provided as a general socket function (socket API) in the OS. The environment setting unit 306 and the NW apps 310 to 312 perform data communication conforming to respective communication protocols by setting parameters in the network control API 313 and calling the network control API.
[0041] The job control unit 302 controls execution of respective jobs for a plurality of functions (such as a copy function, a print function, a file transmission function, and the like) included in the MFP 100. When executing a print job, the job control unit 302 establishes a connection with an external apparatus (host PC) using the NW App 310 in accordance with the LPD protocol. The job control unit 302 receives print data transmitted from the external apparatus via the established connection, and temporarily stores the received print data in a spool area.
[0042] The print processing unit 303 performs print processing based on the print data received from the external apparatus and stored in the spool area, in accordance with an instruction from the job control unit 302. Specifically, the print processing unit 303 interprets the print data to generate image data, transmits the generated image data to the printer 221 via the printer I / F 206, and causes the printer 221 to print the image data.
[0043] The scan processing unit 304 causes the scanner 222 to read an image of an original via the scanner I / F 207 in accordance with an instruction from the job control unit 302, generates image data, and stores the image data as scanned image data in the HDD 204.
[0044] Note that the print processing unit 303 may also read out the scanned image data stored by the scan processing unit 304, and perform print processing based on the image data. For example, when executing a copy function, the operation control unit 301 instructs the job control unit 302 to execute the copy function when accepting an execution instruction for the copy function from a user via the operation unit 220. The job control unit 302 instructs the scan processing unit 304 to read an original, and acquires the scanned image data from the scan processing unit 304. By instructing the print processing unit 303 to perform print processing based on the acquired scanned image data, the job control unit 302 also outputs a sheet on which the image of the original is printed as a copy result of the original.
[0045] <LPR Command and LPR Setting>
[0046] Figure 4AThis diagram illustrates a portion of the RFC 1179 specification defining the Line Printer Daemon (LPD) protocol, and shows the specification of the LPR command as a control command associated with a received data file. As shown in the diagram, the LPR command stores the data file size information (number of bytes) immediately following the command code "03," and the data file name one character away. The LPR command is sent from the host PC to the printing device (MFP 100) where the LPD is running, before the main body of the print data is transmitted.
[0047] Figure 4B An exemplary setup screen (setup screen 400) is shown on the host PC side for configuring the print port to instruct the MFP 100 to perform printing using the LPR command. In setup screen 400, "RAW," "IPP," and "LPR" can be selected as the printing protocol (communication protocol) to be used. Figure 4B In the example, as shown by reference numeral 401 in the attached diagram, "LPR" is selected as the printing protocol. As an LPR setting, the settings screen 400 also allows you to configure whether LPR byte counting is enabled. Figure 4B In the example, as shown by reference numeral 402 in the attached figure, the setting to "OFF" for LPR byte counting is selected as the LPR setting. In other words, the setting to disable LPR byte counting is selected.
[0048] Figure 5A This shows an example of a receive packet including an LPR command when LPR byte counting is enabled (LPR byte count = ON). Figure 5A In the packet shown, the predetermined range starting from the command code "03" as indicated by reference numeral 501 corresponds to the LPR command representing the received data file. As already described with reference to FIG4, when LPR byte counting is enabled on the host PC side, size information 502 appropriately sets size information indicating the size of the print data to be sent from the host PC to the printing device (MFP 100). In this example, the size of "39865" bytes has been set in size information 502.
[0049] Figure 5B This shows an example of a receive packet including an LPR command when LPR byte counting is not enabled (LPR byte count = OFF). Figure 5BIn the packet shown, the predetermined range starting from the command code "03" as indicated by reference numeral 501 corresponds to the LPR command representing the received data file. Size information 502 does not appropriately set size information indicating the size of the print data to be sent from the host PC to the printing device (MFP 100). In this example, the size of "125899906843000" bytes (≈114.5 [TB]) is set in size information 503; in other words, size information representing a large hypothetical file size is set.
[0050] <Setup Screen>
[0051] Figure 6 An example of a setup screen (setup screen 600) displayed on the operation unit 220 of the MFP 100 according to this embodiment is shown. The setup screen 600 is used for settings related to printing via LPD. The setup screen 600 includes setting items 601 to 603 as settings for network settings (LPD settings). Setting item 601 indicates whether the LPD printing function is used. This setting can be made using ON and OFF buttons. The operation control unit 301 controls the display of the operation unit 220, causing the ON or OFF button to be selected based on user operation on setting item 601. To use the LPD printing function on the MFP 100, the user needs to select the ON button for setting item 601.
[0052] Setting item 602 indicates whether to print a title page for each print job during LPD printing. This setting can be made using the ON and OFF buttons. The operation control unit 301 controls the display of the operation unit 220, allowing the user to select the ON or OFF button based on the setting item 602. When setting to print a title page (not shown), information such as the username of the user who has been instructed to perform the print job and the file name used to perform the print job are printed as the partition page of the print job.
[0053] Setting item 603 indicates the operation (behavior) of the MFP 100 after a predetermined time has elapsed since printing stopped due to, for example, out of paper or a paper jam. This setting can be made using drop-down list 604. Specifically, settings are made to either maintain a TCP / IP connection with the host PC while waiting ("connection standby") or disconnect the TCP / IP connection ("disconnect"). The setting of setting item 603 is reflected in the setting value of the reset response flag stored in ROM 203 or HDD 204.
[0054] If a predetermined time has elapsed while print data reception from the external device (host PC) remains suspended, a reset response flag indicates whether to disconnect the connection (TCP / IP connection) with the external device from the print device side (MFP 100 side). When "Connection Standby" is selected as setting item 603, the reset response flag is set to OFF. In other words, if a predetermined time has elapsed while print data reception from the external device (host PC) remains suspended, the setting is made to prevent disconnection from the print device side (MFP 100 side). On the other hand, if "Disconnect" is selected as setting item 603, the reset response flag is set to ON. In other words, if a predetermined time has elapsed while print data reception from the external device (host PC) remains suspended, the setting is made to disconnect the connection from the print device side (MFP 100 side). The connection is disconnected by sending an RST packet (RST command) as a disconnection request to the external device (host PC).
[0055] Pressing (touching) the setting response button 611 on the setting screen 600 enables the settings on the setting screen 600 to be stored by the data storage unit 305. The NW app 310 (LPD module) references and uses the stored settings. After pressing the setting response button 611, the operation control unit 301 switches the display screen of the operation unit 220 from the setting screen 600 to a setting screen (not shown) related to more advanced settings. On the other hand, when the cancel button 612 is pressed, a similar switch of the display screen occurs without reflecting the settings.
[0056] <Processing Procedure>
[0057] Figure 7 This is a flowchart illustrating the process of receiving and processing print data by the CPU 201 in the MFP 100 according to this embodiment. Figure 7 The processing of each step can be implemented in the MFP 100 by the CPU 201 by reading the program stored in ROM 203 or HDD 204 into RAM 202 and executing the program thereon.
[0058] When the MFP 100 is powered on, the CPU 201 performs various initialization processes (not shown). Therefore, when the MFP 100 is available for use as a network-connected printer, the CPU 201 begins executing according to... Figure 7 The process shown is as follows.
[0059] First, in step S701, CPU 201 enters a standby state to wait for the establishment of a TCP / IP-based connection. When CPU 201 receives a request packet for communication establishment from a host PC (external device) such as PC 101 or 102 via LAN I / F 208, it establishes a connection with the host PC based on the request packet.
[0060] After the connection is established, CPU 201 determines in step S702 whether the request from the host PC in the established connection is a print request using the LPR command (LPR print request). If it is determined that the request from the host PC is not an LPR print request, CPU 201 will proceed to step S703, or if it is determined that the request is an LPR print request, it will proceed to step S704.
[0061] In step S703, CPU 201 receives print data from the host PC through a different type of receive processing besides the LPR-based print request receive processing, and terminates that processing. Here, the different types of receive processing can be based on, for example, a print request according to the RAW protocol (TCP port 9100) or a print request according to IPP (Internet Printing Protocol). Subsequently, CPU 201 begins executing according to... Figure 7 The process shown is processed, and then the system enters a standby state to wait for the connection to be established in step S701.
[0062] If the process proceeds from step S702 to step S704, the CPU 201 determines whether an obstacle preventing the reception of print data has occurred. Obstacles include, for example, a paper shortage, paper jam, or a shortage of consumables required for printing in the MFP 100. When such an obstacle occurs, the reception of print data from the host PC stops midway (it can no longer be received smoothly). For example, if printing processing stops and unprocessed print data continues to accumulate in the spool area, thus depleting the free space in the spool area, it forces a halt to the reception of print data from the host PC (external device). This thus obstructs the reception of print data.
[0063] If it is determined that no obstacles have occurred that would prevent the reception of print data, CPU 201 proceeds to step S705. In step S705, CPU 201 receives print data from the host PC via the established connection. Here, the received print data is temporarily stored in the spool area and used sequentially in the printing process. Subsequently, in step S706, CPU 201 determines whether the reception of print data has been completed. Print data is sent from the host PC via the network in multiple packets. Therefore, in step S706, CPU 201 determines whether the reception of all multiple packets in a sequence divided from the print data has been completed. If the reception of print data is not complete (packet reception continues), CPU 201 returns to step S704 from step S706 and repeats the processing from steps S704 to S706.
[0064] Upon completion of receiving print data, CPU 201 sends a receipt confirmation to the host PC for the last received packet and proceeds the process from step S706 to step S707. In step S707, CPU 201 disconnects from the host PC by receiving a FIN packet from the host PC in response to the receipt confirmation. In other words, the sending of the FIN packet causes the connection between the host PC and the printer (MFP 100) to be disconnected. Upon completion of the disconnection from the host PC in the above manner, CPU 201 terminates according to... Figure 7 The process shown illustrates the reception and processing of printed data.
[0065] On the other hand, when it is determined at step S704 that an obstacle preventing the reception of print data has occurred, CPU 201 proceeds to step S708. In step S708, CPU 201 determines whether a timeout event has occurred based on a predetermined timer. The predetermined timer, started based on the occurrence of the obstacle, measures the time elapsed since the obstacle appeared. When the timer reaches the predetermined time (upper limit time), CPU 201 determines that a timeout event has occurred. A timeout event indicates that a predetermined time has elapsed (a timeout has occurred) while the reception of print data remains stopped without resolving the obstacle preventing the reception of print data. If a timeout event is determined to have occurred, CPU 201 proceeds to step S709, or if no timeout event is determined to have occurred, it returns to step S704.
[0066] In step S709, the CPU 201 determines whether the reset response flag is set to ON. As described above, based on the settings made using the setting screen 600, the setting value of the reset response flag is stored in the ROM 203 or HDD 204. The CPU 201 determines whether the reset response flag is set to ON by referring to the stored setting value of the reset response flag.
[0067] When the reset response flag is set to ON (i.e., when setting item 603 on the setting screen 600 is set to "Disconnect"), the CPU 201 proceeds to step S710. Thus, when setting to disconnect the connection from the host PC from the printer side, as an operation when print data reception stops due to an obstruction, the CPU 201 proceeds to step S710. On the other hand, when the reset response flag is set to OFF (i.e., when setting item 603 on the setting screen 600 is set to "Connection Standby"), the CPU 201 returns to step S704. Thus, when setting to maintain the connection with the host PC without sending an RST packet and enter standby mode as an operation when print data reception stops due to an obstruction, the CPU 201 returns to step S704.
[0068] In step S710, CPU 201 sends an RST packet (RST command) to the host PC, which is the source of the print data, via LAN I / F 208. The RST packet corresponds to a TCP / IP disconnect request. Sending the RST packet causes the printer (MFP 100) to actively disconnect from the host PC.
[0069] Thus, the CPU 201 controls whether to disconnect from the external device (host PC) from the MFP 100 side based on settings (reset response flag settings) pre-configured via user operation. Specifically, if a predetermined time has elapsed since print data reception from the external device has stopped and the configuration to disconnect from the external device from the MFP 100 side has been executed, the CPU 201 sends an RST packet to the external device. The RST packet corresponds to a disconnection request. On the other hand, if a predetermined time has elapsed since print data reception from the external device has stopped and the configuration to disconnect from the external device from the MFP 100 side has not been executed, the CPU 201 maintains the connection with the external device.
[0070] When the connection with the host PC is disconnected after the RST packet is sent in step S710, CPU201 terminates according to... Figure 7 The process shown illustrates the reception and processing of printed data.
[0071] <The effect of switching operations when receiving stops>
[0072] In this embodiment, the operation (operation mode) of the MFP 100 is switched based on the settings on the settings screen 600 when receiving print data from the host PC stops due to an obstruction. This operation switching has the following effects.
[0073] Assume the host PC (PC 101 or 102) uses the LPR protocol on a standard TCP / IP port in the Microsoft Windows operating system (OS) for printing. In this case, the standard TCP / IP port has a connection standby time threshold (timeout period). The connection to the host PC is maintained while print data reception remains stopped, and if printing does not proceed after the timeout period (when print data reception has not resumed), the print job is canceled on the host PC side.
[0074] This embodiment allows the aforementioned problem to be avoided by setting setting item 603 on the settings screen 600 to "Disconnect". Specifically, before the print job is canceled in the host PC, the sending of an RST packet (S710) causes the TCP / IP connection to be actively disconnected from the MFP 100 side. Therefore, the predetermined time associated with the timeout event (S708) is defined as a shorter time than the timeout period until the external device (host PC) cancels the print job without the MFP 100 resuming its reception of print data. Thus, a print retry operation is performed between the host PC and the MFP 100 via the aforementioned standard TCP / IP port before the print job is canceled in the host PC. As a result, print job cancellation and printout can be avoided. In other words, even if the reception of print data from the host PC is interrupted, the MFP 100 (printing device) can resume printing normally.
[0075] Here, based on user operations received via a settings screen (not shown) displayed on the operation unit 220, the operation control unit 301 can be configured to change the predetermined time associated with the aforementioned timeout event (S708).
[0076] Alternatively, consider a scenario where the host PC (PC 101 or 102) uses a Common UNIX Printing System (CUPS) running Linux OS for print processing. In this case, disconnecting the TCP / IP connection from the MFP 100 side may cause the following problems. When the TCP / IP connection is disconnected, the print job stops on the host PC according to the default settings of CUPS. Unlike print processing using standard Windows TCP / IP ports, print job cancellation does not occur on the host PC. However, to resume the stopped print job, it is necessary to log in to the Linux system with the same privileges as the system administrator to perform the recovery operation.
[0077] This embodiment allows the aforementioned problem to be avoided by setting setting item 603 on the settings screen 600 to "Connection Standby". In CUPS's default settings, unlike the standard Windows TCP / IP port, no threshold (timeout) is set for connection standby time. Therefore, as described above, maintaining standby while keeping the TCP / IP connection between the host PC and the MFP 100 intact prevents print jobs on the host PC from stopping. Furthermore, the foregoing eliminates the need to log in with privileges equivalent to a system administrator to resume print jobs. As a result, after resolving the obstacles to receiving print data on the MFP 100, print processing can be resumed normally.
[0078] In this embodiment, as described above, the CPU 201 establishes a connection with an external device (host PC) according to a predetermined communication protocol, receives print data sent from the external device via this connection, and temporarily stores the print data in the spool area. The CPU 201 performs printing processing based on the print data stored in the spool area. If the reception of print data from the external device is interrupted midway and a predetermined time has elapsed while the reception remains stopped, the CPU 201 also controls whether to disconnect the connection with the external device from the MFP 100 side according to a setting pre-made by the user. Therefore, even if the reception of print data from the external device in the MFP 100 is interrupted midway, printing processing can be resumed normally.
[0079] Second Embodiment
[0080] Next, a second embodiment of this disclosure will be described. In the following, descriptions of portions similar to those in the first embodiment will be omitted.
[0081] In the first embodiment, when the reception of print data remains stopped, the system switches between sending an RST packet from the printer side (S710) and waiting for the reception of a FIN packet from the host PC side (S707) according to the settings on the settings screen 600. The settings on the settings screen 600 are configured in a manner suitable for the operating system (OS) of the host PC connected to the MFP 100 or for a print data transmission application used on the host PC.
[0082] However, for example, in the case where the MFP 100 is shared by multiple host PCs, it is conceivable that multiple host PCs, each with a different installed OS (e.g., Windows OS and Linux OS), are connected to the MFP 100. In this case, it is desirable to be able to dynamically switch the aforementioned operations to match the currently connected host PC, even if print data reception remains suspended.
[0083] Additionally, it's conceivable that, with the host PC running a Windows OS, applications on the Windows OS would operate similarly to CUPS on the Linux OS, rather than using the standard TCP / IP ports for printing on the Windows OS.
[0084] In this case, it is expected that setting item 603 on setting screen 600 will be set to "Connection Standby" instead of "Disconnect" based on the printing process using the standard TCP / IP port of Windows OS.
[0085] Therefore, this embodiment allows for dynamic switching of the above operations when the reception of print data in the MFP 100 is stopped. Specifically, control is performed regarding whether to disconnect the connection with the external device from the MFP 100 side based on the size of the print data sent from the external device (host PC) and the size of the spool area used for temporary storage of print data.
[0086] <Processing Procedure>
[0087] Figure 8 This is a flowchart illustrating the process of print data receiving and processing performed by the CPU 201 in the MFP 100 according to this embodiment. Figure 8 The processing of each step can be achieved in the MFP 100 by the CPU 201 reading the program stored in ROM 203 or HDD 204 into RAM 202 and executing the program thereon.
[0088] The processing in steps S701 to S703 is similar to that in the first embodiment. In this embodiment, when it is determined at step S702 that the request from the host PC is an LPR printing request, the CPU 201 advances the processing to step S801.
[0089] In step S801, CPU 201 extracts the size information of the print data from the received packet sent from the host PC before sending the print data for LPR printing. Specifically, it extracts the size information described in the LPR command from the received packet, which includes the control command (LPR command) described above with reference to Figures 4, 5A, and 5B. Thus, CPU 201 obtains the size of the print data from the control command (LPR command) sent from the host PC before sending the print data. Then, in step S802, CPU 201 determines whether the size of the print data represented by the extracted size information exceeds the size of the spool area reserved for spool printing data.
[0090] If the size of the printed data exceeds the size of the spool area, CPU 201 proceeds to step S803. In step S803, CPU 201 sets the size-exceeding flag to ON (e.g., set it to a value of 1) and proceeds to step S704. Conversely, if the size of the printed data does not exceed the size of the spool area, CPU 201 proceeds to step S804. In step S804, CPU 201 sets the size-exceeding flag to OFF (e.g., a value of 0) and proceeds to step S704. Thus, the size-exceeding flag being ON indicates that the size of the printed data exceeds (surpasses) the size of the spool area. Here, the setting value of the size-exceeding flag is stored in ROM 203 or HDD 204.
[0091] The processing in steps S704 to S708 is similar to that in the first embodiment. In this embodiment, if it is determined at step S708 that a timeout event has occurred according to the predetermined timer, the CPU 201 will proceed to step S805, or if it is determined that no timeout event has occurred, the processing will return to step S704.
[0092] In step S805, CPU 201 refers to the stored size exceedance flag setting value to determine whether the size exceedance flag is set to ON. If the size exceedance flag is set to OFF (i.e., the size of the print data is equal to or less than the size of the spool area), CPU 201 returns to step S704. Then, CPU 201 waits until the reception obstruction is resolved and print data reception is restored. On the other hand, if the size exceedance flag is set to ON (i.e., the size of the print data exceeds the size of the spool area), CPU 201 proceeds to step S710.
[0093] In step S710, similar to the first embodiment, CPU 201 sends an RST packet (RST command) to the host PC, which is the source of the print data, via LAN I / F 208. In other words, sending the RST packet causes the printer (MFP 100) to actively disconnect from the host PC.
[0094] In this way, CPU 201 controls whether to disconnect from the external device (host PC) based on the size of the print data sent from the external device and the size of the spool area. Specifically, if a predetermined time has elapsed while print data reception from the external device remains suspended and the size of the print data sent from the external device exceeds the size of the spool area, CPU 201 sends an RST packet to the external device. The RST packet corresponds to a disconnect request. On the other hand, if a predetermined time has elapsed while print data reception from the external device remains suspended and the size of the print data sent from the external device does not exceed the size of the spool area, CPU 201 maintains the connection with the external device. In this case, even when print processing remains suspended, all received print data can be stored in the spool area, and thus print data reception continues while maintaining the connection.
[0095] After sending the RST packet in step S710 and completing the disconnection from the host PC, CPU 201 terminates according to... Figure 8 The process shown illustrates the reception and processing of printed data.
[0096] In this embodiment, as described above, the CPU 201 establishes a connection with an external device (host PC) according to a predetermined communication protocol, receives print data sent from the external device via this connection, and temporarily stores the print data in a spool area. The CPU 201 performs printing processing based on the print data stored in the spool area. If the reception of print data from the external device is interrupted and a predetermined time has elapsed while the reception remains stopped, the CPU 201 also controls whether to disconnect from the external device from the MFP 100 side based on the size of the print data sent from the external device and the size of the spool area.
[0097] This allows for dynamic switching of operations when print data reception is interrupted, adapting to the connected host PC. Therefore, even if print data reception from an external device in the MFP 100 is interrupted, printing can resume normally.
[0098] Third Embodiment
[0099] Next, a third embodiment of this disclosure will be described. In the following description, parts similar to the first and second embodiments will be omitted.
[0100] The second embodiment allows dynamic switching between disconnecting from the printer side (S710) and waiting to receive the FIN packet from the host PC side (S707) depending on whether the size of the print data exceeds the size of the spool area. However, as described above, unless the obstacle preventing the receipt of print data is resolved, the receipt of print data from the host PC continues in a state of interruption. In this state, a disconnection occurs between the host PC and the printer when, for example, a transition to sleep or restart occurs in the host PC, or when a transition to sleep (error sleep) occurs in the MFP 100 without resolving the error. As a result, there is a possibility that the print job cancellation operation in the MFP 100 may fail, resulting in the output of abnormal printouts.
[0101] Therefore, according to this embodiment, the MFP 100 performs the following operations to avoid outputting abnormal prints. If a predetermined time has elapsed while the reception of print data from the external device remains suspended, and the size of the print data sent from the external device does not exceed the size of the spool area, the MFP 100 controls whether to disconnect from the external device based on whether the spool area is formed by volatile memory.
[0102] <Processing Procedure>
[0103] Figure 9This is a flowchart illustrating the processing procedure of print data receiving processing performed by CPU 201 in MFP 100 according to this embodiment. Figure 9 The processing of each step can be achieved in the MFP100 by the CPU 201 reading the program stored in ROM 203 or HDD 204 into RAM 202 and executing it thereon.
[0104] The processing of steps S701 to S703, S801 to S804, S704 to S708, and S805 is similar to that of the second embodiment. In this embodiment, if the size exceeds the flag is set to OFF in step S805 (i.e., the size of the printed data is equal to or less than the size of the spool area), the CPU 201 will proceed to step S901.
[0105] In step S901, CPU 201 determines whether the spool region is formed by volatile memory. If the spool region is formed by non-volatile memory (HDD, SD memory, USB memory, etc.), CPU 201 returns the process to step S704, or if the spool region is formed by volatile memory, the process proceeds to step S710.
[0106] In step S710, similar to the first and second embodiments, the CPU 201 sends an RST packet (RST command) to the host PC, which is the source of the print data, via LAN I / F 208. In other words, the sending of the RST packet causes the printer (MFP 100) to actively disconnect from the host PC. Upon completing the disconnection from the host PC in the manner described above, the CPU 201 terminates according to... Figure 9 The process shown illustrates the reception and processing of printed data.
[0107] As described above, if a predetermined time has elapsed while the reception of print data from an external device remains suspended and the size of the print data sent from the external device does not exceed the size of the spool area, the MFP 100 according to this embodiment operates as follows: Specifically, if the spool area is formed by volatile memory, the MFP 100 sends a disconnect request to the external device requesting disconnection. On the other hand, if the spool area is formed by non-volatile memory, the MFP 100 maintains the connection with the external device. Thus, if the size of the print data sent from the external device does not exceed the size of the spool area, the MFP 100 maintains the connection with the external device only when the spool area is formed by non-volatile memory. According to the above processing, even if the reception of print data from the external device is stopped midway by the MFP 100, the printing process can be resumed normally while avoiding the output of abnormal printouts.
[0108] Other embodiments
[0109] The embodiments of the present invention can also be implemented by providing software (programs) that perform the functions of the above embodiments to a system or device via a network or various storage media, and the computer or central processing unit (CPU) or microprocessor unit (MPU) of the system or device reads out and executes the program.
[0110] While the invention has been described with reference to exemplary embodiments, it should be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the appended claims should be accorded the broadest interpretation to cover all such modifications and equivalent structures and functions.
Claims
1. A printing device capable of communicating with an external device, the printing device comprising: Establishment component, used to establish a connection with external devices according to a predetermined communication protocol; A receiving component is configured to receive print data transmitted from the external device via the connection and temporarily store the print data in a spool area; A printing component for performing printing processing based on printing data stored in the spool area; as well as A control unit is configured to, if the reception of print data from the external device is stopped midway and a predetermined time has elapsed while the reception remains stopped, control whether to disconnect the connection from the external device from the printing device side based on the size of the print data sent from the external device and the size of the spool area. Specifically, if the size of the print data sent from the external device exceeds the size of the spooler area, the connection between the printer and the external device is disconnected from the printer side. If the predetermined time has elapsed while the reception of print data from the external device remains stopped, and the size of the print data sent from the external device does not exceed the size of the spool area, the control unit maintains its connection with the external device.
2. The printing device according to claim 1, wherein, The control unit obtains the size of the print data from a control command sent before the print data is sent from the external device.
3. The printing device according to claim 1, wherein, If the predetermined time has elapsed while the reception of print data from the external device remains stopped, and the size of the print data sent from the external device exceeds the size of the spool area, the control unit sends a disconnect request to the external device to request disconnection of the connection.
4. The printing device according to claim 1, wherein, If the predetermined time has elapsed while the reception of print data from the external device remains stopped, and the size of the print data sent from the external device does not exceed the size of the spool area, the control unit controls whether to disconnect the connection from the external device from the printing device side based on whether the spool area is formed by volatile memory.
5. The printing apparatus according to claim 4, wherein, If the predetermined time has elapsed while the reception of print data from the external device remains stopped, and the size of the print data sent from the external device does not exceed the size of the spool area, If the spool region is formed of volatile memory, the control unit sends a disconnect request to the external device to request the disconnection of the connection. If the spool region is formed of non-volatile memory, the control unit maintains connection with the external device.
6. The printing apparatus according to claim 1, wherein, The predetermined time is determined to be shorter than the timeout period used to cancel the print job in the external device if the printing device fails to resume receiving print data.
7. The printing apparatus of claim 1, further comprising a changing component, the changing component being configured to change the predetermined time based on a user operation received via a setting screen displayed on a display component of the printing apparatus.
8. The printing apparatus according to claim 1, wherein, The predetermined communication protocol is the Line Printer Daemon Protocol, also known as the LPD protocol.
9. A printing device capable of communicating with an external device, the printing device comprising: Establishment component, used to establish a connection with external devices according to a predetermined communication protocol; A receiving component is configured to receive print data transmitted from the external device via the connection and temporarily store the print data in a spool area; A printing component for performing printing processing based on printing data stored in the spool area; as well as A control unit is configured to, if the reception of print data from the external device is stopped midway and a predetermined time has elapsed while the reception remains stopped, control whether to disconnect the connection from the external device from the printing device side based on the size of the print data sent from the external device and the size of the spool area. Specifically, if the size of the print data sent from the external device exceeds the size of the spooler area, the connection between the printer and the external device is disconnected from the printer side. If the predetermined time has elapsed while the reception of print data from the external device remains stopped, and the size of the print data sent from the external device does not exceed the size of the spool area, the control unit controls whether to disconnect the connection from the external device from the printing device side based on whether the spool area is formed by volatile memory.
10. The printing apparatus according to claim 9, wherein, The control unit obtains the size of the print data from a control command sent before the print data is sent from the external device.
11. The printing apparatus according to claim 9, wherein, If the predetermined time has elapsed while the reception of print data from the external device remains stopped, and the size of the print data sent from the external device exceeds the size of the spool area, the control unit sends a disconnect request to the external device to request disconnection of the connection.
12. The printing apparatus according to claim 9, wherein, If the predetermined time has elapsed while the reception of print data from the external device remains stopped, and the size of the print data sent from the external device does not exceed the size of the spool area, If the spool region is formed of volatile memory, the control unit sends a disconnect request to the external device to request the disconnection of the connection. If the spool region is formed of non-volatile memory, the control unit maintains connection with the external device.
13. The printing apparatus according to claim 9, wherein, The predetermined time is determined to be shorter than the timeout period used to cancel the print job in the external device if the printing device fails to resume receiving print data.
14. The printing apparatus of claim 9, further comprising a changing component for changing the predetermined time based on a user operation received via a setting screen displayed on a display component of the printing apparatus.
15. The printing apparatus according to claim 9, wherein, The predetermined communication protocol is the Line Printer Daemon Protocol, also known as the LPD protocol.
16. A control method for a printing device, the printing device being able to communicate with an external device, the control method comprising: Establish a connection with external devices according to the predetermined communication protocol; Receive print data sent from the external device via the connection, and temporarily store the print data in the spool area; Printing is performed based on the print data stored in the spool area; as well as If the reception of print data from the external device is interrupted, and a predetermined time has elapsed while the reception remains stopped, the system controls whether to disconnect the connection from the external device based on the size of the print data sent from the external device and the size of the spool area. Specifically, if the size of the print data sent from the external device exceeds the size of the spooler area, the connection between the printer and the external device is disconnected from the printer side. If the predetermined time has elapsed while the reception of print data from the external device remains stopped, and the size of the print data sent from the external device does not exceed the size of the spool area, the connection with the external device is maintained.
17. A computer-readable storage medium storing a program for causing a computer to perform the control method of the printing apparatus according to claim 16 when executed by the computer.
18. A computer program product comprising a program for causing the computer to perform the control method of the printing apparatus according to claim 16 when executed by the computer.
Citation Information
Patent Citations
Control device and method of data communications between devices
JP2003256178A
Printer and control method therefor, program
JP2011116083A
Communication apparatus having direct wireless communication function and method for controlling communication apparatus
US20170083266A1