WO2014183500A1 - 一种动态令牌的工作方法 - Google Patents

一种动态令牌的工作方法 Download PDF

Info

Publication number
WO2014183500A1
WO2014183500A1 PCT/CN2014/073602 CN2014073602W WO2014183500A1 WO 2014183500 A1 WO2014183500 A1 WO 2014183500A1 CN 2014073602 W CN2014073602 W CN 2014073602W WO 2014183500 A1 WO2014183500 A1 WO 2014183500A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
bluetooth
dynamic
data
password
Prior art date
Application number
PCT/CN2014/073602
Other languages
English (en)
French (fr)
Inventor
陆舟
于华章
Original Assignee
飞天诚信科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 飞天诚信科技股份有限公司 filed Critical 飞天诚信科技股份有限公司
Priority to US14/777,768 priority Critical patent/US9781104B2/en
Publication of WO2014183500A1 publication Critical patent/WO2014183500A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • H04L63/0838Network architectures or network communication protocols for network security for authentication of entities using passwords using one-time-passwords
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/33User authentication using certificates
    • G06F21/335User authentication using certificates for accessing specific resources, e.g. using Kerberos tickets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network
    • H04L63/067Network architectures or network communication protocols for network security for supporting key management in a packet data network using one-time keys
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3226Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using a predetermined code, e.g. password, passphrase or PIN
    • H04L9/3228One-time or temporary data, i.e. information which is sent for every authentication or authorization, e.g. one-time-password, one-time-token or one-time-key
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/50Secure pairing of devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2147Locking files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks

Definitions

  • the present invention relates to the field of identity authentication, and in particular, to a method for working with a dynamic token. Background technique
  • the biggest advantage of dynamic tokens is that the passwords used by users each time are different, making it impossible for criminals to fake the identity of legitimate users.
  • the dynamic password authentication technology is considered to be one of the most effective ways to solve the user's identity authentication method at present. It can effectively prevent multiple network problems such as hacker Trojans stealing user account passwords and fake websites, and avoid the loss of user property or data.
  • the dynamic token generated by the user inputting the dynamic password is more secure.
  • the dynamic token generated by the user participating in the dynamic password generation has its own keyboard, and the user information is dynamically transmitted by the user. The keyboard input that comes with the token.
  • the present invention provides a working method of a dynamic token, including
  • Step S1 The dynamic token determines whether there is a set wakeup identifier, if yes, step S2 is performed; otherwise, sleep is performed;
  • Step S2 The dynamic token determines the type of the set wake-up identifier, such as the button wake-up identifier, and then performs step S3; if the Bluetooth connection wake-up identifier, switches the working mode of the Bluetooth module to the monitor.
  • Step S1 resetting the Bluetooth connection wake-up identifier, returning to step S1; if it is a Bluetooth data wake-up identifier, receiving Bluetooth data, saving the Bluetooth data to a receive data buffer, and setting a Bluetooth data reception completion flag, The Bluetooth data wake-up flag is reset, and the process returns to step S1; if the Bluetooth disconnects the wake-up flag, the received data buffer is cleared, the Bluetooth disconnected wake-up flag is reset, and the process returns to step S1; wherein the button wake-up identifier is used for When the dynamic token detects a key interruption, the dynamic token is set; the Bluetooth data wakeup identifier is used to be set by the dynamic token when the dynamic token detects a Bluetooth data interruption.
  • the Bluetooth connection wake-up identifier is configured to be set by the dynamic token when the dynamic token detects a Bluetooth connection interruption; the Bluetooth disconnect wake-up identifier is used to detect a Bluetooth break in the dynamic token When the interrupt is opened, it is set by the dynamic token;
  • Step S3 The dynamic token acquires the key value of the triggered key, and determines whether the triggered key is a power key according to the key value, if yes, step S4 is performed; otherwise, step S5 is performed;
  • Step S4 The dynamic token determines whether the system status identifier is a shutdown identifier.
  • the system status identifier is the shutdown identifier, determining whether the operating voltage of the Bluetooth module is lower than a preset voltage; if the preset voltage is lower than the preset voltage, prompting the Bluetooth module to operate at a low voltage, and operating voltage of the Bluetooth module After the duration of the preset voltage is up to the first preset time, the system status identifier is set as the input challenge code identifier, and step S8 is performed; if not lower than the preset voltage, the Bluetooth module is Powering up, setting the system status identifier to a Bluetooth OTP identifier, switching the working mode of the Bluetooth module to the listening mode, and performing step S8;
  • Step S5 The dynamic token determines the system status identifier, if it is the input challenge code identifier, step S6 is performed; if it is the Bluetooth OTP identifier, step S7 is performed; if it is another identifier, step S8 is performed;
  • Step S6 The dynamic token acquires a key value of the triggered button, and determines the triggered button according to the key value;
  • step S8 If it is a numeric key, save the number corresponding to the key value to the button data buffer, and execute step S8;
  • step S8 If it is a confirmation key, it is determined whether there is data in the button data buffer area, if there is data, the data in the button data buffer area, or the data in the button data buffer area Combining with a basic factor inside the dynamic token as a dynamic factor, calculating a dynamic password according to the dynamic factor, displaying the dynamic password, performing step S8; if there is no data, using the basic factor as a dynamic factor, Calculating a dynamic password according to the dynamic factor, displaying the dynamic password, performing step S8;
  • Step S7 the dynamic token acquires a key value of the triggered button, and the trigger is triggered according to the key value. Press the button to judge;
  • step S8 If it is a numeric key, save the number corresponding to the key value to the button data buffer, and execute step S8;
  • step S8 it is determined whether the Bluetooth data reception completion flag is set, if set, the data in the received data buffer, or the combination of the basic factor and the data in the received data buffer As a dynamic factor, calculating a dynamic password according to the dynamic factor, returning the calculated dynamic password to the upper computer, performing step S8; if not, determining whether data exists in the button data buffer, if present Data, the data in the button data buffer, or the combination of the data in the button data buffer and the basic factor inside the dynamic token as a dynamic factor, and the dynamic password is calculated according to the dynamic factor, Displaying the dynamic password, performing step S8; if there is no data, using the basic factor as a dynamic factor, calculating a dynamic password according to the dynamic factor, returning the calculated dynamic password to the upper computer, and performing step S8 ; if it is a delete key, save the system status identifier as an input pick Identification code, step S8;
  • Step S8 The dynamic token resets the button wakeup identifier, and returns to step S1.
  • Returning the calculated dynamic password to the upper computer includes displaying a dynamic password through a liquid crystal screen and/or returning the dynamic password to the upper computer through a Bluetooth module.
  • the method before determining whether the working voltage of the bluetooth module is lower than the preset voltage, the method further includes: performing a check password operation, and when the password is correct, determining whether the working voltage of the bluetooth module is lower than a preset voltage; when the password is incorrect, Go to step S8;
  • the checking password operation includes,
  • Step E1 The dynamic token acquires a key value of the triggered key, and determines the triggered key according to the key value; if it is a confirmation key, performs step E2; if it is a numeric key If the length of the button data is less than the preset length, the button data corresponding to the number key is saved to the button data buffer area, the check password interface is displayed, and the check password operation is exited; if other key values are performed, the corresponding operation is performed according to the key value, and the check password operation is exited;
  • Step E2 determining whether the password in the button data buffer area is correct, if the password is correct, executing step E3; otherwise, performing step E4;
  • Step E3 Prompt the password is correct, clear the number of password failures, delay the fourth preset time, clear the button data buffer area, confirm the password is correct, and end the check password operation;
  • Step E4 The number of password failures is increased by 1, the password failure interface is displayed, and the fourth preset time is delayed, and step E5 is performed;
  • Step E5 Determine whether the number of password failures is equal to the preset number of times
  • step S8 is performed; otherwise, the password input interface is displayed, the key data buffer is cleared, and step S8 is performed.
  • step S6 If the deletion key is used in the step S6, the data in the button data buffer is cleared, and step S8 is performed;
  • Step A 1 Determine whether the time when the delete button is pressed reaches the preset duration
  • step A 2 If yes, go to step A 2; otherwise, go to step A 5;
  • Step A 2 Determine whether there is data in the button data buffer
  • step A4 If yes, go to step A4; otherwise, go to step A3;
  • Step A 3 Display the menu interface, save the system status identifier as the menu function selection identifier, and execute step S8;
  • Step A 4 Clear the button data buffer, display the input challenge code information interface, and perform the steps.
  • Step A 5 Determine whether data exists in the button data buffer area
  • step A6 If yes, go to step A6; otherwise, go to step A7;
  • Step A 6 Clear the last key value stored in the button data buffer; then perform step A 7;
  • Step A 7 Display the input challenge code information interface, display the data in the button data buffer, and execute step S8;
  • the step S5 further includes: detecting a system status identifier, and if it is a menu function selection identifier, performing a menu function selection operation, performing step S8; the menu function selection operation includes, Step HI: detecting the key value, if it is the confirmation key, executing step H2;
  • Step H2 Determine the selected function, if it is Bluetooth OTP, perform step H3;
  • Step H3 The Bluetooth module is powered on, the Bluetooth OTP interface is displayed, and the system status identifier is saved as the Bluetooth OTP identifier, and step H4 is performed;
  • Step H4 Read the parameters of the Bluetooth module
  • Step H5 Determine whether the parameter of the reading benefit module is successful
  • step H6 is performed; otherwise, step H7 is performed;
  • Step H6 The Bluetooth module switches to the listening mode, and exits the menu function selection operation
  • Step H7 Read the number of parameters of the Bluetooth module plus 1;
  • Step H8 determining whether the number of reading parameters of the Bluetooth module reaches a sixth preset value
  • step H9 If yes, go to step H9; otherwise, return to step H4;
  • Step H9 Prompt the Bluetooth module is damaged, power off the Bluetooth module, delay the third preset time, display the input challenge code information interface, save the system status identifier as the input challenge code identifier, and exit the menu function to select the operation.
  • the base factor is a time factor, and the method further includes:
  • the dynamic token updates the time factor, and the timer wake-up flag is set;
  • Step G1 determining whether the system status identifier is a Bluetooth OTP identifier
  • step G2 the Bluetooth mode counter count value is incremented by 1, and step G2 is performed; otherwise, step G7 is performed; the Bluetooth mode counter count value is initially 0;
  • Step G2 determining whether the Bluetooth mode counter count value is less than the first preset value
  • step G4 If yes, go to step G4; otherwise, go to step G3;
  • Step G3 The Bluetooth mode counter count value is set to 0, clearing the receive data buffer, for Bluetooth Power off the module, display the input challenge code information interface, save the system status identifier as the input challenge code identifier, and then execute step G6;
  • Step G4 detecting whether the working voltage of the bluetooth module is lower than the preset voltage, if it is lower than the preset voltage, performing step G5; if not lower than the preset voltage, performing step G6;
  • Step G5 The Bluetooth mode counter count value is set to 0, the receive data buffer area is cleared, the Bluetooth module is powered off, the input challenge code information interface is displayed, the system status identifier is saved as the input challenge code identifier, and the output voltage is low through the liquid crystal display. Please charge the Bluetooth function prompt message, go to step G6;
  • Step G6 determining whether the system status identifier is an input challenge code identifier
  • step G7 If yes, go to step G7; otherwise, go to step G10;
  • Step G7 No button counter count value plus 1
  • the initial value of the buttonless counter is 0;
  • Step G8 determining whether the count value of the no-key counter is less than a second preset value
  • step G10 If yes, go to step G10; otherwise, go to step G9;
  • Step G9 Set the no-key counter count value to 0, save the system status identifier as the shutdown identifier, clear the button data buffer, and then perform step G10;
  • Step G10 Reset the timer wakeup flag and return to step Sl.
  • the base factor includes a time factor and/or an event factor.
  • a method of working with a dynamic token including,
  • Dynamic token initialization open button interrupt and / or Bluetooth data interrupt and / or Bluetooth connection interrupt and / or Bluetooth disconnect interrupt, dynamic token sleep;
  • step S-1 is performed
  • Step S-1 The dynamic token acquires the key value of the triggered key, determines whether the triggered key is a power key according to the key value, and then performs step S-2; otherwise, detects the system status identifier, if the input challenge code identifier Step S-3 is performed; if it is a Bluetooth OTP identifier, step S-4 is performed; if it is another identifier, the dynamic token is dormant;
  • Step S-2 determining whether the system status identifier is a shutdown identifier, and determining whether the operating voltage of the Bluetooth module is lower than a preset voltage. If the voltage is lower than the preset voltage, the Bluetooth module is low in operating voltage, and the working voltage of the Bluetooth module is low. After the preset voltage reaches the first preset time, the system status identifier is determined. Save as the input challenge code identifier, and the dynamic token sleeps; if it is not lower than the preset voltage, power on the Bluetooth module, save the system status identifier as the Bluetooth OTP logo, and switch the working mode of the Bluetooth module to the monitor mode. Card dormant;
  • system status identifier is not the shutdown identifier, the system status identifier is saved as the shutdown identifier, the data in the button data buffer is cleared, the Bluetooth module is powered off, and the dynamic token is hibernated;
  • Step S-3 The dynamic token acquires the key value of the triggered key, and judges the triggered key according to the key value; if it is a numeric key, saves the key corresponding value to the key data buffer, the dynamic token Sleep; if it is the confirmation key, it is judged whether there is data in the button data buffer, if there is data, the data in the data buffer area will be pressed, or the data in the button data buffer and the basic factor inside the dynamic token
  • the dynamic password is calculated according to the dynamic factor, the dynamic password is displayed, and the dynamic token is dormant; if there is no data, the basic factor is used as the dynamic factor, the dynamic password is calculated according to the dynamic factor, the dynamic password is displayed, and the dynamic token is dormant; If it is a delete key, the data in the button data buffer is cleared, and the dynamic token is dormant;
  • Step S-4 The dynamic token acquires the key value of the triggered key, and judges the triggered key according to the key value;
  • the number corresponding to the key value is saved to the key data buffer area, and the dynamic token sleeps;
  • the Bluetooth data reception completion flag is set, if set, the data in the data buffer area is received, or the combination of the base factor and the data in the received data buffer area is used as a dynamic factor, according to the dynamic
  • the factor calculates the dynamic password, returns the calculated dynamic password to the upper computer, and the dynamic token sleeps; if not set, it determines whether there is data in the button data buffer, and if there is data, the data in the data buffer is pressed.
  • the dynamic password is calculated according to the dynamic factor, the dynamic password is displayed, and the dynamic token is dormant; if no data exists, the base factor is used as The dynamic factor calculates a dynamic password according to the dynamic factor, and returns the calculated dynamic password to the upper computer, and the dynamic token sleeps;
  • the system state identifier is saved as an input challenge code identifier, and the dynamic token is dormant; when the dynamic token detects that the Bluetooth data is interrupted, the Bluetooth data is received, and the Bluetooth data is saved to the receive data buffer until receiving. After the Bluetooth data is completed, the Bluetooth data receiving completion flag is set, dynamic Token sleep
  • the dynamic token detects that the Bluetooth connection is interrupted, the display Bluetooth is connected, the screen is cleared after the preset time, and the dynamic token is hibernated;
  • the receive data buffer is cleared, and the dynamic token is dormant; the base factor includes a time factor and/or an event factor.
  • the step of determining whether the working voltage of the bluetooth module is lower than the preset voltage in the step S-2 further includes: performing a check password operation, and when the password is correct, determining whether the working voltage of the bluetooth module is lower than a preset voltage; when the password is incorrect When the dynamic token is dormant;
  • the checking password operation includes,
  • Step E1 The dynamic token acquires a key value of the triggered key, and determines the triggered key according to the key value; if it is a confirmation key, performs step E2; if it is a numeric key and the key data length If it is less than the preset length, save the key data corresponding to the numeric key to the key data buffer area, display the check password interface, and exit the check password operation; if other key values, perform corresponding operations according to the key value, and exit the check password operation;
  • Step E2 determining whether the password in the button data buffer area is correct, if the password is correct, executing step E3; otherwise, performing step E4;
  • Step E3 Prompt the password is correct, clear the number of password failures, delay the fourth preset time, clear the button data buffer area, confirm the password is correct, and end the check password operation;
  • Step E4 The number of password failures is increased by one, the password failure interface is displayed, and the fourth preset time is delayed, and step E5 is performed;
  • Step E5 Determine whether the number of password failures is equal to the preset number of times
  • the button data buffer is cleared, the password is determined to be incorrect, and the dynamic token is hibernated; otherwise, the password input interface is displayed, the button data buffer is cleared, and the dynamic token is hibernated.
  • the delete key is in the step S-3, the data in the button data buffer is cleared, and the dynamic token is dormant, including,
  • Step A 1 Determine whether the time when the delete button is pressed reaches the preset duration
  • step A 2 If yes, go to step A 2; otherwise, go to step A 5;
  • Step A 2 determining whether data exists in the button data buffer area
  • Step A 3 Display the menu interface, save the system status identifier as the menu function selection identifier, and the dynamic token sleeps;
  • Step A 4 Clear the button data buffer area, display the input challenge code information interface, and dynamic token sleep;
  • Step A5 Determine whether there is data in the button data buffer
  • step A6 If yes, go to step A6; otherwise, go to step A7;
  • Step A 6 Clear the last key value stored in the button data buffer; then perform step A 7;
  • Step A 7 Display the input challenge code information interface, display the data in the button data buffer, and the dynamic token sleeps;
  • the step S-1 further includes: detecting a system status identifier, and if it is a menu function selection identifier, performing a menu function selection operation, the dynamic token is dormant; and the menu function selection operation includes,
  • Step HI Detect the key value, if it is the confirmation key, execute step H2;
  • Step H2 Determine the selected function, if it is Bluetooth OTP, perform step H3;
  • Step H3 The Bluetooth module is powered on, the Bluetooth OTP interface is displayed, and the system status identifier is saved as the Bluetooth OTP identifier, and step H4 is performed;
  • Step H4 Read the parameters of the Bluetooth module
  • Step H5 Determine whether the parameters of the Bluetooth module are successfully read.
  • step H6 is performed; otherwise, step H7 is performed;
  • Step H6 The Bluetooth module switches to the listening mode, and exits the menu function selection operation
  • Step H7 Read the number of parameters of the Bluetooth module plus 1;
  • Step H8 determining whether the number of reading parameters of the Bluetooth module reaches a sixth preset value
  • step H9 If yes, go to step H9; otherwise, return to step H4;
  • Step H9 The Bluetooth module is damaged, the Bluetooth module is powered off, and the third preset time is delayed.
  • the input challenge code information interface is displayed.
  • the system status identifier is saved as the input challenge code identifier, and the menu function selection operation is exited.
  • the base factor is a time factor, and after the dynamic token is initialized, the method further includes: opening a timer interrupt, and the dynamic token is dormant;
  • the time factor is updated to perform a timing operation; the timing operation includes
  • Step G1 determining whether the system status identifier is a Bluetooth OTP identifier
  • step G2 the Bluetooth mode counter count value is incremented by 1, and step G2 is performed; otherwise, step G7 is performed;
  • the Bluetooth mode counter count value is initially 0;
  • Step G2 determining whether the Bluetooth mode counter count value is less than the first preset value
  • step G4 If yes, go to step G4; otherwise, go to step G3;
  • Step G3 The Bluetooth mode counter count value is set to 0, the receive data buffer area is cleared, the Bluetooth module is powered off, the input challenge code information interface is displayed, the system status identifier is saved as the input challenge code identifier, and then the step G6 is performed;
  • Step G4 detecting whether the working voltage of the bluetooth module is lower than the preset voltage, if it is lower than the preset voltage, performing step G5; if not lower than the preset voltage, performing step G6;
  • Step G5 The Bluetooth mode counter count value is set to 0, the receive data buffer area is cleared, the Bluetooth module is powered off, the input challenge code information interface is displayed, the system status identifier is saved as the input challenge code identifier, and the output voltage is low through the liquid crystal display. Please charge the Bluetooth function prompt message, go to step G6;
  • Step G6 determining whether the system status identifier is an input challenge code identifier
  • step G7 If yes, go to step G7; otherwise, the dynamic token sleeps
  • Step G7 No button counter count value plus 1
  • the initial value of the buttonless counter is 0;
  • Step G8 determining whether the count value of the no-key counter is less than a second preset value
  • step G9 is performed
  • Step G9 Set the no-key counter count value to 0, save the system status ID as the shutdown flag, clear the button data buffer, and the dynamic token sleeps.
  • Returning the calculated dynamic password to the upper computer includes displaying the dynamic password through the LCD screen and/or returning the dynamic password to the upper computer through the Bluetooth module.
  • the base factor includes a time factor and/or an event factor.
  • the utility model has the beneficial effects that the upper computer transmits data that needs to be input by the user to the token through the Bluetooth, and the user input step is omitted under the premise of ensuring the security of the dynamic password, thereby avoiding the need for the user to input a large amount of information. It is easy to make mistakes and time consuming.
  • FIG. 1 is a flowchart of a working method of a dynamic token according to Embodiment 1 of the present invention
  • FIG. 2 is a flowchart of a working method of a dynamic token according to Embodiment 2 of the present invention
  • FIG. 3 is a detailed flowchart of a Bluetooth OTP operation method according to Embodiment 1 of the present invention
  • FIG. 4 is a detailed flowchart of a challenge response operation method according to Embodiment 1 of the present invention
  • FIG. 5 is a detailed flowchart of a menu function selection operation method provided in Embodiment 1 of the present invention. detailed description
  • Embodiment 1 of the present invention provides a working method of a dynamic token, including the following steps:
  • Step 100 Token initialization
  • the MCU Microprogrammed Control Unit
  • the stack pointer is pointed to the stack start address
  • the RAM memory Random Access Memory
  • the global variable is cleared, and all wakeup flags are set. Reset, set the system status flag to the shutdown flag, turn on the button interrupt and / or Bluetooth data interrupt and / or Bluetooth connection interrupt and / or Bluetooth disconnect interrupt and / or timer interrupt, reset all interrupt flags, token sleep Go to step 101.
  • Step 101 Waiting for receiving an interrupt trigger signal, determining whether an interrupt trigger signal is received; if yes, performing corresponding interrupt processing, the token is awakened, and performing step 102; otherwise, returning Step 101;
  • the interrupt trigger signal includes: a button interrupt trigger signal, a timer interrupt trigger signal, a Bluetooth data interrupt trigger signal, a Bluetooth connection interrupt trigger signal, and a Bluetooth disconnect interrupt trigger signal.
  • the key interrupt processing is entered, including step M to step b4,
  • Step bl determining whether the button interrupt flag is set, if yes, executing step b2; otherwise, exiting the button interrupt processing;
  • Step b2 Determine whether there is a button pressed, if yes, execute step b3; otherwise, perform step b4; this step can also add delay debounce processing.
  • Step b3 Set the button wakeup flag
  • Step b4 Reset the key interrupt flag and exit the key interrupt processing.
  • the token receives the timer interrupt trigger signal, it enters the timer interrupt processing, including step cl to step c6.
  • Step cl Determine whether the timer interrupt flag is set, if yes, execute step c2; no, 'B, exit timer interrupt processing;
  • Step c2 The second counter counter value is incremented by one, and the second counter counter value is detected. If the second counter count value is equal to the first time interval, the second counter counter value is cleared, the time factor is incremented by 1, the event factor is cleared, and the calibration counter count value is added. 1. Perform step c3; if the second counter count value is equal to the second time interval and the calibration counter count value is greater than or equal to the calibration value, save the result of subtracting the calibration counter count value from the calibration value as a new calibration counter count value, and perform step c4 Otherwise, go to step c5;
  • Step c3 Determine whether the system status flag is a waiting flag, and if so, turn off the LCD (Liquid
  • Step c4 determining whether the calibration direction indicator is set. If set, the second counter count value is decreased by 1, and step c5 is performed; otherwise, the second counter count value is incremented by 1, performing step c5; wherein, the calibration direction flag is set or reset is Set by factory.
  • Step c5 Set the timer wake-up flag, reset the timer interrupt flag, and exit the timer interrupt processing.
  • the Bluetooth data interruption processing is entered, including steps dl to d2,
  • Step dl Determine whether the Bluetooth data interruption flag is set, if yes, execute step d2; otherwise, exit Bluetooth data interruption processing;
  • Step d2 Set the Bluetooth data wake-up flag, reset the Bluetooth data interrupt flag, and exit the Bluetooth data interrupt processing.
  • the Bluetooth connection interruption processing is entered, including: setting the Bluetooth connection wake-up flag, resetting the Bluetooth connection interruption identifier, and exiting the Bluetooth connection interruption processing;
  • the token When the token receives the Bluetooth disconnection interrupt trigger signal, it enters the Bluetooth disconnection interrupt processing, including setting the Bluetooth disconnected wakeup flag, resetting the Bluetooth disconnection interrupt flag, and exiting the Bluetooth disconnection interrupt processing.
  • Step 102 Determine whether there is a set wakeup identifier
  • step 103 If yes, go to step 103; otherwise, the token sleeps and then return to step 101.
  • Step 103 Determine the type of the wakeup identifier that is set
  • buttons 104-113 If the button wakes up the logo, perform steps 104-113;
  • Step 104 Turn off the button interrupt, scan the button and get the key value
  • Step 105 Determine whether the key value is not empty
  • step 106 If yes, go to step 106; otherwise, go to step 113;
  • Step 106 Set the no-key counter count value to 0;
  • Step 107 Determine whether the pressed button is a power button
  • step 109 If yes, go to step 109; otherwise, go to step 108;
  • Step 108 detecting a system status identifier
  • Step 113 After entering the challenge code identifier, perform the challenge response operation, and then perform step 113; if it is the menu function selection identifier, perform the menu function selection operation, and perform step 113; if it is another identifier, perform the corresponding operation, and then perform step 113.
  • the other identifier includes a check password identifier.
  • the password checking operation includes, step E1: detecting the key value, if it is the OK key, executing step E2; if other key values, performing the corresponding operation according to the key value, and then exiting checking Password operation.
  • the input digital data is saved as key data to the key data buffer area, the check password interface is displayed, and then the check password operation is exited;
  • Step E2 Determine whether the password is correct. If the password is correct, go to step E3; otherwise, go to step E7;
  • Step E3 Prompt the password is correct, clear the number of password failures, and delay the fourth preset time;
  • Step E5 The Bluetooth module is low in operating voltage. Please charge. After the working voltage is low for more than the first preset time, the system status indicator is saved as the input challenge code identifier, the button data buffer area is cleared, and the check password operation is exited.
  • Step E6 Power on the Bluetooth module, display the Bluetooth OTP interface, the Bluetooth mode counter count value is set to 0, the system status identifier is saved as the Bluetooth OTP logo, the Bluetooth connection interrupt flag is reset, the Bluetooth OTP allows the key input identifier to be reset, and the Bluetooth identifier is actively selected. Reset, clear the button data buffer, switch the Bluetooth module to the monitor mode, and exit the check password operation.
  • Step E7 The number of password failures is increased by one, the password failure interface is displayed, and the fourth preset time is delayed; Step E8: determining whether the number of password failures is equal to the preset number of times;
  • the Bluetooth OTP operation is performed as shown in FIG. 3, and includes steps F1 to F15. Step F1: detecting the key value, if it is the delete key, executing step F2; if it is a numeric key, executing step F8; if it is an OK key, executing step F10; if it is another key value, performing corresponding operation according to the key value, Exit Bluetooth OTP operation; other key values include left and right buttons;
  • Step F2 determining whether the time when the delete key is pressed reaches the preset duration
  • step F3 If yes, go to step F3; otherwise, go to step F4;
  • Step F3 Display the input challenge code information interface, save the system status identifier as the input challenge code identifier, and exit the Bluetooth OTP operation;
  • Step F4 determining whether the Bluetooth data receiving completion flag is set
  • Step F5 Determine whether the Bluetooth OTP allows the key input identifier to be set
  • step F6 If yes, go to step F6; otherwise, exit Bluetooth OTP operation;
  • Step F6 determining whether the button data length is equal to 0;
  • Step F7 The length of the button data is decreased by 1, the key data stored in the button data buffer area is cleared, the data in the button data buffer area is displayed, and then the Bluetooth OTP operation is exited;
  • Step F8 Determine whether the Bluetooth OTP is allowed to be set by the OTP and the data length of the button is less than the preset length;
  • step F9 If yes, go to step F9; otherwise, exit Bluetooth OTP operation;
  • Step F9 The length of the button data is increased by 1, and the input number corresponding to the key value is stored as the button data in the data buffer area of the button, the data of the button data buffer area is displayed, and then the Bluetooth OTP operation is exited;
  • Step F10 determining whether the Bluetooth data receiving completion flag is set
  • step F11 If yes, go to step F11; otherwise, go to step F12;
  • Step F11 Using the data in the receiving data buffer as the challenge value, calculating the challenge response type dynamic password according to the challenge value, displaying the challenge response type dynamic password, saving the system status identifier as a waiting identifier, clearing the receiving data buffer area, and exiting the Bluetooth OTP.
  • the receiving the data in the data buffer as the challenge value further includes: combining the time factor and/or the event factor with the data in the received data buffer as a challenge value, and calculating the challenge when the challenge value includes the event factor
  • the event factor is added to 1;
  • the data in the receiving data buffer area may be a random number or a transaction amount such as an account amount; in this step, the challenge response type dynamic port may also be sent to the host computer through the Bluetooth channel.
  • Step F12 Determine whether the Bluetooth OTP allows the key input identifier to be set
  • step F13 If set, go to step F13; otherwise, exit Bluetooth OTP operation;
  • Step F13 determining whether the button data length is equal to 0;
  • step F14 If yes, go to step F14; otherwise, go to step F15;
  • Step F14 Calculate the time type dynamic password according to the time factor inside the token, display the time type dynamic password, save the system status identifier as the waiting identifier, and then exit the Bluetooth OTP operation;
  • This step may also be: calculating an event type dynamic password according to an event factor, adding an event factor to 1, displaying an event type dynamic password, and saving the system status identifier as a waiting identifier;
  • the time type dynamic password (event type dynamic password) can also be sent to the host computer through the Bluetooth channel;
  • Step F15 Using the data in the button data buffer as the challenge value, calculating the challenge response type dynamic password according to the challenge value, displaying the challenge response type dynamic password, saving the system status identifier as the waiting identifier, clearing the button data buffer area, and then exiting the Bluetooth OTP. operating.
  • the using the data in the button data buffer as the challenge value further includes: combining the time factor and/or the event factor with the data in the button data buffer as the challenge value, and calculating the challenge response when the challenge value includes the event factor. After the dynamic password is also included, the event factor is increased by 1;
  • the challenge response type dynamic password can also be sent to the host computer through the Bluetooth channel. See Figure 4 for the challenge response operation, including steps A1 through A13.
  • Step A1 detecting the key value, if it is the delete key, executing step A2; if it is a numeric key, executing step A9; if it is an OK key, executing step A1; if other key values, performing corresponding operations according to the key value , exit the challenge response operation;
  • Step A2 It is judged whether the time when the delete key is pressed reaches the preset duration
  • step A3 If yes, go to step A3; otherwise, go to step A6;
  • Step A3 Determine whether the button data length is equal to 0;
  • step A4 is performed; otherwise, step A5 is performed;
  • Step A4 Display a menu interface, save the system status identifier as a menu function selection identifier, and then exit the challenge response operation;
  • Step A5 Clear the button data buffer area, display the input challenge code information interface, set the button data length to 0, and then exit the challenge response operation;
  • Step A6 Determine whether the button data length is equal to 0;
  • step A8 is performed; otherwise, step A7 is performed;
  • Step A7 The key data length is decreased by 1, and the last key data stored in the button data buffer is cleared; then step A8 is performed;
  • Step A8 Display the input challenge code information interface, display the data in the button data buffer area, and then exit the challenge response operation;
  • Step A9 determining whether the length of the button data is less than a preset length
  • step A10 If yes, go to step A10; otherwise, execute the exit challenge response operation;
  • Step A10 Save the input number corresponding to the corresponding key value as the button data to the button data buffer area, increase the length of the button data by 1, and then exit the challenge response operation;
  • Step A1 Determine whether the button data length is equal to 0;
  • step A12 If yes, go to step A12; otherwise, go to step A13;
  • Step A12 Calculate the time type dynamic password according to the time factor inside the token, display the time type dynamic password, and save the system status identifier as a waiting identifier;
  • the event type dynamic password is calculated according to the event factor inside the token, the event factor is incremented by 1, the event type dynamic password is displayed, and the system state identifier is saved as a waiting identifier;
  • the time type dynamic password (event type dynamic password) can also be sent to the host computer through the Bluetooth channel;
  • Step A13 Using the data in the button data buffer as the challenge value, calculating the challenge response type dynamic password according to the challenge value, displaying the challenge response type dynamic password, saving the system status identifier as a waiting identifier, clearing the button data buffer area, and then exiting the challenge. Answer the operation.
  • the using the data in the button data buffer as the challenge value further includes: combining the time factor and/or the event factor with the data in the button data buffer as the challenge value, and calculating the challenge response when the challenge value includes the event factor. After the dynamic password is also included, the event factor is incremented by one.
  • the menu function selection operation is as shown in Fig. 5, including step HI to step H9.
  • Step HI Detect the key value, if it is the OK key, execute step H2;
  • Step H2 Determine the selected function, if it is Bluetooth OTP, perform step H3;
  • Step H3 The Bluetooth module is powered on, the Bluetooth OTP interface is displayed, and the system status identifier is saved as Bluetooth.
  • Bluetooth OTP allows the key input identifier to be reset, actively selects the Bluetooth flag to be set, and executes step H4;
  • Step H4 Read the parameters of the Bluetooth module
  • Bluetooth module parameters include, device name, password and other information.
  • Step H5 Determine whether the parameter of the reading benefit module is successful
  • step H6 is performed; otherwise, step H7 is performed;
  • Step H6 The Bluetooth module switches to the listening mode, and exits the menu function selection operation
  • Step H7 Read the number of parameters of the Bluetooth module plus 1;
  • Step H8 determining whether the number of reading parameters of the Bluetooth module reaches a sixth preset value
  • step H9 If yes, go to step H9; otherwise, return to step H4;
  • Step H9 Prompt the Bluetooth module is damaged, power off the Bluetooth module, delay the third preset time, display the input challenge code information interface, save the system status identifier as the input challenge code identifier, and exit the menu function to select the operation.
  • Step 109 Determine whether the time when the power button is pressed reaches a preset duration
  • step 110 If yes, go to step 110; otherwise, go to step 113.
  • Step 110 Determine whether the system status identifier is a shutdown identifier.
  • step 112 If yes, go to step 112; otherwise, go to step 111;
  • Step 111 The system status identifier is saved as the shutdown identifier, the button data buffer is cleared, the LCD is turned off, and the Bluetooth module is powered off, and step 113 is performed;
  • Step 112 Turn on the LCD, and the LCD is powered on and initialized.
  • This step performs the power-on operation and sets the system status identifier to check the password identifier.
  • This step also includes determining whether the token is locked. If it is locked, the user is prompted to go to the counter to unlock or wait for the password to be automatically unlocked, otherwise the execution continues.
  • Step 113 reset the button wake-up flag, open the button interrupt, and then return to step 102;
  • Step 114 Determine whether the system status identifier is a Bluetooth OTP identifier.
  • step 115 If yes, the Bluetooth mode counter count value is incremented by 1, and step 115 is performed; otherwise, the steps are performed.
  • Step 115 Determine whether the Bluetooth mode counter count value is greater than or equal to the first preset value; if yes, execute step 116; otherwise, perform step 118;
  • Step 116 Determine whether the active selection of the Bluetooth identifier is set; if yes, execute step 117; otherwise, the Bluetooth mode counter count value is set to 0, power off the benefit module, display the input challenge code information interface, and save the system status identifier as Enter the challenge code identifier, and then perform step 120;
  • Step 117 The Bluetooth mode counter count value is set to 0, the Bluetooth module is powered off, the Bluetooth OTP allow button input flag is set, and then step 120 is performed;
  • Step 118 Detect whether the working voltage of the Bluetooth module is not lower than the preset voltage. If it is not lower than the preset voltage, go to step 120. If it is lower than the preset voltage, go to step 119.
  • Step 119 The Bluetooth mode counter count value is set to 0, the Bluetooth module is powered off, and the input challenge code information interface is displayed.
  • the system status identifier is saved as the input challenge code identifier, indicating that the Bluetooth module has a low operating voltage, please use the Bluetooth function after charging, and execute Step 120.
  • Step 120 Determine whether the system status identifier is a waiting identifier.
  • step 121 If yes, go to step 121; otherwise; go to step 122.
  • Step 121 Display a time bar
  • Step 122 Determine whether the system status identifier is an input challenge code identifier.
  • step 123 If yes, go to step 123; otherwise, go to step 133;
  • Step 123 No button counter count value plus 1;
  • Step 124 determining whether the no-key counter count value is greater than or equal to a second preset value
  • step 125 If yes, go to step 125; otherwise, go to step 126;
  • Step 125 The no-key counter count value is set to 0, the system status identifier is saved as the shutdown identifier, and then step 133 is performed;
  • Step 126 Determine whether a button is pressed
  • step 127 is performed; otherwise, step 130 is performed;
  • Step 127 Press the counter to press the counter count value plus 1, and press the button to release the counter count value to 0;
  • Step 128 Determine whether the button press counter count value is greater than the third preset value; If yes, go to step 129; otherwise, go to step 133;
  • the third preset value may be 10.
  • Step 129 Press the counter count value to 0, turn off the key interrupt, and go to step 133;
  • Step 130 Press the button to release the counter count value plus 1 , press the counter count value to 0, and then go to step 131.
  • Step 131 Determine whether the button release counter count value is greater than a fourth preset value
  • step 132 If yes, go to step 132; otherwise, go to step 133;
  • the fourth preset value may be 4.
  • Step 132 The button release counter count value is set to 0, the button interrupt is turned on, step 133 is performed; Step 133: the timer wake-up flag is reset, and then returns to step 102;
  • Step 134 Receive Bluetooth data, and determine whether the Bluetooth data is received or not;
  • step 135 is performed; otherwise, step 138 is performed;
  • the Bluetooth data is received in the form of a byte, and the received byte includes the length information of the Bluetooth data, and the data is received according to the length information.
  • the Bluetooth data reception is completed. .
  • Step 135 Determine whether the received Bluetooth data is legal
  • step 136 If it is legal, go to step 136; otherwise, go to step 137;
  • the check byte in the received data is obtained, and an exclusive OR operation is performed on the portion except the check byte in the data, and the obtained operation result is compared with the check byte, and if matched, The data received is legal, otherwise it is illegal.
  • Step 136 The Bluetooth data receiving completion flag is set, and the received Bluetooth data is saved to the receiving data buffer, and step 138 is performed;
  • Step 137 Clear the receive data buffer, and then perform step 138;
  • Step 138 The Bluetooth data wake-up flag is reset, and then returns to step 102.
  • Step 139 Determine whether the system status identifier is a Bluetooth OTP identifier.
  • step 140 If yes, go to step 140; otherwise, go to step 141.
  • Step 140 Display that Bluetooth is connected, and clear the screen after the fourth preset time delay
  • Step 141 reset the Bluetooth connection wakeup identifier, and then return to step 102;
  • Step 142 Determine whether the system status identifier is a Bluetooth OTP identifier. If yes, go to step 143; otherwise, go to step 144;
  • Step 143 The Bluetooth connection is disconnected, the receiving data buffer is cleared, the Bluetooth data receiving completion flag is reset, and then step 144 is performed;
  • Step 144 The Bluetooth disconnect wakeup flag is reset, and then returns to step 102.
  • Embodiment 2 of the present invention provides a working method of a dynamic token, including the following steps:
  • Step 200 Token initialization
  • the MCU Microprogrammed Control Unit
  • the stack pointer points to the stack start address
  • the RAM memory Random Access Memory
  • the global variable is cleared, and all interrupt identifiers are reset.
  • the button interrupt and/or the timer interrupt and/or the Bluetooth data interruption and/or the Bluetooth connection interruption and/or the Bluetooth disconnection interruption the token is hibernated, and step 201 is performed.
  • Step 201 Wait for receiving the interrupt trigger signal, and determine whether the interrupt trigger signal is received; if yes, the token is awakened, and step 202 is performed; otherwise, return to step 201.
  • the interrupt trigger signal includes: a button interrupt trigger signal, a timer interrupt trigger signal, a Bluetooth data interrupt trigger signal, a Bluetooth connection interrupt trigger signal, and a Bluetooth disconnect interrupt trigger signal.
  • Step 202 Determine a type of an interrupt trigger signal.
  • step 203 If the key interrupt trigger signal, then step 203;
  • step 217 If the timer interrupt trigger signal, then step 217;
  • step 228 is performed;
  • Step 203 Determine whether the button interrupt flag is set
  • step 204 If yes, go to step 204; otherwise, go to step 216.
  • Step 204 Determine whether a button is pressed
  • step 205 If yes, go to step 205; otherwise, go to step 215;
  • This step can also add delay debounce processing.
  • Step 205 Turn off the button interrupt, scan the button and obtain the key value, and perform step 206;
  • Step 206 Determine whether the key value is not empty;
  • step 207 If yes, go to step 207; otherwise, go to step 214;
  • Step 207 No button counter count value is set to 0, step 208 is performed;
  • Step 208 Determine whether the pressed button is a power button
  • step 210 If yes, go to step 210; otherwise, go to step 209.
  • Step 209 detecting a system status identifier
  • step 214 is performed; if the challenge code identifier is input, after performing the challenge response operation, step 214 is performed; if it is the menu function selection identifier, performing the menu function selection operation Step 214 is performed; if it is another identifier, after performing the corresponding operation, step 214 is performed.
  • Other identifiers include checking the password identifier; if checking the password identifier, performing a check password operation; the specific operation is the same as that described in Embodiment 1.
  • the method of the Bluetooth OTP operation is the same as the method of the Bluetooth OTP operation described in Embodiment 1; the method of performing the challenge response operation is the same as the method of performing the challenge response operation described in Embodiment 1;
  • the method of selecting the operation is the same as the method of performing the menu function selection operation described in Embodiment 1, and will not be described again.
  • Step 210 Determine whether the time when the power button is pressed reaches a preset duration
  • step 211 If yes, go to step 211; otherwise, go to step 214.
  • Step 211 Determine whether the system status identifier is a shutdown identifier.
  • step 213 If yes, go to step 213; otherwise, go to step 212;
  • Step 212 The system status identifier is saved as the shutdown identifier, the button data buffer is cleared, and the system is closed.
  • Step 213 Turn on the LCD, initialize the LCD, and perform step 214;
  • This step further includes determining whether the token is locked. If the token is locked, the user is prompted to go to the counter to unlock or wait for automatic unlocking.
  • Step 214 Turn on the button interrupt
  • Step 215 reset the button interrupt flag
  • Step 216 The token sleeps, and then returns to step 201;
  • Step 217 Determine whether the timer interrupt identifier is set. If set, step 218 is performed; otherwise, step 216 is returned.
  • Step 218 The second counter counter value is incremented by one, and the second counter counter value is detected. If it is equal to the first time interval, step 219 is performed; if it is equal to the second time interval and the calibration counter count value is greater than or equal to the calibration value, step 223 is performed; For other values, step 222 is performed;
  • Step 219 The second counter counter value is cleared, the time factor is incremented by 1, the event factor is cleared, the calibration counter count value is incremented by 1, and step 220 is performed;
  • Step 220 Determine whether the system status identifier is a waiting identifier.
  • step 221 If yes, go to step 221; otherwise, go back to step 218;
  • Step 221 Close the LCD, save the system status identifier as the shutdown identifier, go to step 222;
  • Step 222 Perform the timing operation, and then perform step 227;
  • performing a timing operation including,
  • Step kl determining whether the system status identifier is a Bluetooth OTP identifier, and then adding a Bluetooth mode counter count value to 1 to perform step k2; otherwise, performing step k3;
  • Step k2 determining whether the Bluetooth mode counter count value is greater than or equal to the first preset value. If it is greater than or equal to the first preset value, detecting whether the active selection of the Bluetooth identifier is set, if set, the Bluetooth mode counter count value is set to 0. Power off the Bluetooth module, set the Bluetooth OTP allow button input flag, and then execute K3; if the active Bluetooth flag is not set, the Bluetooth mode counter count value is set to 0, the Bluetooth module is powered off, and the input challenge code is displayed.
  • step k3 is performed; if not greater than or equal to the first preset value, it is detected whether the working voltage of the Bluetooth module is not lower than the preset voltage, if not lower than the preset voltage, Step k3 is performed; if the preset voltage is lower than the preset voltage, the Bluetooth mode counter is set to 0.
  • the Bluetooth module is powered off, the input challenge code information interface is displayed, and the system status identifier is saved as the input challenge code identifier, which is output through the liquid crystal display. If the operating voltage is low, please use the Bluetooth function prompt message after charging, and then go to step K3.
  • Step k3 determining whether the system status identifier is a waiting identifier, if yes, displaying a time bar, executing step k4; otherwise; performing step k4;
  • Step k4 determining whether the system status identifier is an input challenge code identifier
  • step K5 determines whether the no-key counter count value is greater than or equal to the second preset value
  • Step K9 Otherwise, perform step ⁇ 6.
  • Step ⁇ 6 Determine if a button has been pressed
  • step ⁇ 8 If a button is pressed, the button press counter count value is incremented by 1, the button counter count value is set to 0, and then step ⁇ 8 is performed; otherwise, the button releases the counter count value plus 1, and the button press counter count value is set to 0. , then perform step ⁇ 7.
  • Step ⁇ 7 Determine whether the button release counter count value is greater than the fourth preset value
  • the button release counter count value is set to 0, the button is interrupted, and the step ⁇ 9 is performed; no Bay
  • the fourth preset value may be 4.
  • Step K8 determining whether the button pressing counter count value is greater than a third preset value
  • step K9 is performed
  • the third preset value may be 10.
  • Step K9 The timer interrupt flag is reset, the token is hibernated, and then returns to step 201.
  • Step 223 Calculate a new calibration counter count value
  • the result of subtracting the calibration value from the calibration counter count value is used as the new calibration counter count value.
  • Step 224 Determine whether the calibration direction indicator is set
  • the calibration direction indicator is set or reset by the factory setting.
  • step 225 If yes, go to step 225; otherwise, go to step 226;
  • Step 225 The second counter counter value is decremented by 1, returning to step 222;
  • Step 226 The second counter count value is incremented by 1, returning to step 222;
  • Step 227 Reset the timer interrupt flag, returning to step 216;
  • Step 228 Determine whether the Bluetooth data interruption identifier is set.
  • step 229 is performed, otherwise, step 216 is returned.
  • Step 229 Receive the benefit tooth data, and determine whether the Bluetooth data is received or not;
  • step 230 If yes, go to step 230; otherwise, go to step 233.
  • the Bluetooth data is received in the form of a byte, and the received byte includes the length information of the Bluetooth data, and the data is received according to the length information.
  • the received byte length is equal to the length information, Bluetooth data reception is complete.
  • Step 230 Determine whether the received data is legal
  • step 231 If it is legal, go to step 231; otherwise, go to step 232;
  • Step 231 The Bluetooth data receiving completion flag is set, and the received data is saved to the receiving data buffer area, and step 233 is performed;
  • Step 232 Clear the receive data buffer, and perform step 233;
  • Step 233 reset the Bluetooth data interruption identifier, and return to step 216;
  • Step 234 Determine whether the system status identifier is a Yi tooth OTP identifier
  • step 235 If yes, go to step 235; otherwise, go back to step 236.
  • Step 235 The display Bluetooth is connected, and the screen is cleared after the fourth preset time is delayed;
  • Step 236 The Bluetooth connection interrupt flag is reset, and returns to step 216;
  • Step 237 Determine whether the system status identifier is a Yi tooth OTP identifier
  • step 238 If yes, go to step 238; otherwise, go to step 239;
  • Step 238 The Bluetooth connection is disconnected, the receiving data buffer is cleared, and the Bluetooth data receiving completion flag is reset.
  • Step 239 The Bluetooth disconnection interrupt flag is reset, and the process returns to step 216.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

本发明公开一种动态令牌的工作方法,涉及通信领域,该方法包括,当令牌被唤醒时,判断置位的唤醒标识类型;如是按键唤醒标识则检测键值,根据被按下的按键执行相应操作;如是蓝牙数据唤醒标识,则接收蓝牙数据,当蓝牙数据接收完成时,则将蓝牙数据保存至接收数据缓存区,将蓝牙数据唤醒标识复位;如果是蓝牙连接唤醒标识,则显示蓝牙已连接,延时第四预设时间后清屏,将蓝牙连接唤醒标识复位;如果是蓝牙断开唤醒标识,则显示蓝牙连接已断开,清空接收数据缓存区,将蓝牙断开唤醒标识复位;如是其他唤醒标识,则根据唤醒标识执行相应操作。

Description

一种动态令牌的工作方法 本申请要求于 2013 年 9 月 9 日提交中国专利局、 申请号为 201310404877.2、发明名称为"一种动态令牌的工作方法"和 2013年 5月 15 日提交中国专利局、 申请号为 201310179870.5、 发明名称为"一种动态令牌 的工作方法"的中国专利申请的优先权, 其全部内容通过引用结合在本申请 中。
技术领域 本发明涉及身份认证领域, 特别涉及到一种动态令牌的工作方法。 背景技术
动态令牌最大的优点在于, 用户每次使用的口令都不相同,使得不法分子 无法仿冒合法用户的身份。动态口令认证技术被认为是目前能够最有效解决用 户的身份认证方式之一, 可以有效防范黑客木马盗窃用户账户口令、假网站等 多种网络问题, 避免用户的财产或者资料的损失。
比起传统的动态令牌,用户输入的信息参与动态口令生成的动态令牌安全 性更高, 目前, 用户输入的信息参与动态口令生成的动态令牌都自带键盘, 用 户信息由用户通过动态令牌自带的键盘输入。
发明人在实现本发明的过程中,发现当所需输入的用户信息较多、数据量 较大时, 人为输入用户信息速度慢、错误率高, 且由于输入错误的数据不易察 觉和更改, 浪费用户时间的同时也带来不必要的麻烦。 发明内容
为解决现有技术中存在的问题, 本发明提供了一种动态令牌的工作方法, 包括,
步骤 S1 : 动态令牌判断是否存在置位的唤醒标识, 是则执行步骤 S2; 否 则休眠;
步骤 S2: 所述动态令牌判断置位的唤醒标识的类型, 如是按键唤醒标识, 则执行步骤 S3; 如是蓝牙连接唤醒标识, 将蓝牙模块的工作模式切换至监听 模式, 将所述蓝牙连接唤醒标识复位, 返回步骤 S1 ; 如是蓝牙数据唤醒标识, 则接收蓝牙数据,将所述蓝牙数据保存至接收数据緩存区,将蓝牙数据接收完 成标识置位, 将所述蓝牙数据唤醒标识复位, 返回步骤 S1 ; 如是蓝牙断开唤 醒标识, 则清空所述接收数据緩存区, 将所述蓝牙断开唤醒标识复位, 返回步 骤 S 1 ; 其中, 所述按键唤醒标识用于在所述动态令牌检测到按键中断时, 被 所述动态令牌置位;所述蓝牙数据唤醒标识用于在所述动态令牌检测到蓝牙数 据中断时,被所述动态令牌置位; 所述蓝牙连接唤醒标识用于在所述动态令牌 检测到蓝牙连接中断时,被所述动态令牌置位; 所述蓝牙断开唤醒标识用于在 所述动态令牌检测到蓝牙断开中断时, 被所述动态令牌置位;
步骤 S3 : 所述动态令牌获取被触发的按键的键值, 根据所述键值判断所 述被触发的按键是否为电源键, 是则执行步骤 S4; 否则执行步骤 S5;
步骤 S4: 所述动态令牌判断系统状态标识是否是关机标识;
如果所述系统状态标识是所述关机标识,则判断蓝牙模块工作电压是否低 于预设电压; 如果低于所述预设电压, 则提示蓝牙模块工作电压低, 并在所述 蓝牙模块工作电压低于所述预设电压的时长达到第一预设时间后,将所述系统 状态标识置为输入挑战码标识, 执行步骤 S8; 如果不低于所述预设电压, 则 对所述蓝牙模块上电, 将所述系统状态标识置为蓝牙 OTP标识, 将所述蓝牙 模块的工作模式切换至监听模式, 执行步骤 S8;
如果所述系统状态标识不是所述关机标识,则将所述系统状态标识置为关 机标识, 清除按键数据緩存区中的数据, 对所述蓝牙模块下电, 执行步骤 S8; 步骤 S5: 所述动态令牌对所述系统状态标识进行判断, 如果是所述输入 挑战码标识, 则执行步骤 S6; 如果是所述蓝牙 OTP标识, 则执行步骤 S7; 如 果是其他标识, 则执行步骤 S8;
步骤 S6: 所述动态令牌获取所述被触发的按键的键值, 根据所述键值对 所述被触发的按键进行判断;
如果是数字键, 则将所述键值对应的数字保存至所述按键数据緩存区,执 行步骤 S8;
如果是确认键, 则判断所述按键数据緩存区中是否存在数据,如果存在数 据, 则将所述按键数据緩存区中的数据, 或者, 所述按键数据緩存区中的数据 与所述动态令牌内部的基础因子的组合作为动态因子,根据所述动态因子计算 动态口令, 显示所述动态口令, 执行步骤 S8; 如果不存在数据, 则将所述基 础因子作为动态因子, 根据所述动态因子计算动态口令, 显示所述动态口令, 执行步骤 S8;
如果是删除键, 则清除所述按键数据緩存区中的数据, 执行步骤 S8; 步骤 S7: 所述动态令牌获取所述被触发的按键的键值, 根据所述键值对 所述被触发的按键进行判断;
如果是数字键, 则将所述键值对应的数字保存至所述按键数据緩存区,执 行步骤 S8;
如果是确认键, 则判断蓝牙数据接收完成标识是否置位, 如果置位, 则将 所述接收数据緩存区中的数据, 或者, 所述基础因子与所述接收数据緩存区中 的数据的组合作为动态因子,根据所述动态因子计算动态口令,将计算得到的 动态口令返回给所述上位机, 执行步骤 S8; 如果没有置位, 则判断所述按键 数据緩存区中是否存在数据, 如果存在数据, 则将所述按键数据緩存区中的数 据, 或者, 所述按键数据緩存区中的数据与所述动态令牌内部的基础因子的组 合作为动态因子, 根据所述动态因子计算动态口令, 显示所述动态口令, 执行 步骤 S8; 如果不存在数据, 则将所述基础因子作为动态因子, 根据所述动态 因子计算动态口令, 将计算得到的动态口令返回给所述上位机, 执行步骤 S8; 如果是删除键, 则将所述系统状态标识保存为输入挑战码标识,执行步骤 S8;
步骤 S8: 所述动态令牌将按键唤醒标识复位, 返回步骤 Sl。
所述将计算得到的动态口令返回给所述上位机包括,通过液晶屏显示动态 口令和 /或通过蓝牙模块将动态口令返回给所述上位机。
所述步骤 S4中,在判断蓝牙模块工作电压是否低于预设电压之前还包括, 进行检查密码操作,当密码正确时,判断蓝牙模块工作电压是否低于预设电压; 当密码不正确时, 执行步骤 S8;
所述检查密码操作包括,
步骤 E1 : 所述动态令牌获取所述被触发的按键的键值, 根据所述键值对 所述被触发的按键进行判断; 若是确认键, 则执行步骤 E2; 若是数字键并且 按键数据长度小于预设长度,则将数字键对应的按键数据保存至按键数据緩存 区, 显示检查密码界面, 退出检查密码操作; 若是其他键值则根据键值执行相 应操作, 退出检查密码操作;
步骤 E2: 判断按键数据緩存区中的密码是否正确, 若密码正确, 则执行 步骤 E3; 否则, 执行步骤 E4;
步骤 E3: 提示密码正确, 将密码失败次数清零, 延时第四预设时间, 清 空按键数据緩存区, 确定密码正确, 结束检查密码操作;
步骤 E4: 密码失败次数加 1, 显示密码失败界面, 延时第四预设时间, 执 行步骤 E5;
步骤 E5: 判断密码失败次数是否等于预设次数;
是则清空按键数据緩存区, 确定密码不正确, 执行步骤 S8; 否则显示密 码输入界面, 清空按键数据緩存区, 执行步骤 S8。
所述步骤 S6中所述如果是删除键,则清除所述按键数据緩存区中的数据, 执行步骤 S8; 包括,
步骤 A 1 : 判断删除键被按下的时间是否达到预设时长;
是则执行步骤 A 2; 否则执行步骤 A 5;
步骤 A 2: 判断按键数据緩存区中是否存在数据;
是则执行步骤 A4; 否则执行步骤 A3;
步骤 A 3 : 显示菜单界面, 将系统状态标识保存为菜单功能选择标识, 执 行步骤 S8;
步骤 A 4 : 清空按键数据緩存区, 显示输入挑战码信息界面, 执行步骤
S8;
步骤 A 5: 判断按键数据緩存区中是否存在数据;
是则执行步骤 A6; 否则执行步骤 A7;
步骤 A 6 : 清除按键数据緩存区中最后存入键值; 然后执行步骤 A 7 ; 步骤 A 7 : 显示输入挑战码信息界面, 显示按键数据緩存区中的数据, 执 行步骤 S8;
所述步骤 S5还包括, 检测系统状态标识, 如果是菜单功能选择标识, 则 进行菜单功能选择操作, 执行步骤 S8; 所述菜单功能选择操作包括, 步骤 HI : 检测键值, 如果是确认键, 则执行步骤 H2;
如果其他键值, 则根据键值执行相应操作, 退出菜单功能选择操作, 其他 键值包括右键和左键;
步骤 H2: 判断选择的功能, 如果是蓝牙 OTP, 则执行步骤 H3;
如果是其他的功能, 则执行相应功能选择操作, 然后退出菜单功能选择操 作;
步骤 H3: 蓝牙模块上电, 显示蓝牙 OTP界面, 系统状态标识保存为蓝牙 OTP标识, 执行步骤 H4;
步骤 H4: 读取蓝牙模块参数;
步骤 H5: 判断读取益牙模块参数是否成功;
如果读取成功, 则执行步骤 H6; 否则执行步骤 H7;
步骤 H6: 蓝牙模块切换为监听模式, 退出菜单功能选择操作;
步骤 H7: 读取蓝牙模块参数次数加 1 ;
步骤 H8: 判断读取蓝牙模块参数次数是否达到第六预设值;
如果是, 则执行步骤 H9; 否则返回步骤 H4;
步骤 H9: 提示蓝牙模块损坏, 给蓝牙模块下电, 延时第三预设时间, 显 示输入挑战码信息界面, 系统状态标识保存为输入挑战码标识, 退出菜单功能 选择操作。
所述基础因子为时间因子, 所述方法还包括:
当检测到定时器中断时, 所述动态令牌更新时间因子,将定时器唤醒标识 置位;
所述动态令牌判断置位的唤醒标识为所述定时器唤醒标识后,执行以下步 骤:
步骤 G1 : 判断系统状态标识是否为蓝牙 OTP标识;
是则蓝牙模式计数器计数值加 1 , 执行步骤 G2; 否则执行步骤 G7; 所述蓝牙模式计数器计数值初始值为 0;
步骤 G2: 判断蓝牙模式计数器计数值是否小于第一预设值;
是则执行步骤 G4; 否则执行步骤 G3;
步骤 G3: 蓝牙模式计数器计数值置为 0, 清空接收数据緩存区, 对蓝牙 模块下电,显示输入挑战码信息界面,将系统状态标识保存为输入挑战码标识, 然后执骤 G6;
步骤 G4: 检测蓝牙模块工作电压是否低于预设电压, 若低于预设电压, 则执行步骤 G5; 若不低于预设电压, 则执行步骤 G6;
步骤 G5: 蓝牙模式计数器计数值置为 0, 清空接收数据緩存区, 对蓝牙 模块下电,显示输入挑战码信息界面,将系统状态标识保存为输入挑战码标识, 通过液晶显示屏输出工作电压低请充电后再使用蓝牙功能的提示信息,执行步 骤 G6;
步骤 G6: 判断系统状态标识是否为输入挑战码标识;
是则执行步骤 G7; 否则执行步骤 G10;
步骤 G7: 无按键计数器计数值加 1 ;
所述无按键计数器初始值为 0;
步骤 G8: 判断无按键计数器计数值是否小于第二预设值;
是则执行步骤 G10; 否则, 执行步骤 G9;
步骤 G9: 将无按键计数器计数值置为 0, 将系统状态标识保存为关机标 识, 清空按键数据緩存区, 然后执行步骤 G10;
步骤 G10: 将定时器唤醒标识复位, 返回步骤 Sl。
所述基础因子包括时间因子和 /或事件因子。
一种动态令牌的工作方法, 包括,
动态令牌初始化,打开按键中断和 /或蓝牙数据中断和 /或蓝牙连接中断和 / 或蓝牙断开中断, 动态令牌休眠;
当动态令牌检测到按键中断时, 动态令牌被唤醒, 执行步骤 S-1 ;
步骤 S-1 : 动态令牌获取被触发的按键的键值, 根据键值判断被触发的按 键是否为电源键, 是则执行步骤 S-2; 否则检测系统状态标识, 如果是输入挑 战码标识, 则执行步骤 S-3; 如果是蓝牙 OTP标识, 则执行步骤 S-4; 如果是 其他标识, 则动态令牌休眠;
步骤 S-2: 判断系统状态标识是否为关机标识, 是则判断蓝牙模块工作电 压是否低于预设电压, 如果低于预设电压, 则提示蓝牙模块工作电压低, 并在 蓝牙模块工作电压低于预设电压的时长达到第一预设时间后,将系统状态标识 保存为输入挑战码标识, 动态令牌休眠; 如果不低于预设电压, 则对蓝牙模块 上电, 将系统状态标识保存为蓝牙 OTP标识, 将蓝牙模块的工作模式切换至 监听模式, 动态令牌休眠;
如果系统状态标识不是关机标识, 则将系统状态标识保存为关机标识,清 除按键数据緩存区中的数据, 对蓝牙模块下电, 动态令牌休眠;
步骤 S-3 : 动态令牌获取被触发的按键的键值, 根据键值对被触发的按键 进行判断; 如果是数字键, 则将键值对应的数字保存至按键数据緩存区, 动态 令牌休眠; 如果是确认键, 则判断按键数据緩存区中是否存在数据, 如果存在 数据, 则将按键数据緩存区中的数据, 或者, 按键数据緩存区中的数据与动态 令牌内部的基础因子的组合作为动态因子,根据动态因子计算动态口令,显示 动态口令, 动态令牌休眠; 如果不存在数据, 则将基础因子作为动态因子, 根 据动态因子计算动态口令, 显示动态口令, 动态令牌休眠; 如果是删除键, 则 清除按键数据緩存区中的数据, 动态令牌休眠;
步骤 S-4: 动态令牌获取被触发的按键的键值, 根据键值对被触发的按键 进行判断;
如果是数字键, 则将键值对应的数字保存至按键数据緩存区, 动态令牌休 眠;
如果是确认键, 则判断蓝牙数据接收完成标识是否置位, 如果置位, 则将 接收数据緩存区中的数据,或者,基础因子与接收数据緩存区中的数据的组合 作为动态因子,根据动态因子计算动态口令,将计算得到的动态口令返回给上 位机,动态令牌休眠;如果没有置位,则判断按键数据緩存区中是否存在数据, 如果存在数据, 则将按键数据緩存区中的数据, 或者, 按键数据緩存区中的数 据与动态令牌内部的基础因子的组合作为动态因子,根据动态因子计算动态口 令, 显示动态口令, 动态令牌休眠; 如果不存在数据, 则将基础因子作为动态 因子, 根据动态因子计算动态口令, 将计算得到的动态口令返回给上位机, 动 态令牌休眠;
如果是删除键,则将系统状态标识保存为输入挑战码标识,动态令牌休眠; 当动态令牌检测到蓝牙数据中断时,接收蓝牙数据,将所述蓝牙数据保存 至接收数据緩存区直到接收完蓝牙数据,将蓝牙数据接收完成标识置位,动态 令牌休眠;
当动态令牌检测到蓝牙连接中断时, 显示蓝牙已连接, 预设时间后清屏, 动态令牌休眠;
当动态令牌检测到蓝牙断开中断时,清空接收数据緩存区,动态令牌休眠; 所述基础因子包括时间因子和 /或事件因子。
所述步骤 S-2 中所述判断蓝牙模块工作电压是否低于预设电压之前还包 括, 进行检查密码操作, 当密码正确时, 判断蓝牙模块工作电压是否低于预设 电压; 当密码不正确时, 动态令牌休眠;
所述检查密码操作包括,
步骤 E1 : 所述动态令牌获取所述被触发的按键的键值, 根据所述键值对 所述被触发的按键进行判断; 若是确认键, 则执行步骤 E2; 若是数字键并且 按键数据长度小于预设长度,则将数字键对应的按键数据保存至按键数据緩存 区, 显示检查密码界面, 退出检查密码操作; 若是其他键值则根据键值执行相 应操作, 退出检查密码操作;
步骤 E2: 判断按键数据緩存区中的密码是否正确, 若密码正确, 则执行 步骤 E3; 否则, 执行步骤 E4;
步骤 E3: 提示密码正确, 将密码失败次数清零, 延时第四预设时间, 清 空按键数据緩存区, 确定密码正确, 结束检查密码操作;
步骤 E4: 密码失败次数加 1 , 显示密码失败界面, 延时第四预设时间, 执 行步骤 E5;
步骤 E5: 判断密码失败次数是否等于预设次数;
是则清空按键数据緩存区, 确定密码不正确, 动态令牌休眠; 否则显示密 码输入界面, 清空按键数据緩存区, 动态令牌休眠。
所述步骤 S-3中所述如果是删除键, 则清除按键数据緩存区中的数据, 动 态令牌休眠, 包括,
步骤 A 1: 判断删除键被按下的时间是否达到预设时长;
是则执行步骤 A 2; 否则, 执行步骤 A 5;
步骤 A 2 : 判断按键数据緩存区中是否存在数据;
是则执行步骤 A4; 否则执行步骤 A3; 步骤 A 3 : 显示菜单界面, 将系统状态标识保存为菜单功能选择标识, 动 态令牌休眠;
步骤 A 4 : 清空按键数据緩存区, 显示输入挑战码信息界面, 动态令牌休 眠;
步骤 A 5 : 判断按键数据緩存区中是否存在数据;
是则执行步骤 A6; 否则执行步骤 A7;
步骤 A 6 : 清除按键数据緩存区中最后存入键值; 然后执行步骤 A 7 ; 步骤 A 7 : 显示输入挑战码信息界面, 显示按键数据緩存区中的数据, 动 态令牌休眠;
所述步骤 S-1还包括, 检测系统状态标识, 如果是菜单功能选择标识, 则 进行菜单功能选择操作, 动态令牌休眠; 所述菜单功能选择操作包括,
步骤 HI : 检测键值, 如果是确认键, 则执行步骤 H2;
如果其他键值, 则根据键值执行相应操作, 退出菜单功能选择操作, 其他 键值包括右键和左键;
步骤 H2: 判断选择的功能, 如果是蓝牙 OTP, 则执行步骤 H3;
如果是其他的功能, 则执行相应功能选择操作, 然后退出菜单功能选择操 作;
步骤 H3: 蓝牙模块上电, 显示蓝牙 OTP界面, 系统状态标识保存为蓝牙 OTP标识, 执行步骤 H4;
步骤 H4: 读取蓝牙模块参数;
步骤 H5: 判断读取蓝牙模块参数是否成功;
如果读取成功, 则执行步骤 H6; 否则执行步骤 H7;
步骤 H6: 蓝牙模块切换为监听模式, 退出菜单功能选择操作;
步骤 H7: 读取蓝牙模块参数次数加 1;
步骤 H8: 判断读取蓝牙模块参数次数是否达到第六预设值;
如果是, 则执行步骤 H9; 否则, 返回步骤 H4;
步骤 H9: 提示蓝牙模块损坏, 给蓝牙模块下电, 延时第三预设时间, 显 示输入挑战码信息界面, 系统状态标识保存为输入挑战码标识, 退出菜单功能 选择操作。 所述基础因子为时间因子, 所述动态令牌初始化之后还包括,打开定时器 中断, 动态令牌休眠;
当检测到定时器中断时, 更新时间因子, 执行定时操作; 所述定时操作包 括,
步骤 G1 : 判断系统状态标识是否为蓝牙 OTP标识;
是则蓝牙模式计数器计数值加 1, 执行步骤 G2; 否则执行步骤 G7;
所述蓝牙模式计数器计数值初始值为 0;
步骤 G2: 判断蓝牙模式计数器计数值是否小于第一预设值;
是则执行步骤 G4; 否则执行步骤 G3;
步骤 G3: 蓝牙模式计数器计数值置为 0, 清空接收数据緩存区, 对蓝牙 模块下电,显示输入挑战码信息界面,将系统状态标识保存为输入挑战码标识, 然后执骤 G6;
步骤 G4: 检测蓝牙模块工作电压是否低于预设电压, 若低于预设电压, 则执行步骤 G5; 若不低于预设电压, 则执行步骤 G6;
步骤 G5: 蓝牙模式计数器计数值置为 0, 清空接收数据緩存区, 对蓝牙 模块下电,显示输入挑战码信息界面,将系统状态标识保存为输入挑战码标识, 通过液晶显示屏输出工作电压低请充电后再使用蓝牙功能的提示信息,执行步 骤 G6;
步骤 G6: 判断系统状态标识是否为输入挑战码标识;
是则执行步骤 G7; 否则动态令牌休眠;
步骤 G7: 无按键计数器计数值加 1 ;
所述无按键计数器初始值为 0;
步骤 G8: 判断无按键计数器计数值是否小于第二预设值;
是则动态令牌休眠; 否则, 执行步骤 G9;
步骤 G9: 将无按键计数器计数值置为 0, 将系统状态标识保存为关机标 识, 清空按键数据緩存区, 动态令牌休眠。
所述将计算得到的动态口令返回给上位机包括,通过液晶屏显示动态口令 和 /或通过蓝牙模块将动态口令返回给上位机。
所述基础因子包括时间因子和 /或事件因子。 本发明的有益效果是,上位机通过蓝牙将需要用户输入到令牌的数据发送 给令牌, 在保证动态口令安全性的前提下, 又省略了用户输入的步骤, 避免了 需要用户输入大量信息时容易出错、 耗费时间的问题。 附图说明
图 1-1和图 1-2为本发明实施例 1提供的一种动态令牌的工作方法流程图; 图 2为本发明实施例 2提供的一种动态令牌的工作方法流程图;
图 3为本发明实施例 1中提供的一种蓝牙 OTP操作方法的细化流程图; 图 4为本发明实施例 1中提供的一种挑战应答操作方法的细化流程图;以 及
图 5为本发明实施例 1 中提供的一种菜单功能选择操作方法的细化流程 图。 具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造 性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
实施例 1 :
参见图 1-1和图 1-2, 本发明实施例 1提供了一种动态令牌的工作方法, 包括以下步骤:
步骤 100: 令牌初始化;
本实施例中,初始化 MCU( Microprogrammed Control Unit,微控制单元 ), 将堆栈指针指向堆栈起始地址,初始化 RAM存储器( Random Access Memory, 随机存储器) , 并将全局变量清零, 将所有的唤醒标识复位, 将系统状态标识 置为关机标识,打开按键中断和 /或蓝牙数据中断和 /或蓝牙连接中断和 /或蓝牙 断开中断和 /或定时器中断,将所有的中断标识复位,令牌休眠,执行步骤 101。
步骤 101 : 等待接收中断触发信号, 判断是否收到中断触发信号; 如果是, 则进行相应中断处理, 令牌被唤醒, 执行步骤 102; 否则, 返回 步骤 101;
本实施例中, 中断触发信号包括: 按键中断触发信号、 定时器中断触发信 号、蓝牙数据中断触发信号、蓝牙连接中断触发信号、蓝牙断开中断触发信号。
当令牌收到按键中断触发信号时, 进入按键中断处理, 包括步骤 M至步 骤 b4,
步骤 bl : 判断按键中断标识是否置位, 如果是, 则执行步骤 b2; 否则, 退出按键中断处理;
步骤 b2: 判断是否存在按键被按下, 如果是, 则执行步骤 b3; 否则, 执 行步骤 b4; 本步骤还可以加入延时消抖处理。
步骤 b3: 将按键唤醒标识置位;
步骤 b4: 将按键中断标识复位, 退出按键中断处理。 当令牌收到定时器中断触发信号时, 进入定时器中断处理, 包括步骤 cl 至步骤 c6,
步骤 cl : 判断定时器中断标识是否置位, 如果是, 则执行步骤 c2; 否贝' J , 退出定时器中断处理;
步骤 c2: 秒计数器计数值加 1 , 检测秒计数器计数值, 如果秒计数器计数 值等于第一时间间隔, 则秒计数器计数值清零, 时间因子加 1 , 事件因子清零, 校准计数器计数值加 1 , 执行步骤 c3; 如果秒计数器计数值等于第二时间间隔 并且校准计数器计数值大于等于校准值,则将校准计数器计数值减去校准值的 结果保存为新的校准计数器计数值, 执行步骤 c4; 否则, 执行步骤 c5;
步骤 c3: 判断系统状态标识是否为等待标识, 如果是则关闭 LCD ( Liquid
Crystal Display, 液晶显示屏), 系统状态标识保存为关机标识, 执行步骤 c5; 否则, 返回步骤 c2;
步骤 c4:判断校准方向标识是否置位,如果置位,则秒计数器计数值减 1 , 执行步骤 c5; 否则, 秒计数器计数值加 1, 执行步骤 c5; 其中, 校准方向标 识置位或复位是由出厂前设置。
步骤 c5: 将定时器唤醒标识置位, 将定时器中断标识复位, 退出定时器 中断处理。 当令牌收到蓝牙数据中断触发信号时,进入蓝牙数据中断处理, 包括步骤 dl至 d2,
步骤 dl : 判断蓝牙数据中断标识是否置位, 如果是, 则执行步骤 d2; 否 则, 退出蓝牙数据中断处理;
步骤 d2: 将蓝牙数据唤醒标识置位, 将蓝牙数据中断标识复位, 退出蓝 牙数据中断处理。
当令牌收到蓝牙连接中断触发信号时, 进入蓝牙连接中断处理, 包括, 将蓝牙连接唤醒标识置位,将蓝牙连接中断标识复位, 退出蓝牙连接中断 处理;
当令牌收到蓝牙断开中断触发信号时, 进入蓝牙断开中断处理, 包括, 将蓝牙断开唤醒标识置位,将蓝牙断开中断标识复位, 退出蓝牙断开中断 处理。
步骤 102: 判断是否存在置位的唤醒标识;
如果存在, 则执行步骤 103; 否则, 令牌休眠, 然后返回步骤 101。
步骤 103: 判断置位的唤醒标识类型;
如是按键唤醒标识, 则执行步骤 104- 113;
如是定时器唤醒标识, 则执行步骤 114-133;
如是蓝牙数据唤醒标识, 则执行步骤 134-138;
如是蓝牙连接唤醒标识, 则执行步骤 139-141 ;
如是蓝牙断开唤醒标识, 则执行步骤 142-144;
步骤 104: 关闭按键中断, 扫描按键并获取键值;
步骤 105: 判断键值是否不为空;
如果是, 则执行步骤 106; 否则, 执行步骤 113;
步骤 106: 将无按键计数器计数值置为 0;
步骤 107: 判断被按下的按键是否为电源键;
如果是, 则执行步骤 109; 否则, 执行步骤 108;
步骤 108: 检测系统状态标识;
如果是蓝牙 OTP标识, 则进行蓝牙 OTP操作后, 执行步骤 113; 如果是 输入挑战码标识, 则进行挑战应答操作后, 执行步骤 113; 如果是菜单功能选 择标识, 则进行菜单功能选择操作后, 执行步骤 113; 如果是其他标识, 则进 行相应操作后, 执行步骤 113。
本实施例中, 其他标识包括检查密码标识。
如果是检查密码标识, 则进行检查密码操作; 检查密码操作包括, 步骤 E1 : 检测键值, 如果是 OK键, 则执行步骤 E2; 若是其他键值, 则 根据键值执行相应操作, 然后退出检查密码操作。
若其他键值为数字键并且输入的数字长度小于预设长度,则将输入的数字 作为按键数据保存至按键数据緩存区,显示检查密码界面, 然后退出检查密码 操作;
步骤 E2: 判断密码是否正确, 若密码正确, 则执行步骤 E3; 否则, 执行 步骤 E7;
步骤 E3: 提示密码正确, 将密码失败次数清零, 延时第四预设时间; 步骤 E4: 检测蓝牙模块工作电压是否不低于预设工作电压, 若低于预设 工作电压, 则执行步骤 E5; 若不低于预设工作电压, 则执行步骤 E6;
步骤 E5: 提示蓝牙模块工作电压低, 请充电, 工作电压低状态超过第一 预设时间后, 系统状态标识保存为输入挑战码标识, 清空按键数据緩存区, 退 出检查密码操作;
步骤 E6: 给蓝牙模块上电, 显示蓝牙 OTP界面, 蓝牙模式计数器计数值 置为 0, 系统状态标识保存为蓝牙 OTP标识, 蓝牙连接中断标识复位, 蓝牙 OTP允许按键输入标识复位, 主动选择蓝牙标识复位, 清空按键数据緩存区, 将蓝牙模块切换至监听模式, 退出检查密码操作。
步骤 E7: 密码失败次数加 1 , 显示密码失败界面, 延时第四预设时间; 步骤 E8: 判断密码失败次数是否等于预设次数;
如果是, 则清空按键数据緩存区, 显示令牌被锁定, 退出检查密码操作; 否则, 显示密码输入界面, 清空按键数据緩存区, 退出检查密码操作。 其中, 令牌被锁定可以在第五预设时间后自动解锁, 也可以通过拒台解锁。 进行蓝牙 OTP操作如图 3所示, 包括步骤 F1至步骤 F15。 步骤 Fl : 检测键值, 如果是删除键, 则执行步骤 F2; 如果是数字键, 则 执行步骤 F8; 如果是 OK键, 则执行步骤 F10; 如果是其他键值则根据键值执 行相应操作, 退出蓝牙 OTP操作; 其他键值包括左键和右键;
步骤 F2: 判断删除键被按下的时间是否达到预设时长;
如果是, 则执行步骤 F3; 否则, 执行步骤 F4;
步骤 F3: 显示输入挑战码信息界面, 系统状态标识保存为输入挑战码标 识, 退出蓝牙 OTP操作;
步骤 F4: 判断蓝牙数据接收完成标识是否置位;
如果是, 退出蓝牙 OTP操作; 否则, 执行步骤 F5;
步骤 F5: 判断蓝牙 OTP允许按键输入标识是否置位;
如果是, 则执行步骤 F6; 否则, 退出蓝牙 OTP操作;
步骤 F6: 判断按键数据长度是否等于 0;
如果是, 则退出蓝牙 OTP操作; 否则, 执行步骤 F7;
步骤 F7:按键数据长度减 1 ,清空按键数据緩存区中最后存入的按键数据, 显示按键数据緩存区中的数据, 然后退出蓝牙 OTP操作;
步骤 F8: 判断是否符合蓝牙 OTP允许按键输入标识置位和按键数据长度 小于预设长度;
如果符合, 则执行步骤 F9; 否则, 退出蓝牙 OTP操作;
步骤 F9:按键数据长度加 1 ,将键值对应的输入数字作为按键数据存入按 键数据緩存区, 显示按键数据緩存区的数据, 然后退出蓝牙 OTP操作;
步骤 F10: 判断蓝牙数据接收完成标识是否置位;
如果是, 则执行步骤 F11 ; 否则, 执行步骤 F12;
步骤 F11 : 将接收数据緩存区中的数据作为挑战值, 根据挑战值计算挑战 应答型动态口令,显示挑战应答型动态口令,将系统状态标识保存为等待标识, 清空接收数据緩存区, 退出蓝牙 OTP操作; 其中, 将接收数据緩存区中的数 据作为挑战值还包括, 将时间因子和 /或事件因子与接收数据緩存区中数据的 组合作为挑战值, 当挑战值中包含事件因子时, 计算挑战应答型动态口令后还 包括, 事件因子加 1 ; 接收数据緩存区中的数据可以是随机数, 也可以是账号 金额等交易信息;本步骤也可以通过蓝牙通道向上位机发送挑战应答型动态口 令;
步骤 F12: 判断蓝牙 OTP允许按键输入标识是否置位;
如果置位, 则执行步骤 F13; 否则, 退出蓝牙 OTP操作;
步骤 F13: 判断按键数据长度是否等于 0;
如果是, 则执行步骤 F14; 否则, 执行步骤 F15;
步骤 F14: 根据令牌内部的时间因子计算时间型动态口令, 显示时间型动 态口令, 系统状态标识保存为等待标识, 然后退出蓝牙 OTP操作;
本步骤还可以为, 根据事件因子计算事件型动态口令, 事件因子加 1 , 显 示事件型动态口令, 系统状态标识保存为等待标识;
本步骤也可以通过蓝牙通道向上位机发送时间型动态口令(事件型动态口 令) ;
步骤 F15: 将按键数据緩存区中的数据作为挑战值, 根据挑战值计算挑战 应答型动态口令, 显示挑战应答型动态口令, 系统状态标识保存为等待标识, 清空按键数据緩存区, 然后退出蓝牙 OTP操作。 其中, 将按键数据緩存区中 的数据作为挑战值还包括, 将时间因子和 /或事件因子与按键数据緩存区中的 数据的组合作为挑战值, 当挑战值中包含事件因子时,计算挑战应答型动态口 令后还包括, 事件因子加 1 ;
本步骤也可以通过蓝牙通道向上位机发送挑战应答型动态口令。 进行挑战应答操作参见图 4, 包括步骤 A1至步骤 A13。
步骤 A1 : 检测键值, 如果是删除键, 则执行步骤 A2; 如果是数字键, 则 执行步骤 A9; 如果是 OK键, 则执行步骤 Al l; 如是其他键值, 则根据键值 执行相应操作, 退出挑战应答操作;
步骤 A2: 判断删除键被按下的时间是否达到预设时长;
是则执行步骤 A3; 否则, 执行步骤 A6;
步骤 A3: 判断按键数据长度是否等于 0;
如果等于 0, 则执行步骤 A4; 否则, 执行步骤 A5;
步骤 A4: 显示菜单界面, 将系统状态标识保存为菜单功能选择标识, 然 后退出挑战应答操作; 步骤 A5: 清空按键数据緩存区, 显示输入挑战码信息界面, 将按键数据 长度置为 0, 然后退出挑战应答操作;
步骤 A6: 判断按键数据长度是否等于 0;
如果等于 0, 则执行步骤 A8; 否则, 执行步骤 A7;
步骤 A7: 按键数据长度减 1 , 清除按键数据緩存区中最后存入的按键数 据; 然后执行步骤 A8;
步骤 A8: 显示输入挑战码信息界面, 显示按键数据緩存区中的数据, 然 后, 退出挑战应答操作;
步骤 A9: 判断按键数据长度是否小于预设长度;
是则执行步骤 A10; 否则, 执行退出挑战应答操作;
步骤 A10:将相应键值对应的输入数字作为按键数据保存至按键数据緩存 区, 按键数据长度加 1, 然后退出挑战应答操作;
步骤 Al 1: 判断按键数据长度是否等于 0;
是则执行步骤 A12; 否则, 执行步骤 A13;
步骤 A12: 根据令牌内部的时间因子计算时间型动态口令, 显示时间型动 态口令, 系统状态标识保存为等待标识;
本步骤还可以为,根据令牌内部的事件因子计算事件型动态口令, 事件因 子加 1 , 显示事件型动态口令, 系统状态标识保存为等待标识;
本步骤也可以通过蓝牙通道向上位机发送时间型动态口令(事件型动态口 令) ;
步骤 A13: 将按键数据緩存区中的数据作为挑战值,根据挑战值计算挑战 应答型动态口令, 显示挑战应答型动态口令, 系统状态标识保存为等待标识, 清空按键数据緩存区, 然后, 退出挑战应答操作。 其中, 将按键数据緩存区中 的数据作为挑战值还包括, 将时间因子和 /或事件因子与按键数据緩存区中的 数据的组合作为挑战值, 当挑战值中包含事件因子时,计算挑战应答型动态口 令后还包括, 事件因子加 1。
菜单功能选择操作如图 5所示, 包括步骤 HI至步骤 H9。
步骤 HI : 检测键值, 如果是 OK键, 则执行步骤 H2;
如果其他键值, 则根据键值执行相应操作, 退出菜单功能选择操作, 其他 键值包括右键和左键。
步骤 H2: 判断选择的功能, 如果是蓝牙 OTP, 则执行步骤 H3;
如果是其他的功能, 则执行相应功能选择操作, 然后退出菜单功能选择操 作。
步骤 H3: 蓝牙模块上电, 显示蓝牙 OTP界面, 系统状态标识保存为蓝牙
OTP标识, 蓝牙 OTP允许按键输入标识复位, 主动选择蓝牙标识置位, 执行 步骤 H4;
步骤 H4: 读取蓝牙模块参数;
蓝牙模块参数包括, 设备名称, 密码等信息。
步骤 H5: 判断读取益牙模块参数是否成功;
如果读取成功, 则执行步骤 H6; 否则执行步骤 H7;
步骤 H6: 蓝牙模块切换为监听模式, 退出菜单功能选择操作;
步骤 H7: 读取蓝牙模块参数次数加 1 ;
步骤 H8: 判断读取蓝牙模块参数次数是否达到第六预设值;
如果是, 则执行步骤 H9; 否则, 返回步骤 H4;
步骤 H9: 提示蓝牙模块损坏, 给蓝牙模块下电, 延时第三预设时间, 显 示输入挑战码信息界面, 系统状态标识保存为输入挑战码标识, 退出菜单功能 选择操作。
步骤 109: 判断电源键被按下的时间是否达到预设时长;
如果是, 则执行步骤 110; 否则, 执行步骤 113。
步骤 110: 判断系统状态标识是否为关机标识;
如果是, 则执行步骤 112; 否则, 执行步骤 111 ;
步骤 111 : 系统状态标识保存为关机标识, 清空按键数据緩存区, 关闭 LCD, 对蓝牙模块下电, 执行步骤 113;
步骤 112: 打开 LCD, LCD上电初始化;
本步骤进行开机操作, 设置系统状态标识为检查密码标识。
本步骤中还包括判断令牌是否被锁定,如果被锁定, 则提示用户去柜台解 锁或者等待密码被自动解锁, 否则继续执行。
步骤 113: 将按键唤醒标识复位, 打开按键中断, 然后返回步骤 102; 步骤 114: 判断系统状态标识是否为蓝牙 OTP标识;
如果是, 则蓝牙模式计数器计数值加 1, 执行步骤 115; 否则, 执行步骤
120。
步骤 115: 判断蓝牙模式计数器计数值是否大于等于第一预设值; 如果是, 则执行步骤 116; 否则, 执行步骤 118;
步骤 116: 判断主动选择蓝牙标识是否置位; 如果是, 则执行步骤 117; 否则, 蓝牙模式计数器计数值置为 0, 给益牙模块下电, 显示输入挑战码信息 界面, 系统状态标识保存为输入挑战码标识, 然后执行步骤 120;
步骤 117: 蓝牙模式计数器计数值置为 0, 给蓝牙模块下电, 将蓝牙 OTP 允许按键输入标识置位, 然后执行步骤 120;
步骤 118: 检测蓝牙模块工作电压是否不低于预设电压, 若不低于预设电 压, 则执行步骤 120; 若低于预设电压, 则执行步骤 119。
步骤 119: 蓝牙模式计数器计数值置为 0, 给蓝牙模块下电, 显示输入挑 战码信息界面, 系统状态标识保存为输入挑战码标识,提示蓝牙模块工作电压 低, 请充电后使用蓝牙功能, 执行步骤 120。
步骤 120: 判断系统状态标识是否为等待标识;
如果是, 则执行步骤 121 ; 否则; 执行步骤 122。
步骤 121 : 显示时间条;
步骤 122: 判断系统状态标识是否为输入挑战码标识;
如果是, 则执行步骤 123; 否则, 执行步骤 133;
步骤 123: 无按键计数器计数值加 1 ;
步骤 124: 判断无按键计数器计数值是否大于等于第二预设值;
如果是, 则执行步骤 125; 否则, 执行步骤 126;
步骤 125: 无按键计数器计数值置为 0, 系统状态标识保存为关机标识, 然后执行步骤 133;
步骤 126: 判断是否有按键被按下;
如果有按键被按下, 则执行步骤 127; 否则, 执行步骤 130;
步骤 127: 按键按下计数器计数值加 1, 按键松开计数器计数值置为 0; 步骤 128: 判断按键按下计数器计数值是否大于第三预设值; 如果是, 则执行步骤 129; 否则, 执行步骤 133;
其中, 第三预设值可以为 10。
步骤 129: 按键按下计数器计数值置为 0, 关闭按键中断, 执行步骤 133; 步骤 130: 按键松开计数器计数值加 1 , 按键按下计数器计数值置为 0, 然后执行步骤 131。
步骤 131 : 判断按键松开计数器计数值是否大于第四预设值;
如果是, 则执行步骤 132; 否则, 执行步骤 133;
其中, 第四预设值可以为 4。
步骤 132: 按键松开计数器计数值置为 0, 打开按键中断, 执行步骤 133; 步骤 133: 定时器唤醒标识复位, 然后返回步骤 102;
步骤 134: 接收蓝牙数据, 判断蓝牙数据是否接收完成;
如果接收完成, 则执行步骤 135; 否则, 执行步骤 138;
本实施例中, 以字节的形式接收蓝牙数据,接收的字节中包含蓝牙数据的 长度信息, 根据该长度信息接收数据, 当接收的字节长度值等于长度信息时, 则蓝牙数据接收完成。
步骤 135: 判断收到的蓝牙数据是否合法;
如果合法, 则执行步骤 136; 否则, 执行步骤 137;
本实施例中,获取收到的数据中的校验字节,对该数据中除去校验字节以 外的部分进行异或运算, 得到的运算结果与校验字节进行比较, 如果匹配, 则 收到的数据合法, 否则不合法。
步骤 136: 蓝牙数据接收完成标识置位, 将接收到的蓝牙数据保存至接收 数据緩存区, 执行步骤 138;
步骤 137: 清空接收数据緩存区, 然后执行步骤 138;
步骤 138: 蓝牙数据唤醒标识复位, 然后返回步骤 102。
步骤 139: 判断系统状态标识是否是蓝牙 OTP标识;
如果是, 则执行步骤 140; 否则, 执行步骤 141。
步骤 140: 显示蓝牙已连接, 延时第四预设时间后清屏;
步骤 141 : 将蓝牙连接唤醒标识复位, 然后返回步骤 102;
步骤 142: 判断系统状态标识是否是蓝牙 OTP标识; 如果是, 则执行步骤 143; 否则, 执行步骤 144;
步骤 143: 显示蓝牙连接已断开, 清空接收数据緩存区, 蓝牙数据接收完 成标识复位, 然后执行步骤 144;
步骤 144: 蓝牙断开唤醒标识复位, 然后返回步骤 102。
实施例 2
参见图 2, 本发明实施例 2提供了一种动态令牌的工作方法, 包括以下步 骤:
步骤 200: 令牌初始化;
本实施例中,初始化 MCU( Microprogrammed Control Unit,微控制单元 ), 堆栈指针指向堆栈起始地址, 初始化 RAM存储器 (Random Access Memory, 随机存储器) , 并将全局变量清零, 将所有的中断标识复位, 打开按键中断和 /或定时器中断和 /或蓝牙数据中断和 /或蓝牙连接中断和 /或蓝牙断开中断,令牌 休眠, 执行步骤 201。
步骤 201 : 等待接收中断触发信号, 判断是否收到中断触发信号; 如果是, 则令牌被唤醒, 执行步骤 202; 否则返回步骤 201。
本实施例中, 中断触发信号包括, 按键中断触发信号、 定时器中断触发信 号、蓝牙数据中断触发信号、蓝牙连接中断触发信号、蓝牙断开中断触发信号。
步骤 202: 判断中断触发信号的类型;
如是按键中断触发信号, 则执行步骤 203;
如是定时器中断触发信号, 则执行步骤 217;
如是蓝牙数据中断触发信号, 则执行步骤 228;
如是蓝牙连接中断触发信号, 则执行步骤 234;
如是蓝牙断开中断触发信号, 则执行步骤 237。
步骤 203: 判断按键中断标识是否置位;
如果是, 则执行步骤 204; 否则, 执行步骤 216。
步骤 204: 判断是否存在按键被按下;
如果是, 则执行步骤 205; 否则, 执行步骤 215;
本步骤还可以加入延时消抖处理。
步骤 205: 关闭按键中断, 扫描按键并获取键值, 执行步骤 206; 步骤 206: 判断键值是否不为空;
如果是, 则执行步骤 207; 否则, 执行步骤 214;
步骤 207: 无按键计数器计数值置为 0,执行步骤 208;
步骤 208: 判断被按下的按键是否为电源键;
如果是, 则执行步骤 210; 否则, 执行步骤 209。
步骤 209: 检测系统状态标识;
如果是蓝牙 OTP标识, 则执行蓝牙 OTP操作后, 然后执行步骤 214; 如 果是输入挑战码标识, 则执行挑战应答操作后, 执行步骤 214; 如果是菜单功 能选择标识, 则执行菜单功能选择操作后, 执行步骤 214; 如果是其他标识, 则执行相应操作后, 执行步骤 214。 其他标识, 包括检查密码标识; 如是检查 密码标识, 则执行检查密码操作; 具体的操作同实施例 1中所述的方法相同。
本实施例中, 蓝牙 OTP操作的方法与实施例 1中所述的蓝牙 OTP操作的 方法相同;执行挑战应答操作的方法与实施例 1中所述的执行挑战应答操作的 方法相同;执行菜单功能选择操作的方法与实施例 1中所述的执行菜单功能选 择操作的方法相同, 不再赘述。
步骤 210: 判断电源键被按下的时间是否达到预设时长;
如果是, 则执行步骤 211 ; 否则, 执行步骤 214。
步骤 211 : 判断系统状态标识是否为关机标识;
如果是, 则执行步骤 213; 否则, 执行步骤 212;
步骤 212: 系统状态标识保存为关机标识, 清空按键数据緩存区, 关闭
LCD, 对蓝牙模块下电, 执行步骤 214;
步骤 213: 打开 LCD, 对 LCD上电初始化, 执行步骤 214;
本步骤进行开机操作,设置系统状态标识为检查密码标识, 本步骤还包括 判断令牌是否被锁定,是则显示令牌被锁定,提示用户去柜台解锁或者等待自 动解锁。
步骤 214: 打开按键中断;
步骤 215: 将按键中断标识复位;
步骤 216: 令牌休眠, 然后返回步骤 201 ;
步骤 217: 判断定时器中断标识是否置位; 如果置位, 则执行步骤 218; 否则, 返回步骤 216。
步骤 218: 秒计数器计数值加 1, 检测秒计数器计数值, 如果等于第一时 间间隔, 则执行步骤 219; 如果等于第二时间间隔并且校准计数器计数值大于 等于校准值, 则执行步骤 223; 如果为其他值则执行步骤 222;
步骤 219: 秒计数器计数值清零, 时间因子加 1, 事件因子清零, 校准计 数器计数值加 1 , 执行步骤 220;
步骤 220: 判断系统状态标识是否为等待标识;
如果是, 则执行步骤 221 ; 否则, 返回步骤 218;
步骤 221 : 关闭 LCD, 将系统状态标识保存为关机标识, 执行步骤 222; 步骤 222: 执行定时操作, 然后执行步骤 227;
本实施例中, 执行定时操作, 包括,
步骤 kl : 判断系统状态标识是否为蓝牙 OTP标识, 是则将蓝牙模式计数 器计数值加 1 , 执行步骤 k2; 否则, 执行步骤 k3;
步骤 k2: 判断蓝牙模式计数器计数值是否大于等于第一预设值, 如果大 于等于第一预设值, 则检测主动选择蓝牙标识是否置位, 若置位, 则蓝牙模式 计数器计数值置为 0, 对蓝牙模块下电, 将蓝牙 OTP允许按键输入标识置位, 然后执行 K3; 若主动选择蓝牙标识未置位, 则蓝牙模式计数器计数值置为 0, 对蓝牙模块下电, 显示输入挑战码信息界面, 系统状态标识保存为输入挑战码 标识, 然后执行步骤 k3; 若不大于等于第一预设值, 则检测蓝牙模块工作电 压是否不低于预设电压, 若不低于预设电压, 则执行步骤 k3; 若低于预设电 压, 则蓝牙模式计数器计数值置为 0, 对蓝牙模块下电, 显示输入挑战码信息 界面, 系统状态标识保存为输入挑战码标识,通过液晶显示屏输出工作电压低 请充电后再使用蓝牙功能的提示信息, 然后执行步骤 K3。
步骤 k3: 判断系统状态标识是否为等待标识, 是则显示时间条, 执行步 骤 k4; 否则; 执行步骤 k4;
步骤 k4: 判断系统状态标识是否为输入挑战码标识;
是则无按键计数器计数值加 1 , 然后执行步骤 K5; 否则, 执行步骤 k9; 步骤 k5: 判断无按键计数器计数值是否大于等于第二预设值;
是则将无按键计数器计数值置为 0, 系统状态标识保存为关机标识, 执行 步骤 K9; 否则, 执行步骤 Κ6。
步骤 Κ6: 判断是否有按键被按下;
如果有按键被按下, 则按键按下计数器计数值加 1, 按键 计数器计数 值置为 0, 然后执行步骤 Κ8; 否则, 按键松开计数器计数值加 1 , 按键按下计 数器计数值置为 0, 然后执行步骤 Κ7。
步骤 Κ7: 判断按键松开计数器计数值是否大于第四预设值;
是则按键松开计数器计数值置为 0, 打开按键中断, 执行步骤 Κ9; 否贝 |J, 执行步骤 K9;
其中, 第四预设值可以为 4。
步骤 K8: 判断按键按下计数器计数值是否大于第三预设值;
是则将按键按下计数器计数值置为 0, 关闭按键中断, 执行步骤 K9; 否 则, 执行步骤 K9;
其中, 第三预设值可以为 10。
步骤 K9: 定时器中断标识复位, 令牌休眠, 然后返回步骤 201。
步骤 223: 计算新的校准计数器计数值;
本实施例中,将校准计数器计数值减去校准值的结果作为新的校准计数器 计数值。
步骤 224: 判断校准方向标识是否置位;
本实施例中 , 校准方向标识置位或复位是由出厂前设置。
如果是, 则执行步骤 225; 否则, 执行步骤 226;
步骤 225: 秒计数器计数值减 1 , 返回步骤 222;
步骤 226: 秒计数器计数值加 1 , 返回步骤 222;
步骤 227: 将定时器中断标识复位, 返回步骤 216;
步骤 228: 判断蓝牙数据中断标识是否置位;
如果置位, 则执行步骤 229, 否则, 返回步骤 216。
步骤 229: 接收益牙数据, 判断蓝牙数据是否接收完成;
如果是, 则执行步骤 230; 否则, 执行步骤 233。
本实施例中, 以字节的形式接收蓝牙数据,接收的字节中包含蓝牙数据的 长度信息, 根据该长度信息接收数据, 当接收的字节长度等于长度信息时, 则 蓝牙数据接收完成。
步骤 230: 判断收到的数据是否合法;
如果合法, 则执行步骤 231 ; 否则, 执行步骤 232;
步骤 231 : 蓝牙数据接收完成标识置位, 将接收到的数据保存至接收数据 緩存区, 执行步骤 233 ;
步骤 232: 清空接收数据緩存区, 执行步骤 233;
步骤 233 : 将蓝牙数据中断标识复位, 返回步骤 216;
步骤 234: 判断系统状态标识是否是益牙 OTP标识;
如果是, 则执行步骤 235; 否则, 返回步骤 236。
步骤 235 : 显示蓝牙已连接, 延时第四预设时间后清屏;
步骤 236: 蓝牙连接中断标识复位, 返回步骤 216;
步骤 237: 判断系统状态标识是否是益牙 OTP标识;
如果是, 则执行步骤 238; 否则, 执行步骤 239;
步骤 238: 显示蓝牙连接已断开, 清空接收数据緩存区, 蓝牙数据接收完 成标识复位;
步骤 239: 蓝牙断开中断标识复位, 返回步骤 216。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于 此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易想到 变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护范围应 所述以权利要求的保护范围为准。

Claims

权 利 要 求
1、 一种动态令牌的工作方法, 其特征在于, 包括以下步骤:
步骤 S 1 : 动态令牌判断是否存在置位的唤醒标识, 是则执行步骤 S2; 否 则休眠;
步骤 S2: 所述动态令牌判断置位的唤醒标识的类型, 如是按键唤醒标识, 则执行步骤 S3 ; 如是蓝牙连接唤醒标识, 将蓝牙模块的工作模式切换至监听 模式, 将所述蓝牙连接唤醒标识复位, 返回步骤 S1 ; 如是蓝牙数据唤醒标识, 则接收蓝牙数据,将所述蓝牙数据保存至接收数据緩存区,将蓝牙数据接收完 成标识置位, 将所述蓝牙数据唤醒标识复位, 返回步骤 S1 ; 如是蓝牙断开唤 醒标识, 则清空所述接收数据緩存区, 将所述蓝牙断开唤醒标识复位, 返回步 骤 S 1 ; 其中, 所述按键唤醒标识用于在所述动态令牌检测到按键中断时, 被 所述动态令牌置位;所述蓝牙数据唤醒标识用于在所述动态令牌检测到蓝牙数 据中断时,被所述动态令牌置位; 所述蓝牙连接唤醒标识用于在所述动态令牌 检测到蓝牙连接中断时,被所述动态令牌置位; 所述蓝牙断开唤醒标识用于在 所述动态令牌检测到蓝牙断开中断时, 被所述动态令牌置位;
步骤 S3 : 所述动态令牌获取被触发的按键的键值, 根据所述键值判断所 述被触发的按键是否为电源键, 是则执行步骤 S4; 否则执行步骤 S5;
步骤 S4: 所述动态令牌判断系统状态标识是否是关机标识;
如果所述系统状态标识是所述关机标识,则判断蓝牙模块工作电压是否低 于预设电压; 如果低于所述预设电压, 则提示蓝牙模块工作电压低, 并在所述 蓝牙模块工作电压低于所述预设电压的时长达到第一预设时间后,将所述系统 状态标识置为输入挑战码标识, 执行步骤 S8; 如果不低于所述预设电压, 则 对所述蓝牙模块上电, 将所述系统状态标识置为蓝牙 OTP标识, 将所述蓝牙 模块的工作模式切换至监听模式, 执行步骤 S8;
如果所述系统状态标识不是所述关机标识,则将所述系统状态标识置为关 机标识, 清除按键数据緩存区中的数据, 对所述蓝牙模块下电, 执行步骤 S8; 步骤 S5 : 所述动态令牌对所述系统状态标识进行判断, 如果是所述输入 挑战码标识, 则执行步骤 S6; 如果是所述蓝牙 OTP标识, 则执行步骤 S7; 如 果是其他标识, 则执行步骤 S8;
步骤 S6: 所述动态令牌获取所述被触发的按键的键值, 根据所述键值对 所述被触发的按键进行判断;
如果是数字键, 则将所述键值对应的数字保存至所述按键数据緩存区,执 行步骤 S8;
如果是确认键, 则判断所述按键数据緩存区中是否存在数据,如果存在数 据, 则将所述按键数据緩存区中的数据, 或者, 所述按键数据緩存区中的数据 与所述动态令牌内部的基础因子的组合作为动态因子,根据所述动态因子计算 动态口令, 显示所述动态口令, 执行步骤 S8; 如果不存在数据, 则将所述基 础因子作为动态因子, 根据所述动态因子计算动态口令, 显示所述动态口令, 执行步骤 S8;
如果是删除键, 则清除所述按键数据緩存区中的数据, 执行步骤 S8; 步骤 S7: 所述动态令牌获取所述被触发的按键的键值, 根据所述键值对 所述被触发的按键进行判断;
如果是数字键, 则将所述键值对应的数字保存至所述按键数据緩存区,执 行步骤 S8;
如果是确认键, 则判断蓝牙数据接收完成标识是否置位, 如果置位, 则将 所述接收数据緩存区中的数据, 或者, 所述基础因子与所述接收数据緩存区中 的数据的组合作为动态因子,根据所述动态因子计算动态口令,将计算得到的 动态口令返回给所述上位机, 执行步骤 S8; 如果没有置位, 则判断所述按键 数据緩存区中是否存在数据, 如果存在数据, 则将所述按键数据緩存区中的数 据, 或者, 所述按键数据緩存区中的数据与所述动态令牌内部的基础因子的组 合作为动态因子, 根据所述动态因子计算动态口令, 显示所述动态口令, 执行 步骤 S8; 如果不存在数据, 则将所述基础因子作为动态因子, 根据所述动态 因子计算动态口令, 将计算得到的动态口令返回给所述上位机, 执行步骤 S8; 如果是删除键, 则将所述系统状态标识保存为输入挑战码标识,执行步骤
S8;
步骤 S8: 所述动态令牌将按键唤醒标识复位, 返回步骤 Sl。
2、 如权利要求 1所述的方法, 其特征在于,
所述将计算得到的动态口令返回给所述上位机包括,通过液晶屏显示动态 口令和 /或通过蓝牙模块将动态口令返回给所述上位机。
3、 如权利要求 1所述的方法, 其特征在于,
所述步骤 S4中,在判断蓝牙模块工作电压是否低于预设电压之前还包括, 进行检查密码操作,当密码正确时,判断蓝牙模块工作电压是否低于预设电压; 当密码不正确时, 执行步骤 S8;
所述检查密码操作包括,
步骤 E1 : 所述动态令牌获取所述被触发的按键的键值, 根据所述键值对 所述被触发的按键进行判断; 若是确认键, 则执行步骤 E2; 若是数字键并且 按键数据长度小于预设长度,则将数字键对应的按键数据保存至按键数据緩存 区, 显示检查密码界面, 退出检查密码操作; 若是其他键值则根据键值执行相 应操作, 退出检查密码操作;
步骤 E2: 判断按键数据緩存区中的密码是否正确, 若密码正确, 则执行 步骤 E3; 否则, 执行步骤 E4;
步骤 E3: 提示密码正确, 将密码失败次数清零, 延时第四预设时间, 清 空按键数据緩存区, 确定密码正确, 结束检查密码操作;
步骤 E4: 密码失败次数加 1 , 显示密码失败界面, 延时第四预设时间, 执 行步骤 E5;
步骤 E5: 判断密码失败次数是否等于预设次数;
是则清空按键数据緩存区, 确定密码不正确, 执行步骤 S8; 否则显示密 码输入界面, 清空按键数据緩存区, 执行步骤 S8。
4、如权利要求 1所述的方法, 其特征在于, 所述步骤 S6中所述如果是删 除键, 则清除所述按键数据緩存区中的数据, 执行步骤 S8; 包括,
步骤 A 1 : 判断删除键被按下的时间是否达到预设时长;
是则执行步骤 A 2; 否则执行步骤 A 5;
步骤 A 2: 判断按键数据緩存区中是否存在数据;
是则执行步骤 A4; 否则执行步骤 A3;
步骤 A 3 : 显示菜单界面, 将系统状态标识保存为菜单功能选择标识, 执 行步骤 S8;
步骤 A 4 : 清空按键数据緩存区, 显示输入挑战码信息界面, 执行步骤 S8;
步骤 A 5: 判断按键数据緩存区中是否存在数据;
是则执行步骤 A6; 否则执行步骤 A7;
步骤 A 6 : 清除按键数据緩存区中最后存入键值; 然后执行步骤 A 7 ; 步骤 A 7 : 显示输入挑战码信息界面, 显示按键数据緩存区中的数据, 执 行步骤 S8;
所述步骤 S5还包括, 检测系统状态标识, 如果是菜单功能选择标识, 则 进行菜单功能选择操作, 执行步骤 S8; 所述菜单功能选择操作包括,
步骤 HI : 检测键值, 如果是确认键, 则执行步骤 H2;
如果其他键值, 则根据键值执行相应操作, 退出菜单功能选择操作, 其他 键值包括右键和左键;
步骤 H2: 判断选择的功能, 如果是蓝牙 OTP, 则执行步骤 H3;
如果是其他的功能, 则执行相应功能选择操作, 然后退出菜单功能选择操 作;
步骤 H3: 蓝牙模块上电, 显示蓝牙 OTP界面, 系统状态标识保存为蓝牙
OTP标识, 执行步骤 H4;
步骤 H4: 读取蓝牙模块参数;
步骤 H5: 判断读取蓝牙模块参数是否成功;
如果读取成功, 则执行步骤 H6; 否则执行步骤 H7;
步骤 H6: 蓝牙模块切换为监听模式, 退出菜单功能选择操作;
步骤 H7: 读取蓝牙模块参数次数加 1 ;
步骤 H8: 判断读取蓝牙模块参数次数是否达到第六预设值; 如果是, 则执行步骤 H9; 否则返回步骤 H4;
步骤 H9: 提示蓝牙模块损坏, 给蓝牙模块下电, 延时第三预设时间, 显 示输入挑战码信息界面, 系统状态标识保存为输入挑战码标识, 退出菜单功能 选择操作。
5、 如权利要求 1所述的方法, 其特征在于, 所述基础因子为时间因子, 所述方法还包括:
当检测到定时器中断时, 所述动态令牌更新时间因子, 将定时器唤醒标识 置位;
所述动态令牌判断置位的唤醒标识为所述定时器唤醒标识后,执行以下步 骤:
步骤 G1 : 判断系统状态标识是否为蓝牙 OTP标识;
是则蓝牙模式计数器计数值加 1 , 执行步骤 G2; 否则执行步骤 G7;
所述蓝牙模式计数器计数值初始值为 0;
步骤 G2: 判断蓝牙模式计数器计数值是否小于第一预设值;
是则执行步骤 G4; 否则执行步骤 G3;
步骤 G3: 蓝牙模式计数器计数值置为 0, 清空接收数据緩存区, 对蓝牙 模块下电,显示输入挑战码信息界面,将系统状态标识保存为输入挑战码标识, 然后执骤 G6;
步骤 G4: 检测蓝牙模块工作电压是否低于预设电压, 若低于预设电压, 则执行步骤 G5; 若不低于预设电压, 则执行步骤 G6;
步骤 G5: 蓝牙模式计数器计数值置为 0, 清空接收数据緩存区, 对蓝牙 模块下电,显示输入挑战码信息界面,将系统状态标识保存为输入挑战码标识, 通过液晶显示屏输出工作电压低请充电后再使用蓝牙功能的提示信息,执行步 骤 G6;
步骤 G6: 判断系统状态标识是否为输入挑战码标识;
是则执行步骤 G7; 否则执行步骤 G10;
步骤 G7: 无按键计数器计数值加 1 ;
所述无按键计数器初始值为 0;
步骤 G8: 判断无按键计数器计数值是否小于第二预设值;
是则执行步骤 G10; 否则, 执行步骤 G9;
步骤 G9: 将无按键计数器计数值置为 0, 将系统状态标识保存为关机标 识, 清空按键数据緩存区, 然后执行步骤 G10;
步骤 G10: 将定时器唤醒标识复位, 返回步骤 Sl。
6、 如权利要求 1所述的方法, 其特征在于, 所述基础因子包括时间因子 和 /或事件因子。
7、 一种动态令牌的工作方法, 其特征在于, 包括,
动态令牌初始化,打开按键中断和 /或蓝牙数据中断和 /或蓝牙连接中断和 / 或蓝牙断开中断, 动态令牌休眠;
当动态令牌检测到按键中断时, 动态令牌被唤醒, 执行步骤 S-1 ;
步骤 S-1 : 动态令牌获取被触发的按键的键值, 根据键值判断被触发的按 键是否为电源键, 是则执行步骤 S-2; 否则检测系统状态标识, 如果是输入挑 战码标识, 则执行步骤 S-3; 如果是蓝牙 OTP标识, 则执行步骤 S-4; 如果是 其他标识, 则动态令牌休眠;
步骤 S-2: 判断系统状态标识是否为关机标识, 是则判断蓝牙模块工作电 压是否低于预设电压, 如果低于预设电压, 则提示蓝牙模块工作电压低, 并在 蓝牙模块工作电压低于预设电压的时长达到第一预设时间后,将系统状态标识 保存为输入挑战码标识, 动态令牌休眠; 如果不低于预设电压, 则对蓝牙模块 上电, 将系统状态标识保存为蓝牙 OTP标识, 将蓝牙模块的工作模式切换至 监听模式, 动态令牌休眠;
如果系统状态标识不是关机标识, 则将系统状态标识保存为关机标识, 清 除按键数据緩存区中的数据, 对蓝牙模块下电, 动态令牌休眠;
步骤 S-3: 动态令牌获取被触发的按键的键值, 根据键值对被触发的按键 进行判断; 如果是数字键, 则将键值对应的数字保存至按键数据緩存区, 动态 令牌休眠; 如果是确认键, 则判断按键数据緩存区中是否存在数据, 如果存在 数据, 则将按键数据緩存区中的数据, 或者, 按键数据緩存区中的数据与动态 令牌内部的基础因子的组合作为动态因子,根据动态因子计算动态口令,显示 动态口令, 动态令牌休眠; 如果不存在数据, 则将基础因子作为动态因子, 根 据动态因子计算动态口令, 显示动态口令, 动态令牌休眠; 如果是删除键, 则 清除按键数据緩存区中的数据, 动态令牌休眠;
步骤 S-4: 动态令牌获取被触发的按键的键值, 根据键值对被触发的按键 进行判断;
如果是数字键, 则将键值对应的数字保存至按键数据緩存区,动态令牌休 眠;
如果是确认键, 则判断蓝牙数据接收完成标识是否置位, 如果置位, 则将 接收数据緩存区中的数据,或者,基础因子与接收数据緩存区中的数据的组合 作为动态因子,根据动态因子计算动态口令,将计算得到的动态口令返回给上 位机,动态令牌休眠;如果没有置位,则判断按键数据緩存区中是否存在数据, 如果存在数据, 则将按键数据緩存区中的数据, 或者, 按键数据緩存区中的数 据与动态令牌内部的基础因子的组合作为动态因子,根据动态因子计算动态口 令, 显示动态口令, 动态令牌休眠; 如果不存在数据, 则将基础因子作为动态 因子, 根据动态因子计算动态口令, 将计算得到的动态口令返回给上位机, 动 态令牌休眠;
如果是删除键,则将系统状态标识保存为输入挑战码标识,动态令牌休眠; 当动态令牌检测到蓝牙数据中断时,接收蓝牙数据, 将所述蓝牙数据保存 至接收数据緩存区直到接收完蓝牙数据,将蓝牙数据接收完成标识置位,动态 令牌休眠;
当动态令牌检测到蓝牙连接中断时, 显示蓝牙已连接, 预设时间后清屏, 动态令牌休眠;
当动态令牌检测到蓝牙断开中断时,清空接收数据緩存区,动态令牌休眠; 所述基础因子包括时间因子和 /或事件因子。
8、 如权利要求 7所述的方法, 其特征在于,
所述步骤 S-2 中所述判断蓝牙模块工作电压是否低于预设电压之前还包 括, 进行检查密码操作, 当密码正确时, 判断蓝牙模块工作电压是否低于预设 电压; 当密码不正确时, 动态令牌休眠;
所述检查密码操作包括,
步骤 E1 : 所述动态令牌获取所述被触发的按键的键值, 根据所述键值对 所述被触发的按键进行判断; 若是确认键, 则执行步骤 E2; 若是数字键并且 按键数据长度小于预设长度,则将数字键对应的按键数据保存至按键数据緩存 区, 显示检查密码界面, 退出检查密码操作; 若是其他键值则根据键值执行相 应操作, 退出检查密码操作;
步骤 E2: 判断按键数据緩存区中的密码是否正确, 若密码正确, 则执行 步骤 E3; 否则, 执行步骤 E4;
步骤 E3: 提示密码正确, 将密码失败次数清零, 延时第四预设时间, 清 空按键数据緩存区, 确定密码正确, 结束检查密码操作;
步骤 E4: 密码失败次数加 1 , 显示密码失败界面, 延时第四预设时间, 执 行步骤 E5;
步骤 E5: 判断密码失败次数是否等于预设次数;
是则清空按键数据緩存区, 确定密码不正确, 动态令牌休眠; 否则显示密 码输入界面, 清空按键数据緩存区, 动态令牌休眠。
9、 如权利要求 7所述的方法, 其特征在于, 所述步骤 S-3中所述如果是 删除键, 则清除按键数据緩存区中的数据, 动态令牌休眠, 包括,
步骤 A 1: 判断删除键被按下的时间是否达到预设时长;
是则执行步骤 A 2; 否则, 执行步骤 A 5;
步骤 A 2: 判断按键数据緩存区中是否存在数据;
是则执行步骤 A4; 否则执行步骤 A3;
步骤 A 3 : 显示菜单界面, 将系统状态标识保存为菜单功能选择标识, 动 态令牌休眠;
步骤 A 4 : 清空按键数据緩存区, 显示输入挑战码信息界面, 动态令牌休 眠;
步骤 A 5: 判断按键数据緩存区中是否存在数据; 是则执行步骤 A6; 否则执行步骤 A7;
步骤 A 6 : 清除按键数据緩存区中最后存入键值; 然后执行步骤 A 7 ; 步骤 A 7 : 显示输入挑战码信息界面, 显示按键数据緩存区中的数据, 动 态令牌休眠;
所述步骤 S-1还包括, 检测系统状态标识, 如果是菜单功能选择标识, 则 进行菜单功能选择操作, 动态令牌休眠; 所述菜单功能选择操作包括,
步骤 HI : 检测键值, 如果是确认键, 则执行步骤 H2;
如果其他键值, 则根据键值执行相应操作, 退出菜单功能选择操作, 其他 键值包括右键和左键;
步骤 H2: 判断选择的功能, 如果是蓝牙 OTP, 则执行步骤 H3;
如果是其他的功能, 则执行相应功能选择操作, 然后退出菜单功能选择操 作;
步骤 H3: 蓝牙模块上电, 显示蓝牙 OTP界面, 系统状态标识保存为蓝牙 OTP标识, 执行步骤 H4;
步骤 H4: 读取蓝牙模块参数;
步骤 H5: 判断读取蓝牙模块参数是否成功;
如果读取成功, 则执行步骤 H6; 否则执行步骤 H7;
步骤 H6: 蓝牙模块切换为监听模式, 退出菜单功能选择操作;
步骤 H7: 读取蓝牙模块参数次数加 1 ;
步骤 H8: 判断读取益牙模块参数次数是否达到第六预设值;
如果是, 则执行步骤 H9; 否则, 返回步骤 H4;
步骤 H9: 提示蓝牙模块损坏, 给蓝牙模块下电, 延时第三预设时间, 显 示输入挑战码信息界面, 系统状态标识保存为输入挑战码标识, 退出菜单功能 选择操作。
10、 如权利要求 7所述的方法, 其特征在于, 所述^出因子为时间因子, 所述动态令牌初始化之后还包括, 打开定时器中断, 动态令牌休眠;
当检测到定时器中断时, 更新时间因子, 执行定时操作; 所述定时操作包 括,
步骤 G1 : 判断系统状态标识是否为蓝牙 OTP标识;
是则蓝牙模式计数器计数值加 1, 执行步骤 G2; 否则执行步骤 G7;
所述蓝牙模式计数器计数值初始值为 0;
步骤 G2: 判断蓝牙模式计数器计数值是否小于第一预设值;
是则执行步骤 G4; 否则执行步骤 G3;
步骤 G3: 蓝牙模式计数器计数值置为 0, 清空接收数据緩存区, 对蓝牙 模块下电,显示输入挑战码信息界面,将系统状态标识保存为输入挑战码标识, 然后执骤 G6;
步骤 G4: 检测蓝牙模块工作电压是否低于预设电压, 若低于预设电压, 则执行步骤 G5; 若不低于预设电压, 则执行步骤 G6;
步骤 G5: 蓝牙模式计数器计数值置为 0, 清空接收数据緩存区, 对蓝牙 模块下电,显示输入挑战码信息界面,将系统状态标识保存为输入挑战码标识, 通过液晶显示屏输出工作电压低请充电后再使用蓝牙功能的提示信息,执行步 骤 G6;
步骤 G6: 判断系统状态标识是否为输入挑战码标识;
是则执行步骤 G7; 否则动态令牌休眠; 步骤 G7: 无按键计数器计数值加 1 ; 所述无按键计数器初始值为 0; 步骤 G8: 判断无按键计数器计数值是否小于第二预设值; 是则动态令牌休眠; 否则, 执行步骤 G9; 步骤 G9: 将无按键计数器计数值置为 0, 将系统状态标识保存为关机标 识, 清空按键数据緩存区, 动态令牌休眠。
11、 如权利要求 7所述的方法, 其特征在于, 所述将计算得到的动态口令返回给上位机包括,通过液晶屏显示动态口令 和 /或通过蓝牙模块将动态口令返回给上位机。
12、 如权利要求 7所述的方法, 其特征在于, 所述基础因子包括时间因子 和 /或事件因子。
PCT/CN2014/073602 2013-05-15 2014-03-18 一种动态令牌的工作方法 WO2014183500A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/777,768 US9781104B2 (en) 2013-05-15 2014-03-18 Working method of dynamic token

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN2013101798705A CN103312508A (zh) 2013-05-15 2013-05-15 一种动态令牌的工作方法
CN201310179870.5 2013-05-15
CN201310404877.2A CN103457741B (zh) 2013-05-15 2013-09-09 一种动态令牌的工作方法
CN201310404877.2 2013-09-09

Publications (1)

Publication Number Publication Date
WO2014183500A1 true WO2014183500A1 (zh) 2014-11-20

Family

ID=49137315

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/073602 WO2014183500A1 (zh) 2013-05-15 2014-03-18 一种动态令牌的工作方法

Country Status (3)

Country Link
US (1) US9781104B2 (zh)
CN (2) CN103312508A (zh)
WO (1) WO2014183500A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103312508A (zh) 2013-05-15 2013-09-18 飞天诚信科技股份有限公司 一种动态令牌的工作方法
WO2015102880A1 (en) * 2013-12-30 2015-07-09 Vasco Data Security, Inc. An authentication apparatus with a bluetooth interface
CN110557725B (zh) * 2019-09-16 2021-07-30 飞天诚信科技股份有限公司 一种设置蓝牙工作状态的方法及装置
CN111159655B (zh) * 2019-12-31 2023-06-27 深圳市显控科技股份有限公司 人机交互多级密码设置方法
CN114980363B (zh) * 2022-07-27 2024-03-19 荣耀终端有限公司 一种蓝牙回连方法及其相关装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102611556A (zh) * 2012-03-31 2012-07-25 飞天诚信科技股份有限公司 一种动态令牌的工作方法
US20130024932A1 (en) * 2011-07-18 2013-01-24 Cisco Technology, Inc. Enhanced security for bluetooth-enabled devices
CN103023643A (zh) * 2012-11-22 2013-04-03 天地融科技股份有限公司 一种动态口令牌及动态口令生成方法
CN103312508A (zh) * 2013-05-15 2013-09-18 飞天诚信科技股份有限公司 一种动态令牌的工作方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7540022B2 (en) * 2005-06-30 2009-05-26 Nokia Corporation Using one-time passwords with single sign-on authentication
CN101022292A (zh) * 2006-02-14 2007-08-22 南京大学 便携式蓝牙求救装置
CN101197665B (zh) * 2007-12-24 2011-11-09 北京飞天诚信科技有限公司 动态口令生成方法及其装置
US9407619B2 (en) * 2013-03-17 2016-08-02 NXT-ID, Inc. Un-password™: risk aware end-to-end multi-factor authentication via dynamic pairing
US20160164725A1 (en) * 2014-12-08 2016-06-09 Cyntec Co., Ltd. Wireless System Package and Communication Method of Wireless System Package and Communication Device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130024932A1 (en) * 2011-07-18 2013-01-24 Cisco Technology, Inc. Enhanced security for bluetooth-enabled devices
CN102611556A (zh) * 2012-03-31 2012-07-25 飞天诚信科技股份有限公司 一种动态令牌的工作方法
CN103023643A (zh) * 2012-11-22 2013-04-03 天地融科技股份有限公司 一种动态口令牌及动态口令生成方法
CN103312508A (zh) * 2013-05-15 2013-09-18 飞天诚信科技股份有限公司 一种动态令牌的工作方法
CN103457741A (zh) * 2013-05-15 2013-12-18 飞天诚信科技股份有限公司 一种动态令牌的工作方法

Also Published As

Publication number Publication date
US9781104B2 (en) 2017-10-03
US20160301687A1 (en) 2016-10-13
CN103457741A (zh) 2013-12-18
CN103457741B (zh) 2016-08-17
CN103312508A (zh) 2013-09-18

Similar Documents

Publication Publication Date Title
US10402621B2 (en) Finger print state integration with non-application processor functions for power savings in an electronic device
CN101770268B (zh) 智能终端复位方法及装置
WO2014183500A1 (zh) 一种动态令牌的工作方法
CN103312517B (zh) 一种双用途设备共用显示屏和按键的实现方法
WO2014173244A1 (zh) 一种智能密钥设备的工作方法
WO2013166778A1 (zh) 基于传感器操作移动终端的方法和装置、移动终端
CN104503569B (zh) 电子设备及其唤醒方法
WO2014082573A1 (zh) 一种终端设备的解锁方法及终端设备
WO2013166844A1 (zh) 移动终端的解锁方法、系统及装置
WO2014161512A1 (zh) 一种网络连接方法及装置
WO2015180030A1 (zh) 识别用户身份的方法及电子设备
CN106371938B (zh) 智能延迟自动关机系统及其方法
CN104836869A (zh) 一种移动通信终端和移动通信终端开机方法
WO2019041243A1 (zh) 指纹传感器功能的验证方法及终端
CN101350995B (zh) 一种移动终端模块间唤醒方法及应用该方法的多模终端
TWI545495B (zh) 觸摸屏操作系統及方法
US9672048B2 (en) Electronic device and method for waking up operating system thereof
WO2016008447A1 (zh) 实现智能密钥设备模式间切换的方法和装置
JP5941490B2 (ja) パワー・ステートを制御する方法、コンピュータ・プログラムおよびコンピュータ
CN103209077A (zh) 一种适用于动态令牌的解锁方法
CN105306985A (zh) 一种视频播放界面智能锁定解锁方法、系统及移动终端
CN105740677A (zh) 一种开关机方法、系统及智能移动终端
WO2018137383A1 (zh) 屏幕显示方法及装置、终端
CN103684785B (zh) 一种具有按键保护功能的动态令牌及其工作方法
CN105282298A (zh) 一种手机熄屏方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14798556

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14777768

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14798556

Country of ref document: EP

Kind code of ref document: A1