Abstract:
A method and system for file transfer, an instant messaging terminal, and a computer storage medium are described, so as to solve the problem that in case of a poor network environment, too much manual intervention is required when file transfer through an existing instant messaging software encounters a network connection interruption, leading to a low transfer efficiency and poor user. With the present disclosure, an instant messaging terminal is provided with an option of automatic retransfer upon disconnection, an option of automatic reception upon disconnection, and an option of automatic offline-file forwarding upon disconnection, such that when transfer of a file is interrupted, an instant messaging system can automatically retransfer (or resume the interrupted transfer of) the file, thus enhancing efficiency in file transfer.

Description:
CROSS REFERENCE TO RELATED APPLICATIONS 
       [0001]    This is a continuation application of International Patent Application No.:PCT/CN2013/071409, filed on Feb. 5, 2013, which claims priority to Chinese Patent Application No.:201210044496.3 filed on Feb. 24, 2012, the disclosure of which is incorporated by reference herein in its entirety. 
     
    
     TECHNICAL FIELD 
       [0002]    The present disclosure relates to the field of Instant Messaging (IM), and in particular to a method and system for file transfer each of which enables automatic resumption of sending and receiving, an instant messaging terminal, and a computer storage medium. 
       BACKGROUND 
       [0003]    All existing instant messaging systems can transfer files. Thus, a user of an instant messaging system may send a file to a friend or receive a file from a friend, wherein a basic process is that: 
         [0004]    (1) a sender sends a file transfer request to a receiver, then waits for a response of the receiver; 
         [0005]    (2) after an instant messaging client of the receiver receives the file transfer request, the client prompts the receiver user on the screen to receive the file, and after the receiver user clicks on a receiving button to confirm to receive, the receiver sends the sender a response to agree to receive; 
         [0006]    (3) after receiving the response to agree to receive, the sender starts to transmit the file to the receiver; 
         [0007]    (4) during the file transfer, if a network connection is accidentally interrupted, then after detecting the transfer disconnection, the sender prompts the sender user to retransfer or to resumption of the transfer, and after the sender user clicks on a retransfer or resuming-transfer button, the sender sends the receiver a retransfer or resuming-transfer request; 
         [0008]    (5) after the receiver detects the transfer disconnection, the receiver user is prompted of the transfer disconnection; after the receiver detects the retransfer or resuming-transfer request from the sender, the receiver user is prompted whether to agree to retransfer or to resumption of the transfer; after the receiver user confirms, a retransfer or resuming-transfer response is sent to the sender; 
         [0009]    (6) when receiving a response from the sender to agree to retransfer or resumption of the transfer, the receiver retransfers the file, or resumes the transfer of the interrupted file to the sender. 
         [0010]    On-line file transfer refers to file transfer through a network connection established directed between the sender and the receiver when both the sender and the receiver of the file are online. Off-line file transfer refers to that when the receiver of the file is offline, the file to be transferred is stored by a server, and is forwarded by the server to the receiver after the receiver goes online. 
         [0011]    In such a way, file transfer between friends can be implemented. In a case of a poor network environment in which the transfer is susceptible to interruption, the existing instant messaging system requires manual confirmation from both the sender and the receiver to determine whether a retransfer or resumption of the transfer is needed. The retransfer refers to transferring the whole file once again, whereas the resumption of the transfer refers to resumption of the transfer at a point of interruption, namely, transfer of the remaining part that is not transferred is continued at a location of interruption based on the transferred part of the file. 
         [0012]    However, when the transfer is interrupted frequently due to poor network environment, the file sender has to initiate a file sending operation frequently; meanwhile, the file receiver has to initiate a file receiving operation frequently, which is very inconvenient for users. Particularly, when a user at one party is not on scene, the file transfer is unable to be completed. 
         [0013]    Therefore, in case of a poor network environment, too much manual intervention is required when file transfer by an existing instant messaging software encounters a network connection interruption, leading to a low transfer efficiency. 
       SUMMARY 
       [0014]    In view of this, it is desired to provide in the present disclosure a method and system for file transfer as well as an instant messaging terminal, so as to enhance efficiency in file transfer. 
         [0015]    To this end, a technical solution of the present disclosure is implemented as follows. 
         [0016]    According to an aspect of an embodiment of the present disclosure, a method for file transfer which is applied to an instant messaging system includes: 
         [0017]    when transfer of a file is interrupted, and when a sender is configured with an option of automatic retransfer upon disconnection, the sender sends an online file-retransfer or resuming-file-transfer request to a receiver; and 
         [0018]    when transfer of a file is interrupted, and when the receiver is configured with an option of automatic reception upon disconnection, the receiver makes automatically response to a file-retransfer or resuming-file-transfer request from the sender, then the file is retransferred; alternatively, the transfer of the file is resumed. 
         [0019]    According to an aspect of an embodiment of the present disclosure, a method for file transfer includes: 
         [0020]    when transfer of a file is interrupted, and when a sender is configured with an option of automatic retransfer upon disconnection, an instant messaging terminal which serves as the sender sends automatically an online file-retransfer or resuming-file-transfer request to a receiver, and retransfers the file on line or resumes on line the interrupted transfer of the file to the receiver after a response to confirm receiving by the receiver is received. 
         [0021]    According to an aspect of an embodiment of the present disclosure, an instant messaging terminal includes: 
         [0022]    a first configuring module arranged to configure or cancel an option of automatic retransfer upon disconnection; and 
         [0023]    an automatic retransferring module arranged to, when the option of automatic retransfer upon disconnection is configured and when transfer of a file is interrupted, send automatically an online file-retransfer or resuming-file-transfer request to a receiver, and retransfer the file on line or resume on line the interrupted transfer of the file to the receiver after a response to confirm receiving by the receiver is received. 
         [0024]    According to an aspect of an embodiment of the present disclosure, another method for file transfer includes: 
         [0025]    when an instant messaging terminal at a receiver is configured with an option of automatic reception upon disconnection, and when transfer of a file is interrupted, the instant messaging terminal which serves as the receiver makes automatically response to a file-retransfer or resuming-file-transfer request from the sender by sending the sender a response to confirm receiving, and receives again the file, or resumes reception of the interrupted file. 
         [0026]    According to an aspect of an embodiment of the present disclosure, another instant messaging terminal includes: 
         [0027]    a second configuring module arranged to configure or cancel an option of automatic reception upon disconnection; and 
         [0028]    an automatic receiving module arranged to, when the option of automatic reception upon disconnection is configured and when transfer of a file is interrupted, make automatically response to a file-retransfer or resuming-file-transfer request from the sender by sending the sender a response to confirm receiving, and receive again the file, or resume reception of the interrupted file. 
         [0029]    According to an aspect of an embodiment of the present disclosure, an instant messaging terminal includes: the first configuring module, the automatic retransferring module, the second configuring module and the automatic receiving module. 
         [0030]    According to an aspect of an embodiment of the present disclosure, a system for file transfer includes: a first instant messaging terminal serving as a file sender, including the first configuring module and the automatic retransferring module; a server; and an second instant messaging terminal serving as a file receiver including the second configuring module and the automatic receiving module. 
         [0031]    According to an aspect of an embodiment of the present disclosure, a computer storage medium is provided, in which a computer program is stored, which computer program is for executing an aforementioned method for file transfer. 
         [0032]    With the embodiments of the present disclosure, an instant messaging terminal is provided with an option of automatic retransfer upon disconnection, an option of automatic reception upon disconnection, an option of automatic offline-file forwarding upon disconnection, such that when transfer of a file is interrupted, an instant messaging system can automatically retransfer the file or resume the interrupted transfer of the file, thus enhancing efficiency in file transfer. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0033]      FIG. 1  is a flowchart of a method for sending a file by a sender (e.g. an instant messaging terminal) according to an embodiment of the present disclosure; 
           [0034]      FIG. 2  is a flowchart of a method for receiving a file by a receiver (e.g. an instant messaging terminal) according to an embodiment of the present disclosure; and 
           [0035]      FIG. 3  is a diagram depicting a functional structure of a system for file transfer according to an embodiment of the present disclosure. 
       
    
    
     DETAILED DESCRIPTION 
       [0036]      FIG. 1  is a flowchart of a method for sending a file by a sender (e.g. an Instant Messaging terminal) according to an embodiment of the present disclosure. The method includes the following steps. 
         [0037]    In step  101 , a sender sends a file transfer request to a receiver, and after receiving a response to confirm receiving from the receiver, transmits a file to the receiver in a transfer mode such as TCP. 
         [0038]    The receiver may be an instant messaging client or an instant messaging server (referred to as a server hereinafter). 
         [0039]    In step  102 , if during the file transfer, it is detected that the file transfer is accidentally interrupted, for example due to a factor such as a network problem, step  104  is executed, otherwise step  103  is executed. 
         [0040]    In step  103 , when no accidental interruption of the file transfer is detected, the file transfer between the sender and the receiver is completed normally, and the flow ends. 
         [0041]    In step  104 , when it is detected that the file transfer is interrupted, it is determined whether the sender is configured with an option of automatic retransfer upon disconnection. If the sender is configured with the option, step  106  is executed, otherwise step  105  is executed. 
         [0042]    In step  105 , a user is prompted that file transfer fails, and the flow ends. 
         [0043]    In some examples, in a case that the sender is not configured with the option of automatic retransfer upon disconnection, instant messaging terminals at both the sender and the receiver may prompt respective users that file transmission fails, the sender user may manually initiate the retransfer or resuming-transfer request again, the receiver user may manually accept the request. If the receiver is configured with an option of automatic reception upon disconnection, when the receiver receives a retransfer or resuming-transfer request sent by the sender, the receiver may automatically send the sender a response to proceed with online file retransfer or resumption of the transfer at an interrupted point. 
         [0044]    In step  106 , the sender initiates automatically an online file-retransfer or resuming-file-transfer request to the receiver. 
         [0045]    In some examples, after the sender is configured with the option of automatic retransfer upon disconnection, when transfer of a file is interrupted, the sender will monitor in real time whether the network is back to normal, and once the network is back to normal, the sender will automatically send the receiver the online file-retransfer or resuming-file-transfer request. 
         [0046]    In step  107 , after the sender initiates automatically an online file-retransfer or resuming-file-transfer request, the sender waits for a confirming response of the receiver; if no confirming response is received from the receiver within a set period, step  109  is executed, otherwise step  108  is executed. 
         [0047]    In step  108 , after a confirming response of the receiver is received, online file retransfer or resumption of the transfer may be performed between the sender and the receiver, and the flow ends after transfer completes. 
         [0048]    In step  109 , the sender determines whether it is configured with an option of automatic offline-file forwarding upon disconnection; if it is configured with the option, step  110  is executed, otherwise a user is prompted that automatic retransfer or resumption of the transfer fails; and the flow ends. 
         [0049]    In step  110 , the sender initiates automatically an offline file-retransfer or resuming-file-transfer request to a server; after the server returns an acknowledgement, the sender may send the file first to the server for cache; and after the receiver goes on line again, the receiver may receive the file of which transfer is interrupted or resume the interrupted transfer of the file from the server. 
         [0050]    With the method for sending a file by a sender according to the embodiments, when accidentally interrupted, a transfer will not be affected negatively as in prior art, as when it is detected that file transfer is accidentally interrupted for example due to a factor such as a network problem, it will be determined whether the sender is configured with the option of automatic retransfer upon disconnection. When the sender is configured with the option, the sender initiates automatically an online file-retransfer or resuming-file-transfer request to the receiver, thus enhancing efficiency in file transfer. 
         [0051]      FIG. 2  is a flowchart of a method for receiving a file by a receiver (e.g. an Instant Messaging terminal) according to an embodiment of the present disclosure. The method includes the following steps. 
         [0052]    In step  201 , after a receiver receives a file transfer request from a sender and sends the sender a confirming response, file transfer starts between the sender and the receiver. 
         [0053]    In step  202 , if during the file transfer, it is detected that the file transfer is interrupted, for example due to a network problem, step  204  is executed, otherwise step  203  is executed. 
         [0054]    In step  203 , when there is no interruption during the file transfer, the file transfer between the sender and the receiver is completed normally, and the flow ends. 
         [0055]    In step  204 , it is determined whether the receiver is configured with an option of automatic reception upon disconnection. When the receiver is configured with the option, step  206  is executed, otherwise step  105  is executed. 
         [0056]    In step  205 , a user is prompted that file transfer fails, and the flow ends. 
         [0057]    In some examples, when the receiver is not configured with the option of automatic reception upon disconnection and the receiver is a server, the flow ends. When the receiver is not configured with the option of automatic reception upon disconnection and the receiver is an instant messaging terminal, the instant messaging terminal will prompt its user that file transmission fails, and after the receiver receives a file-retransfer or resuming-file-transfer request from the sender, the request may be manually accepted by a user, so as to complete file transfer. 
         [0058]    In step  206 , when the receiver receives the file-retransfer or resuming-file-transfer request from the sender, the receiver automatically accepts the request of the sender by sending the sender a response to confirm receiving, and a file is retransferred or the file transfer is resumed at an interrupted point. 
         [0059]    In some examples, in the flow shown in  FIG. 2 , both the receiver and the sender may be instant messaging terminals. In some examples, the sender may be a server. In some examples, the receiver may be a server. 
         [0060]    With the method for receiving a file by a receiver according to the embodiments, when accidentally interrupted, a transfer will not be affected negatively as in prior art, as when it is detected that file transfer is interrupted for example due to a network problem, it will be determined whether the receiver is configured with the option of automatic reception upon disconnection. If the receiver is configured with such an option, then when the receiver receives a file-retransfer or resuming-file-transfer request initiated by the sender, the receiver automatically accepts the request of the sender by sending the sender a response to confirm receiving, and a file is retransferred or the file transfer is resumed at an interrupted point, thus enhancing efficiency in file transfer. 
         [0061]      FIG. 3  is a schematic diagram of a modularized functional structure of a system for file transfer according to an embodiment of the present disclosure. The system includes a sender  300  (e.g. an instant messaging terminal), a receiver  320  (e.g. an instant messaging terminal), and a server  310 . 
         [0062]    An instant messaging terminal which may serve as the sender  300  may include: 
         [0063]    a first configuring module  301  arranged to configure or cancel an option of automatic retransfer upon disconnection; and 
         [0064]    an automatic retransferring module  302  arranged to, when the option of automatic retransfer upon disconnection is configured and when transfer of a file is interrupted, send automatically an online file-retransfer or resuming-file-transfer request to a receiver, and retransfer the file on line or resume on line the interrupted transfer of the file to the receiver after a response to confirm receiving by the receiver is received. 
         [0065]    In some examples, in the instant messaging terminal serving as the sender  300 , the first configuring module  301  may be further arranged to configure a n option of automatic offline-file forwarding. In some examples, the automatic retransferring module may be further arranged to, when the option of automatic offline-file forwarding is configured and in case that no response to confirm receiving by the receiver is received within a set period after the online file-retransfer or resuming-file-transfer request is sent, send automatically an offline file-retransfer or resuming-file-transfer request to the server  310 . 
         [0066]    An instant messaging terminal which may serve as the receiver  320  may include: 
         [0067]    a second configuring module  321  arranged to configure or cancel an option of automatic reception upon disconnection; and 
         [0068]    an automatic receiving module  322  arranged to, when the option of automatic reception upon disconnection is configured and when transfer of a file is interrupted, make automatically response to a file-retransfer or resuming-file-transfer request from the sender by sending the sender a response to confirm receiving, and receive again, or resume reception of, the file of which transfer is interrupted. 
         [0069]    In some examples, opposite to an instant messaging terminal which serves as the receiver, the sender of the file may be an instant messaging terminal or a server. 
         [0070]    In some embodiments of the present disclosure, function modules included in an instant messaging terminal which serves as the sender and function modules included in an instant messaging terminal which serves as the receiver are integrated together to implement automatic retransfer (or resumption of the transfer) and automatic reception of a disconnected file. 
         [0071]    When implemented in form of a software functional module and sold or used as an independent product, integrated modules of embodiments of the present disclosure may also be stored in a computer-readable storage medium. Based on such an understanding, an essential part of embodiments of the present disclosure or a part contributing to the prior art may appear in form of a software product, which software product is stored in a storage medium, and includes a number of instructions for allowing a computer equipment (such as a personal computer, a server, a network equipment, or the like) to execute all or part of the methods in various embodiments of the present disclosure. The storage medium include various media that can store program codes such as a U disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, a CD, and the like. Thus, embodiments of the present disclosure are not limited to any specific combination of hardware and software. 
         [0072]    An embodiment of the present disclosure provides a computer storage medium in which a computer program is stored, which computer program is for executing the method for file transfer according to an embodiment of the present disclosure. 
         [0073]    What described are various embodiments of the disclosure, and are not intended to limit the scope of the present disclosure.