Abstract:
Disclosed is a one-time password operating method, comprising: when a one-time password detects a valid key, judging the type of a pressed key, if the pressed key is a power-on key, detecting whether a current power-on logo is set, if yes, resetting same, otherwise, setting same and inspecting whether a locking logo is set, if yes, entering an unlocking code interface, otherwise entering an information interface; if the pressed key is a delete key, deleting data at the tail end of a data cache area; if the pressed key is a number key and the one-time password is not in the information interface, storing corresponding data in the data cache area; if the one-time password is in the information interface, judging whether the time for the key being pressed down goes beyond a preset time period, if yes, entering a power-on password modifying interface, otherwise storing corresponding data in the data cache area; if the pressed key is an Enter key and the one-time password is not in the information interface, judging whether the data in the data cache area are correct or meet requirements, if the one-time password is in the information interface, generating a dynamic password and displaying corresponding contents.

Description:
FIELD 
       [0001]    The invention relates to information security field, and more particularly, to a working method of a dynamic token. 
       BACKGROUND 
       [0002]    In the prior art, One-time Password (OTP) is a technology for preventing an account number from being stolen reliably and conveniently. An unpredictable random number combination is generated according to a dedicated algorithm, and each password is used for only one time. A user is required to input a one-time password besides an account number and a static password in authentication. The user can login or perform transaction normally only if the user passes the authentication of the system, so as to ensure legitimacy and uniqueness of the user identity effectively. OTP has a prominent advantage that the password used by the user each time is different and thus an illegitimate user can not personate the identity of a legitimate user. OTP authentication technology is regarded as one of the effective ways for authenticating user identity, which can effectively avoid network problems such as stealing password of account number by a hacker or Trojan, fake website, which will cause financial loss or data loss of user. At present, OTP authentication technology is widely used in fields such as e-bank, online game, telecom operator, e-administration and enterprise. 
         [0003]    However, the inventors found that the existing password of the dynamic token has 6 or 8 digits and thus has a risk of being cracked by inversing after a stealer obtains a seed or multiple passwords, and the dynamic token is easily to be lost or stolen. 
       SUMMARY 
       [0004]    In view of the defects in the prior art, a working method of a dynamic token is provided according to the present invention, for preventing the dynamic token from being stolen and lost, and avoiding seed file loss and group attack. 
         [0005]    The technical solutions provided by the present invention are as follows. 
         [0006]    A working method of a dynamic token includes, after the dynamic token detects that its key flag is set, 
         [0007]    Step A, clearing the key flag, scanning keys and determining type of the key pressed down; performing Step B in a case that the key pressed down is a power key; performing Step D in a case that the key pressed down is a delete key; performing Step E in a case that the key pressed down is a key in a first numeric key group; performing Step F in a case that the key pressed down is a key in a second numeric key group; and performing Step G in a case that the key pressed down is an OK key; 
         [0008]    Step B, checking power flag; in a case that the power flag is set, resetting the power flag and entering a dormant state; and in a case that the power flag is not set, setting the power flag and performing Step C; 
         [0009]    Step C, checking lock flag; in a case that the lock flag is set, setting state identification to be a first predetermined value and performing Step L; and in a case that the lock flag is not set, setting the state identification to be a second predetermined value and performing Step L; 
         [0010]    Step D, checking the power flag; in a case that the power flag is set, deleting one unit data at the end of a data cache, displaying a corresponding number, and performing Step L; and in a case that the power flag is not set, entering the dormant state; 
         [0011]    Step E, checking the power flag; in a case that the power flag is set, storing corresponding data into the data cache, displaying a corresponding number, and performing Step L; and in a case that the power flag is not set, entering the dormant state; 
         [0012]    Step F, checking the power flag; 
         [0013]    in a case that the power flag is set and the state identification is a third predetermined value, determining whether time period for holding the key pressed down exceeds a predetermined time period; setting the state identification to be a fifth predetermined value and performing Step L in a case that the time period for holding the key pressed down exceeds the predetermined time period; and performing Step L directly in a case that the time period for holding the key pressed down does not exceed the predetermined time period; 
         [0014]    in a case that the power flag is set and the state identification is not the third predetermined value, storing corresponding data into the data cache, displaying a corresponding number, and performing Step L; and 
         [0015]    in a case that the power flag is not set, entering the dormant state; 
         [0016]    Step G, checking the power flag; 
         [0017]    in a case that the power flag is set, checking the state identification; performing Step H in a case that the state identification is the first predetermined value; performing Step I in a case that the state identification is the second predetermined value; performing Step J in a case that the state identification is the third predetermined value; and performing Step K in a case that the state identification is the fifth predetermined value; and 
         [0018]    in a case that the power flag is not set, entering the dormant state; 
         [0019]    Step H, generating an unlock verification code by computing; determining whether data in the data cache is identical to the generated unlock verification code; in a case that the data in the data cache is identical to the generated unlock verification code, resetting the lock flag, setting the state identification to be the fifth predetermined value, clearing the data in the data cache, and performing Step L; and in a case that the data in the data cache is not identical to the generated unlock verification code, clearing the data in the data cache and performing Step C; 
         [0020]    Step I, determining whether data in the data cache is identical to a logon password currently stored in the dynamic token; in a case that the data in the data cache is identical to the logon password currently stored in the dynamic token, setting the state identification to be the third predetermined value, clearing the data in the data cache, and performing Step L; and in a case that the data in the data cache is not identical to the logon password currently stored in the dynamic token, clearing the data in the data cache, setting the lock flag, and performing Step C; 
         [0021]    Step J, generating a dynamic password by computing, displaying content corresponding to the dynamic password and performing Step L; 
         [0022]    Step K, determining whether data in the data cache meets a predetermined condition; in a case that the data in the data cache meets the predetermined condition, replacing the logon password currently stored in the dynamic token with the data in the data cache, clearing the data in the data cache, setting the state identification to be the third predetermined value, and performing Step L; and in a case that the data in the data cache does not meet the predetermined condition, clearing the data in the data cache and performing Step L; 
         [0023]    Step L, determining whether the key flag is detected to be set in a predetermined time period; in a case that the key flag is detected to be set in the predetermined time period, performing Step A; and in a case that the key flag is not detected to be set in the predetermined time period, resetting the power flag and entering the dormant state. 
         [0024]    Alternatively, 
         [0025]    another working method of a dynamic token includes, after the dynamic token detects that its key flag is set, 
         [0026]    Step a, clearing the key flag, scanning keys and determining type of the key pressed down; performing Step b in a case that the key pressed down is a power key; performing Step d in a case that the key pressed down is a delete key; performing Step e in a case that the key pressed down is a key in a first numeric key group; performing Step f in a case that the key pressed down is a key in a second numeric key group; and performing Step g in a case that the key pressed down is an OK key; 
         [0027]    Step b, checking power flag; in a case that the power flag is set, resetting the power flag and entering a dormant state; and in a case that the power flag is not set, setting the power flag and performing Step c; 
         [0028]    Step c, checking lock flag; in a case that the lock flag is set, setting the state identification to be a first predetermined value and performing Step l; and in a case that the lock flag is not set, setting the state identification to be a second predetermined value and performing Step l; 
         [0029]    Step d, checking the power flag; in a case that the power flag is set, checking state identification, deleting one unit data at the end of a corresponding cache, displaying a corresponding number, and performing Step l; and in a case that the power flag is not set, entering the dormant state; 
         [0030]    Step e, checking the power flag; in a case that the power flag is set, checking the state identification, storing corresponding data into a corresponding cache, displaying a corresponding number, and performing Step l; and in a case that the power flag is not set, entering the dormant state; 
         [0031]    Step f, checking the power flag; 
         [0032]    in a case that the power flag is set and the state identification is a third predetermined value; determining whether time period for holding the key pressed down exceeds a predetermined time period; setting the state identification to be a fifth predetermined value and performing Step l in a case that the time period for holding the key pressed down exceeds the predetermined time period; and performing Step l directly in a case that the time period for holding the key pressed down does not exceed the predetermined time period; 
         [0033]    in a case that the power flag is set and the state identification is not the third predetermined value, checking the state identification, storing corresponding data into a corresponding cache, displaying a corresponding number, and performing Step l; and 
         [0034]    in a case that the power flag is not set, entering the dormant state; 
         [0035]    Step g, checking the power flag; 
         [0036]    in a case that the power flag is set, checking the state identification; performing Step h in a case that the state identification is the first predetermined value; performing Step i in a case that the state identification is the second predetermined value; performing Step j in a case that the state identification is the third predetermined value; and performing Step k in a case that the state identification is the fifth predetermined value; and 
         [0037]    in a case that the power flag is not set, entering the dormant state; 
         [0038]    Step h, generating an unlock verification code by computing; determining whether data in an unlock code cache is identical to the unlock verification code generated by computing; in a case that the data in the unlock code cache is identical to the unlock verification code generated by computing, resetting the lock flag, setting the state identification to be the fifth predetermined value, clearing the data in the unlock code cache, and performing Step l; and in a case that the data in the unlock code cache is not identical to the unlock verification code generated by computing, clearing the data in the unlock code cache and performing Step c; 
         [0039]    Step i, determining whether data in a logon password cache is identical to a logon password currently stored in the dynamic token; in a case that the data in the logon password cache is identical to the logon password currently stored in the dynamic token, setting the state identification to be the third predetermined value, clearing the data in the logon password cache, and performing Step l; and in a case that the data in the logon password cache is not identical to the logon password currently stored in the dynamic token, clearing the data in the logon password cache, setting the lock flag, and performing Step c; 
         [0040]    Step j, generating a dynamic password by computing, displaying content corresponding to the dynamic password, and performing Step l; 
         [0041]    Step k, determining whether data in a new logon password cache meets a predetermined condition; in a case that the data in the new logon password cache meets the predetermined condition, replacing the logon password currently stored in the dynamic token with the data in the new logon password cache, clearing the data in the new logon password cache, setting the state identification to be the third predetermined value, and performing Step  1 ; and in a case that the data in the new logon password cache does not meet the predetermined condition, clearing the data in the new logon password cache and performing Step l; 
         [0042]    Step l, determining whether the key flag is detected to be set in a predetermined time period; in a case that the key flag is detected to be set in the predetermined time period, performing Step A; and in a case that the key flag is not detected to be set in the predetermined time period, resetting the power flag and entering the dormant state. 
         [0043]    The present invention has advantages of effectively preventing the dynamic token from being stolen, avoiding user loss caused by the dynamic token loss and the seed loss, and reducing possibility of successful group attack. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0044]    In order to illustrate the technical solutions according to the embodiments of the present invention or the prior art more clearly, drawings to be used in the description of the embodiments or the prior art will be described briefly hereinafter. Apparently, the drawings described hereinafter are only some embodiments of the present invention, and other drawings may be obtained by those skilled in the art according to these drawings without creative labor. 
           [0045]      FIG. 1  is a flow chart of a working method of a dynamic token provided by a second embodiment of the present invention; 
           [0046]      FIG. 2  is a flow chart of Step  102  to Step  117  in  FIG. 1 ; 
           [0047]      FIG. 3  is a flow chart of Step  118  to Step  126  in  FIG. 1 ; 
           [0048]      FIG. 4  is a flow chart of Step  127  to Step  138  in  FIG. 1 ; and 
           [0049]      FIG. 5  is a flow chart of Step  139  to Step  171  in  FIG. 1 . 
       
    
    
     DETAILED DESCRIPTION 
       [0050]    The technical solutions according to the embodiments of the invention will be described clearly and completely in conjunction with the drawings in the embodiments of the invention. Apparently, the described embodiments are only part but not all of embodiments of the present invention. All other embodiments obtained by those skilled in the art based on these embodiments of the present invention without creative labor should fall within the scope of protection of the present invention. 
       First Embodiment 
       [0051]    In order to effectively prevent a dynamic token from being stolen and lost, and avoid seed file loss and group attack, a working method of a dynamic token is provided according to an embodiment of the present invention. In the embodiment, the dynamic token is generally in dormant state. When a key is pressed down, the dynamic token is waken up and the key flag is set. When a power key is pressed down for a time period exceeding a predetermined time period, or when there is no key entry for a predetermined time period, the dynamic token enters the dormant state again, the state identification is restored to be a default value, and the current permitted password retry time and the current state of the lock flag are stored. 
         [0052]    In a case that the key flag is detected to be set and the initialization of the dynamic token has not been finished, the dynamic token detects whether the liquid crystal screen and the keyboard are available according to the type of the key pressed down. 
         [0053]    In a case that the key flag is detected to be set and the initialization of the dynamic token has been finished, the dynamic token performs the following Steps S 1  to S 18 . 
         [0054]    Step S 1 , clearing the key flag, scanning keys and determining the type of the key pressed down; performing Step S 2  in a case that the key pressed down is a power key; performing Step S 4  in a case that the key pressed down is a delete key; performing Step S 5  in a case that the key pressed down is a key in a first numeric key group; performing Step S 6  in a case that the key pressed down is a key in a second numeric key group; and performing Step S 9  in a case that the key pressed down is an OK key. 
         [0055]    The key may be a button, a touch key, a micro switch, a photoelectric switch or an inductive switch, etc. 
         [0056]    The power key, the delete key and the OK key may be independent keys respectively, or may be any keys in the first numeric key group respectively, or any two of them may share one key. 
         [0057]    If the power key is a key in the first number key group, and in this step, in a case that it is determined that the key pressed down is a key in the first numeric key group, it is determined whether the key is a first predetermined key. In a case that the key is the first predetermined key, it is determined whether the time period for holding the key pressed down exceeds a predetermined time period, Step S 2  is performed in a case that the time period for holding the key pressed down exceeds the predetermined time period, and Step S 5  is performed in a case that the time period for holding the key pressed down does not exceed the predetermined time period. In a case that the key is not the first predetermined key, Step S 5  is performed. 
         [0058]    If the delete key is a key in the first number key group, and in this step, in a case that it is determined that the key pressed down is a key in the first numeric key group, it is determined whether the key pressed down is a second predetermined key. In a case that the key pressed down is the second predetermined key, it is determined whether the time period for holding the key pressed down exceeds a predetermined time period, Step S 4  is performed in a case that the time period for holding the key pressed down exceeds the predetermined time period, and Step S 5  is performed in a case that the time period for holding the key pressed down does not exceed the predetermined time period. In a case that the key pressed down is not the second predetermined key, Step S 5  is performed. 
         [0059]    If the OK key is a key in the first numeric key group, and in this step, in a case that it is determined that the key pressed down is a key in the first numeric key group, it is determined whether the key pressed down is a third predetermined key. In a case that the key pressed down is the third predetermined key, it is determined whether the time period for holding the key pressed down exceeds a predetermined time period, Step S 9  is performed in a case that the time period for holding the key pressed down exceeds the predetermined time period, and Step S 5  is performed in a case that the time period for holding the key pressed down does not exceed the predetermined time period. In a case that the key pressed down is not the third predetermined key, Step S 5  is performed. 
         [0060]    If the power key and the delete key share one key, and in this step, in a case that it is determined that the key pressed down is the power key, it is determined whether the time period for holding the key pressed down exceeds a predetermined time period, Step S 2  is performed in a case that the time period for holding the key pressed down exceeds the predetermined time period, and Step S 4  is performed in a case that the time period for holding the key pressed down does not exceed the predetermined time period. 
         [0061]    If the OK key and the power key share one key, and in this step, in a case that it is determined that the key pressed down is the OK key, it is determined whether the time period for holding the key pressed down exceeds a predetermined time period, Step S 2  is performed in a case that the time period for holding the key pressed down exceeds the predetermined time period, and Step S 9  is performed in a case that the time period for holding the key pressed down does not exceed the predetermined time period. 
         [0062]    If the OK key and the delete key share one key, and in this step, in a case that it is determined that the key pressed down is the OK key, it is determined whether the time period for holding the key pressed down exceeds a predetermined time period, Step S 4  is performed in a case that the time period for holding the key pressed down exceeds the predetermined time period, and Step S 9  is performed in a case that the time period for holding the key pressed down does not exceed the predetermined time period. 
         [0063]    Preferably, in the present embodiment, in order to prevent the key flag from being set due to interferences such as static electricity and bounce of a key itself, a key debounce process is performed after the token detects that the key flag is set. The key debounce process includes: after it is detected that the key flag is set, determining whether the time period for holding the key pressed down exceeds a predetermined time period; in a case that the time period for holding the key pressed down exceeds the predetermined time period, performing Step S 1 ; and in a case that the time period for holding the key pressed down does not exceed the predetermined time period, clearing the key flag, entering the dormant state, and waiting for setting of the key flag. There are multiple ways for detecting the time period for holding the key pressed down, which are not limited herein. 
         [0064]    Preferably, in the present embodiment, the predetermined time period is 20 milliseconds. 
         [0065]    The key debounce process may also be realized by a hardware circuit, and may specifically be realized according to the characteristic of a RS trigger. 
         [0066]    Step S 2 , checking the power flag; in a case that the power flag is set, resetting the power flag, entering the dormant state, and performing Step S 1  when it is detected that the key flag is set again; and in a case that the power flag is not be set, setting the power flag and performing the next step. 
         [0067]    Step S 3 , checking the lock flag; in a case that the lock flag is set, displaying information for prompting that the dynamic token is locked, setting the state identification to be a first predetermined value, displaying information for prompting entering the unlock code and performing step S 15 ; and in a case that the lock flag is not set, setting the state identification to be a second predetermined value, displaying information for prompting entering the logon password, and performing Step S 15 . 
         [0068]    Step S 4 , checking the power flag; in a case that the power flag is set, deleting one unit data at the end of the data cache, displaying the corresponding number and performing Step S 15 , or performing Step S 15  directly if no data is in the data cache; and in a case that the power flag is not set, entering the dormant state, and performing Step S 1  when it is detected that the key flag is set again. 
         [0069]    One unit data in the data cache represents one number; and the unit data is coded or uncoded. 
         [0070]    The displaying the corresponding number includes: displaying numbers corresponding to all unit data in the data cache. The displayed corresponding number is plain data, or is a symbol “-”, or is the plain data for a fixed time period and then the symbol “-”. The displaying manner may be selected according to the current value of the state identification if different predetermined values of the state identification correspond to different displaying manners. 
         [0071]    Step S 5 , checking the power flag; in a case that the power flag is set, storing corresponding data into the data cache, displaying the corresponding number, and performing Step S 15 ; and in a case that the power flag is not set, entering the dormant state, and performing Step S 1  when it is detected that the key flag is set again. 
         [0072]    In this step, 
         [0073]    storing corresponding data into the data cache includes: determining whether the number of the unit data in the data cache exceeds a predetermined number according to the state identification, storing a predetermined number of unit data from the first or the last unit data in a case that the number of unit data in the data cache exceeds the predetermined number; and storing all unit data in a case that the number of unit data in the data cache does not exceed the predetermined number. 
         [0074]    Step S 6 , checking the power flag; in a case that the power flag is set, performing the next step; and in a case that the power flag is not set, entering the dormant step, and performing Step S 1  when it is detected that the key flag is set again. 
         [0075]    Step S 7 , checking the state identification; in a case that the state identification is a third predetermined value, performing the next step; and in a case that the state identification is not the third predetermined value, storing corresponding data into the data cache, displaying the corresponding number, and performing Step S 15 . 
         [0076]    Step S 8 , determining whether the time period for holding the key pressed down exceeds a predetermined time period; in a case that the time period for holding the key pressed down exceeds the predetermined time period, setting the state identification to be a fifth predetermined value, displaying information for prompting resetting the logon password, and performing Step S 15 ; and in a case that the time period for holding the key pressed down does not exceed the predetermined time period, performing Step S 15  directly. 
         [0077]    Step S 9 , checking the power flag; in a case that it is detected that the power flag is set, performing the next step; and in a case that the power flag is not set, entering the dormant state, and performing Step S 1  when it is detected that the key flag is set again. 
         [0078]    Step S 10 , checking the state identification; performing Step S 11  in a case that the state identification is the first predetermined value; performing Step S 12  in a case that the state identification is the second predetermined value; performing Step S 13  in a case that the state identification is the third predetermined value; and performing Step S 14  in a case that the state identification is the fifth predetermined value. 
         [0079]    Step S 11 , generating an unlock verification code by computing, determining whether the data in the data cache is identical to the unlock verification code generated by computing; in a case that the data in the data cache is identical to the unlock verification code generated by computing, resetting the lock flag, setting the state identification to be the fifth predetermined value, displaying information for prompting the user to reset the logon password, clearing the data in the data cache, and performing Step S 15 ; and in a case that the data in the data cache is not identical to the unlock verification code generated by computing, clearing the data in the data cache and performing Step S 3 . 
         [0080]    Step S 12 , determining whether the data in the data cache is identical to the logon password currently stored in the dynamic token; in a case that the data in the data cache is identical to the logon password currently stored in the dynamic token, setting the state identification to be the third predetermined value, displaying information for prompting that an information interface is entered, clearing the data in the data cache, and performing Step S 15 ; and in a case that the data in the data cache is not identical to the logon password currently stored in the dynamic token, setting the lock flag, clearing the data in the data cache, and performing Step S 3 . 
         [0081]    Preferably, a permitted password retry time may be set in the dynamic token. 
         [0082]    Correspondingly, in a case that the lock flag is not set, it is determined whether the data in the data cache is identical to the logon password currently stored in the dynamic token. In a case that the data in the data cache is identical to the logon password currently stored in the dynamic token, the state identification is set to be the third predetermined value, information for prompting that an information interface is entered is displayed, the permitted password retry time is set to be the initial value, the data in the data cache is cleared, and Step S 15  is performed. In a case that the data in the data cache is not identical to the logon password currently stored in the dynamic token, the data in the data cache is cleared, a result which is used as the current permitted password retry time is computed by subtracting 1 from the permitted password retry time, then it is determined whether the current permitted password retry time is 0, the lock flag is set and Step S 3  is performed in a case that the current permitted password retry time is 0, and Step S 3  is performed directly in a case that the current permitted password retry time is not 0. 
         [0083]    Step S 13 , generating a dynamic password by computing, displaying content corresponding to the dynamic password, and performing Step S 15 . 
         [0084]    Step S 14 , determining whether the data in the data cache meets a predetermined condition; in a case that the data in the data cache meets the predetermined condition, replacing the logon password currently stored in the dynamic token with the data in the data cache, setting the state identification to be the third predetermined value, displaying information for prompting that an information interface is entered, clearing the data in the data cache, and performing step S 15 ; and in a case that the data in the data cache does not meet the predetermined condition, clearing the data in the data cache and performing Step S 15 . 
         [0085]    Step S 15 , determining whether the key flag is detected to be set in a predetermined time period; in a case that the key flag is detected to be set in the predetermined time period, performing Step S 1 ; and in a case that the key flag is not detected to be set in the predetermined time period, resetting the power flag, entering the dormant state, and performing Step S 1  when it is detected that the key flag is set again. 
         [0086]    Preferably, step S 10  may further includes: performing Step S 16  in a case that the state identification is a fourth predetermined value; performing Step S 17  in a case that the state identification is a sixth predetermined value; performing Step S 18  in a case that the state identification is a seventh predetermined value. 
         [0087]    Step S 16 , determining whether the data in the data cache is identical to the logon password currently stored in the dynamic token; in a case that the data in the data cache is identical to the logon password currently stored in the dynamic token, setting the state identification to be the fifth predetermined value, displaying information for prompting resetting the logon password, clearing the data in the data cache, and performing Step S 15 ; and in a case that the data in the data cache is not identical to the logon password currently stored in the dynamic token, clearing the data in the data cache and performing Step S 15 . 
         [0088]    Correspondingly, Step S 8  further includes: in a case that it is determined that the time period for holding the key pressed down exceeds the predetermined time period, setting the state identification to be the fourth predetermined value, displaying information for prompting entering the current logon password, and performing Step S 15 . 
         [0089]    Step S 17 , determining whether the data in the data cache is identical to the new logon password; in a case that the data in the data cache is identical to the new logon password, replacing the logon password currently stored in the dynamic token with the new logon password, setting the state identification to be the third predetermined value, displaying information for promoting that an information interface is entered, clearing the data in the data cache, and performing Step S 15 ; and in a case that the data in the data cache is not identical to the new logon password, setting the state identification to be the fifth predetermined value, displaying information for prompting resetting the logon password, clearing the data in the data cache, and performing Step S 15 . 
         [0090]    Correspondingly, Step S 14  further includes: in a case that the data in the data cache meets a predetermined condition, storing the data in the data cache as a new logon password, setting the state identification to be the sixth predetermined value, displaying information for prompting confirming the reset logon password, clearing the data in the data cache, and performing Step S 15 . 
         [0091]    Step S 18 , setting the state identification to be the third predetermined value, and performing Step S 15 . 
         [0092]    Correspondingly, Step S 13  further includes: after generating the dynamic password by computing, setting the state identification to be a seventh predetermined value; determining whether the key flag is set before the dynamic password becomes invalid; in a case that the key flag is set before the dynamic password becomes invalid, performing Step S 1 ; and in a case that the key flag is not set before the dynamic password becomes invalid, setting the state identification to be the third predetermined value when the dynamic password becomes invalid and performing Step S 15 . 
       Second Embodiment 
       [0093]    In order to effectively prevent the dynamic token from being stolen and lost, and avoid seed file loss and group attack, a method for implementing a dynamic token is provided according to an embodiment of the present invention, in which the power key and the delete key share one key, numeric keys 1 to 9 are taken as a first numeric key group, and numeric key 0 is taken as a second numeric key group. In the embodiment, the dynamic token is generally in dormant state. When a key is pressed down, the dynamic token is waken up and the key flag is set. When the time period for holding the power key pressed down exceeds a predetermined time period or when there is no key entry for a predetermined time period, the dynamic token enters the dormant state again, the state identification is restored to be a default value, and the current permitted password retry time and current state of the lock flag are stored. Referring to  FIG. 1 ,  FIG. 2 ,  FIG. 3 ,  FIG. 4  and  FIG. 5 , the dynamic token performs the following Steps  101  to  168  after it is detected that the key flag is set. 
         [0094]    Step  101 , clearing the key flag, scanning the keyboard and determining the type of the key pressed down; performing Step  102  in a case that the key pressed down is a power key; performing Step  118  in a case that the key pressed down is any one of the numeric keys 1 to 9; performing Step  127  in a case that the key pressed down is the numeric key 0; and performing Step  139  in a case that the key pressed down is an OK key. 
         [0095]    Step  102 , determining whether the device is initialized, performing Step  106  in a case that the device is initialized, and performing the next step in a case that the device is not initialized. 
         [0096]    The process for initializing the device is a process for writing user information into the dynamic token. 
         [0097]    Step  103 , the liquid crystal screen performing self-check. 
         [0098]    Step  104 , determining whether the key flag is detected to be set in a predetermined time period, performing Step  101  in a case that the key flag is detected to be set in the predetermined time period, and performing Step  105  in a case that the key flag is not detected to be set in the predetermined time period. 
         [0099]    Step  105 , entering the dormant state; and performing Step  101  when it is detected that the key flag is set again. 
         [0100]    Step  106 , checking whether the power flag is set, performing Step  107  in a case that the power flag is set, and performing Step  110  in a case that the power flag is not set. 
         [0101]    Step  107 , determining whether the time period for holding the power key pressed down exceeds a predetermined time period, performing Step  108  in a case that the time period for holding the key pressed down exceeds the predetermined time period, and performing Step  109  in a case that the time period for holding the key pressed down does not exceed the predetermined time period. 
         [0102]    Preferably, in the second embodiment, the predetermined time period is 2 seconds. 
         [0103]    Step  108 , resetting the power flag, entering the dormant state, and performing Step  101  when it is detected that the key flag is set again. 
         [0104]    Step  109 , deleting one unit data at the end of the data cache, displaying the corresponding number, and performing Step  116 ; and if no data is in the data cache, skipping Step  109  and performing Step  116  directly. 
         [0105]    One unit data in the data cache represents one number, and the one byte data is coded or uncoded. The displaying the corresponding number includes displaying numbers corresponding to all unit data in the data cache. 
         [0106]    Step  110 , determining whether the time period for holding the power key pressed down exceeds a predetermined time period, performing Step  111  in a case that the time period for holding the power key pressed down exceeds the predetermined time period, and performing Step  112  in a case that the time period for holding the power key pressed down does not exceed the predetermined time period. 
         [0107]    Step  111 , entering the dormant state; and performing Step  101  when it is detected that the key flag is set again. 
         [0108]    Step  112 , setting the power flag. 
         [0109]    Step  113 , detecting whether the lock flag is set, performing Step  114  in a case that the lock flag is set, and performing Step  115  in a case that the lock flag is not set. 
         [0110]    Step  114 , setting the state identification to be a first predetermined value, displaying an unlock code entering interface, and performing Step  116 . 
         [0111]    Step  115 , setting the state identification to be a second predetermined value, and displaying a logon password entering interface. 
         [0112]    Step  116 , determining whether the key flag is detected to be set in a predetermined time period, performing Step  101  in a case that the key flag is detected to be set in the predetermined time period, and performing Step  117  in a case that the key flag is not detected to be set in the predetermined time period. 
         [0113]    Step  117 , resetting the power flag, entering the dormant state, and performing Step  101  when it is detected that the key flag is set again. 
         [0114]    Step  118 , determining whether the device is initialized, performing Step  122  in a case that the device is initialized, and performing Step  119  in a case that the device is not initialized. 
         [0115]    Step  119 , displaying the corresponding number. 
         [0116]    Step  120 , determining whether the key flag is detected to be set in a predetermined time period, performing Step  101  in a case that the key flag is detected to be set in the predetermined time period, and performing Step  121  in a case that the key flag is not detected to be set in the predetermined time period. 
         [0117]    Step  121 , entering the dormant state, and performing Step  101  when it is detected that the key flag is set again. 
         [0118]    Step  122 , detecting whether the power flag is set, performing Step  124  in a case that the power flag is set, and performing Step  123  in a case that the power flag is not set. 
         [0119]    Step  123 , entering the dormant state, and performing Step  101  when it is detected that the key flag is set again. 
         [0120]    Step  124 , storing the corresponding data into the data cache and displaying the corresponding number. 
         [0121]    Preferably, in the present embodiment, in a case that the state identification is the second predetermined value or a fourth predetermined value or a fifth predetermined value or a sixth predetermined value, it is determined whether the number of the unit data in the data cache exceeds 6, the first or the last 6 unit data are stored in a case that the number of the unit data in the data cache exceeds 6, and all unit data are stored in a case that the number of the unit data in the data cache does not exceed 6. In a case that the state identification is the first predetermined value, it is determine whether the number of the unit data in the data cache exceeds 8, the first or the last 8 unit data are stored in a case that the number of the unit data in the data cache exceeds 8, and all unit data are stored in a case that the number of the unit data in the data cache does not exceeds 8. 
         [0122]    The displaying the corresponding number includes displaying numbers corresponding to all unit data in the data cache. 
         [0123]    The displayed corresponding number may be plain data, or may be a symbol such as “-” or “*”, or may be plain data for some time period and then a symbol such as “-” or “*”. If different state identifications correspond to different displaying manners, the displaying manner may be selected according to the state identification. 
         [0124]    Step  125 , determining whether the key flag is detected to be set in a predetermined time period, performing Step  101  in a case that the key flag is detected to be set in the predetermined time period, and performing Step  126  in a case that the key flag is not detected to be set in the predetermined time period. 
         [0125]    Step  126 , resetting the power flag, entering the dormant state, and performing Step  101  when it is detected that the key flag is set again. 
         [0126]    Step  127 , determining whether the device is initialized, performing Step  131  in a case that the device is initialized, and performing Step  128  in a case that the device is not initialized. 
         [0127]    Step  128 , displaying the number 0. 
         [0128]    Step  129 , determining whether the key flag is detected to be set in a predetermined time period, performing Step  101  in a case that the key flag is detected to be set in the predetermined time period, and performing Step  130  in a case that the key flag is not detected to be set in the predetermined time period. 
         [0129]    Step  130 , entering the dormant state, and performing Step  101  when it is detected that the key flag is set again. 
         [0130]    Step  131 , checking whether the power flag is set, performing Step  133  in a case that the power flag is set, and performing Step  132  in a case that the power flag is not set. 
         [0131]    Step  132 , entering the dormant state, and performing Step  101  when it is detected that the key flag is set again. 
         [0132]    Step  133 , checking the state identification; performing Step  135  in a case that the state identification is a third predetermined value, and performing Step  134  in a case that the state identification is not the third predetermined value. 
         [0133]    Step  134 , storing the corresponding data into the data cache, displaying the corresponding number, and performing Step  137 . 
         [0134]    The implementation of Step  134  is identical to that of Step  124 , and the detailed description is omitted therein. 
         [0135]    Step  135 , determining whether the time period for holding the numeric key 0 pressed down exceeds a predetermined time period, performing Step  136  in a case that the time period for holding the numeric key 0 pressed down exceeds the predetermined time period, and performing Step  137  in a case that the time period for holding the numeric key 0 pressed down does not exceed the predetermined time period. 
         [0136]    Step  136 , setting the state identification to be the fourth predetermined value, displaying a logon password changing interface, and performing Step  137 . 
         [0137]    Step  137 , determining whether the key flag is detected to be set in a predetermined time period, performing Step  101  in a case that the key flag is detected to be set in the predetermined time period, and performing Step  138  in a case that the key flag is not detected to be set in the predetermined time period. 
         [0138]    Step  138 , resetting the power flag, entering the dormant state, and performing Step  101  when it is detected that the key flag is set again. 
         [0139]    Step  139 , determining whether the device is initialized, performing Step  143  in a case that the device is initialized, and performing Step  140  in a case that the device is not initialized. 
         [0140]    Step  140 , displaying predetermined information. 
         [0141]    In the present embodiment, the predetermined information is “success”. 
         [0142]    Step  141 , determining whether the key flag is detected to be set in a predetermined time period, performing Step  101  in a case that the key flag is detected to be set in the predetermined time period, and performing Step  142  in a case that the key flag is not detected to be set in the predetermined time period. 
         [0143]    Step  142 , entering the dormant state, and performing Step  101  when it is detected that the key flag is set again. 
         [0144]    Step  143 , checking whether the power flag is set, performing Step  145  in a case that the power flag is set, and performing Step  144  in a case that the power flag is not set. 
         [0145]    Step  144 , entering the dormant state and performing Step  101  when it is detected that the key flag is set again. 
         [0146]    Step  145 , checking the state identification, performing Step  146  in a case that the state identification is the third predetermined value; performing Step  149  in a case that the state identification is the second predetermined value; performing Step  151  in a case that the state identification is the first predetermined value; performing Step  157  in a case that the state identification is the fourth predetermined value; performing Step  160  in a case that the state identification is the fifth predetermined value; performing Step  163  in a case that the state identification is the sixth predetermined value; and performing Step  166  in a case that the state identification is a seventh predetermined value. 
         [0147]    Step  146 , generating a dynamic password by computing, setting the state identification to be the seventh predetermined value and displaying content corresponding to the dynamic password. 
         [0148]    In the present embodiment, the dynamic token generates a dynamic password with 6 digits by computing. The dynamic password may be generated according to a time factor (or an event factor) and a static factor pre-stored in the dynamic token, or according to a time factor (or an event factor), data in the data cache and a static factor pre-stored in the dynamic token, which is not limited herein. 
         [0149]    Preferably, in the present embodiment, the displaying the corresponding data includes displaying the first four digits of the dynamic password and symbols “-” for the last two digits. 
         [0150]    Further, a time bar may be displayed for representing the remained valid time of the current dynamic password. 
         [0151]    Step  147 , determining whether the key flag is detected to be set when the dynamic password is valid, performing Step  101  in a case that the key flag is detected to be set when the dynamic password is valid, and performing Step  148  when the dynamic password is invalid in a case that the key flag is not detected to be set when the dynamic password is valid. 
         [0152]    Step  148 , setting the state identification to be the third predetermined value, displaying an information interface, and performing Step  167 . 
         [0153]    Step  149 , generating an unlock verification code by computing, and determining whether the data in the data cache is identical to the unlock verification code, performing Step  150  in a case that the data in the data cache is identical to the unlock verification code, and performing Step  155  in a case that the data in the data cache is not identical to the unlock verification code. 
         [0154]    The dynamic token generates three unlock verification codes each of which has 8 digits by using a predetermined algorithm according to a static factor and a time factor (or an event factor), or according to a static factor, a time factor (or an event factor) and data in the data cache. The three unlock verification codes respectively correspond to the time factor previous to the current time factor, the current time factor and the time factor next to the current time factor, or respectively correspond to the current event factor, the event factor next to the current event factor and the event factor next to the next event factor of the current event factor. 
         [0155]    Further, the determining whether the corresponding number in the data cache is identical to the unlock verification code includes determining whether the corresponding number in the data cache is identical to any one of the three unlock verification codes generated by the dynamic token. 
         [0156]    Step  150 , clearing the data in the data cache, resetting the lock flag, setting the state identification to be the fifth predetermined value, displaying a new logon password setting interface, and performing Step  167 . 
         [0157]    Step  151 , determining whether the data in the data cache is identical to the logon password stored in the dynamic token, performing Step  156  in a case that the data in the data cache is identical to the logon password stored in the dynamic token, and performing Step  152  in a case that the data in the data cache is not identical to the logon password stored in the dynamic token. 
         [0158]    Step  152 , clearing the data in the data cache, and computing a result, which is used as the permitted password retry time, by subtracting 1 from the current password retry time. 
         [0159]    In the present embodiment, if it is the first time that Step  152  is performed, the initial value of the current password retry time is 6; otherwise, the current password retry time is the permitted password retry time obtained by performing Step  152  last time. 
         [0160]    Step  153 , determining whether the permitted password retry time is 0; in a case that the permitted password retry time is 0, setting the lock flag and performing Step  154 ; and in a case that the permitted password retry time is not 0, performing Step  154  directly. 
         [0161]    Step  154 , prompting that the logon password is error, prompting the permitted password retry time, and performing Step  155 . 
         [0162]    Step  155 , clearing the data in the data cache and performing Step  113 . 
         [0163]    Step  156 , clearing the data in the data cache, setting the state identification to be the third predetermined value, displaying an information interface, and performing Step  167 . 
         [0164]    Step  157 , determining whether the data in the data cache is identical to the logon password stored in the dynamic token, performing Step  158  in a case that the data in the data cache is identical to the logon password stored in the dynamic token, and performing Step  159  in a case that the data in the data cache is not identical to the logon password stored in the dynamic token. 
         [0165]    Step  158 , clearing the data in the data cache, setting the state identification to be the fifth predetermined value, displaying a new logon password setting interface, and performing Step  167 . 
         [0166]    Step  159 , clearing the data in the data cache, prompting that the logon password is error, and performing Step  167 . 
         [0167]    Step  160 , determining whether the data in the data cache meets a predetermined condition, performing Step  161  in a case that the data in the data cache meets the predetermined condition, and performing Step  162  in a case that the data in the data cache does not meet the predetermined condition. 
         [0168]    Preferably, in the present embodiment, the data in the data cache meets the predetermined condition is that the data in the data cache corresponds to 6 digits which are numbers from 0 to 9. 
         [0169]    Step  161 , clearing the data in the data cache, storing the data entered by the user as P1, setting the state identification to be the sixth predetermined value, displaying a new logon password confirmation interface, and performing Step  167 . 
         [0170]    Step  162 , clearing the data in the data cache, prompting failure of the logon password changing, and performing Step  167 . 
         [0171]    Step  163 , determining whether the data in the data cache is identical to P1, performing Step  165  in a case that the data in the data cache is identical to P1, and performing Step  164  in a case that the data in the data cache is not identical to P1. 
         [0172]    Step  164 , clearing the data in the data cache, prompting failure of logon password changing, setting the state identification to be the fifth predetermined value, displaying a new logon password setting interface, and performing Step  167 . 
         [0173]    Step  165 , clearing the data in the data cache, replacing the logon password stored in the dynamic token with P1, setting the state identification to be the third predetermined value, displaying an information interface, and performing Step  167 . 
         [0174]    Step  166 , setting the state identification to be the third predetermined value and displaying an information interface. 
         [0175]    Step  167 , determining whether the key flag is detected to be set in a predetermined time period, performing Step  101  in a case that the key flag is detected to be set in the predetermined time period, and performing Step  168  in a case that the key flag is not detected to be set in the predetermined time period. 
         [0176]    Step  168 , resetting the power flag, entering the dormant state, and performing Step  101  when it is detected that the key flag is set again. 
       Third Embodiment 
       [0177]    In order to effectively prevent a dynamic token from being stolen and lost, and avoid seed file loss and group attack, another working method of a dynamic token is provided according to an embodiment of the present invention. In the embodiment, the dynamic token is generally in a dormant state. When a key is pressed down, the dynamic token is waken up and the key flag is set. When a power key is pressed down for a time period exceeding a predetermined time period, or when there is no key entry for a predetermined time period, the dynamic token enters the dormant state again, the state identification is restored to be a default value, and the current permitted password retry time and the current state of the lock flag are stored. 
         [0178]    In a case that the key flag is detected to be set and the initialization of the dynamic token has not been finished, the dynamic token detects whether the liquid crystal screen and the keyboard are available according to the type of the key pressed down. 
         [0179]    In a case that the key flag is detected to be set and the initialization of the dynamic token has been finished, the dynamic token performs the following Steps  201  to  215 . 
         [0180]    Step  201 , clearing the key flag, scanning keys and determine the type of the key pressed down; performing Step  202  in a case that the key pressed down is a power key; performing Step  203  in a case that the key pressed down is a delete key; performing Step  204  in a case that the key pressed down is a numeric key; and performing Step  206  in a case that the key pressed down is an OK key. 
         [0181]    Preferably, in the third embodiment, in order to prevent the key flag from being set due to interferences such as static electricity and bounce of the key itself, a key debounce process is performed after the token detects that the key flag is set. The key debounce process includes: after it is detected that the key flag is set, determining whether the time period for holding the key pressed down exceeds a predetermined time period; in a case that the time period for holding the key pressed down exceeds the predetermined time period, performing Step S 1 ; and in a case that the time period for holding the key pressed down does not exceed the predetermined time period, clearing the key flag, entering the dormant state, and waiting for setting of the key flag. There are multiple ways for detecting the time period for holding the key pressed down, which are not limited herein. 
         [0182]    Preferably, in the present embodiment, the predetermined time period is 20 milliseconds. 
         [0183]    The key debounce process may also be realized by a hardware circuit, and may specifically be realized according to the characteristic of a RS trigger. 
         [0184]    Step  202 , checking the power flag; 
         [0185]    in a case that the power flag is set, resetting the power flag, entering the dormant state, and performing Step  201  when it is detected that the key flag is set again; and 
         [0186]    in a case that the power flag is not set, setting the power flag and performing Step  203 . 
         [0187]    Step  203 , checking whether the lock flag is set; in a case that the lock flag is set, displaying information for promoting that the dynamic token has been locked, setting the state identification to be a first predetermined value, displaying information for promoting entering the unlock code, and performing Step  212 ; and in a case that the lock flag is not set, setting the state identification to be a second predetermined value, displaying information for promoting entering the logon password, and performing Step  212 . 
         [0188]    Step  204 , checking the power flag; 
         [0189]    in a case that the power flag is set, checking the state identification,
       deleting one corresponding unit data at the end of the corresponding cache, displaying the corresponding number, and performing Step  212 , and   performing Step  212  directly if no data is in the corresponding cache; and       
 
         [0192]    in a case that the power flag is not set, entering the dormant state, and performing Step  201  when it is detected that the key flag is set again. 
         [0193]    Specifically, the checking the state identification and deleting one unit data at the end of the corresponding cache includes: 
         [0194]    checking the state identification; in a case that the state identification is the first predetermined value, deleting a unit data at the end of the unlock code cache; in a case the state identification is the second predetermined value or a fourth predetermined value, deleting a unit data at the end of the logon password cache; in a case that the state identification is a fifth predetermined value, deleting a unit data at the end of the new logon password cache; in a case that the state identification is a sixth predetermined value, deleting a unit data at the end of the new logon password confirmation cache; and in a case that the state identification is other value, performing no operation. 
         [0195]    One unit data in the data cache represents a number; and the one unit data is coded or uncoded. 
         [0196]    The displaying the corresponding number includes: displaying numbers corresponding to all unit data in the data cache. The displayed corresponding number is plain data, or is a symbol “-”, or is the plain data for a fixed time period and then the symbol “-”. If different predetermined values of the state identification correspond to different displaying manners, the displaying manner may be selected according to the current value of the state identification. 
         [0197]    Step  205 , checking the power flag; in a case that the power flag is set, checking the state identification, storing corresponding data into the corresponding cache according to the value of the key, and performing Step  212 ; and in a case that the power flag is not set, entering the dormant state, and performing Step  201  when it is detected that the key flag is set again. 
         [0198]    Specifically, the checking the state identification and storing corresponding data into the corresponding cache according to the value of the key includes: checking the state identification; in a case that the state identification is the first predetermined value, storing the corresponding data into the unlock code cache; in a case that the state identification is the second predetermined value or the fourth predetermined value, storing the corresponding data into the logon password cache; in a case that the state identification is the fifth predetermined value, storing the corresponding data into the new logon password cache; in a case that the state identification is the sixth predetermined value, storing the corresponding data into the new logon password confirmation cache; and in a case that the state identification is other value, performing no operation. 
         [0199]    The storing corresponding data into the corresponding data cache includes: determining whether the number of the unit data in the corresponding cache exceeds a predetermined number according to the state identification; storing a predetermined number of unit data from the first or the last unit data in a case that the number of the unit data in the corresponding cache exceeds the predetermined number; and storing all unit data in a case that the number of the unit data in the corresponding cache does not exceed the predetermined number. 
         [0200]    Step  206 , checking the power flag; 
         [0201]    in a case that the power flag is set, checking the state identification,
       in a case that the state identification is a third predetermined value, determining whether the time period for holding the key pressed down exceeds a predetermined time period;
           in a case that the time period for holding the key pressed down exceeds the predetermined time period, setting the state identification to be the fifth predetermined value, displaying information for promoting resetting the logon password, and performing Step  212 ; and   in a case that the time period for holding the key pressed down does not exceed the predetermined time period, performing Step  212  directly; and   
           in a case that the state identification is not the third predetermined value, storing the corresponding data into the corresponding cache, displaying the corresponding number, and performing Step  212 ; and       
 
         [0206]    in a case that the power flag is not set, entering the dormant state, and performing Step  211  when it is detected that the key flag is set again. 
         [0207]    The storing the corresponding data into the corresponding cache in a case that the state identification is not the third predetermined value includes: in a case that the state identification is the first predetermined value, storing the corresponding data into the unlock code cache; in a case that the state identification is the second predetermined value or the fourth predetermined value, storing the corresponding data into the logon password cache; in a case that the state identification is the fifth predetermined value, storing the corresponding data into the new logon password cache; in a case that the state identification is the sixth predetermined value, storing the corresponding data into the new logon password confirmation cache; and in a case that the state identification is other value, performing no operation. 
         [0208]    Step  207 , checking the power flag; in a case that the power flag is set, checking the state identification, performing Step  208  in a case that the state identification is the first predetermined value, performing Step  209  in a case that the state identification is the second predetermined value, performing Step  210  in a case that the state identification is the third predetermined value, and performing Step  211  in a case that the state identification is the fifth predetermined value; and in a case that the power flag is not set, entering the dormant state, and performing Step  201  when it is detected that the key flag is set again. 
         [0209]    Step  208 , generating an unlock verification code by computing; determine whether the data in the unlock code cache is identical to the generated unlock verification code; in a case that the data in the unlock code cache is identical to the generated unlock verification code, resetting the lock flag, setting the state identification to be the fifth predetermined value, displaying information for prompting the user to reset the logon password, clearing the data in the unlock code cache, and performing Step  212 ; and in a case that the data in the unlock code cache is not identical to the generated unlock verification code, clearing the data in the unlock code cache, and performing Step  203 . 
         [0210]    Specifically, the method for generating the unlock verification code by computing is the same as the method for generating the unlock verification code by computing in the second embodiment, and the detailed description is omitted herein. 
         [0211]    Step  209 , determining whether the data in the logon password cache is identical to the logon password currently stored in the dynamic token; in a case that the data in the logon password cache is identical to the logon password currently stored in the dynamic token, setting the state identification to be the third predetermined value, displaying information for prompting that an information interface is entered, clearing the data in the logon password cache, and performing Step  212 ; and in a case that the data in the logon password cache is not identical to the logon password currently stored in the dynamic token, setting the lock flag, clearing the data in the logon password cache, and performing Step  203 . 
         [0212]    Preferably, a permitted password retry time may be set in the dynamic token. 
         [0213]    Correspondingly, in a case that the lock flag is not set, it is determined whether the data in the logon password cache is identical to the logon password currently stored in the dynamic token, 
         [0214]    in a case that the data in the logon password cache is identical to the logon password currently stored in the dynamic token, the state identification is set to be the third predetermined value, information for promoting that an information interface is entered is displayed, the permitted password retry time is set to be the initial value, the data in the logon password cache is cleared, and Step  212  is performed; and 
         [0215]    in a case that the data in the logon password cache is not identical to the logon password currently stored by the dynamic token, the data in the logon password cache is cleared, a result, which is used as the current permitted password retry time, is computed by subtracting 1 from the permitted password retry time, and it is determined whether the current permitted password retry time is 0, the lock flag is set and Step  203  is performed in a case that the current permitted password retry time is 0, and Step  203  is performed directly in a case that the current permitted password retry time is not 0. 
         [0216]    Step  210 , generating a dynamic password by computing, displaying content corresponding to the dynamic password, and performing Step  212 . 
         [0217]    Specifically, the method for generating the dynamic password by computing is the same as the method for generating the dynamic password by computing in the second embodiment, and the detailed description is omitted herein. 
         [0218]    Step  211 , determining whether the data in the new logon password cache meets a predetermined condition; in a case that the data in the new logon password cache meets the predetermined condition, replacing the logon password currently stored in the token with the data in the new logon password cache, setting the state identification to be the third predetermined value, displaying information for promoting that an information interface is entered, clearing the data in the new logon password cache, and performing Step  212 ; and in a case that the data in the new logon password cache does not meet the predetermined condition, clearing the data in the new logon password cache, and performing Step  212 . 
         [0219]    Step  212 , determining whether the key flag is detected to be set in a predetermined time period; in a case that the key flag is detected to be set in the predetermined time period, performing Step  201 ; and in a case that the key flag is not detected to be set in the predetermined time period, resetting the power flag, entering the dormant state, and performing Step  201  when it is detected that the key flag is set again. 
         [0220]    Preferably, Step  207  further includes: in a case that the state identification is the fourth predetermined value, performing Step  213 ; in a case that the state identification is the sixth predetermined value, performing Step  214 ; and in a case that the state identification is a seventh predetermined value, performing Step  215 . 
         [0221]    Step  213 , determining whether the data in the logon password cache is identical to the logon password currently stored in the dynamic token; in a case that the data in the logon password cache is identical to the logon password currently stored in the dynamic token, setting the state identification to be the fifth predetermined value, displaying information for promoting resetting the logon password, clearing the data in the logon password cache, and performing Step  212 ; and in a case that the data in the logon password cache is not identical to the logon password currently stored in the dynamic token, clearing the data in the logon password cache, and performing Step  212 . 
         [0222]    Correspondingly, Step  206  further includes: in a case that it is determined the time period for holding the key pressed down exceeds the predetermined time period, setting the state identification to be the fourth predetermined value, displaying information for promoting entering the current logon password, and performing Step  212 . 
         [0223]    Step  214 , determining whether the data in the logon password confirmation cache is identical to a new logon password; in a case that the data in the logon password confirmation cache is identical to the new logon password, replacing the logon password currently stored in the dynamic token with the new logon password, setting the state identification to be the third predetermined value, displaying information for promoting that an information interface is entered, clearing the data in the logon password confirmation cache, and performing Step  212 ; and in a case that the data in the logon password confirmation cache is not identical to the new logon password, setting the state identification to be the fifth predetermined value, displaying information for prompting resetting the logon password, clearing the data in the logon password confirmation cache, and performing Step  212 . 
         [0224]    Correspondingly, in Step  211 , in a case that the data in the new logon password cache meets the predetermined condition, the data in the new logon password cache is stored as the new logon password, the state identification is set to be the sixth predetermined value, the information for prompting confirming the reset logon password is displayed, the data in the new logon password cache is cleared, and Step  212  is performed. 
         [0225]    Step  215 , setting the state identification to be the third predetermined value and performing Step  212 . 
         [0226]    Correspondingly, Step  210  further includes: after generating the dynamic password by computing, setting the state identification to be the seventh predetermined value and determining whether the key flag is set before the dynamic password becomes invalid; in a case that the key flag is set before the dynamic password becomes invalid, performing Step  201 ; and in a case that the key flag is not set before the dynamic password becomes invalid, setting the state identification to be the third predetermined value when the dynamic password becomes invalid, and performing Step  212 . 
         [0227]    Specifically, in the present embodiment, the unlock code cache and the logon password cache share a same storing region. In addition, there are other ways for cache sharing, for example, the unlock code cache and the new logon password cache may share a same storing region. 
         [0228]    The above are only embodiments of the present invention. Any modification and equivalent substitute made by those skilled in the art within the technical scope of the present disclosure without any creative labor should fall into the protection scope of the present invention. The protection scope of the present invention should follow the protection scope of the claims.