Abstract:
A network device including a software updating module for automatically updating software of the network device so that the software corresponds with that of a server side is provided. The software updating module includes a version file downloading unit for downloading a new version file from the server side, a main checking unit for checking whether the new version file exists, a software downloading unit for downloading new software, and a main updating unit for updating the software of the network device. A method of updating the software using the software updating module is also provided. Compared with a manual updating method, the network device and the software updating method thereof may automatically update the software, which makes them more safe, reliable and simple.

Description:
FIELD OF THE INVENTION  
       [0001]     The invention relates to a system and method for updating software, and more particularly to a system and method for automatically updating software in a network device.  
       DESCRIPTION OF RELATED ART  
       [0002]     Network devices such as digital set-top boxes, cable modems, and asymmetric digital subscriber line modems (ADSL modems), and so on include kernel software and non-kernel software including applications and drivers, etc. When using these devices, users often encounter some problems such as meeting requirements for adding software in the network device to enhance its functionality, or updating a version of the software to increase data transmission rate. Therefore, it is important to timely and efficiently add the software, or update the software version. In general, software updating is performed by a user. People undertaking an updating process should have relevant technical knowledge to ensure the reliability of their efforts to update the software. A risk of damaging the network device if the updating is performed by an unskilled user exists.  
       SUMMARY OF INVENTION  
       [0003]     One aspect of the invention provides a network device that includes a software updating module for automatically updating software of the network device so that the software corresponds with software of a server side is provided. The software updating module includes a version file downloading module for downloading a new version file, a main checking module for checking the new version file of a new software, a software downloading module for downloading the new software, and a main updating module for updating the software in the network device.  
         [0004]     Advantageously, the network device further includes a decryption module for decrypting the new version file, a verification module for verifying validity of the new software, and a kernel software checking module for checking whether the new software is kernel software. The main checking module further includes a new-added software checking module for checking whether the new version file includes a new-added software, and a version checking module for checking whether the new version file includes new version software. The main updating module further includes a kernel software updating module for updating kernel software, and a non-kernel updating software for updating non-kernel software.  
         [0005]     Another aspect of the invention provides a software updating method, which updates the software of the network device using the software updating module, so that the software of the network corresponds to that of the server side. The method includes downloading the new version file from the server side, checking the new version file to determine whether new software exists, downloading the new software when the new software exists, and updating the software of the network device.  
         [0006]     Advantageously, the method further includes checking whether the new version file includes the new-added software, checking whether the new version file includes the new version software, verifying the validity of the new-added software, checking whether the new-added software is the kernel software, updating the kernel software if the new-added software is the kernel software, and updating the software if the new-added software is not the kernel software. The kernel software updating process further includes writing the kernel software to a storage device of the network device, updating kernel software information in an old version file, deleting a temporary folder in the network device, and restarting the network device. The non-kernel updating process further includes updating the old version file and identifying the corresponding software as “ALREADY UPDATED”.  
         [0007]     Other advantages and novel features will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings, in which: 
     
    
     BRIEF DESCRIPTION OF DRAWINGS  
       [0008]      FIG. 1  is a schematic diagram of a software updating module of a network device of the invention;  
         [0009]      FIG. 2  is a flow chart of updating software using a software updating module of a network device of the invention; and  
         [0010]      FIG. 3  is a flow chart of updating kernel software using a kernel software updating unit of a network device of the invention. 
     
    
     DETAILED DESCRIPTION  
       [0011]     Current network devices each have a version file of software stored therein. In the embodiment, in order to implement automatic updating of software, information stored in the version file of a network is compared with that in a server side, item by item. The information stored in the version file includes: file name, which is a name of the software stored in the network device; version, in updating the software, the network device compares a software version of the server side with that of the network device using the version information, to determine whether a new software version is required; date, which is launching date of a corresponding version software; path, which is a folder in which the software should be located; digest, which is a verification string for confirming whether the software is appropriate or not, such as Message Digest Algorithm 5 (MD5) verification; and comment, which is used as further explanation of the software.  
         [0012]     The network device in the embodiment may be a set top box, an asymmetric digital subscriber line (ADSL) modem, a cable modem, etc.  
         [0013]     Now referring to  FIG. 1 , a schematic diagram illustrating a software updating system  100  in the network device according to an embodiment of the invention is shown. In the exemplary embodiment, the software updating system  100  is used to update the software of the network device to correspond with that of the server side. The software updating system  100  includes a version file downloading unit  111 , a decryption unit  113 , a main checking unit  115 , a software downloading unit  117 , a verification unit  119 , a kernel software checking unit  121 , and a main updating unit  123 . The main checking unit  115  includes a new added software checking unit  1151  and a version checking module  1152 , and the main updating module  123  includes a non-kernel software updating unit  1231  and a kernel software updating unit  1232 .  
         [0014]     In an embodiment of the invention, the version file downloading unit  111  is used to download a new version file from the server side, and the decryption unit  113  is used to decrypt the new version file. The main checking unit  115  is used to check whether there is information on new software in the decrypted new version file. The new-added software checking unit  1151  is used to check whether there is new-added software in the decrypted new version file, and the version checking unit  1152  is used to check whether there is new version software in the decrypted new version file. The information downloading unit  117  is used to download the new-added software and the new version software. The verification unit  119  is used to verify the validity of the software downloaded by the software downloading unit  117 . In this embodiment, the verification unit  119  uses a Message Digest Algorithm 5 (MD5) algorithm to verify the validity of the software. The kernel software checking unit  121  is used to check whether the software passing the above verification is kernel software. The non-kernel software updating unit  1231  of the main updating module  123  is used to update non-kernel software, while the kernel software updating unit  1232  is used to update kernel software.  
         [0015]     Now referring to  FIG. 2 ,  FIG. 2  is a flow chart of updating software using a software updating module of a network device  10  of the invention . In this exemplary embodiment, before updating the software, the network device has an initial version file. The software updating module  100  sets up a temporary folder before updating the software. The temporary folder is used for storing the version file or the software downloaded from the server side in the following updating process. Following the completion of the software updating, the network device transfers all data in the temporary folder to a target folder, and then deletes the temporary folder. In this embodiment, different software corresponds to different target folders.  
         [0016]     When the network device is enabled, the process starts at step S 211 , where the software updating module  100  checks whether there is an old temporary folder in a storage device of the network device. If the software updating module  100  determines there is an old temporary folder, the process proceeds to step S 212 , where the old temporary folder is deleted to ensure that there is enough space in the storage device of the network device to complete the updating process. After the old temporary folder is deleted by the software updating module  100 , in step  213 , a new temporary folder is set up. In step S 211 , if no old temporary folder is detected by the software updating module  100 , then the process proceeds to step S 213 , and a new temporary folder is set up.  
         [0017]     The process then enters step S 215 , where the file downloading unit  111  downloads a new version file from the server side based on the trivial file transfer protocol (TFTP), and places it into the temporary folder set up in step S 213 , then the decryption unit  113  decrypts this new version file.  
         [0018]     The process then proceeds to step S 217 , where the new added software checking unit  1151  checks whether the new-added software exists. Specifically, the new-added software checking unit  1151  chronologically or alphabetically arranges software information listed in the old and the new version file, and then compares the number of software listed in these version files to check whether the new-added software exists. The process then proceeds to step S 218 , where the software downloading unit  117  downloads the new-added software. If there is a plurality of software to be downloaded, it is done so one at a time. Downloaded software is placed in the temporary folder. Each time software is downloaded, a verification unit  119  checks the validity of the downloaded software in S 220 . If the downloaded software is valid, the process proceeds to step S 227 , where the downloaded software is transferred to a target folder. If not, the process returns to step S 218 , where the software that failed the verification is re-downloaded by the software downloading unit  117 .  
         [0019]     In step S 217 , if the comparison finds that the number of the software listed in the new version file is the same as that of a corresponding old version file, then there is no new added software of the server side. The process then proceeds to step S 219 , where the version checking unit  1152  compares the software version of the new version file with that of the old version file, one by one, according to the version information in the version file. If the software version in the new version file is not new in comparison with the corresponding one in the old version file, the process directly proceeds to step S 230 , where the software is identified as ALREADY UPDATED.  
         [0020]     If the version checking unit  1152  discovers that the software version in the new version file is new in comparison with the corresponding one in the old version file, then the process proceeds to step S 221 , where the software downloading unit  117  downloads the newest version software from the server side based on the TFTP. Upon the completion of the downloading, the process proceeds to step S 223 , where the verification unit  119  verifies the validity of the downloaded software, if the downloaded software is valid, the process proceeds to step S 225 , if invalid, the process returns to step S 221 .  
         [0021]     In step S 225 , the kernel software checking unit  121  checks the software downloaded by the software downloading unit  117  in step S 221 , to determine whether the downloaded software is the kernel software. Referring to  FIG. 3 , the downloaded software will enter a node A if it is the kernel software.  
         [0022]     In step S 225 , if the kernel software checking unit  121  determines the downloaded software is the non-kernel software, the process directly proceeds to step S 227 , where the downloaded software is transferred to the target folder.  
         [0023]     In step S 227 , after the software updating module  100  transfers the downloaded software to the target folder, the process proceeds to step S 229 , where the software updating module  100  updates the information of the corresponding software in the old version file thereof, then the process proceeds to step S 230 , where the software is identified as ALREADY UPDATED. The process then proceeds to step S 231 , where the software updating module  100  checks whether all the software has been updated according to the number of the software listed in the new version file. If the updating is not complete, the process returns to step S 217  and starts the updating of the next software. If the updating is complete, the process proceeds to step S 233 , where the temporary folder built in step S 213  is deleted, and the updating process finishes. Following the completion of the software updating, the software information in the old version file, which includes the number and version of the software, is the same as that in the new version file.  
         [0024]     Now referring to  FIG. 3 ,  FIG. 3  is a flow chart of updating kernel software using a kernel software updating unit of a network device  10  of the invention. In step S 225 , the process begins at the node A shown in  FIG. 2 , and then proceeds to step S 226 , where the kernel software updating unit  1232  writes the downloaded kernel software to a flash disk, the process then proceeds to step S 228 , where the kernel software updating unit  1232  updates the kernel software information in the old version file. The process then proceeds to step S 232 , where the software updating unit  1232  deletes the temporary folder built in step S 213 . The process then proceeds to step S 234 , where the kernel software updating unit  1232  is restarted to ensure the proper operation of the downloaded kernel software. The process ends at the node B shown in  FIG. 2  to perform the next updating.  
         [0025]     It is believed that the present embodiments and their advantages will be understood from the foregoing description, and it will be apparent that various changes may be made thereto without departing from the spirit and scope of the invention or sacrificing all of its material advantages, the examples hereinbefore described merely being preferred or exemplary embodiments.