Abstract:
A mobile device is provided. The mobile device includes a transceiver, a sensor unit, a storage device and a processor. The sensor unit detects the position and the motion of the mobile device to provide sensor data. The storage device stores activity records. The processor obtains an identification code of the base station connected to the mobile device through the transceiver and calculates the height of the mobile device according to the sensor data. When the identification code of the base station and the height of the mobile device match those in an activity record, the processor executes a predetermined function corresponding to the activity record. When the execution of the predetermined function fails, the processor generates a moving trail of the mobile device according to the sensor data. When the moving trail of the mobile device matches that in the activity record, the processor executes the predetermined function.

Description:
BACKGROUND OF THE INVENTION 
       [0001]    1. Field of the Invention 
         [0002]    The invention relates to a mobile device and a controlling method thereof, and more particularly to a mobile device and a method for executing a function thereof. 
         [0003]    2. Description of Related Art 
         [0004]    With improvement of computing capability of mobile devices, the bandwidth of wireless network is also increased continuously. Currently, it is common that people transmit data by using mobile devices via wireless transmission protocols such as Wi-Fi, Bluetooth or 3G/4G. 
         [0005]    Currently, each wireless transmission interface of mobile devices may be switched on or off manually by the user. For example, the user may switch on the 3G/4G wireless transmission interface manually and play games via the 3G/4G wireless transmission interface. For instance, the user may switch on the Bluetooth wireless transmission interface manually for connection with the stereo system in a car via the Bluetooth wireless transmission interface to play the music files stored in the mobile device. When one of the above wireless transmission interfaces is no longer needed, the user may switch off the interface manually to save power. 
         [0006]    It is troublesome for the user to switch on or off the above functions manually. The user may choose to keep the wireless transmission interface in an on status permanently to save the trouble of manual operations, however, which causes additional power consumption. For example, in that case, a corresponding wireless transceiver will be kept on and continue to consume power. 
       SUMMARY OF THE INVENTION 
       [0007]    The invention provides a mobile device and a method for executing a function thereof, which may save the user&#39;s trouble to perform manual operations while avoiding the problem of continuing power consumption. 
         [0008]    In the invention, the mobile device includes a transceiver, a sensor unit, a storage device and a processor. The sensor unit detects a position and an action of the mobile device for providing sensor data. The storage device stores activity records. The processor is coupled to the transceiver, the sensor unit and the storage device. The processor obtains a first identification code of a base station connected to the mobile device via the transceiver and calculates first height where the mobile device is positioned based on the sensor data. When the first identification code of the base station and the first height of the mobile device are consistent with a second identification code and second height in one of the activity records, the processor executes a predetermined function corresponding to the activity record. When the predetermined function is not executed successfully, the processor generates a first moving trail of the mobile device based on the sensor data. When the first moving trail of the mobile device is consistent with a second moving trail in the activity record, the processor executes the predetermined function. 
         [0009]    In the invention, the method for executing a function may be applied to the mobile device described above. The method for executing a function includes the following steps, obtaining a first identification code of a base station connected to the mobile device; detecting the position and action of the mobile device for providing sensor data; calculating first height where the mobile device is positioned based on the sensor data; when the first identification code of the base station and the first height of the mobile device are consistent with a second identification code and second height in one of the activity records, executing a predetermined function corresponding to the activity record; when the predetermined function is not executed successfully, generating a first moving trail of the mobile device based on the sensor data; when the first moving trail of the mobile device is consistent with a second moving trail in the activity record, executing the predetermined function. 
         [0010]    Based on the above, the invention may allow the predetermined function to be switched on or off automatically according to the position of the mobile device and the activity records of the user, whereby saving the user&#39;s trouble in performing manual operations and reducing power consumption of the mobile device. 
         [0011]    In order to make the aforementioned features and advantages of the invention more comprehensible, embodiments accompanying figures are described in detail below. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0012]      FIG. 1  is a schematic view illustrating a mobile device according to an embodiment of the invention. 
           [0013]      FIG. 2  is a flowchart illustrating a method for executing a function according to an embodiment of the invention. 
           [0014]      FIG. 3  is a flowchart illustrating a method for executing a function according to another embodiment of the invention. 
       
    
    
     DESCRIPTION OF EMBODIMENTS 
       [0015]      FIG. 1  is a schematic view illustrating a mobile device  100  according to an embodiment of the invention. The mobile device  100  may be a portable electronic device such as a smart phone, a personal digital assistant (PDA) or a tablet PC. The mobile device  100  includes a storage device  110 , a processor  120 , a transceiving unit  130  and a sensor unit  140 . The processor  120  is coupled to the storage device  110 , the transceiving unit  130  and the sensor unit  140 . The storage device  110  may store the activity records of the user as basis for automatically triggering certain predetermined functions. The transceiving unit  130  includes a regional transceiver  131  and a wide area transceiver  132 . The regional transceiver  131  may transmit or receive information for the mobile device  100  via regional wireless transmission protocols such as Wi-Fi or Bluetooth. The wide area transceiver  132  may transmit or receive information for the mobile device  100  via wide area wireless transmission protocols such as 3G or 4G. The sensor unit  140  includes an acceleration sensor  141 , a gyro-sensor  142 , an electronic compass  143  and a barometer  144 . The sensor unit  140  may detect the position and action of the mobile device  100  for providing sensor data. 
         [0016]      FIG. 2  is a flowchart illustrating a method for executing a function according to an embodiment of the invention. The method may be executed by the mobile device  100 . In step  210 , the processor  120  executes a predetermined function. The predetermined function is usually executed corresponding to the user&#39;s operations. For example, when the user activates a web page browser or an online game, the predetermined function in step  210  may be activating the regional transceiver  131  and transmitting and/or receiving data from the web page browser or data of the online game via the regional transceiver  131  and a regional wireless hotspot such as a Wi-Fi hotspot. 
         [0017]    In step  220 , the processor  120  checks whether the storage device  110  has stored an activity record corresponding to the predetermined function. If the activity record corresponding to the predetermined function does not exist in the storage device  110 , in step  230 , the processor  120  adds an activity record corresponding to the predetermined function in the storage device  110 . 
         [0018]    The processor  120  may be connected to a cellular radio access network such as 3G or 4G network via the wide area transceiver  132 . The processor  120  may obtain an identification code of a base station used by the mobile device  100  via the wide area transceiver  132 . The identification code may be used for positioning the mobile device  100 . The processor  120  may also calculate the height where the mobile device  100  is positioned based on the sensor data provided by the barometer  144 . The height may represent a floor where the mobile device  100  is located. The combination of the identification code of the base station and the height of the mobile device  100  may represent the position where the mobile device  100  is located. In step  230 , the processor  120  may incorporate the identification code of the base station and the height of the mobile device  100  into the activity record. 
         [0019]    The relation between the sensor data of the barometer  144  and the height of the mobile device  100  may vary depending on weather conditions. To calculate the height more accurately, the processor  120  may obtain the latest weather report via the wide area transceiver  132  and calibrate the height of the mobile device  100  at least according to one of the temperature, humidity and atmosphere included in the weather report. 
         [0020]    As mentioned above, the predetermined function in the step  210  may be transmitting and/or receiving data via the regional transceiver  131  and a regional wireless hotspot. In step  230 , the processor  120  may incorporate the identification code and password of the regional wireless hotspot into the activity record, such that when the processor  120  executes the predetermined function again in the method flowchart shown by  FIG. 3 , the processor  120  may automatically use the identification code and password of the regional wireless hotspot in the activity record for connection with the regional wireless hotspot. 
         [0021]    If the password of the regional wireless hotspot is a public known password or preset in the mobile device  100 , the processor  120  does not need to add the password to the activity record but only add the identification code of the regional wireless hotspot to the activity record. Accordingly, when the processor  120  in the method flowchart as shown by  FIG. 3  executes the predetermined function again, the processor  120  may automatically use the identification code of the regional wireless hotspot in the activity record for connection with the regional wireless hotspot. 
         [0022]    The above-mentioned regional wireless hotspot may be a regional wireless hotspot that meets wireless transmission protocol such as Wi-Fi, Bluetooth, 3G or 4G 
         [0023]    In another embodiment, the predetermined function described in step  210  may be other functions such as starting playing music, stopping playing music, executing or closing one of application software in the mobile device  100 , or activating or closing a portion of the hardware of the mobile device  100 . 
         [0024]      FIG. 3  is a flowchart illustrating a method for executing a function according to another embodiment of the invention. The method may be executed by the mobile device  100 . In step  305 , the processor  120  obtains an identification code of a base station used by the mobile device  100  via the wide area transceiver  132 . In step  310 , the sensor unit  140  detects the position and action of the mobile device  100  for providing sensor data. In step  315 , the processor  120  calculates a height of the mobile device  100  based on the sensor data. As described above, the processor  120  may obtain the weather report via the wide area transceiver  132  and calibrate the height of the mobile device  100  according to the weather report. 
         [0025]    In step  320 , the processor  120  compares the identification code of the base station and the height of the mobile device  100  with the activity records in the storage device  110 . If there is no activity record that is consistent with the identification code of the base station and the height of the mobile device  100 , the process ends at this stage. If the identification code of the base station and the height of the mobile device are consistent with the identification code and height in one of the activity records stored in the storage device  110 , the processor  120  executes a predetermined function corresponding to the activity record in step  325 . 
         [0026]    As mentioned above, the predetermined function may be activating the regional transceiver  131  and transmitting and/or receiving data via the regional transceiver  131  and a regional wireless hotspot. Prior to the step  325 , if the mobile device  100  is using the wide area transceiver  132  to transmit and/or receive data, the processor  120  may switch transmission and/or reception of the data to the regional transceiver  131  in step  325 . 
         [0027]    When the user of the mobile device  100  is away from the regional wireless hotspot, the mobile device  100  may lose the signal of the regional wireless hotspot. When the regional wireless hotspot loses the signal for a time length that is shorter than a predetermined value (e.g. 10 seconds or other time length), the processor  120  may still retain the predetermined function. When the regional wireless hotspot loses the signal for a time length that is longer than the predetermined value, the processor  120  may deactivate the predetermined function, that is, close the regional transceiver  131 . Prior to the step  325 , if the mobile device  100  is using the wide area transceiver  132  to transmit and/or receive data, the processor  120  may switch the transmission and/or reception of the data back to the wide area transceiver  132  for execution after the regional transceiver  131  is closed. 
         [0028]    In step  330 , the processor  120  checks whether the predetermined function is executed successfully. For example, when the predetermined function is to transmit and/or receive data via the regional wireless hotspot, it is likely that the function cannot be executed successfully under the circumstances where the regional wireless hotspot in the activity record is not found. At this time, the processor  120  may close the regional transceiver  131 . 
         [0029]    If the predetermined function is executed successfully, the process ends at this stage. If the predetermined function is not executed successfully, the processor  120  may check, in step  335 , whether the activity record that is determined to be consistent in the step  320  includes a moving trail of the mobile device  100 . If not, the process goes to step  355 ; if yes, the process goes to step  340 . 
         [0030]    In step  355 , the processor  120  begins to record the moving trail of the mobile device  100  until the same predetermined function is executed successfully next time. Next, the processor  120  adds the moving trail to the activity record in step  360 . For example, the user may once connect to a regional wireless hotspot successfully at a position, but fail to connect to the regional wireless hotspot at the same position some other time and once again connect to the regional wireless hotspot successfully after moving within a short distance. If the above situation happens, the moving trail in the activity record may serve as basis for automatically executing the predetermined function in subsequent operations. 
         [0031]    The moving trail is from the sensor data provided by the sensor unit  140 . The acceleration sensor  141  may be used as a pedometer. The gyro-sensor  142  may detect the angular velocity of rotation of the mobile device  100 . The electronic compass  143  may sense the direction of the mobile device  100 . The barometer  144  may sense the height of the mobile device  100 . All of the above four sensing devices  141 - 144  may detect the moving trail of the mobile device  100 . Therefore, the moving trail may include the sensor data that is output by at least one of the four sensing devices  141 - 144 . 
         [0032]    In another embodiment, the moving trail may include data that is generated by further processing the sensor data output by at least one of the sensing devices  141 - 144 . For example, the moving trail may include a sum of three accelerations corresponding to three coordinate axes output by the acceleration sensor  141 , or include a sum of three angular velocity corresponding to three coordinate axes output by the gyro-sensor  142 , or include a height of the mobile device  100  generated by calculating according to output of the barometer  144 . 
         [0033]    In step  340 , the processor  120  may still use the same approach to generate the moving trail of the mobile device  100 . In step  345 , the processor  120  may compare the moving trail generated in the step  340  with the moving trial in the activity record. If the two moving trails are not consistent with each other, the process ends at the stage. If the two moving trails are consistent with each other, the processor  120  executes the predetermined function corresponding to the activity record in step  350 . 
         [0034]    Generally, people nowadays live a life with repeated activities. The invention may record the position of the mobile device when executing the predetermined function, and execute the same predetermined function automatically at the same position next time. For example, when the user enters an office, the mobile device may automatically activate the regional transceiver for connection with the regional wireless hotspot. When the user returns to his/her residence, the mobile device may automatically play music. In brief, the invention may automatically execute the predetermined function to save the user&#39;s trouble of performing manual operations. The invention may automatically switch to a wireless transmission protocol with faster speed. The invention may also automatically activate or deactivate a portion of the hardware of the mobile device to prevent the portion of hardware from continuously consuming power. 
         [0035]    Although the invention has been disclosed by the above embodiments, the embodiments are not intended to limit the invention. It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the invention without departing from the scope or spirit of the invention. Therefore, the protecting range of the invention falls in the appended claims.