Abstract:
A method for toggling between different working states of an electronic device includes detecting temperature and pressure data from at least one sensor when a home button of the electronic device is pressed, and recording a duration of the pressing when the sensed data is within predetermined values. A current state of the electronic device and/or display screen is detected, and a working state is changed from the prevailing state to an opposite state, in dependence on the recorded duration of the pressing.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This application claims priority to Chinese Patent Application No. 201410765228.X filed on Dec. 11, 2014, the contents of which are incorporated by reference herein. 
       FIELD 
       [0002]    The subject matter herein generally relates to control technology. 
       BACKGROUND 
       [0003]    An electronic device (e.g., a mobile phone or personal digital assistant) can be equipped with a physical button which, when pressed, turns on and/or turns off the electronic device. The working life of a full power, resiliently-supported, physical button is not long. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0004]    Many aspects of the disclosure can be better understood with reference to the following drawings. The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the disclosure. Moreover, in the drawings, like reference numerals designate corresponding parts throughout the several views. 
           [0005]      FIG. 1  is a block diagram of an example embodiment of an electronic device. 
           [0006]      FIG. 2  is a diagrammatic view of an example embodiment of a home button of the electronic device. 
           [0007]      FIG. 3  is a block diagram of an example embodiment of function modules of a working state changing system in an electronic device. 
           [0008]      FIG. 4  is a flowchart of an example embodiment of a working state changing method using an electronic device. 
       
    
    
     DETAILED DESCRIPTION 
       [0009]    It will be appreciated that for simplicity and clarity of illustration, where appropriate, reference numerals have been repeated among the different figures to indicate corresponding or analogous elements. In addition, numerous specific details are set forth in order to provide a thorough understanding of the embodiments described herein. However, it will be understood by those of ordinary skill in the art that the embodiments described herein can be practiced without these specific details. In other instances, methods, procedures, and components have not been described in detail so as not to obscure the related relevant feature being described. Also, the description is not to be considered as limiting the scope of the embodiments described herein. The drawings are not necessarily to scale and the proportions of certain parts may be exaggerated to better illustrate details and features of the present disclosure. 
         [0010]    The present disclosure, including the accompanying drawings, is illustrated by way of examples and not by way of limitation. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean “at least one.” 
         [0011]    The term “module”, as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, such as, Java, C, or assembly. The term “comprising,” when utilized, means “including, but not necessarily limited to”, it specifically indicates open-ended inclusion or membership in the so-described combination, group, series and the like. One or more software instructions in the modules can be embedded in firmware, such as in an EPROM. The modules described herein can be implemented as either software and/or hardware modules and can be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, BLU-RAY™, flash memory, and hard disk drives. 
         [0012]      FIG. 1  is a block diagram of an example embodiment of an electronic device. In at least one embodiment, an electronic device  1  includes a working state changing system  10 . The electronic device  1  further includes, but is not limited to, a home button  11 , a storage device  12 , at least one processor  13 , and at least one sensor, such as a temperature sensor  14  and a pressure sensor  15 . In at least one embodiment, the electronic device  1  can be a smart phone, a personal digital assistant (PDA), a tablet computer, or other electronic device.  FIG. 1  illustrates only one example of the electronic device, other examples can include more or fewer components than as illustrated, or have a different configuration of the various components in other embodiments. 
         [0013]    In at least one embodiment, the home button  11  can be a physical button, or a virtual button. The temperature sensor  14  can be a contact temperature sensor, and include thermocouples and thermistors that measure a temperature. The pressure sensor  15  can measure pressure. The temperature sensor  14  can be installed around the home button  11 , and the pressure sensor  15  can be installed under the home button  11  as shown in  FIG. 2 . 
         [0014]    In at least one embodiment, the storage device  12  can include various types of non-transitory computer-readable storage mediums. For example, the storage device  12  can be an internal storage system, such as a flash memory, a random access memory (RAM) for temporary storage of information, and/or a read-only memory (ROM) for permanent storage of information. The storage device  12  can also be an external storage system, such as a hard disk, a storage card, or a data storage medium. The at least one processor  13  can be a central processing unit (CPU), a microprocessor, or other data processor chip that performs functions of the electronic device  1 . 
         [0015]    The working state changing system  10  can change a working state of the electronic device  1  to save power, according to data from the at least one sensor. 
         [0016]      FIG. 3  is a block diagram of one embodiment of function modules of the working state changing system. In at least one embodiment, the working state changing system  10  can include a detection module  101 , a recording module  102 , and an adjusting module  103 . The function modules  101 ,  102 , and  103  can include computerized codes in the form of one or more programs which are stored in the storage device  12 . The at least one processor  13  executes the computerized codes to provide functions of the function modules  101 - 103 . 
         [0017]    The detection module  101  detects data from the sensor, in event the home button  11  is pressed. In at least one embodiment, the detected data includes a temperature data and a pressure data. As mentioned above, the at least one sensor includes the temperature sensor  14 , and the pressure sensor  15 . When the home button  11  is pressed by a user, the temperature of the touch of a finger can be measured by the temperature sensor  14 , and the pressure of the fingertip can be measured by the pressure sensor  15 . 
         [0018]    The recording module  102  records a duration of pressing the home button in event the detected data is within a predetermined value. In at least one embodiment, when the temperature data is equal to or greater than a first predetermined value, such as 35 degrees Celsius, and the pressure data is within a second predetermined value range, it can be determined that the home button  11  is deliberately touched by a user, and the recording module  102  records a duration of pressing the home button  11 . When the temperature data is less than the first predetermined value or the pressure data is outside of the second predetermined value range, it can be determined that the home button  11  is accidentally touched, there is no need to record a duration of pressing the home button  11 . 
         [0019]    The detection module  101  detects a current state of the electronic device  1 . In at least one embodiment, states of the electronic device  1  may include the electronic device  1  being powered on, the electronic device  1  being powered off, the display screen of the electronic device  1  being active, and the display screen of the electronic device  1  being in a sleep state. 
         [0020]    The adjusting module  103  changes the current state of the electronic device  1  according to the recorded duration. In at least one embodiment, the recorded duration is corresponding to at least one predetermined duration ranges, the at least one predetermined duration ranges includes a first duration range and a second duration range. In at least one embodiment, a minimum value of the first duration range is greater than a maximum value of the second duration range. 
         [0021]    In one embodiment, when the recorded duration is within the first duration range and the current state of the electronic device is powered off, the adjusting module  103  powers on the electronic device  1 . In one embodiment, when the recorded duration is within the first duration range and the current state of the electronic device is powered on, the adjusting module  103  powers off or restarts the electronic device  1 . In one embodiment, when the recorded duration is within the second duration range and the current state of the electronic device  1  is powered on and the display screen is in a sleep state, the adjusting module  103  activates the display screen of the electronic device  1 . In another embodiment, when the recorded duration is within the second duration range and the current state of the electronic device  1  is powered on and the display screen is in a working state, the adjusting module  103  deactivates the display screen of the electronic device  1  so it enters a sleep state. 
         [0022]      FIG. 4  illustrates a flowchart is presented in accordance with an example embodiment. An example method  400  is provided by way of example, as there are a variety of ways to carry out the method. The example method  400  described below can be carried out using the configurations illustrated in  FIG. 1  and  FIG. 3 , and various elements of these figures are referenced in explaining the example method. Each block shown in  FIG. 4  represents one or more processes, methods, or subroutines, carried out in the example method  400 . Furthermore, the illustrated order of blocks is illustrative only and the order of the blocks can be changed. The example method  400  can begin at block  401 . Depending on the embodiment, additional blocks can be utilized and the ordering of the blocks can be changed. 
         [0023]    At block  401 , a detection module detects data from the sensor, in event the home button  11  is pressed. In at least one embodiment, the detected data from the sensor includes a temperature data and a pressure data. As mentioned above, the sensor includes a temperature sensor and a pressure sensor. The temperature sensor is installed around the home button, and the pressure sensor is installed under the home button. When the home button is pressed by a user, the temperature data can be measured by the temperature sensor, and the pressure data can be measured by the pressure sensor. 
         [0024]    At block  402 , a recording module records a duration of pressing the home button in event the detected data is within a predetermined value. In at least one embodiment, when the temperature data is equal to or greater than a first predetermined value, such as 35 degrees Celsius, and the pressure data is within a second predetermined value range, it can be determined that the home button is deliberately touched by a user, and the recording module records a duration of pressing the home button. When the temperature data is less than the first predetermined value or the pressure data is outside of the second predetermined value range, it can be determined that the home button is accidentally touched, there is no need to record a duration of pressing the home button. 
         [0025]    At block  403 , the detection module detects a current state of the electronic device. In at least one embodiment, states of the electronic device may include the electronic device being powered on, the electronic device  1  being powered off, the display screen of the electronic device being active, and the display screen of the electronic device being in a sleep state. 
         [0026]    At block  404 , an adjusting module changes the current state of the electronic device according to the recorded duration. In at least one embodiment, the recorded duration is corresponding to at least one predetermined duration ranges, the at least one predetermined duration ranges includes a first duration range and a second duration range. In at least one embodiment, a minimum value of the first duration range is greater than a maximum value of the second duration range. 
         [0027]    In one embodiment, when the recorded duration is within the first duration range and the current state of the electronic device is powered off, the adjusting module powers on the electronic device. In one embodiment, when the recorded duration is within the first duration range and the current state of the electronic device is powered on, the adjusting module powers off or restarts the electronic device. In one embodiment, when the recorded duration is within the second duration range and the current state of the electronic device is powered on and the display screen is in a sleep state, the adjusting module activates and illuminates the display screen of the electronic device. In another embodiment, when the recorded duration is within the second duration range and the current state of the electronic device is powered on and the display screen is in a working state, the adjusting module deactivates the display screen of the electronic device. 
         [0028]    It should be emphasized that the above-described embodiments of the present disclosure, including any particular embodiments, are merely possible examples of implementations, set forth for a clear understanding of the principles of the disclosure. Many variations and modifications can be made to the above-described embodiment(s) of the disclosure without departing substantially from the spirit and principles of the disclosure. All such modifications and variations are intended to be included herein within the scope of this disclosure and protected by the following claims.