Abstract:
An embedded system and method capable of automatically updating system software. The embedded system includes a first storage device for storing a first system software and a boot image; a microcontroller coupled to the first storage device for respectively converting the first system software and the boot image into a system code and a boot code, for controlling booting of the embedded system; and a connecting interface coupled to the microcontroller and further coupled to an external data storage device through a data transmitting media. The external data storage device contains a second system software. The boot code includes an update agent interface programming (UAIP) code utilized for reading the second system software from the external data storage device through the connection interface to update the first system software.

Description:
BACKGROUND OF INVENTION  
       [0001]     1. Field of the Invention  
         [0002]     The invention relates to a device and related method for updating software, and more particularly, to a device and related method capable of automatically updating a system software of an embedded system.  
         [0003]     2. Description of the Prior Art  
         [0004]     Please refer to  FIG. 1 , which is a diagram of an embedded system  100  according to the prior art. The typical prior art embedded system  100  comprises a micro-controller  104 , a plurality of storage devices  102  and  106 , and a downloading interface  108 . As shown in  FIG. 1 , the micro-controller  104 , the storage devices  102  and  106 , and the downloading interface  108  transfer data to each other through a bus  101 . The storage device  102  is utilized to store a system software Sys_ 1  and a boot image Boot_ 1 . Generally speaking, the storage device  102  is a non-volatile memory (e.g., a flash memory). The micro-controller  104  is utilized to respectively transform the system software Sys_ 1  and boot image Boot_ 1  into a system code Sys_Code and a boot code Boot_Code and orderly execute the boot code Boot_Code and the system code Sys_Code to control booting of the embedded system  100 . The storage device  106  is utilized to temporarily store the above-mentioned system code Sys_Code and the boot code Boot_Code. Generally speaking, the storage device  106  is a volatile memory (e.g., a random access memory). The downloading interface  108  is coupled to a computer host  130  through a data transmission media  120 . Furthermore, the computer host  130  stores another system software Sys_ 2 . For the prior art embedded system  100 , the downloading interface  108  can be a serial port, a joint test action group (JTAG) interface, or a network interface. However, users must operate the computer host  130  manually to upload the system software Sys_ 2  to the embedded system  100  through the data transmission media  120  such as a cable, a LAN, a WLAN, or an internet to perform an update to the original system software Sys_ 1 .  
         [0005]     Please refer to  FIG. 2 , which is an operational flow chart of updating the system software Sys_ 1  of the embedded system  100  shown in  FIG. 1 . The flow chart comprises the following steps:  
         [0006]     Step  200 : Couple the embedded system  100  to the computer host  130  through the downing interface  108  and the data transmission media  120 ;  
         [0007]     Step  210 : A user manually operates the computer host  130 , and uploads the system software Sys_ 2  stored in the computer host  130  to the storage device  106  of the embedded system  100 ; and  
         [0008]     Step  220 : The micro-controller  104  reads the system software Sys_ 2  stored in the storage device  106  and utilizes the system software Sys_ 2  to update the original software Sys_ 1  stored in the storage device  104 .  
         [0009]     As mentioned above, the prior art embedded system  100  requires a manual operation of another external computer host  130  to update its system software (e.g., an operating system). Therefore, a great amount of time is required when the amount of system software to be updated is large. Furthermore, because the embedded system relies on users to manually operate the computer host  130  to update the system software, the users need to own the computer host  130  and must also have knowledge of operating the computer host  130 . Therefore, the inconvenience for users is a serious problem.  
       SUMMARY OF INVENTION  
       [0010]     It is therefore one of primary objectives of the claimed invention to provide a device and method capable of automatically updating system software of an embedded system, to solve the above-mentioned problem.  
         [0011]     According to an exemplary embodiment of the claimed invention, an embedded system capable of automatically updating system software is disclosed. The embedded system comprises: a first storage device for storing a first system software and a boot image; a micro-controller coupled to the first storage device for respectively transforming the first system software and the boot image into a system code and a boot code and for orderly executing the boot code and the system code to control booting of the embedded system; and a connecting interface coupled to the micro-controller and coupled to an external data storage device through a data transmission media, the external data storage device storing a second system software; wherein the boot code comprises an update agent interface programming (UAIP), and the micro-controller is capable of executing the update agent interface programming to read the second system software from the external data storage device through the connecting interface before executing the system code.  
         [0012]     According to an exemplary embodiment of the claimed invention, a method for automatically updating system software of an embedded system is disclosed. The embedded system stores a first system software and a boot image, the method comprises: respectively transforming the first system software and the boot image into a system code and a boot code, wherein the boot code and the system code are orderly executed to control booting of the embedded system, and the boot code comprises an update agent interface programming (UAIP); coupling the embedded system to an external data storage device through a data transmission media, the external data storage device storing a second system software; and before executing the system code, executing the update agent interface programming to read the second system software from the external data storage device in order to update the first system software.  
         [0013]     The present invention device and method capable of automatically updating the embedded system can utilize an update agent interface programming to determine, when loading a boot code, whether to automatically update the system software of the embedded system. Therefore, it can enormously reduce the memory wasting of the embedded system. That is, the update agent interface programming is placed in the boot code and executed instead of being placed in the application software and executed. Therefore, the update agent interface programming does not occupy the system memory after the embedded system is booted. Furthermore, the present invention can reduce the cost and utilization of human resources because the present invention can automatically update the system software. Therefore, the present invention can improve the convenience of the embedded system because the users no longer need to operate another computer host.  
         [0014]     These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.  
     
    
     BRIEF DESCRIPTION OF DRAWINGS  
       [0015]      FIG. 1  is a diagram of an embedded system according to the prior art.  
         [0016]      FIG. 2  is an operational flow chart of updating the system software of the embedded system shown in  FIG. 1 .  
         [0017]      FIG. 3  is a diagram of an embedded system of a first embodiment according to the present invention.  
         [0018]      FIG. 4  is a flow chart of the operation of updating system software of the embedded system shown in  FIG. 3 .  
         [0019]      FIG. 5  is a diagram of an embedded system of a second embodiment according to the present invention. 
     
    
     DETAILED DESCRIPTION  
       [0020]     Please refer to  FIG. 3 , which is a diagram of an embedded system  300  of a first embodiment according to the present invention. The embedded system  300  comprises a micro-controller  304 , a plurality of storage devices  302  and  306 , and a connecting interface  308 . As shown in  FIG. 3 , the micro-controller  304 , a plurality of storage devices  302  and  306 , and the connecting interface  308  transfer data to each other through a bus  301 . In this embodiment, the embedded system  300  utilizes a flash memory to achieve the storage device  302  and utilizes a dynamic random access memory DRAM to achieve the storage device  306 . However, the present invention is not limited to the type of the storage devices  302  and  306 . In other words, the storage device  302  can be other types of non-volatile memories and the storage device  306  can be other types of volatile memories.  
         [0021]     The storage device  302  is utilized to store a system software Sys_ 1  and a boot image Boot_ 1 , and the micro-controller  304  is utilized to respectively transform the system software Sys_ 1  and the boot image Boot_ 1  into a system code Sys_Code and a boot code Boot_Code and to orderly execute the boot code Boot_Code and the system code Sys_Code to control booting of the embedded system  300 . Please note that in this embodiment, the boot code Boot_Code comprises an update agent interface programming (UAIP), a burning program code Flashing_Code, and a network connecting program code Network_Code. As shown in  FIG. 3 , the storage device  306  is utilized to temporarily store the system program code Sys_Code and the boot code Boot_Code for the micro-controller  304  to read the boot code Boot_Code and the system code Sys_Code to perform related operation. The connecting interface  308  is coupled to an external data storage device  320  through a data transmission media, wherein the external data storage device  320  stores a system software Sys_ 2 . Please note that in this embodiment, the connecting interface  308  is a network interface for transferring data to or from the external storage device  320  (e.g., a server) through a transmission control protocol/internet protocol (TCP/IP). Furthermore, the data transmission media  310  can be a local network, an intranet, or an internet. However, the above-mentioned devices are only utilized as a preferred embodiment and do not represent a limitation. In other words, the present invention is not limited by the type of the connecting interface or the data transmission media.  
         [0022]     To clearly illustrate the operation of updating system software of the present invention, please refer to  FIG. 4 .  FIG. 4  is a flow chart of the operation of updating system software Sys_ 1  of the embedded system  300  shown in  FIG. 3 . The flow chart comprises the following steps:  
         [0023]     Step  400 : Turn on the embedded system  300 ;  
         [0024]     Step  402 : The micro-controller  304  respectively transforms the system software Sys_ 1  and the boot image Boot_ 1  into the system code Sys_Code and the boot code Boot_Code and orderly executes the boot code Boot_Code and the system code Sys_Code to control booting of the embedded system  300 ;  
         [0025]     Step  404 : Before executing the system code Sys_Code, the micro-controller  304  executes the update agent interface programming (UAIP);  
         [0026]     Step  406 : The update agent interface programming starts the network connecting program code Network_Code to connect the embedded system  300  to the external data storage device  320  through the data transmission media  310 ;  
         [0027]     Step  408 : The update agent interface programming reads information of the software edition of the system software Sys_ 2  and compares the software editions of the system software Sys_ 1  and Sys_ 2 ;  
         [0028]     Step  410 : If the software edition of the system software Sys_ 2  is more recent than the software edition of the system software Sys_ 1  then go to step  412 ; otherwise, go to step  416 ;  
         [0029]     Step  412 : The update agent interface programming reads the system software Sys_ 2  from the external data storage device  320  and initializes the burning program code Flashing_Code to update the original system software Sys_ 1  according to the system software Sys_ 2 ;  
         [0030]     Step  414 : The boot code Boot_Code drives the embedded system  300  to reboot, and then go back to step  402 ; and  
         [0031]     Step  416 : The micro-controller  304  executes the system code Sys_Code.  
         [0032]     A further illustration of the operation of updating system software of the embedded system  300  is as follows: First, the boot image Boot_ 1  stored in the storage device  302  is loaded into the storage device  306 . Next, the micro-controller  304  transforms the boot image Boot_ 1  into the boot code Boot_Code. The micro-controller  304  can now execute the boot code Boot_Code to control booting of the embedded system  300 . The boot code Boot_Code firstly initializes the hardware devices of the embedded system  300  and then secondly executes the update agent interface programming of the boot code Boot_Code. Thirdly, the update agent interface programming starts the network connecting program code Network_Code of the boot code Boot_Code to read information of the system software Sys_ 2  stored in the external storage device  320  through the connecting interface  308  and finally the boot code Boot_Code determines whether to utilize the system software Sys_ 2  to update the system software Sys_ 1  originally stored in the embedded system. In this embodiment, the operation of reading data from the external data storage device  320  is as follows: Firstly, load the network connecting program code Network_Code. The network connecting program code Network_Code can obtain the needed IP address of the embedded system utilizing a dynamic host configuration protocol (DHCP) or a static IP address. Secondly, the network connecting program code Network_Code can initiate a trivial file transfer protocol (TFTP), hypertext transfer protocol (HTTP), or other network protocols to connect to the external data storage device  320 . In this embodiment, we assume that the external data storage device  320  is a TFTP server, therefore, the update agent interface programming can read the edition information of the system software Sys_ 2  in the file database of the TFTP server through a TFTP protocol supported by the network connecting program code Network_Code. Furthermore, the edition information is utilized to compare with the edition information of the system software Sys_ 1  stored inside the embedded system  300 . The comparison operation will be illustrated in the following disclosure.  
         [0033]     If the software edition of the system software Sys_ 2  is more recent than the system software Sys_ 1  then the micro-controller  304  executes the update agent interface programming to determine that the system software Sys_ 2  needs to be utilized to update the system software Sys_ 1 . The flow of utilizing the system software Sys_ 2  to update the system software Sys_ 1  is as follows:  
         [0034]     Firstly, the update agent interface programming initializes the network connecting program code Network_Code to download the system software Sys_ 2  to the storage device  306 . Secondly, the update agent interface program code initializes the burning program code Flashing_Code. Therefore, the micro-controller  304  can execute the burning program codes Flashing_Code to burn the system software Sys_ 2  into the storage device  302  in order to achieve the purpose of updating the system software Sys_ 1 . Lastly, the boot code Boot_Code drives the embedded system  300  to reboot.  
         [0035]     In the following disclosure, we discuss the data content of the system software Sys_ 1  and Sys_ 2 . In this embodiment, the system software Sys_ 1  comprises a kernel image and a file system image. Unlike Sys_ 1 , the system software Sys_ 2  can comprise any of three possible images as follows: only comprises the kernel image, only comprises the file system image, or simultaneously comprise both the kernel image and the file system image. If the system software Sys_ 2  only comprises the kernel image, after the system software Sys_ 1  is updated, only the kernel image of the system software Sys_ 1  is updated to the system software Sys_ 2 . That is, the file system image of the system software Sys_ 1  remains unchanged. Similarly, if the system software Sys_ 2  only comprises the file system image, after the system software Sys_ 1  is updated, only the file system image of the system software Sys_ 1  is updated to the system software Sys_ 2 . That is, the kernel image of the system software Sys_ 1  remains unchanged. As mentioned above, if the system software Sys_ 2  comprises both the kernel image and the file system image then both of the kernel image and the file system image of the system software Sys_ 1  are updated.  
         [0036]     After the system software Sys_ 1  is updated to system software Sys_ 2  and the embedded system  300  reboots, the above-mentioned operation is repeated. That is, the update agent interface programming determines whether to automatically update the current system software Sys_ 2  of the embedded system  300 . At this time, the system software Sys_ 1  has already been replaced by the system software Sys_ 2 . Therefore, if the external data storage device  320  stores a system software Sys- 3  (not shown), whose software edition is more recent than the system software Sys_ 2 , then the current system software Sys_ 2  is updated. Otherwise, after the boot code Boot_Code completes the booting operation, the system code Sys_Code is directly executed without updating the current system software Sys_ 2 . Furthermore, after the system code Sys_Code is loaded successfully, the embedded system  300  completes the booting operation. Next we discuss the operation of comparing the software editions of the system software Sys_ 1  and Sys_ 2 .  
         [0037]     In this embodiment, the update agent interface programming compares the software editions of the system software Sys_ 1  and Sys_ 2  according to their timing tags (e.g., the establishing timing of the file). That is, if the timing tag of the system software Sys_ 2  and Sys_ 1  shows that the establishing timing of the system software Sys_ 2  is later than that of the system software Sys_ 1  then the update agent interface programming utilizes the system software Sys_ 2  to update the system software Sys_ 1  through the burning program code Flashing_Code. Please note that the present invention is not limited to utilizing the timing tags to compare software editions. That is, the present invention can utilize other methods to compare the software editions. For example, the update agent interface programming can compare the software editions according to the file names of the system software Sys_ 1  and Sys_ 2 . Furthermore, please note that in the above-mentioned embodiment, the update agent interface programming, the burning program code Flashing_Code, and the network connecting program code Network_Code are respectively standalone programs. However, the burning program code Flashing_Code and the network connecting program code Network_Code can also be integrated in the update agent interface programming. ###This characteristic provides flexibility to the present invention.  
         [0038]     Please refer to  FIG. 5 , which is a diagram of an embedded system  500  of a second embodiment according to the present invention. The embedded system  500  comprises a micro-controller  504 , a plurality of storage devices  502  and  506 , a connecting interface  508 , and a human interface device (HID)  510 . As shown in  FIG. 5 , the micro-controller  504 , the storage devices  502  and  506 , the connecting interface  508 , and the human interface device  510  transfer data to each other through a bus  501 . Similarly, the connecting interface  508  is coupled to an external data storage device  520  through a data transmission media  512 . Please note that the devices having the same name have the same function and operation, and thus the further illustration is omitted here. From  FIG. 3  and  FIG. 5 , it is easily observed that the embedded system  500  in this embodiment is very similar to the embedded system  300  from the first embodiment with the one difference being in the human interface device  510 . That is, the embedded system  500  further comprises the human interface device  510 , which is coupled to micro-controller  504  for allowing the users of the embedded system  500  some amount of manual involvement during the updating operation. In other words, the users can utilize the human interface device  510  to input commands to control the update agent interface programming to determine whether to update the system software Sys_ 1 .  
         [0039]     For example, when the boot code Boot_Code is executed, the human interface device  510  displays an indication message on the screen (not shown) of the embedded system  500 . Therefore, the users can utilize the human interface device  510  to send a command to determine the status of the update agent interface programming (e.g., is it executing). Furthermore, the users can utilize the human interface device  510  to set the execution mode of the update agent interface programming to “manual”. Therefore, the update agent interface programming can show the comparison result on the screen of the embedded system  500 , and the users can manually utilize the human interface device  510  to send a command to decide whether to update the system software. In summary, the embedded system  500  can provide the users another choice. In other words, the embedded system  500  has superior flexibility.  
         [0040]     In contrast to the prior art, the present invention can utilize an update agent interface programming to determine whether to automatically update the system software of the embedded system when loading a boot code. Therefore, it can enormously reduce the memory wasting of the embedded system. That is, the update agent interface programming is placed in the boot code and executed instead of being placed in the application software and executed. Therefore, the update agent interface programming does not occupy the system memory after the embedded system boots. Furthermore, the present invention can reduce the cost and the utilization of human resources because the present invention can automatically update the system software. Therefore, the present invention can raise the convenience of the embedded system because the users no longer need to operate another computer host.  
         [0041]     Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.