Abstract:
Disclosed are a communication control apparatus and a communication control method for re-establishing the connection of a line when a user disconnects the line by mistake during the transmission of data, and a storage medium therefor.  
     According to the present invention, when a lower layer is disconnected while data is being transmitted to another apparatus, an upper layer is so controlled that it maintains a session for a predetermined period of time, and when a line connection is re-established within the predetermined period of time, establishes a connection for the transmission of data.

Description:
BACKGROUND OF THE INVENTION  
         [0001]    1. Field of the Invention  
           [0002]    The present invention relates to processing performed to remove an abnormality on a data communication line, and to a printing process for the transmission of data along, for example, an IEEE 1394 line.  
           [0003]    2. Related Background Art  
           [0004]    Since for the performance of a communication process across a so-called centronics line only an image data source and a printer are connected together, basically, even when a physical line is disconnected, the canceling of a session is not required unless a user physically breaks the connection. And when data are being transmitted to other apparatuses, if a lower layer is disconnected from a line, accordingly an upper layer is immediately disconnected from the line.  
           [0005]    Assume that, as provided for by the IEEE 1394 specification, a plurality of image data sources and a plurality of printers are connected together along a single, closed communication line. If, for example, one of the image sources that is connected to the line and that is transmitting data is disconnected, and if a printer that during a session communicates with that image data source continues to be connected to the source, as with a centronics line, the printer will be unable to transmit data to other image data sources on the line.  
           [0006]    If an upper layer is disconnected immediately after a lower layer is disconnected, or if the disconnection and the re-connection of a line is performed due to the careless performance of an operation by a user or due to a rearrangement of apparatuses, the printing process must be repeated from the beginning. As a result, an undesirable, excessive expenditure of time, paper and ink (toner, etc.)  
         occurs. SUMMARY OF THE INVENTION  
         [0007]    It is, therefore, one objective of the present invention to provide a communication control apparatus and a communication control method for re-connecting a system that, during a data transmission session, has been disconnected from a line due to the careless performance of an operation by a user, and a storage medium therefor.  
           [0008]    To achieve the above objective, according to the present invention, a communication control apparatus comprises:  
           [0009]    control means for, if a lower layer is disconnected while data is being transmitted to an apparatus, permitting an upper layer to continue to maintain a session for a predetermined period of time, and for, if a line connection is re-established within the predetermined period of time, permitting the upper layer to establish a connection for the transmission of data.  
           [0010]    Further, according to the present invention, a communication control method comprises:  
           [0011]    a control step for, if a lower layer is disconnected while data is being transmitted to an apparatus, permitting an upper layer to continue to maintain a session for a predetermined period of time, and for, if a line connection is re-established within the predetermined period of time, permitting the upper layer to establish a connection for the transmission of data.  
           [0012]    Furthermore, according to the present invention, provided is a storage medium, on which is stored a communication control program, the communication control program comprising:  
           [0013]    a control step for, if a lower layer is disconnected while data is being transmitted to an apparatus, permitting an upper layer to continue to maintain a session for a predetermined period of time, and for, if a line connection is re-established within the predetermined period of time, permitting the upper layer to establish a connection for the transmission of data. 
       
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0014]    [0014]FIG. 1 is a diagram showing an example system configuration for which the present invention can be applied;  
         [0015]    [0015]FIG. 2 is a hardware block diagram showing a host computer according to one embodiment of the present invention;  
         [0016]    [0016]FIG. 3 is a hardware block diagram showing a printer according to one embodiment of the present invention;  
         [0017]    [0017]FIG. 4 is a flowchart showing a print data transmission program;  
         [0018]    [0018]FIG. 5 which is composed of FIGS. 5A and 5B are flowcharts showing the processing performed by the host computer when the printer is disconnected from a bus during the transmission of print data;  
         [0019]    [0019]FIG. 6 is a flowchart showing the processing performed when the operating condition of the printer is normal;  
         [0020]    [0020]FIG. 7 is a flowchart showing the processing performed by the printer when the host computer is disconnected from the bus during the transmission of print data; and  
         [0021]    [0021]FIG. 8 is a diagram showing the relationship between an OSI seven layer model and the present invention. 
     
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS  
       [0022]    The preferred embodiments of the present invention will now be described in detail while referring to the accompanying drawings.  
       (First Embodiment)  
       [0023]    [0023]FIG. 1 is a diagram showing an example system configuration for which the present invention is applied.  
         [0024]    [0024]FIG. 2 is a block diagram illustrating the internal components of a host computer shown in FIG. 1. The host computer comprises: a CPU  1 , for controlling the overall operations of a host computer of the present invention; a RAM  2 , used as a work area for the CPU  1 ; a memory (a hard disk, a floppy disk, or a CDROM)  3  in which control programs, including those for flowcharts in FIG. 4 and FIGS. 5A and 5B of the present invention, are stored; an input unit (specifically, a mouse or a keyboard)  4 , used by a user to enter a command; an IEEE 1394 controller  5 ; a user I/F display  6 , specifically a display device; and a main bus  8 .  
         [0025]    [0025]FIG. 3 is a block diagram illustrating the internal components of a printer in FIG. 1. The printer comprises: a CPU  11 , for controlling the printer; a RAM  12 , used as a work area for the CPU  11 ; a ROM (a floppy disk, a CD-ROM or a hard disk)  14 , in which are stored control programs, including those for the flowcharts in FIGS. 6 and 7 for the present invention; an IEEE 1394 controller  15 ; a printer engine  16 ; and a main bus  18 .  
         [0026]    It should be noted that, even though not specifically described, in the host computer the CPU  1  controls the RAM  2 , the memory  3 , the input unit  4 , and the IEEE 1394 controller  5 , via the main bus  8 . In the printer, the CPU  11  controls the RAM  12 , the ROM  13 , the IEEE 1394 controller  15 , and the printer engine  16 , via the main bus  18 .  
         [0027]    In the host computer, the processing to be performed in accordance with the present invention is divided into a print data transmission program and a bus reset interrupt processing program. In the printer, the processing to be performed in accordance with the present invention is divided into a print data reception program and a bus reset interrupt processing program.  
         [0028]    It is assumed that SBP-2 is automatically logged out when a specified apparatus is disconnected from the bus.  
         [0029]    The print data transmission program for the host computer will now be described while referring to FIG. 4.  
         [0030]    First, the program waits for print data to be prepared and for a printing request to be issued by a user (S 401 ).  
         [0031]    When a printing request is issued, an application in the host computer produces additional print data based on the data prepared by the user (S 402 ). To initiate the transmission of data to the printer, a login process for the printer is performed in accordance with the rules established for SBP-2 by the IEEE 1394 controller  5  connected to the IEEE 1394 line (S 403 ). A check is then performed to determine whether the login was successful (S 404 ). If the login was not successful, it is assumed that the operating condition of the printer is abnormal or that the printer is busy, and a user is notified via the user I/F display  6  that the printer can not be used at the present (S 405 ). Thereafter, the print data that were prepared are cleared (S 406 ).  
         [0032]    If the login was successful, however, login identifier “NULL” is transmitted along the IEEE 1394 line, via the IEEE 1394 controller  5 , to the printer, in order to notify the printer that a new printing request has been received (S 407 ). Then, the program waits for the reception of a login identifier that is issued by the printer relative to the printing request (S 408 ). Upon receiving the login identifier, its value is stored in a “PRNLOGINID” area in the RAM  2  (S 409 ). Thereafter, the user is requested to enter the time for the session time-out via the user I/F display  6  (S 410 ). The program then waits for the user to employ the input unit  4  to enter the time for the session time-out (S 411 ). When the user enters the time, its value is stored in a “SESSIONTIME” area in the RAM  2  (S 412 ), and the value stored in the “SESSIONTIME” area in the RAM  2  is transmitted via the IEEE 1394 controller  5  and the IEEE 1394 line to the printer (S 413 ). Then the transmission of the print data to the printer is begun via the IEEE controller  5  and the IEEE 1394 line (S 414 ). When the printer data have been transmitted, the data transmission process is terminated (S 415 ), and by logging out the printer, which is performed in accordance with the rules established for SBP-2, the communication process is also terminated (S 416 ). Then, the process at step S 401  is performed while the program waits for the next printing request.  
         [0033]    An explanation will now be given, while referring to FIGS. 5A and 5B, for the processing performed by the host computer when the printer is disconnected from the IEEE 1394 line while print data are being transmitted.  
         [0034]    This processing is performed in accordance with a host computer interrupt program that is initiated by an IEEE 1394 bus reset.  
         [0035]    When an interrupt occurs (S 500 ), a check is performed to determine whether the interrupt is the result of an IEEE 1394 bus reset at a lower layer shown in FIG. 8 (a lower layer detects the disconnection of a line, or the connection of a new apparatus to a line, and performs a line disconnection) (S 501 ). If the interrupt is not the result of a bus reset, an interrupt routine that corresponds to the reason for the interrupt is activated and the appropriate processing is performed (S 502 ). The processing is thereafter terminated (S 522 ). If the interrupt is the result of a bus reset, a check is performed to determine whether print data are currently being transmitted to the printer (S 503 ). When print data are not being transmitted, it is assumed that there is no event to be processed, and the interrupt process is terminated (S 522 ).  
         [0036]    When print data are being transmitted, a check is performed to determine, via the IEEE 1394 controller  5  on the IEEE 1394 line, whether a printer in a session is currently connected to the bus (S 504 ). If the printer in the session is connected, it is assumed that the bus reset does not adversely affect the communications performed by the and the interrupt process is terminated (S 522 ). If the pertinent printer is not connected, it is assumed that the printer that is receiving data is not connected to the bus, and a logout process for the internal communication performed by the host computer (an abnormality end process) is performed (S 505 ). The timer for the host computer is started and measures the elapsed time since the printer was disconnected from the bus (S 506 ). The elapsed time is stored in an area “TIME” in the RAM  2 . A value in “TIME” is then compared with a value in “SESSIONTIME” (S 507 ).  
         [0037]    When the value in “TIME” is &gt;the value in “SESSIONTIME”, it is assumed that the session time has expired, and print data stored in the host computer are cleared (S 519 ) and all the tasks associated with the transmission of print data are initialized (S 520 ). Then, the user is notified via the user I/F display  6  that printing has been halted (S 521 ). The processing is thereafter terminated (S 522 ).  
         [0038]    When the value in “TIME” is &lt;the value in “SESSIONTIME”, it is assumed that the session time has not yet expired, and a check is performed to determine whether the printer in the session has been reconnected to the bus (S 508 ). If the printer has not yet been re-connected, the process at step S 507  is repeated.  
         [0039]    When the printer in use during the session has been re-connected, the login of the printer in the session is again performed in accordance with the rules established for SBP-2 (S 509 ). A check is thereafter performed to determine whether the login has been successful (S 510 ). If the login has not been successful, it is assumed that an abnormality has occurred at the printer, and the user is notified via the user I/F display  6  that the printer can not presently be used (S 517 ). Thereafter, print data stored in the host computer are cleared (S 518 ), and all the tasks associated with the transmission of print data are initialized. If the login has been successful, however, a login ID that is stored as a login identifier in area “PRNLOGINID” is transmitted along the IEEE 1394 line via the IEEE 1394 controller  5  (S 511 ), and reception of permission for continuous reception by the printer is waited for (S 512 ). If permission for continuous reception is not received, the printer is logged out to clear the print data, and all the tasks concerning the transmission of print data are initialized. But when continuous reception is permitted, transmission of print data to the printer is resumed (S 513 ). When the print data have been transmitted, the transmission process is terminated (S 514 ) and the logging out of the printer is performed in accordance with the rules established for SBP-2 for the termination of communication (S 515 ). Then all the tasks associated with the transmission of print data are initialized (S 516 ). The processing is thereafter terminated (S 522 ).  
         [0040]    The processing for receiving print data when the printer is operating normally will now be described while referring to FIG. 6.  
         [0041]    A check is performed to determine whether a login request output along the IEEE 1394 line by the host computer has been received via the IEEE 1394 controller  15  (S 601 ). When a login request has been received, sequentially, checks are performed to determine whether a login identifier has been received (S 602 ), and when one is received, whether the received identifier is a “NULL” (S 603 ). If the login identifier is a “NULL”, it is assumed that the received request is a new printing request, and a new login identifier is issued and is stored in area “LOGINID” in the RAM  12  (S 604 ). Thereafter, the login identifier is transmitted to the host computer (S 611 ) and the reception of a session time from the host computer is waited for (S 612 ). When the session time is received, its value is stored in area “SESSIONTIME” in the RAM  12  (S 613 ). Following this, print data output along the IEEE 1394 line by the host computer are received via the IEEE 1394 controller  15  (S 614 ). After the reception of print data has ended (S 615 ) and a logout notification has been received from the host computer (S 616 ), the communication process is terminated. Printing is then initiated by the printer engine  16  (S 610 ).  
         [0042]    If the received login identifier is not a “NULL”, however, it is assumed that the request is for the continuous transmission of print data that has been halted, and a check is performed to determine whether the print data for the received login identifier are valid (S 604 ). When the print data are not valid, an abnormal end notification is transmitted to the host computer to terminate the communication process (S 605 ), the printer is initialized (S 606 ), and the process at step S 601  is repeated.  
         [0043]    When the received print data are valid, permission for continuous reception is transmitted via the IEEE 1394 controller  15  and along the IEEE 1394 line to the host computer (S 607 ), and the reception of print data from the host computer is resumed (S 608 ). When the reception of data has been completed (S 609 ) and a logout notification has been received from the host computer, the communication process is terminated (S 616 ) and printing is initiated by the printer engine  16  (S 610 ). Thereafter, the process at step S 601  is repeated.  
         [0044]    An explanation will now be given, while referring to FIG. 7, for the processing performed by the printer when the host computer is disconnected from the IEEE 1394 line during the transmission of print data.  
         [0045]    This processing is performed by a program for processing an interrupt that occurs as the result of an IEEE 1394 bus reset.  
         [0046]    When an interrupt has occurred (S 700 ), a check is performed to determine whether the interrupt is the result of an IEEE 1394 bus reset (S 701 ). If the interrupt is not the result of a bus reset, an interrupt routine that corresponds to the cause of the interrupt is activated, the appropriate processing is performed (S 702 ), and the processing is thereafter terminated (S 710 ). However, if the interrupt was the result of a bus reset, a check is performed to determine, via the IEEE 1394 controller  5  and the IEEE 1394 line, whether the host computer in the session is currently connected to the bus (S 703 ). If the host computer in the session is connected to the bus, it is assumed that the bus reset has not adversely affected communication by the printer and the interrupt process is terminated (S 710 ). If the host computer in the session is not connected, it is assumed that the host computer that was transmitting the data has been disconnected from the bus and a logout process is performed inside the printer (an abnormal end process) (S 704 ). The timer for the printer is activated to measure the time that has elapsed since the host computer was disconnected from the bus, and the elapsed time is stored in area “TIME” in the RAM  12  (S 705 ). Thereafter, the value stored in “TIME” is compared with the value stored in “SESSIONTIME” (S 706 ).  
         [0047]    If the value stored in “TIME”≧the value stored in “SESSIONTIME”, it is assumed that the session time has expired and the print data that are stored in the printer are cleared (S 708 ). Then, all the tasks concerning the transmission of print data are initialized (S 709 ) and the processing is thereafter terminated (S 710 ).  
         [0048]    If the value stored in “TIME”&lt;the value in “SESSIONTIME”, it is assumed that the session time has not yet expired, and a check is performed to determine whether the host computer in the session has been reconnected to the bus (S 707 ). If the host computer has not been re-connected, the process at step S 706  is repeated.  
         [0049]    If the host computer in the session has been reconnected, the processing is thereafter terminated (S 710 ).  
         [0050]    An explanation will now be given, while referring to FIG. 8, for the form of the present invention as it compares with an OSI (Open System Interconnection) seven layer model composed in accordance with the international standard.  
         [0051]    The lower layer of the OSI seven layer model includes a physical layer, a data link layer, a network layer and a transport layer; and the upper layer includes a session layer, a presentation layer and an application layer. When the individual layers are compared with the means provided by the present invention, it is apparent that the functions of the upper layer are implemented by the control provided by the programs shown in FIG. 4 and FIGS. 5A and 5B, and that the functions of the lower layer are implemented by the control provided by SBP-2, as determined by IETF and by IEEE 1394.  
       (Second Embodiment)  
       [0052]    While in the first embodiment the session time is set by a user, the session time can be fixed by a system. Further, in the first embodiment, the session time for the disconnection of the host computer from the bus is equals that for the disconnection of the printer. However, a different session time can be set for each case.  
       (Third Embodiment)  
       [0053]    In the first embodiment, the IEEE 1394 line is employed by the host computer to transmit data to the printer. However, it can be easily understood that a great economical effect can be obtained when this control method is applied when transmitting a large amount of data along a line for which a transmission fee is charged.  
         [0054]    According to the present invention, if a plurality of image sources and a plurality of printers can be connected to a single, closed communication line like the IEEE 1394, and if an image data source in a connection that is transmitting data is disconnected from the line, the printer can exchange data with another image source along another line so long as a predetermined time has expired.  
         [0055]    Since the upper layer is not immediately disconnected upon the disconnection of the lower layer, even when the disconnection and the re-connection of a line occurs due to a careless mistake or the rearrangement of apparatuses by a user, the continuous transmission of data can be sustained so long as the line connection is re-established within a predetermined time. As a result, as concerns printing, paper, time and ink (toner) are not wasted.  
         [0056]    According to the present invention, even if a line disconnection occurs, data received before then can be effectively employed.