WO2011120408A1 - 校正动态口令令牌温漂的方法和动态口令令牌 - Google Patents

校正动态口令令牌温漂的方法和动态口令令牌 Download PDF

Info

Publication number
WO2011120408A1
WO2011120408A1 PCT/CN2011/072202 CN2011072202W WO2011120408A1 WO 2011120408 A1 WO2011120408 A1 WO 2011120408A1 CN 2011072202 W CN2011072202 W CN 2011072202W WO 2011120408 A1 WO2011120408 A1 WO 2011120408A1
Authority
WO
WIPO (PCT)
Prior art keywords
time
dynamic password
password token
value
temperature
Prior art date
Application number
PCT/CN2011/072202
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 US13/258,156 priority Critical patent/US8443432B2/en
Publication of WO2011120408A1 publication Critical patent/WO2011120408A1/zh

Links

Classifications

    • GPHYSICS
    • G04HOROLOGY
    • G04GELECTRONIC TIME-PIECES
    • G04G3/00Producing timing pulses
    • G04G3/04Temperature-compensating arrangements

Definitions

  • the invention belongs to the field of information security, and in particular relates to a method for correcting dynamic password token temperature drift and a dynamic password token. Background technique
  • Real-Time Clock is a device that controls the time and date of BCD (Binary-Coded Decimal) code to the main system.
  • the basic function of RTC is to keep track of time and date.
  • the crystal oscillator provides high accuracy at a fixed frequency. Most RTCs use a 32.768KHZ crystal.
  • the crystal oscillator output is divided to produce a 1Hz reference to refresh the time and date.
  • the accuracy of the RTC depends primarily on the accuracy of the crystal oscillator.
  • the time drift of the dynamic password token is required to be no more than 2 minutes per year, ie less than 5 ppm, and the time drift is caused by the internal frequency of the dynamic password token being 32.
  • a 768KHz clock crystal When the temperature of the clock crystal changes, the crystal frequency of the crystal will show a parabolic trend, and the 23ppm temperature drift will generate a clock error of 1 minute or a larger clock error every month. The clock error caused by the temperature drift of the dynamic password token needs to be corrected.
  • the invention provides a method for correcting the temperature drift of a dynamic password token.
  • the technical solution is as follows:
  • a method for correcting dynamic password token temperature drift wherein the dynamic password token obtains a dynamic factor according to a time value and a change time step of a dynamic factor, and generates and displays a dynamic password according to the dynamic factor, where the method includes :
  • the dynamic password token detects the temperature of the environment in which the dynamic password token is currently located at an interval of a first preset time; the dynamic password token searches the data table according to the detected temperature, and obtains the checked The characteristic value corresponding to the temperature;
  • the dynamic password token corrects the current time value in the dynamic password token according to the feature value at intervals of the second preset time.
  • a dynamic password token comprising:
  • a timer module configured to: when the first preset time expires, turn on the detection module to detect the temperature of the environment in which the dynamic password token is currently located;
  • a detecting module configured to detect a temperature of an environment in which the dynamic password token is currently located when the timer module reaches the first preset time, and trigger a query module to perform data query;
  • a table storage module configured to store a feature value of the real-time clock crystal at different temperatures
  • a querying module configured to search, in the table storage module, a feature value corresponding to the detected temperature according to a temperature of the current environment of the dynamic password token detected by the detecting module;
  • a correction module configured to correct a current time value in the dynamic password token according to the feature value
  • a triggering module configured to trigger the generating module to generate a dynamic password
  • a generating module configured to: after the trigger module is touched, extract a current time value of the dynamic password token, and generate a dynamic password according to the extracted time value and a change time step of the dynamic factor
  • a display module configured to display or close the dynamic password generated by the generating module.
  • the beneficial effects are: monitoring the temperature of the environment in which the dynamic password token is located at a fixed time interval, and calculating the cumulative time deviation at different temperatures according to the characteristic value of the crystal as the temperature changes, and dynamically according to the time deviation within a fixed time interval After the password token temperature drift is corrected, the clock skew of the dynamic password token in the high and low temperature environment is effectively improved, and the improvement effect is obvious.
  • 1 is a temperature drift curve of a 32.768 KHz crystal provided by an embodiment of the present invention.
  • FIG. 2 is a flowchart of a method for correcting dynamic password token temperature drift according to an embodiment of the present invention
  • FIG. 3 is a flowchart of another method for correcting dynamic password token temperature drift according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural view of the OTP device 400. detailed description
  • the embodiment of the present invention provides a method for correcting the dynamic password token temperature drift.
  • the dynamic password token provided by the embodiment of the present invention internally stores an eigenvalue of a crystal oscillator of 32.768 KHz at different temperatures. , that is, the crystal frequency (as shown in Table 1), wherein the data in Table 1 is obtained through trial and error. Further, in order to improve the test accuracy, a more intensive test temperature can be selected during the test. Test the crystal oscillator frequency of the crystal oscillator.
  • Table 1 32. Crystal Frequency of 786KHz Crystal Oscillator at Different Temperatures (in Hz)
  • 32766. 8 32767. 4 32767. 45 32767. 48 32767. 5 32767. 6 32767. 64 32767. 8
  • the dynamic password token loading timer is the first preset time, and can be set according to the actual situation.
  • the timer is set according to the timing time of 1 hour;
  • the timer time of the timer is set to 10 minutes or less, if the temperature difference of the environment in which the dynamic password token is located is small, the timer time of the timer Set to a time of 1 hour or longer, which improves the dynamic password token temperature drift accuracy while reducing the power consumption of the dynamic password token, thereby increasing the lifetime of the dynamic password token.
  • the dynamic password token detects the temperature of the current environment when the time is up, records the detected temperature T, and then reloads the timer;
  • a dynamic thermistor is provided with a thermistor, and the dynamic password token detects the temperature of the environment in which the dynamic password token is currently located according to the thermistor.
  • the thermistor is connected in series with a high-precision resistor, wherein the high-precision resistor is connected to the power source and the ground, and the resistance value of the thermistor is changed according to the temperature of the environment in which the dynamic password token is located. Therefore, the voltage value at which the thermistor is connected to the high-precision resistor is also changed according to the temperature of the environment in which the dynamic password token is located.
  • the AD converter in the dynamic password token is connected to the thermistor.
  • the dynamic password token Connected to a high-precision resistor, when the timing time expires, the dynamic password token detects the temperature of the current environment, and the AD converter starts to convert the voltage value of the thermistor terminal into a digital signal, and then according to the heat.
  • the temperature coefficient of the sensitive resistor and the reference voltage of the AD converter calculate the temperature of the environment in which the dynamic password token is currently located;
  • the dynamic password token detects the temperature of the current environment when the timing time expires, for example, the detected temperature T is 22 degrees, and then reloads the timer, in the environment where the next dynamic password token is located. The temperature is detected at the timing.
  • the dynamic password token can determine whether to detect the temperature of the current environment by querying the flag bit.
  • the hardware circuit in the dynamic password token will change the flag bit, for example, the flag bit. The value is changed from 0 to 1, and the dynamic password token queries the flag. For example, when the flag is 1, the dynamic password token detects the temperature of the current environment.
  • the dynamic password token searches for a pre-stored data table according to the recorded temperature T, and determines whether the crystal frequency f corresponding to the temperature T can be found in the data table.
  • the dynamic password token searches for the pre-stored data table according to the recorded temperature T to obtain two temperatures T1 and T2 in the data table that are close to the temperature T;
  • the dynamic password token finds the crystal frequency fl under the temperature T1 and ⁇ 2 according to the temperature T1 and ⁇ 2 ⁇ data tables. ⁇ 2, and calculate the crystal frequency f corresponding to the crystal under temperature ⁇ according to Tl, T2, fl, f2;
  • the calculation method of calculating the crystal frequency f corresponding to the crystal at temperature T according to Tl, T2, fl, and f2 is:
  • the crystal frequency of the crystal at -20 degrees can be found in the data table to be 32765 ⁇ .
  • the dynamic password token calculates the time deviation of the crystal under temperature ⁇ ;
  • the dynamic password token calculates the crystal frequency deviation Af of the temperature underarm crystal oscillator, and converts the calculated crystal frequency deviation Af into a time deviation ⁇ .
  • the calculated time deviation At is the current 1 second.
  • the time deviation within the temperature T, and the time deviation ⁇ at the temperature T also includes the time deviation within the timing time. Therefore, the time deviation ⁇ at the temperature T is the time deviation ⁇ in the current 1 second multiplied by the timing time plus the current 1 second. Time deviation within the time and store the calculated time deviation ⁇ of the temperature ⁇ in the temporary cache of the dynamic password token;
  • ⁇ and ⁇ are calculated as:
  • ⁇ f f-standard crystal frequency
  • the standard crystal oscillator frequency is the crystal oscillator frequency of the crystal oscillator at normal temperature (25 degrees). In this embodiment, since the crystal oscillator of 32.768 KHz is used, the standard crystal oscillator frequency is 32.768 KHz.
  • the dynamic password token calculates a current accumulated time deviation T′ according to the calculated time deviation ⁇ , and stores the calculated current accumulated time deviation T′ in a temporary cache of the dynamic password token;
  • the process of calculating the current accumulated time deviation T' is an accumulation calculation process, and accumulating the currently obtained time deviation ⁇ with the time deviation calculated from the previous timing time to obtain the current accumulated time deviation T′.
  • the calculated time offset ⁇ -1.5 * 10-6 * 3601 seconds, before, has two opening timing, temperatures were detected, respectively, the time offset calculated -0.75 * 10-6 * 3600 seconds -1 and 3.15 * 10-6 * 3600 seconds, the current cumulative time deviation (-0.75 * 10-6 * 3601 seconds) + (15 * 10-6 -1 ⁇ * 3601 seconds) + (-1.5 * 10-6 * 3601 seconds), and the calculated current integral time offset T 'in the temporary buffer, as the next time to calculate the current cumulative deviation storage base.
  • the dynamic password token determines whether the accumulated time offset T′ in the current cache is greater than, equal to, or less than a predetermined value.
  • the predetermined value in this embodiment is 1 second.
  • the dynamic password token corrects the current time of the token, and clears the current cache, that is, the current accumulated time offset is cleared to zero, and returns to execution 102;
  • the dynamic password token adds the corrected time after adding the current time by 1 second, and clears the cache;
  • the dynamic password token corrects the current time of the token, and saves the time value obtained by subtracting the current accumulated time offset T′ by 1 second into the temporary cache, as the base of the next accumulated calculation, and returns to execution 102. .
  • the dynamic password token adds the corrected time after adding the current time to 1 second;
  • Both 109 and 110 add the corrected time to the current time of the dynamic password token for 1 second.
  • the reason is as follows: From the temperature drift curve (Fig. 1), it can be seen intuitively that the crystal frequency of the crystal is maximum at 25 degrees. At other temperatures, the crystal frequency of the crystal will be slower, that is, the actual frequency of the crystal is less than or equal to the standard crystal frequency. Compared with the standard crystal frequency, the clock crystal is more than the standard oscillation time in 1 second ( 32768) If the deviation is Af, the deviation between the actual oscillation time of the clock crystal and the standard oscillation time is Af/f (seconds), that is, the actual oscillation time of the clock crystal is slower than the standard oscillation time by Af/f (seconds). Therefore, it is only necessary to add ls to the current time of the dynamic password token when the deviation Af/f (seconds) is added to 1 second, and the correction is achieved.
  • Trigger a dynamic password token extract a current corrected time value and a change time step of the dynamic factor, and calculate a dynamic factor according to the time value and the change time step;
  • the dynamic password token based on time synchronization authentication technology uses time as a dynamic factor, and uses a certain password generation algorithm to calculate the current time factor and static factor.
  • the dynamic factor generally takes 60 seconds or 30 seconds as the change time. Step size.
  • the calculation start time of the dynamic factor of the token and the change time step of the dynamic factor have been set. For example: The starting time for calculating the dynamic factor at the factory is 0:00:00 on January 1, 2010, and the time step of the dynamic factor is 60 seconds.
  • the dynamic factor is calculated as: (current extracted time value - calculation start time) / dynamic factor change time step;
  • the dynamic password token generates and displays a dynamic password according to the calculated dynamic factor
  • the dynamic password token calculates a dynamic password and displays the output according to the calculated dynamic factor and the pre-stored static factor according to the pre-stored dynamic password generation algorithm.
  • the above embodiment implements the correction of the time deviation of the crystal oscillator caused by the temperature drift by the application of the dynamic password token, and the correction method can realize the correction precision of the temperature drift by modifying the corresponding application program without increasing the accuracy.
  • the hardware chip is flexible, simple, and easy to implement product upgrade, and effectively improves the time error of the dynamic password token due to temperature drift in high and low temperature environments.
  • a digital time precision adjustment circuit can be integrated in the RTC, and the dynamic password token writes the calculated crystal frequency deviation Af to the adjustment circuit register of the time precision adjustment circuit.
  • the adjustment circuit register can realize the correction of the time deviation due to the temperature drift according to the written crystal frequency deviation.
  • the dynamic password token writes the crystal frequency f at temperature T to the RTC, and the RTC corrects the current time value according to the written crystal frequency f;
  • a digital time precision adjustment circuit is integrated in the RTC, and the adjustment circuit converts the written crystal frequency f into an adjustment value, and performs clock travel adjustment according to the adjustment value, specifically changing the pulse within 1 second. Count; convert the written crystal frequency f into an adjustment value.
  • the specific conversion method is:
  • the adjustment value is 0, +1, -64, -63 or the default value.
  • the crystal oscillator frequency of the crystal oscillator is less than or equal to the standard crystal oscillator frequency, so the case where the crystal oscillator frequency is greater than the standard crystal oscillator frequency is no longer considered in this embodiment.
  • the digital time adjustment circuit changes the count value of the clock pulse in the current one second according to the adjustment value at the 20th second of each minute, thereby achieving the clock travel time adjustment;
  • the above method realizes the correction of the dynamic password token temperature drift through the integrated high-precision digital time precision adjustment circuit inside the dynamic password token, and the implementation manner is simple and the correction precision is relatively high; the dynamic password token can be effectively improved at a high level. Time error due to temperature drift in low temperature environment.
  • the dynamic password token uses other crystals (such as a 32 kHz crystal)
  • the dynamic password token only needs to store the crystal oscillator frequency of the corresponding crystal oscillator at different temperatures, and the specific implementation manner can be described above. .
  • the real-time clock circuit RTC determines the time and date by the second count.
  • the current time and date are stored in a set of registers.
  • the 32. 768KHZ crystal oscillator is divided to generate a 1Hz reference to refresh the time and date. If the seconds are counted, the timing accuracy is 1 second, which will cause a large error.
  • an improved counting method can be used in this embodiment to determine the time and date, that is, the second floating point counting method is used to realize drift correction time error is generated, wherein the floating-point precision of 10-6; 107 to 110 can then be replaced by the following procedure: the calculated time variation ⁇ written into the register circuit, the circuit register is The floating-point register is accumulatively calculated according to the time deviation of each write in the position of the floating-point precision in the circuit register. When the accumulated calculated value is full, the auto-carrying is performed, thus changing the current RTC clock count, thereby The clock error due to temperature drift is corrected.
  • second floating point notation to correct the error due to the clock drift is generated, such as: the timing of the first time to time, the calculated timing deviation 1.5 * 10-6 is written to the register, the first when the second timer to time, the calculated timing deviation 1.54 * 10-6 is written into the register, the third-time timer to time, the calculated time offset of 2.0 6 * 10_ is written to register Medium, ..., the value of the register floating point precision position changes to 1. 5 * 10 - 6 , 1. 5 * 10 - 6 +1. 54 * 10 - 6 ,
  • the embodiment of the present invention provides another method for correcting the dynamic password token temperature drift.
  • the dynamic password token provided by the embodiment of the present invention internally stores the characteristic value of the 32.768 KHz crystal at different temperatures, that is, Frequency stability (as shown in Table 2), wherein the data in Table 2 is calculated through trial and error. Further, in order to improve the test accuracy, a more intensive test temperature can be selected during the test. Test the time deviation of the crystal.
  • the dynamic password token loading timer is the first preset time, and can be set according to the actual situation.
  • the timer is set according to the timing time of 30 minutes;
  • the timer time of the timer is set to 10 minutes or less, if the temperature difference of the environment in which the dynamic password token is located is small, the timer time of the timer Set to a time of 1 hour or longer, which improves the accuracy of the corrected temperature drift while reducing the power consumption of the dynamic password token. Increase the useful life of dynamic password tokens.
  • the dynamic password token detects the temperature of the current environment when the time is up, records the detected temperature T, and then reloads the timer.
  • the dynamic password token is provided with a thermistor, and the dynamic password token detects the temperature of the environment in which the dynamic password token is located according to the thermistor.
  • the thermistor is connected in series with a high-precision resistor, and the high-precision resistor is connected to the power source and the ground.
  • the resistance value of the thermistor is changed according to the temperature of the environment in which the dynamic password token is located, so The voltage value at which the thermistor is connected to the high-precision resistor is also changed according to the temperature of the environment in which the dynamic password token is located.
  • the AD converter in the dynamic password token is connected to the thermistor and the high
  • the dynamic password token detects the temperature of the current environment
  • the dynamic password token starts the AD converter, converts the voltage value of the thermistor terminal into a digital signal, and then according to the thermal Calculate the temperature of the current environment by the temperature coefficient of the resistor and the reference voltage of the AD;
  • the dynamic password token detects the temperature of the current environment when the timing time expires, for example, the detected temperature T is 32 degrees, and then reloads the timer, in the environment where the next dynamic password token is located. Temperature detection is timed;
  • the dynamic password token can determine whether to detect the temperature of the current environment by querying the flag bit.
  • the hardware circuit in the dynamic password token will change the flag bit, for example, the flag bit. The value is changed from 0 to 1, and the dynamic password token queries the flag. For example, when the flag is 1, the dynamic password token detects the temperature of the current environment.
  • the dynamic password token searches for a pre-stored data table according to the recorded temperature T, and determines whether the frequency stability At at the temperature T can be found in the data table.
  • the obtained frequency stability At is saved in the cache inside the dynamic password token and executed.
  • the dynamic password token searches for two temperatures T1 and T2 in the data table that are close to the temperature T according to the recorded temperature T.
  • the dynamic password token obtains frequency stabilitys At1 and ⁇ 2 at frequencies T1 and ⁇ 2 according to the obtained temperatures T1 and ⁇ 2, and calculates the frequency stability of the crystal under temperature ⁇ according to ⁇ 1, ⁇ 2, ⁇ ⁇ ⁇ 2. At;
  • the dynamic password token calculates a time deviation ⁇ at the temperature T;
  • the dynamic password token calculates a current accumulated time offset T ';
  • the process of calculating the current accumulated time offset T′ is a cumulative calculation process, that is, the dynamic password token accumulates the currently obtained time deviation ⁇ and the time deviation calculated from the previous timing time to obtain the current accumulated.
  • Time deviation T ' is a cumulative calculation process, that is, the dynamic password token accumulates the currently obtained time deviation ⁇ and the time deviation calculated from the previous timing time to obtain the current accumulated.
  • the calculation time obtained The deviations are -0.75 * 10 - 6 * 1801 seconds and -1. 15 * 10 - 6 * 1801 seconds, then the current accumulated time deviation is (-0. 75 * 10 - 6 * 1801 seconds) + ( - 1 ⁇ 15*10— 6 *1801 seconds) + ( -1. 5*10— 6 *1801 seconds), and store the calculated current accumulated time deviation T′ in the temporary buffer as the next calculation of the current accumulated time deviation The cardinality.
  • the dynamic password token determines whether the accumulated time offset in the current cache is greater than, equal to, or less than a predetermined value.
  • the predetermined value is 1 second.
  • the dynamic password token corrects the current time of the token, and clears the current cache, that is, the current accumulated time offset is cleared, and returns to execution 202;
  • the dynamic password token adds 1 second to the current time to obtain the corrected time, and clears the time offset in the cache;
  • the dynamic password token corrects the current time of the token, and saves the current accumulated time offset T′ minus the time value obtained after 1 second into the temporary buffer, so as to return to the base of the accumulated calculation at the next timing time, and return Execute 202.
  • the dynamic password token adds the corrected time after adding the current time to 1 second;
  • Both 209 and 210 add the corrected time to the current time of the dynamic password token for 1 second.
  • the reason is as follows: From the temperature drift curve (Fig. 1), it can be intuitively seen that the frequency stability of the crystal is 25 degrees. 0, that is, there is no deviation in the crystal frequency, and at other temperatures, the frequency stability of the crystal will change to different degrees, and the values are all negative, indicating that the crystal oscillator is within the current 1 second, compared with the standard time value. slower than a deviation ⁇ * 10- 6 seconds, whereby only when the deviation ⁇ * 10- 6 second count to 1 second when the current time plus LS OTP token, will reach the correction purposes .
  • Trigger a dynamic token and propose a current corrected time value and a change time step of the dynamic factor, and calculate a dynamic factor according to the time value and the change time step;
  • the dynamic password token based on the time synchronization authentication technology uses time as a dynamic factor, and uses a certain password generation algorithm to calculate the current time factor and the static sub.
  • the dynamic factor is generally 60 seconds or 30 seconds. Change the time step.
  • the calculation start time of the dynamic factor of the token and the change time step of the dynamic factor have been set.
  • the calculation start time of the dynamic factor set at the factory is 0:00:00 on January 1, 2010, and the dynamic factor change time step is 60 seconds.
  • the dynamic factor is calculated as: (current extracted time value - calculation start time) / dynamic factor change time step;
  • the dynamic password token obtains a dynamic password according to the calculated dynamic factor and displays the output;
  • the dynamic password token calculates the dynamic password and displays the output according to the calculated dynamic factor and the pre-stored static factor, according to the pre-stored dynamic password generation algorithm;
  • the above embodiment implements the correction of the time deviation of the crystal oscillator caused by the temperature drift by the application of the dynamic password token, and the correction method can realize the correction precision of the temperature drift by modifying the corresponding application program without increasing the accuracy.
  • the hardware chip is flexible, simple, and easy to implement product upgrade, and effectively improves the time error of the dynamic password token due to temperature drift in high and low temperature environments.
  • a digital time precision adjustment circuit may be integrated in the RTC, and the dynamic password token writes the obtained frequency stability At to the adjustment circuit register of the time precision adjustment circuit.
  • the adjustment circuit register can realize the correction of the time deviation due to the temperature drift according to the written frequency stability At.
  • step 206'
  • the dynamic password token writes the frequency stability At to the RTC, and the RTC corrects the current time value according to the written frequency stability At;
  • the RTC internally integrates a digital time precision adjustment circuit that writes the time offset ⁇ into the adjustment circuit register, which effectively adjusts the accuracy of the clock timing according to the time offset At.
  • the digital time adjustment circuit changes the clock count value of the clock pulse in the current 1 second according to the written frequency stability at the 20th second every 1 minute, thereby achieving the clock travel time adjustment;
  • the dynamic password token uses other crystals (such as a 32 kHz crystal)
  • the dynamic password token only needs to store the crystal oscillator frequency of the corresponding crystal oscillator at different temperatures, and the specific implementation manner can be described above. .
  • Example 3
  • the embodiment of the present invention provides a method for correcting the dynamic password token temperature drift.
  • the dynamic password token provided by the embodiment of the present invention internally stores an eigenvalue of a crystal oscillator of 32.768 KHz at different temperatures. , that is, the time deviation (as shown in Table 3), wherein the data in Table 3 is obtained through trial and error. Further, in order to improve the test accuracy, a more intensive test temperature can be selected during the test. Test the crystal oscillator frequency of the crystal oscillator.
  • time deviation specifically refers to the time deviation of the dynamic password token during the timing period when the timer timing time expires. 32. Crystal frequency (unit s) of 786KHz crystal oscillator at different temperatures
  • the dynamic password token loading timer, the timer timing, that is, the first preset value may be set according to actual conditions.
  • the timer is set according to the timing time of 30 minutes;
  • the timer time of the timer is set to 10 minutes or less, if the temperature difference of the environment in which the dynamic password token is located is small, the timer time of the timer Set to a time of 1 hour or longer, which improves the dynamic password token temperature drift accuracy while reducing the power consumption of the dynamic password token, thereby increasing the lifetime of the dynamic password token.
  • the dynamic password token detects the temperature of the current environment when the time is up, records the detected temperature T, and then reloads the timer.
  • a dynamic thermistor is provided with a thermistor, and the dynamic password token detects the temperature of the environment in which the dynamic password token is currently located according to the thermistor.
  • the thermistor is connected in series with a high-precision resistor, wherein the high-precision resistor is connected to the power source and the ground, and the resistance value of the thermistor is changed according to the temperature of the environment in which the dynamic password token is located. Therefore, the voltage value at which the thermistor is connected to the high-precision resistor is also changed according to the temperature of the environment in which the dynamic password token is located.
  • the AD converter in the dynamic password token is connected to the thermistor.
  • the dynamic password token Connected to a high-precision resistor, when the timing time expires, the dynamic password token detects the temperature of the current environment, and the AD converter starts to convert the voltage value of the thermistor terminal into a digital signal, and then according to the heat.
  • the temperature coefficient of the sensitive resistor and the reference voltage of the AD converter calculate the temperature of the environment in which the dynamic password token is currently located;
  • the dynamic password token detects the temperature of the current environment when the timing time expires, for example, the detected temperature T is 22 degrees, and then reloads the timer, in the environment where the next dynamic password token is located. The temperature is detected at the timing.
  • the dynamic password token may determine whether to detect the temperature of the current environment by querying the flag bit.
  • the hardware circuit in the dynamic password token will change the flag bit, for example Change the flag bit from 0 to 1, and the dynamic password token queries the flag bit. For example, when the flag bit is 1, the dynamic password token detects the current location. The temperature of the environment.
  • the dynamic password token searches for a pre-stored data table according to the recorded temperature T, and determines whether the time deviation ⁇ corresponding to the temperature T can be found in the data table.
  • the dynamic password token searches for the pre-stored data table according to the recorded temperature, and obtains two temperatures T1 and ⁇ 2 in the data table that are close to the temperature;
  • the dynamic password token finds the time deviations ⁇ !, ⁇ 2 under the temperature ⁇ 1, ⁇ 2 according to the temperatures T1 and ⁇ 2, and calculates the crystal corresponding to the temperature according to ⁇ 1, ⁇ 2, ⁇ 1, ⁇ 2.
  • the calculation of the time deviation ⁇ corresponding to the crystal at temperature ⁇ is calculated according to ⁇ 1, ⁇ 2, ⁇ 1, ⁇ 2
  • the time deviation of the crystal at -20 degrees can be found in the data table to be -2800 ⁇ 8 .
  • the dynamic password token calculates a current accumulated time deviation T′ according to the time deviation ⁇ , and stores the calculated current accumulated time deviation T′ in a temporary cache of the dynamic password token;
  • the process of calculating the accumulated time offset T' is an accumulation calculation process, that is, the dynamic password token accumulates the current time deviation ⁇ and the time deviation calculated from the previous time arrival to obtain the current accumulated time. Deviation T'.
  • the calculated time offset ⁇ -22.8 * 10-6 seconds when the timing of this time, the calculated time offset ⁇ -22.8 * 10-6 seconds, and before, has two open timing of temperature detection, the time deviations calculated respectively 0 * 10-6 sec and -45 seconds, the current cumulative time deviation (-22.8 * 10-6 seconds) + (0 seconds) + (-45 * 10-6 seconds), and the currently accumulated time offset calculated T' is stored in the temporary cache as the base for the next calculation of the current accumulated time offset.
  • the dynamic password token determines whether the accumulated time offset T′ in the current cache is greater than, equal to, or less than a predetermined value.
  • the predetermined value is 1 second.
  • the dynamic password token corrects the current time of the token, and clears the current cache, that is, the current accumulated time offset is cleared, and returns to execution 302;
  • the dynamic password token adds the corrected time after adding the current time to 1 second, and clears the cache; 309.
  • the dynamic password token corrects the current time of the token, and saves the time value obtained by subtracting the current accumulated time T by 1 second into a temporary cache, so as to accumulate when the dynamic password token is timed again. Calculate the cardinality and return to execution 302.
  • the dynamic password token adds the corrected time after adding the current time to 1 second;
  • Both 308 and 309 add the corrected time to the current time of the dynamic password token for 1 second.
  • the reason is as follows: As can be seen from the data in Table 3, there is no time deviation when going out at room temperature (25 degrees). At other temperatures, there is a time error in the RTC crystal, and the error is slower than the standard time compared to the standard time. Therefore, only when the deviation Af/f (seconds) is added to 1 second, By adding ls to the current time of the dynamic password token, the purpose of the correction is achieved.
  • Trigger a dynamic password token extract a current corrected time value and a change time step of the dynamic factor, and calculate a dynamic factor according to the time value and the change time step;
  • the dynamic password token based on time synchronization authentication technology uses time as a dynamic factor, and uses a certain password generation algorithm to calculate the current time factor and static factor.
  • the dynamic factor generally takes 60 seconds or 30 seconds as the change time. Step size.
  • the calculation start time of the dynamic factor of the token and the change time step of the dynamic factor have been set. For example: The starting time for calculating the dynamic factor at the factory is 0:00:00 on January 1, 2010, and the time step of the dynamic factor is 60 seconds.
  • the dynamic factor is calculated as: (current extracted time value - calculation start time) / dynamic factor change time step;
  • the dynamic password token generates and displays a dynamic password according to the calculated dynamic factor.
  • the dynamic password token calculates a dynamic password and displays the output according to the calculated dynamic factor and the pre-stored static factor according to the pre-stored dynamic password generation algorithm.
  • the above embodiment implements the correction of the time deviation of the crystal oscillator caused by the temperature drift by the application of the dynamic password token, and the correction method can realize the correction precision of the temperature drift by modifying the corresponding application program without increasing the accuracy.
  • the hardware chip is flexible, simple, and easy to implement product upgrade, and effectively improves the time error of the dynamic password token due to temperature drift in high and low temperature environments.
  • a dynamic password token 400 includes a timer module 401, a detection module 402, a query module 403, a table storage module 404, a correction module 405, a trigger module 406, a generation module 407, and a display module 408;
  • the timer module 401 is configured to detect the temperature of the environment in which the dynamic password token 400 is currently located.
  • the timing of the timer module 401 can be set according to the actual situation. For example, the timer is set to every 10 Open in minutes or 1 hour. If the temperature difference of the dynamic password token is large, you can select a shorter timing to open. If the temperature difference of the environment where the dynamic password token is located is not very large, you can select a longer timing. Turn on time; this can improve the working efficiency of the dynamic password token while improving the accuracy of the calibration temperature drift.
  • the detecting module 402 is mainly configured to detect the temperature of the environment in which the dynamic password token 400 is currently located when the timer module 401 is timed, and touch the query module 403 to query the table storage module 404 according to the detected current ambient temperature. ;
  • the query module 403 is configured to search for the feature value of the current password temperature of the dynamic password token 400 in the table storage module 404 according to the temperature of the environment in which the dynamic password token 400 is detected by the detecting module 402;
  • the table storage module 404 stores the characteristic values of the RTC crystal at different temperatures
  • the characteristic values include the crystal frequency of the RTC crystal at different temperatures or the frequency stability of the RTC crystal at different temperatures or the time deviation at different temperatures.
  • the correction module 405 is configured to correct the current time of the dynamic password token 400 based on the feature values queried by the query module 403.
  • the triggering module 406 is configured to enable the generating module 407, specifically a trigger button, a button or a switch;
  • the generating module 407 is configured to generate a dynamic password according to the currently corrected time value, and specifically includes a dynamic factor generating unit and a dynamic password generating unit.
  • the dynamic factor generating unit is mainly configured to generate a dynamic factor according to the current time value obtained after the corrected correction module 406 is corrected;
  • the dynamic password generating unit is configured to generate a dynamic password according to the dynamic factor generated by the dynamic factor generating unit.
  • the display module 408 is configured to display or close the dynamic password generated by the display after the dynamic password is generated.
  • the query module 403 further includes:
  • the query unit is configured to search, in the table storage module, the corresponding feature value in the ambient temperature according to the detected current ambient temperature, and determine whether the feature value can be found;
  • a first calculating unit configured to calculate, according to the data in the table storage module and the detected temperature, the feature value in the ambient temperature when the determining result of the query unit is not possible.
  • the correction module 405 includes:
  • a second calculating unit configured to calculate a current accumulated time offset according to the eigenvalues found by the query module 403; when the eigenvalue is a crystal oscillator frequency of the RTC crystal at different temperatures, the second calculating module is further configured to calculate Crystal frequency deviation, and the operation of converting the crystal frequency deviation into a time deviation;
  • a determining unit configured to determine whether the value of the accumulated time offset calculated by the second calculating unit 405 is up to a predetermined value
  • a first correcting unit when the determining result of the determining unit is YES, correcting the current time of the dynamic password token 400 according to the predetermined value;
  • the correction module 405 further includes:
  • a conversion unit configured to convert the feature value obtained by querying by the query module 403 according to a predetermined manner to obtain an adjustment value
  • a second correction unit configured to change a clock count value of the clock pulse according to the adjustment value converted by the conversion unit, thereby The current time value is corrected.
  • the predetermined value is a preset one second

Description

校正动态口令令牌温漂的方法和动态口令令牌
技术领域
本发明属于信息安全领域,尤其涉及一种校正动态口令令牌温漂的方法和动态口令令牌。 背景技术
实时时钟 RTC ( Real-Time Clock ) 是一个由晶体控制精度的, 向主系统提供 BCD (Binary-Coded Decimal ) 码表示的时间和日期的器件, RTC 的基本功能是保持跟踪时间和 日期等信息, 晶体振荡器在固定频率中能够提供较高的精度, 大多数的 RTC采用 32. 768KHZ 的晶体, 晶体振荡器输出经过分频后会产生 1Hz 的基准来刷新时间和日期。 RTC的精度主要 取决于晶体振荡器的精度。
在以时间作为动态因子的动态口令令牌中, 对动态口令令牌的时间的漂移要求为每年不 得超过 2 分钟, 即要小于 5ppm, 而产生时间漂移的原因在于动态口令令牌内部的频率为 32. 768KHz 的时钟晶体, 该时钟晶体在温度变化时, 晶体的晶振频率将会呈现抛物线趋势的 变化, 而 23ppm的温漂大约每月会产生 1分钟的时钟误差或者更大的时钟误差, 因此, 需对 动态口令令牌由于温漂产生的时钟误差进行校正。 发明内容
本发明提供了一种校正动态口令令牌温漂的方法, 技术方案如下:
一种校正动态口令令牌温漂的方法, 其中, 所述动态口令令牌根据时间值及动态因子的 变化时间步长得到动态因子, 根据所述动态因子生成并显示动态口令, 所述方法包括:
动态口令令牌以第一预设时间为间隔来检测所述动态口令令牌当前所处环境的温度; 所述动态口令令牌根据所述检测到的温度查找数据表, 得到所述检查到的温度对应的特 征值;
所述动态口令令牌以第二预设时间为间隔, 根据所述特征值对所述动态口令令牌内的当 前时间值进行校正。
一种动态口令令牌, 所述动态口令令牌包括:
定时器模块, 用于在第一预设时间到时开启检测模块检测所述动态口令令牌当前所处环 境的温度;
检测模块, 用于在所述定时器模块计时达到所述第一预设时间时, 检测所述动态口令令 牌当前所处环境的温度, 并触发查询模块进行数据查询;
表存储模块, 用于存储实时时钟晶体在不同温度下的特征值;
查询模块, 用于根据所述检测模块检测到的所述动态口令令牌当前所处环境的温度在表 存储模块中查找所述检测到的温度对应的特征值;
校正模块, 用于根据所述特征值对所述动态口令令牌内的当前时间值进行校正; 触发模块, 用于触发生成模块生成动^口令; 生成模块, 用于被所述触发模块触动后, 提取所述动态口令令牌的当前时间值, 并根据 所述提取的时间值及动态因子的变化时间步长来生成动态口令;
显示模块, 用于显示或关闭显示所述生成模块生成的所述动态口令。
有益效果: 以固定的时间间隔来监控动态口令令牌所处环境的温度, 并根据晶体随温度 变化的特征值计算不同温度下的累计时间偏差, 在固定时间间隔内根据所述时间偏差对动态 口令令牌温漂进行校正后, 使得动态口令令牌在高、低温环境下的时钟偏差得到有效的改善, 改善效果明显。 附图说明
图 1是本发明实施例提供的 32. 768KHz晶体的温漂曲线图;
图 2是本发明实施例提供的一种校正动态口令令牌温漂的方法流程图;
图 3是本发明实施例提供的另一种校正动态口令令牌温漂的方法流程图;
图 4是本发明实施例提供的一种动态口令令牌;
图 5是 OTP设备 400的结构示意图。 具体实施方式
为使本发明的目的、 技术方案和优点更加清楚, 下面将结合附图对本发明实施方式作进 一步地详细描述: 实施例 1
本发明实施例提供了一种校正动态口令令牌温漂的方法, 需要说明的是: 本发明实施例 提供的动态口令令牌内部存储有 32. 768KHZ的晶体振荡器在不同温度下的特征值, 即晶振频 率(如表 1所示), 其中, 表 1中的数据是经过反复试验得出的, 进一步地, 为了提高试验精 度, 在进行试验的过程中, 可以选择更密集的试验温度来测试晶体振荡器的晶振频率。
表 1 : 32. 786KHz晶体振荡器在不同温度下的晶振频率 (单位 Hz )
-40° -35° -32. 8° -31. 5° -28° -25. 3° -20° -17°
32762. 2 32763 32763. 1 32763. 9 32764. 1 32764. 7 32765 32765. 7
-3° 0° 2° 9° 10° 14° 19° 20°
32766. 8 32767. 4 32767. 45 32767. 48 32767. 5 32767. 6 32767. 64 32767. 8
24° 25° 30° 30. 1 ° 31. 5° 33. 2° 35° 40°
32767. 95 32768 32767. 89 32797. 86 32767. 79 32767. 66 32737. 54 32767. 5
43° 44. 5° 47. 2° 50° 52. 3° 60° 65° 70°
32767. 42 32767. 3 32767. 25 32766. 16 32766. 08 32766. 32765. 5 32765
72° 72. 8° 74° 76. 3° 76. 9° 78° 78. 9° 80°
32764. 8 32764. 5 32784. 2 32764. 1—5 32764. 04 32764. 5 32764. 66 32763. 7 为了更直观的体现晶体振荡器的晶振频率随温度的变化趋势, 我们将表 1中的数据以曲 线图的形式展示(如图 1所示), 从图 1中可以清楚的看到晶体振荡器的晶振频率会受到温度 变化的极大影响, 因此动态口令令牌在提交客户使用时, 必须要对动态口令令牌的温漂进行 校正, 具体的校正方式如下:
101、 动态口令令牌装载定时器, 定时器的定时时间即第一预设时间, 可以根据实际情况 进行设定, 本实施例中按照定时时间为 1小时来设置定时器;
具体地, 如果动态口令令牌所处环境的温差较大, 定时器的定时时间设置为 10分钟或者 更短的定时时间, 如果动态口令令牌所处的环境温差较小, 定时器的定时时间设置为 1小时 或者更长的定时时间, 这样在提高校正动态口令令牌温漂精度的同时又降低了动态口令令牌 的功耗, 从而提高动态口令令牌的使用寿命。
102、 动态口令令牌在定时时间到时, 检测当前所处环境的温度, 并将检测到的温度 T记 录下来, 然后, 重新装载定时器;
具体地, 动态口令令牌内设置有热敏电阻, 动态口令令牌根据该热敏电阻来检测动态口 令令牌当前所处环境的温度。 具体为: 该热敏电阻串接一个高精度的电阻, 其中, 该高精度 的电阻与电源和地相连, 热敏电阻的阻值是根据动态口令令牌所处环境的温度的变化而变化 的, 因此, 热敏电阻与高精度电阻相连接处的电压值也是根据动态口令令牌所处环境的温度 的变化而变化的, 另外, 动态口令令牌内的 AD转换器是连接在热敏电阻与高精度电阻相连接 处的, 当定时时间到, 动态口令令牌检测当前所处环境的温度时启动 AD转换器, 该 AD转换 器把热敏电阻端的电压值转换为数字信号,然后根据热敏电阻的温度系数和 AD转换器的基准 电压计算出动态口令令牌当前所处环境的温度;
本实施例中, 动态口令令牌在定时时间到时, 检测当前所处环境的温度, 例如检测到的 温度 T为 22度, 之后, 重新装载定时器, 对下一次动态口令令牌所处环境温度的检测进行定 时。
进一步地, 动态口令令牌可以通过查询标志位的方式来确定是否要检测当前所处环境的 温度, 定时时间到时, 动态口令令牌内的硬件电路将改变所述标志位, 例如将标志位由 0改 为 1, 动态口令令牌查询所述标志位, 例如, 当标志位为 1 时, 动态口令令牌检测当前所处 环境的温度。
103、动态口令令牌根据记录的温度 T查找预先存储的数据表, 并判断是否能够在该数据 表中查找得到温度 T所对应的晶振频率 f,
如果能查到, 执行 106;
如果不能查到, 执行 104;
104、动态口令令牌根据记录的温度 T查找预先存储的数据表得到该数据表中与温度 T接 近的两个温度 T1和 T2;
本实施例中,根据表 1中所存储的数据可以知道,与 T=22度最为接近的两个温度是 Tl=20 度, Τ2=24度。
105、动态口令令牌根据温度 T1和 Τ2 ^数据表中查找得到温度 Tl、 Τ2下的晶振频率 fl、 ΐ2, 并根据 Tl、 T2、 fl、 f2计算晶体在温度 Τ下所对应的晶振频率 f;
具体地, 根据 Tl、 T2、 fl、 f2计算晶体在温度 T下所对应的晶振频率 f 的计算方式是:
T-T1 _ /-/1
T2-T1 _ /2-/1, 本实施例中, 根据查表 1可以得到 T1 、 T2对应的晶振频率 fl和 f2, 分别记为 a= (Tl, fl) = (20度, 32767.5Hz) 和 b= (T2, f2) = (24度, 32767.95Hz) 及 T=22度,将该组数据 代入上述公式得到 f 为: 32767.95Hz;
本实施例中, 如果在 102中检测到的温度 T=-20度, 则在数据表中就可以查找到晶体在 -20度下的晶振频率为 32765Ηζ。
106、 动态口令令牌计算晶体在温度 Τ下的时间偏差 ΔΤ;
具体地, 动态口令令牌计算温度 Τ下晶体振荡器的晶振频率偏差 Af, 并将计算得到的晶 振频率偏差 Af转换为时间偏差 Δΐ, 需要说明的是, 计算得到的时间偏差 At是当前 1秒内 的时间偏差, 而温度 T下的时间偏差 ΔΤ还包括定时时间内的时间偏差, 所以, 温度 T下的 时间偏差 ΔΤ为当前 1秒内的时间偏差 Δΐ乘以定时时间再加上当前 1秒内的时间偏差,并将 计算得到的温度 Τ下的时间偏差 ΔΤ存储在动态口令令牌的临时缓存中;
具体地, Δΐ、 Δΐ的计算方式为:
△f=f-标准晶振频率;
△t = Af/f (秒);
其中, 标准晶振频率为常温 (25度) 下的晶体振荡器的晶振频率, 本实施例中, 由于采 用的是 32.768KHz的晶体振荡器, 则标准晶振频率为 32.768KHz。
本实施中, At=f_标准晶振频率 = 32767.95-32768 = _L 5*1Q- 6秒;
f 32767.95
贝 |J, 温度 T下的时间偏差 ΔΤ=-1.5*10—6 *3601秒, 即温度 Τ下当前时间值和标准时间值 相比较慢了 1.5*10—6 *3601秒。
107、 动态口令令牌根据计算得到的时间偏差 ΔΤ计算当前累计时间偏差 T' , 并将计算 得到的当前累计时间偏差 T' 存储在动态口令令牌的临时缓存中;
本实施例中, 计算当前累计时间偏差 T' 的过程是一个累加计算的过程, 将当前得到的 时间偏差 ΔΤ 与之前定时时间到时计算得到的时间偏差进行累加就得到当前累计时间偏差 T' 。
具体地, 本次定时时间到时, 计算得到的时间偏差 ΔΤ为 -1.5*10— 6 *3601秒, 在此之前, 已有两次开启定时, 进行了温度的检测, 计算得到的时间偏差分别为 -0.75*10— 6 *3600 秒和 -1· 15*10—6 *3600 秒, 则当前累计时间偏差为 (-0.75*10—6 *3601 秒) + (-1· 15*10— 6 *3601 秒) + (-1.5*10—6 *3601秒), 并将计算得到的当前累计时间偏差 T' 存储在临时缓存中, 作 为下次计算当前累计时间偏差的基数。
108、 动态口令令牌判断当前缓存中的累计时间偏差 T' 是大于、 等于还是小于预定值, 本实施例中预定值为 1秒,
如果是等于 1秒, 执行 109;
如果是大于 1秒, 则执行 110;
如果是小于 1秒, 则返回执行 102;
109、 动态口令令牌对令牌的当前时间进行校正, 并清空当前缓存, 即将当前累计时间偏 差清零, 返回执行 102;
具体地, 动态口令令牌将当前时间加上 1秒后得到校正后的时间, 并清空缓存;
110、 动态口令令牌对令牌的当前时间进行校正, 并将当前累计时间偏差 T ' 减去 1秒后 得到的时间值保存至临时缓存中, 作为下次进行累加计算的基数, 返回执行 102。
具体地, 动态口令令牌将当前时间加上 1秒后得到校正后的时间;
109和 110中均对动态口令令牌的当前时间加上 1秒得到校正后的时间, 原因如下: 由 温漂曲线图 (图 1 ) 可以直观的看出, 晶体的晶振频率在 25度时最大, 而其他温度下, 晶体 的晶振频率都会变慢, 也就是说晶体的实际频率是小于等于标准晶振频率的, 在与标准晶振 频率相比, 时钟晶体在 1秒的时间里比标准震荡次数(32768)要少, 偏差是 Af, 则时钟晶 体的实际震荡时间与标准的震荡时间的偏差是 Af/f (秒),即时钟晶体的实际震荡时间比标准 的震荡时间慢了 Af/f (秒), 因此, 只需当偏差 Af/f (秒)累加到 1秒的时候, 对动态口令令 牌的当前时间加上 ls, 便达到了校正的目的。
111、 触发动态口令令牌, 提取当前经过校正的时间值及动态因子的变化时间步长, 并根 据所述时间值及变化时间步长计算得到动态因子;
需要说明的是: 基于时间同步认证技术的动态口令令牌是把时间作为动态因子, 采用一 定的口令生成算法对当前时间因子和静态因子进行计算, 动态因子一般以 60秒或 30秒作为 变化时间步长。 在每个动态令牌出厂时, 就已经设定好了该令牌的动态因子的计算起始时间 和动态因子的变化时间步长。例如: 出厂时设定动态因子的计算起始时间为 2010年 1月 1日 0时 0分 0秒, 动态因子的变化时间步长为 60秒。
动态因子的计算方式为:(当前提取的时间值-计算起始时间) /动态因子的变化时间步长;
112、 动态口令令牌根据计算得到的动态因子生成并显示动态口令;
具体地, 动态口令令牌根据计算得到的动态因子、 预先存储的静态因子, 根据预存的动 态口令生成算法计算得到动态口令并显示输出。
上述实施例是由动态口令令牌的应用程序来实现对由于温漂而引起的晶体振荡器的时间 偏差的校正, 该校正方法可以通过修改相应的应用程序来实现温漂的校正精度, 无需增加硬 件芯片, 实现方式灵活、 简单、 易于实现产品的升级, 并有效的改善了动态口令令牌在高低 温环境下由于温漂而弓 I起的时间误差。
在实际应用中, 除了上述实现方式外, 还可以在 RTC内部集成一个数字化的时间精度调 整电路, 动态口令令牌将计算得出的晶振频率偏差 Af 写入到该时间精度调整电路的调整电 路寄存器中, 该调整电路寄存器便可以根据该写入的晶振频率偏差 来实现由于温漂而引 起的时间偏差的校正。 按照上述所述, 上述步骤中的 106至 110由步骤 106 ' 替换:
106 ' 、 动态口令令牌将温度 T下的晶振频率 f写入到 RTC内部, RTC根据写入的晶振频 率 f对当前的时间值进行校正;
具体地, RTC 内集成有数字化的时间精度调整电路, 该调整电路将写入的晶振频率 f 转 换为调整值, 并根据该调整值进行时钟走时的调整, 具体的表现为改变 1秒内的脉冲计数; 将写入的晶振频率 f转换为调整值具体的转换方式为:
当晶振频率等于标准晶振频率时, 是不需要改变 1秒内的计数脉冲的, 调整值为 0、 +1、 -64、 -63或者为缺省值。
当晶振频率小于标准晶振频率时, 要减少 1秒内的计数脉冲; 调整值 =晶振频 f - ^ ^振频率 = (晶振频率 f-标准晶振频率) *20 ;
晶振频率 / * 2
标准晶振频率 * 20
由图 1可以看出, 在高低温环境下, 晶体振荡器的晶振频率是小于等于标准晶振频率的, 所以本实施例中不再考虑晶振频率大于标准晶振频率的情况。
具体地,数字时间调整电路根据调整值在每分钟内的第 20秒时改变当前 1秒内的时钟脉 冲的计数值, 从而达到时钟走时调整;
上述方法是通过动态口令令牌内部的集成高精度的数字时间精度调整电路来实现对动态 口令令牌温漂的校正, 实现方式简单、 校正精度比较高; 可以有效的改善动态口令令牌在高 低温环境中由于温漂而弓 I起的时间误差。
本实施例中, 如果动态口令令牌采用其他晶体(如 32KHz的晶体), 则动态口令令牌内部 只需存储相应晶体振荡器在不同温度下的晶振频率, 具体的实现方式采用上述说明即可。
另外需要说明的是, 实时时钟电路 RTC通过秒计数确定时间和日期, 当前时间和日期保 存在一组寄存器中, 32. 768KHZ 的晶体振荡器经过分频后会产生 1Hz 的基准来刷新时间和日 期, 秒计数的话计时精度为 1秒, 这样就会有很大的误差, 所以本实施例中还可以使用一种 改进的计数方式来确定时间和日期, 即采用秒浮点计数的方式来实现由于温漂而产生的时间 误差的校正, 其中, 浮点精度为 10— 6; 则 107至 110就可以由以下过程来替换: 将计算得到 的时间偏差 ΔΤ 写入到电路寄存器中, 该电路寄存器是浮点寄存器, 在电路寄存器中浮点精 度的位置上会根据每次写入的时间偏差进行累加计算, 当累加计算得到的数值满一则自动进 位, 这样就改变了当前的 RTC时钟计数, 从而校正了由于温漂而产生的时钟误差。
现举例来说明秒浮点计数法来校正由于温漂而产生的时钟误差, 如: 第一次定时时间到 时, 将计算得到的计时偏差 1. 5*10— 6写入到寄存器中, 第二次定时时间到时, 将计算得到的 计时偏差 1. 54*10— 6写入到寄存器中, 第三次定时时间到时, 将计算得到的时间偏差 2. 0*10_6 写入到寄存器中,……,则寄存器浮点精度位置上的数值变化为 1. 5*10—6, 1. 5*10—6+1. 54*10—6
1. 5*10— 6+1. 54*10— 6+2. 0*10— 6, 1. 5*10— 6+1. 54*10— 6+2. 0*10— 6+ , , 当浮点精度位置上数 值大于等于 1时, 将会向秒的位置上自动进 1, 例如浮点位置上的数值为 100005*10— 6时, 当 前 RTC计数值会自动加 1, 而此时浮点精度位置上的数值为 0. 5*10— 6, 当下次定时开始, 写入 的时间偏差为 3. 6*10—6, 浮点精度位置上的数值变为 0. 5*10—6+3. 6*10—6, 按照上述方式进行变 化。 实施例 2
本发明实施例提供了另一种校正动态口令令牌温漂的方法, 需要说明的是: 本发明实施 例提供的动态口令令牌内部存储有 32. 768KHz晶体在不同温度下的特征值,即频率稳定度(如 表 2所示),其中,表 2中的数据是经过反复试验计算得出的,进一步地, 为了提高试验精度, 在进行试验的过程中, 可以选择更密集的试验温度来测试晶体的时间偏差。
其中, 频率稳定度是指在晶体振荡器的工作温度范围内晶振频率随着温度变化的大小, 一般用 ppm来表示, 其中, lppm=l*10— 6秒。
具体地, lppm指温度每变化一度, 晶体的晶振频率变化百万分之一, 就是说频率的误差 = (1/1*106) *振荡器的标称频率 ;
32. 786KHZ晶体在不同温度下的频率稳定度 (单位: ppm)
Figure imgf000009_0001
为了更直观的体现晶体的晶振频率随温度的变化趋势, 我们将表 2中的数据以曲线图的 形式展示(如图 1所示), 从图 1中可以清楚的看到晶体的晶振频率会受到温度变化的极大影 响, 因此动态口令令牌在提交客户使用时, 必须要对动态口令令牌的温漂进行校正, 具体的 校正方式如下:
201、 动态口令令牌装载定时器, 定时器的定时时间即第一预设时间, 可以根据实际情况 进行设定, 本实施例中按照定时时间为 30分钟来设置定时器;
具体地, 如果动态口令令牌所处环境的温差较大, 定时器的定时时间设置为 10分钟或者 更短的定时时间, 如果动态口令令牌所处的环境温差较小, 定时器的定时时间设置为 1小时 或者更长的定时时间, 这样在提高校正温漂精度的同时又降低了动态口令令牌的功耗, 从而 提高动态口令令牌的使用寿命。
202、 动态口令令牌在定时时间到时, 检测当前所处环境的温度, 并将检测到的温度 T记 录下来, 然后, 重新装载定时器;
需要说明的是, 动态口令令牌内设置有热敏电阻, 动态口令令牌根据该热敏电阻来检测 动态口令令牌所处环境的温度。 具体为: 该热敏电阻串接一个高精度的电阻, 该高精度的电 阻与电源和地相连, 热敏电阻的阻值是根据动态口令令牌所处环境的温度的变化而变化的, 因此,热敏电阻 与高精度电阻相连接处的电压值也是根据动态口令令牌所处环境的温度的变 化而变化的,另外,动态口令令牌内的 AD转换器是连接在热敏电阻与高精度电阻相连接处的, 当定时时间到, 动态口令令牌检测当前所处环境的温度时, 动态口令令牌启动 AD转换器, 把 热敏电阻端的电压值转换为数字信号, 然后根据热敏电阻的温度系数和 AD的基准电压, 计算 出当前环境的温度;
本实施例中, 动态口令令牌在定时时间到时, 检测当前所处环境的温度, 例如检测到的 温度 T为 32度, 之后, 重新装载定时器, 对下一次动态口令令牌所处环境温度的检测进行定 时;
进一步地, 动态口令令牌可以通过查询标志位的方式来确定是否要检测当前所处环境的 温度, 定时时间到时, 动态口令令牌内的硬件电路将改变所述标志位, 例如将标志位由 0改 为 1, 动态口令令牌查询所述标志位, 例如, 当标志位为 1 时, 动态口令令牌检测当前所处 环境的温度。
203、动态口令令牌根据记录的温度 T查找预先存储的数据表, 并判断是否能够在该数据 表中查找到温度 T下的频率稳定度 At,
如果能查到, 将查找得到的频率稳定度 At 保存在动态口令令牌内部的缓存中并执行
206;
如果不能查到, 执行 204;
204、 动态口令令牌根据记录的温度 T查找数据表中与温度 T接近的两个温度 T1和 T2; 本实施例中,根据表 2存储的数据可以知道,与 32度最为接近的两个温度是 Tl=31. 5度,
Τ2=33. 2度;
205、动态口令令牌根据查找得到的温度 T1和 Τ2得到频率 Tl、 Τ2下的频率稳定度 At l、 Δΐ2, 并根据 Τ1、 Τ2、 Δΐ Κ Δΐ2计算晶体在温度 Τ下所对应的频率稳定度 At;
根据 Τ1、 Τ2、 Δΐ 1、 Δΐ2计算晶体在温度 Τ下所对应的频率稳定度 At的具体计算方式 是 T - Tl _ Ar - Arl
疋' T2 - T1 ~ Δί2 - Δί1
本实施例中, 查找数据表 2可以得到 T1对应的频率稳定度 Δΐΐ和 Τ2对应的频率稳定度 Δΐ2, 记为 a= ( Τ1, Δΐ ΐ ) = ( 31. 5° , -2. 15ppm)和 b= ( Τ2, Δΐ2 ) = ( 33. 2° , -3. 65ppm) 及 Τ=32° ,将该组数据代入上述公式得到 At为: -1. 52ppm;
如果 202中检测到的温度 T=-20度, 则在数据表中就可以查找到晶体在 -20度下的时间 偏差为 _95ppm。 206、 动态口令令牌计算温度 T下的时间偏差 ΔΤ;
具体地, 动态口令令牌根据频率稳定度 At计算温度 Τ下的时间偏差 ΔΤ, 具体计算方式 如下: 将频率稳定度按照百万分之一秒转换为时间值, 该时间值是当前 1秒内的时间偏差, 而当前时间偏差还包括定时时间内的时间偏差, 所以温度 Τ下的时间偏差 ΔΤ为所述时间值 乘以定时时间再加上当前 1秒内的时间偏差, 并将计算得到的时间偏差 ΔΤ存储至临时缓存; 本实施例中, 温度 Τ下的时间偏差 ΔΤ=-1. 52*10—6*1801秒。
207、 动态口令令牌计算当前累计时间偏差 T ' ;
本实施例中, 计算当前累计时间偏差 T ' 的过程是一个累加计算的过程, 即动态口令令 牌将当前得到的时间偏差 ΔΤ 与之前定时时间到时计算得到的时间偏差进行累加就得到当前 累计时间偏差 T ' 。
具体地, 本次定时时间到时, 计算得到的时间偏差 ΔΤ为 -1. 52*10— 6 *1801秒, 而在此之 前, 已有两次开启定时进行了温度的检测, 计算得到的时间偏差分别为 -0. 75*10— 6 *1801 秒 和 -1. 15*10—6 *1801秒, 则当前累计时间偏差为 (-0. 75*10—6 *1801秒) + ( - 1· 15*10— 6 *1801 秒) + ( -1. 5*10—6 *1801秒), 并将计算得到的当前累计时间偏差 T ' 存储在临时缓存中, 作 为下次计算当前累计时间偏差的基数。
208、 动态口令令牌判断当前缓存中的累计时间偏差是大于、 等于还是小于预定值, 本实 例中预定值为 1秒,
如果是等于 1秒, 执行 209;
如果是大于 1秒, 则执行 210;
如果是小于 1秒, 则返回执行 202;
209、 动态口令令牌对令牌的当前时间进行校正, 并清空当前缓存, 即将当前累计时间偏 差清零, 返回执行 202;
具体地, 动态口令令牌将当前时间加上 1秒得到校正后的时间, 并清空缓存中的时间偏 差;
210、 动态口令令牌对令牌的当前时间进行校正, 保存的当前累计时间偏差 T ' 减去 1秒 后得到的时间值至临时缓存中, 以便在下次定时时间到作为累加计算的基数, 返回执行 202。
具体地, 动态口令令牌将当前时间加上 1秒后得到校正后的时间;
209和 210中均对动态口令令牌的当前时间加上 1秒得到校正后的时间, 原因如下: 由 温漂曲线图 (图 1 ) 可以直观的看出, 晶体的频率稳定度在 25度时为 0, 即晶振频率不存在 偏差, 而其他温度下, 晶体的频率稳定度都会出现不同程度的变化, 且数值都是负的, 说明, 晶体振荡器在当前 1 秒内, 与标准时间值相比要慢, 偏差是 Δΐ*10— 6秒,因此, 只需当偏差 Δΐ*10— 6秒累加到 1秒的时候, 对动态口令令牌的当前时间加上 ls, 便达到了校正的目的。
211、 触发动态令牌, 提出当前经过校正的时间值及动态因子的变化时间步长, 并根据所 述时间值及变化时间步长计算得到动态因子;
需要说明的是: 基于时间同步认证技术的动态口令令牌是把时间作为动态因子, 采用一 定的口令生成算法对当前时间因子和静态 子进行计算, 动态因子一般以 60秒或 30秒作为 变化时间步长。 在每个动态令牌出厂时, 就已经设定好了该令牌的动态因子的计算起始时间 和动态因子的变化时间步长。例如: 出厂时设定动态因子的计算起始时间为 2010年 1月 1日 0时 0分 0秒, 动态因子的变化时间步长为 60秒。
动态因子的计算方式为:(当前提取的时间值-计算起始时间) /动态因子的变化时间步长;
212、 动态口令令牌根据计算得到的动态因子得到动态口令并显示输出;
具体地, 动态口令令牌根据计算得到的动态因子及预先存储的静态因子, 并根据预先存 储的动态口令生成算法, 计算得到动态口令并显示输出;
上述实施例是由动态口令令牌的应用程序来实现对由于温漂而引起的晶体振荡器的时间 偏差的校正, 该校正方法可以通过修改相应的应用程序来实现温漂的校正精度, 无需增加硬 件芯片, 实现方式灵活、 简单、 易于实现产品的升级, 并有效的改善了动态口令令牌在高低 温环境下由于温漂而弓 I起的时间误差。
在实际应用中, 除了上述实现方式外, 还可以在 RTC内部集成一个数字化的时间精度调 整电路, 动态口令令牌将查找得到的频率稳定度 At 写入到该时间精度调整电路的调整电路 寄存器中, 该调整电路寄存器便可以根据该写入的频率稳定度 At 来实现由于温漂而引起的 时间偏差的校正。
按照上述所述, 上述步骤中的 206至 210由步骤 206 ' 替换:
206 ' 、动态口令令牌将频率稳定度 At写入到 RTC内部, RTC根据写入的频率稳定度 At 对当前的时间值进行校正;
具体地, RTC 内部集成了数字化的时间精度调整电路, 该时间精度调整电路将时间偏差 Δΐ写入到调整电路寄存器中,该调整电路寄存器根据时间偏差 At来有效的调整时钟计时的 精度。
具体地, 数字时间调整电路根据写入的频率稳定度在每 1分钟内的第 20秒时改变当前 1 秒内的时钟脉冲的时钟计数值, 从而达到时钟走时调整;
本实施例中, 如果动态口令令牌采用其他晶体(如 32KHz的晶体), 则动态口令令牌内部 只需存储相应晶体振荡器在不同温度下的晶振频率, 具体的实现方式采用上述说明即可。 实施例 3
本发明实施例提供了一种校正动态口令令牌温漂的方法, 需要说明的是: 本发明实施例 提供的动态口令令牌内部存储有 32. 768KHZ的晶体振荡器在不同温度下的特征值, 即时间偏 差 (如表 3所示), 其中, 表 3中的数据是经过反复试验得出的, 进一步地, 为了提高试验精 度, 在进行试验的过程中, 可以选择更密集的试验温度来测试晶体振荡器的晶振频率。
需要说明的是, 时间偏差具体是指, 在定时器定时时间到时, 动态口令令牌的在定时期 间内的时间偏差。 32. 786KHz晶体振荡器在不同温度下的晶振频率 (单位 s )
Figure imgf000013_0001
301、 动态口令令牌装载定时器, 定时器的定时时间, 即第一预设值可以根据实际情况进 行设定, 本实施例中按照定时时间为 30分钟来设置定时器;
具体地, 如果动态口令令牌所处环境的温差较大, 定时器的定时时间设置为 10分钟或者 更短的定时时间, 如果动态口令令牌所处的环境温差较小, 定时器的定时时间设置为 1小时 或者更长的定时时间, 这样在提高校正动态口令令牌温漂精度的同时又降低了动态口令令牌 的功耗, 从而提高动态口令令牌的使用寿命。
302、 动态口令令牌在定时时间到时, 检测当前所处环境的温度, 并将检测到的温度 T记 录下来, 然后, 重新装载定时器;
具体地, 动态口令令牌内设置有热敏电阻, 动态口令令牌根据该热敏电阻来检测动态口 令令牌当前所处环境的温度。 具体为: 该热敏电阻串接一个高精度的电阻, 其中, 该高精度 的电阻与电源和地相连, 热敏电阻的阻值是根据动态口令令牌所处环境的温度的变化而变化 的, 因此, 热敏电阻与高精度电阻相连接处的电压值也是根据动态口令令牌所处环境的温度 的变化而变化的, 另外, 动态口令令牌内的 AD转换器是连接在热敏电阻与高精度电阻相连接 处的, 当定时时间到, 动态口令令牌检测当前所处环境的温度时启动 AD转换器, 该 AD转换 器把热敏电阻端的电压值转换为数字信号,然后根据热敏电阻的温度系数和 AD转换器的基准 电压计算出动态口令令牌当前所处环境的温度;
本实施例中, 动态口令令牌在定时时间到时, 检测当前所处环境的温度, 例如检测到的 温度 T为 22度, 之后, 重新装载定时器, 对下一次动态口令令牌所处环境温度的检测进行定 时。
进一步地, 动态口令令牌可以通过查询标志位的方式来确定是否要检测当前所处环境的 温度, 第一预设时间到时, 动态口令令牌内的硬件电路将改变所述标志位, 例如将标志位由 0改为 1, 动态口令令牌查询所述标志位, 例如, 当标志位为 1时, 动态口令令牌检测当前所 处环境的温度。
303、动态口令令牌根据记录的温度 T查找预先存储的数据表, 并判断是否能够在该数据 表中查找得到温度 T所对应的时间偏差 ΔΤ,
如果能查到, 执行 306;
如果不能查到, 执行 304;
304、动态口令令牌根据记录的温度 Τ查找预先存储的数据表得到该数据表中与温度 Τ接 近的两个温度 T1和 Τ2;
本实施例中,根据表 1中所存储的数据可以知道,与 Τ=22度最为接近的两个温度是 Tl=20 度, Τ2=24度。
305、动态口令令牌根据温度 T1和 Τ2在数据表中查找得到温度 Τ1、Τ2下的时间偏差△!!、 ΔΤ2, 并根据 Τ1、 Τ2、 ΔΤ 1、 ΔΤ 2计算晶体在温度 Τ下所对应的时间偏差 ΔΤ;
具体地, 根据 Τ1、 Τ2、 ΔΤ 1、 ΔΤ 2计算晶体在温度 Τ下所对应的时间偏差 ΔΤ的计算
, . B T-T1 ΔΤ-ΔΤ1
万式是: = ;
T2-T1 ΔΤ2 - ΔΤ1
本实施例中, 根据查表可以得到 T1 、 Τ2对应的晶振频率 ΔΤ 1和 ΔΤ 2, 分别记为 a= (Τ1, ΔΤ 1) = (20度, -45μδ) 和 = (Τ2, ΔΤ 2) = (24度, -22.8μδ) 及 Τ=22度,将该 组数据代入上述公式得到 ΔΤ为: -22.8μ8;
本实施例中, 如果在 302中检测到的温度 Τ=-20度, 则在数据表中就可以查找到晶体在 -20度下的时间偏差为 -2850μ8
306、 动态口令令牌根据时间偏差 ΔΤ计算当前累计时间偏差 T' , 并将计算得到的当前 累计时间偏差 T' 存储在动态口令令牌的临时缓存中;
本实施例中, 计算累计时间偏差 T' 的过程是一个累加计算的过程, 即动态口令令牌将 当前得到的时间偏差 ΔΤ 与之前当时时间到时计算得到的时间偏差进行累加就得到当前累计 时间偏差 T' 。
具体地, 本次定时时间到时, 计算得到的时间偏差 ΔΤ为 -22.8*10— 6秒, 而在此之前, 已 有两次开启定时进行了温度的检测,计算得到的时间偏差分别为 0秒和 -45*10— 6秒,则当前累 计时间偏差为 (-22.8*10— 6秒) + (0秒) + (-45*10— 6秒), 并将计算得到的当前累计时间偏差 T' 存储在临时缓存中, 作为下次计算当前累计时间偏差的基数。
307、 动态口令令牌判断当前缓存中的累计时间偏差 T' 是大于、 等于还是小于预定值, 本实施例中预定值为 1秒,
如果是等于 1秒, 执行 308;
如果是大于 1秒, 则执行 309;
如果是小于 1秒, 则返回执行 302;
308、 动态口令令牌对令牌的当前时间进行校正, 并清空当前缓存, 即将当前累计时间偏 差清零, 返回执行 302;
具体地, 动态口令令牌将当前时间加上 1秒后得到校正后的时间, 并清空缓存中; 309、动态口令令牌对令牌的当前时间进行校正, 并将当前累计时间 T减去 1秒后得到的 时间值保存至临时缓存中, 以便在动态口令令牌再次定时时间到时, 作为累加计算的基数, 返回执行 302。
具体地, 动态口令令牌将当前时间加上 1秒后得到校正后的时间;
308和 309中均对动态口令令牌的当前时间加上 1秒得到校正后的时间, 原因如下: 由 表 3中的数据可以看出, 出去再室温 ( 25度) 的情况下是没有时间偏差的, 在其他温度下, RTC 晶体都存在时间误差, 且误差与标准时间相比均是要慢于标准时间值的, 因此, 只需当 偏差 Af/f (秒)累加到 1秒的时候, 对动态口令令牌的当前时间加上 ls, 便达到了校正的目 的。
310、 触发动态口令令牌, 提取当前经过校正的时间值及动态因子的变化时间步长, 并根 据所述时间值及变化时间步长计算得到动态因子;
需要说明的是: 基于时间同步认证技术的动态口令令牌是把时间作为动态因子, 采用一 定的口令生成算法对当前时间因子和静态因子进行计算, 动态因子一般以 60秒或 30秒作为 变化时间步长。 在每个动态令牌出厂时, 就已经设定好了该令牌的动态因子的计算起始时间 和动态因子的变化时间步长。例如: 出厂时设定动态因子的计算起始时间为 2010年 1月 1日 0时 0分 0秒, 动态因子的变化时间步长为 60秒。
动态因子的计算方式为:(当前提取的时间值-计算起始时间) /动态因子的变化时间步长;
311、 动态口令令牌根据计算得到的动态因子生成并显示动态口令;
具体地, 动态口令令牌根据计算得到的动态因子、 预先存储的静态因子, 根据预存的动 态口令生成算法计算得到动态口令并显示输出。
上述实施例是由动态口令令牌的应用程序来实现对由于温漂而引起的晶体振荡器的时间 偏差的校正, 该校正方法可以通过修改相应的应用程序来实现温漂的校正精度, 无需增加硬 件芯片, 实现方式灵活、 简单、 易于实现产品的升级, 并有效的改善了动态口令令牌在高低 温环境下由于温漂而弓 I起的时间误差。 实施例 4
一种动态口令令牌 400, 该动态口令令牌包括定时器模块 401、 检测模块 402、 查询模块 403、 表存储模块 404、 校正模块 405、 触发模块 406、 生成模块 407、 显示模块 408;
定时器模块 401用于定时开启检测模块 402检测动态口令令牌 400当前所处环境的温度; 本实施例中定时器模块 401的定时开启时间可以根据实际情况进行设置, 例如定时器设 置为每 10分钟或 1个小时开启一次, 如果动态口令令牌所处环境的温差较大, 可以选择较短 的定时开启时间, 如果动态口令令牌所处环境的温差不是很大, 可以选择较长的定时开启时 间; 这样可以在提高校正温漂精度的同时提高动态口令令牌的工作效率。
检测模块 402主要用于在定时器模块 401的定时时间到时, 检测动态口令令牌 400当前 所处环境的温度, 并触动查询模块 403 根据检测到的当前所处环境温度去查询表存储模块 404; 查询模块 403用于根据检测模块 402检测到的动态口令令牌 400当前所处环境的温度, 查找表存储模块 404中动态口令令牌 400当前所处环境温度下的特征值;
表存储模块 404存储有 RTC晶体在不同温度下的特征值;
具体地, 所述特征值包括 RTC晶体在不同温度下的晶振频率或 RTC晶体在不同温度下的 频率稳定度或不同温度下的时间偏差。
校正模块 405用于根据查询模块 403查询得到的特征值对动态口令令牌 400的当前时间 进行校正。
触发模块 406用于开启生成模块 407, 具体为触发按键、 按钮或开关;
生成模块 407用于根据当前经过校正后的时间值生成动态口令, 具体包括动态因子生成 单元、 动态口令生成单元;
动态因子生成单元主要用于根据提取的校正模块 406校正后得到的当前时间值来生成动 态因子;
动态口令生成单元用于根据动态因子生成单元生成的动态因子来生成动态口令; 显示模块 408, 用于在动态口令生成后显示或关闭显示生成的动态口令;
具体地, 所述查询模块 403还包括:
查询单元, 用于根据所述检测得到的当前环境温度在表存储模块中查找得到所述环境温 度下相应的特征值, 并判断是否能够查找得到所述特征值;
第一计算单元, 用于当所述查询单元的判断结果为不能时, 根据表存储模块中的数据及 检测到的温度计算所述环境温度下的特征值。
具体地, 校正模块 405包括:
第二计算单元, 用于根据查询模块 403查找得到的特征值, 计算当前累计时间偏差; 当所述特征值为 RTC晶体在不同温度下的晶振频率时, 所述第二计算模块还用于计算晶 振频率偏差, 以及将晶振频率偏差转换为时间偏差的运算;
判断单元, 用于判断第二计算单元 405累加计算得到的累计时间偏差的值是否达到预定 值,
第一校正单元, 当判断单元的判断结果是是时, 根据该预定值对动态口令令牌 400的当 前时间进行校正;
具体地, 所述校正模块 405还包括:
转换单元,用于将查询模块 403查询得到的特征值根据预定的方式进行转换得到调整值; 第二校正单元, 用于根据转换单元转换得到的调整值来改变时钟脉冲的时钟计数值, 从 而对当前时间值进行校正。
本实施例中, 预定值是预先设定的 1秒;
以上所述仅是本发明的较佳实施例, 并不用于限制本发明, 凡在本发明的精神和原则之 内, 所做的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。

Claims

权利要求书
1、 一种校正动态口令令牌温漂的方法, 其中, 所述动态口令令牌根据时间值及动态因子 的变化时间步长得到动态因子, 根据所述动态因子生成并显示动态口令, 其特征在于, 所述 方法包括:
动态口令令牌以第一预设时间为间隔来检测所述动态口令令牌当前所处环境的温度; 所述动态口令令牌根据所述检测到的温度查找数据表, 得到所述检查到的温度对应的特 征值;
所述动态口令令牌以第二预设时间为间隔, 根据所述特征值对所述动态口令令牌内的当 前时间值进行校正。
2、 根据权利要求 1所述的方法, 其特征在于, 所述第一预设时间是自定义的, 所述动态 口令令牌通过定时器定时的方式或轮询标志位的方式来实现以第一预设时间为间隔检测所述 动态口令令牌当前所处环境的温度。
3、 根据权利要求 1所述的方法, 其特征在于, 所述动态口令令牌根据所述检测到的温度 查找数据表, 得到所述检查到的温度对应的特征值包括:
所述动态口令令牌根据所述检测到的温度查找数据表, 并判断是否能够查找得到所述检 测到的温度对应的特征值,
如果不能查找得到, 则根据所述检测到的温度及所述数据表计算所述检测到的温度对应 的特征值。
4、根据权利要求 3所述的方法, 其特征在于, 根据所述检测到的温度及所述数据表计算 所述检测到的温度对应的特征值包括:
所述动态口令令牌根据所述检测到的温度查找所述数据表, 得到第一温度和第二温度及 所述第一温度和第二温度对应的第一特征值和第二特征值, 所述动态口令令牌根据查找得到 的上述数据及所述检测到的温度按照第一预设公式计算所述检测到的温度对应的特征值; 其中, 所述第一预设公式为:
所述检测到的温度-第一温度 _所述特征值 -第一特征值
^第二温度-第一温度 ^—第二特征值-第一特征值。
5、 根据权利要求 1所述的方法, 其特征在于, 所述数据表是预先存储在所述动态口令令 牌内部的;
所述数据表中的数据为所述动态口令令牌内晶体振荡器所采用的晶体在不同温度下的晶 振频率、晶体在不同温度下的频率稳定度或晶体在不同温度下的第一预设时间内的时间偏差; 则,
所述检测到的温度对应的特征值为晶振频率、频率稳定度或第一预设时间内的时间偏差。
6、 根据权利要求 5所述的方法, 其特征在于, 当所述特征值为第一预设时间的时间偏差 时, 所述动态口令令牌以第二预设时间为间隔, 根据所述特征值对当前时间值进行校正的方 法包括:
所述动态口令令牌在第二预设时间到时, 将当前第一预设时间内的时间偏差与之前第二 预设时间到时得到的第一预设时间内的时间偏差进行累加计算, 得到所述动态口令令牌的当 前累计时间偏差;
所述动态口令令牌判断所述当前累计时间偏差是小于、 等于、 大于预定值的哪一种, 如果是小于, 则返回到动态口令令牌以第一预设时间为间隔来检测所述动态口令令牌当 前所处环境的温度的步骤;
如果是等于, 所述动态口令令牌的当前时间值加上所述预定值, 得到校正后的时间值, 并将当前累计时间偏差清零;
如果是大于, 所述动态口令令牌的当前时间值加上所述预定值, 得到校正后的时间值, 并将当前累计时间偏差中多于所述预定值的部分作为下次进行累加计算时的基数。
7、 根据权利要求 5所述的方法, 其特征在于, 当所述特征值为晶振频率时, 所述动态口 令令牌以第二预设时间为间隔, 根据所述特征值对所述动态口令令牌的当前时间值进行校正 的方法还包括:
所述动态口令令牌根据所述晶振频率及晶振标准频率计算得到所述环境温度下的晶振频 率偏差;
所述动态口令令牌将所述计算得到的晶振频率偏差转换为时间值, 所述转换得到的时间 值为当前 1秒内的时间偏差。
所述动态口令令牌根据所述当前 1秒内的时间偏差按照第二预设公式计算得到所述第一 预设时间内的时间偏差;
所述动态口令令牌在第二预设时间到时, 将当前计算得到的第一预设时间内的时间偏差 与之前第二预设时间到时得到的第一预设时间内的时间偏差进行累加计算, 得到所述动态口 令令牌的当前累计时间偏差;
所述动态口令令牌判断所述当前累计时间偏差是小于、 等于、 大于预定值的哪一种, 如果是小于, 则返回到动态口令令牌以第一预设时间为间隔来检测所述动态口令令牌当 前所处环境的温度的步骤;
如果是等于, 所述动态口令令牌的当前时间值加上所述预定值, 得到校正后的时间值, 并将当前累计时间偏差清零;
如果是大于, 所述动态口令令牌的当前时间值加上所述预定值, 得到校正后的时间值, 并将所述累计时间偏差中多于所述预定值的部分作为下次进行累计计算时的基数。
8、 根据权利要求 7所述的方法, 其特征在于, 所述第二预设公式具体为: 第一预设时间间隔内的时间偏差 =^¾§^* ( 1+第一预设时间)。
晶振标准频率
9、 根据权利要求 5所述的方法, 其特征在于, 当所述特征值为频率稳定度时, 所述动态 口令令牌以第二预设时间为间隔, 根据所述特征值对当前时间值进行校正的方法还包括: 所述动态口令令牌将所述频率稳定度转换为时间值, 所述转换得到的时间值为当前 1秒 内的时间偏差。
所述动态口令令牌根据所述当前 1秒内的时间偏差按照第三预设公式计算得到所述第一 预设时间内的时间偏差;
所述动态口令令牌在第二预设时间到时, 将当前计算得到的第一预设时间内的时间偏差 与之前第二预设时间到时得到的第一时间间隔内的时间偏差进行累加计算, 得到所述动态口 令令牌的当前累计时间偏差;
所述动态口令令牌判读所述当前累计时间偏差是小于、 等于、 大于预定值的哪一种, 如果是小于, 则返回到动态口令令牌以第一预设时间为间隔来检测所述动态口令令牌当 前所处环境的温度的步骤;
如果是等于, 所述动态口令令牌的当前时间值加上所述预定值, 得到校正后的时间值, 并将当前累计时间偏差清零;
如果是大于, 所述动态口令令牌的当前时间值加上所述预定值, 得到校正后的时间值, 并将所述累计时间偏差中多于所述预定值的部分作为下次进行累加计算时的基数。
10、 根据权利要求 9所述的方法, 其特征在于, 所述第三预设公式具体为:
第一预设时间间隔 =频率稳定度 * ( 1+第一预设时间) *10— 6
11、 根据权利要求 7至 9所述的方法, 其特征在于, 所述第一预设时间和所述第二预设 时间是相同的。
12、 根据权利要求 1所述的方法, 其特征在于, 所述动态口令令牌以第二预设时间为间 隔, 根据所述特征值对所述动态口令令牌内的当前时间值进行校正的方法还包括:
在第二预设时间到时, 所述动态口令令牌将所述特征值转换为调整值;
所述动态口令令牌将所述调整值写入到时间调整寄存器;
所述时间调整寄存器在所述第二预设时间到时根据所述调整值改变当前时钟脉冲的时钟 计数值, 来对当前时间值进行校正;
13、 根据权利要求 12所述的方法, 其特征在于, 所述第二预设时间具体为 1分钟。
14、 一种动态口令令牌, 其特征在于, 所述动态口令令牌包括:
定时器模块, 用于在第一预设时间到时开启检测模块检测所述动态口令令牌当前所处环 境的温度;
检测模块, 用于在所述定时器模块计时达到所述第一预设时间时, 检测所述动态口令令 牌当前所处环境的温度, 并触发查询模块进行数据查询;
表存储模块, 用于存储实时时钟晶体在不同温度下的特征值;
查询模块, 用于根据所述检测模块检测到的所述动态口令令牌当前所处环境的温度在表 存储模块中查找所述检测到的温度对应的特征值;
校正模块, 用于根据所述特征值对所述动态口令令牌内的当前时间值进行校正; 触发模块, 用于触发生成模块生成动态口令;
生成模块, 用于被所述触发模块触动 , 提取所述动态口令令牌的当前时间值, 并根据 所述提取的时间值及动态因子的变化时间步长来生成动态口令;
显示模块, 用于显示或关闭显示所述生成模块生成的所述动态口令。
15、 根据权利要求 14所述的动态口令令牌, 其特征在于, 所述查询模块包括: 查询单元, 用于根据所述检测模块检测到的温度在所述表存储模块中查找所述检测到的 温度对应的特征值, 并判断是否能够查找得到所述特征值;
第一计算单元, 用于当所述查询单元的查询结果为不能时, 计算所述检测到的温度对应 的特征值。
16、 根据权利要求 14所述的动态口令令牌, 其特征在于, 所述校正模块包括: 第二计算单元, 用于根据所述查询模块得到的特征值, 计算所述动态口令令牌的当前累 计时间偏差;
判断单元, 用于判断第二计算单元计算得到的当前累计时间偏差是否达到预定值; 第一校正单元, 用于当所述判断单元的判断结果为是时, 将所述动态口令令牌的当前时 间值加上所述预定值, 得到校正后的时间值。
17、 根据权利要求 14所述的动态口令令牌, 其特征在于, 所述校正模块还包括: 转换单元, 用于将所述查询模块得到的特征值转换为调整值;
第二校正单元, 用于根据所述调整值来改变所述动态口令令牌的当前时钟脉冲的时钟计 数值, 对当前时间值进行校正。
18、 根据权利要求 14所述的动态口令令牌, 其特征在于, 所述检测到的温度对应的特征 值包括晶振频率、 频率稳定度或所述第一预设时间内的时间偏差。
PCT/CN2011/072202 2010-03-29 2011-03-28 校正动态口令令牌温漂的方法和动态口令令牌 WO2011120408A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US13/258,156 US8443432B2 (en) 2010-03-29 2011-03-28 Method for calibrating a temperature float of a one time password token and a one time password token thereof

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2010101374140A CN101854147B (zh) 2010-03-29 2010-03-29 校正动态口令令牌温漂的方法和动态口令令牌
CN201010137414.0 2010-03-29

Publications (1)

Publication Number Publication Date
WO2011120408A1 true WO2011120408A1 (zh) 2011-10-06

Family

ID=42805449

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/072202 WO2011120408A1 (zh) 2010-03-29 2011-03-28 校正动态口令令牌温漂的方法和动态口令令牌

Country Status (3)

Country Link
US (1) US8443432B2 (zh)
CN (1) CN101854147B (zh)
WO (1) WO2011120408A1 (zh)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101854147B (zh) * 2010-03-29 2012-04-18 飞天诚信科技股份有限公司 校正动态口令令牌温漂的方法和动态口令令牌
CN102323742B (zh) * 2011-04-19 2014-03-26 上海众人网络安全技术有限公司 一种用于动态密码令牌时钟校准系统及方法
CN102307182B (zh) * 2011-04-27 2015-01-07 上海动联信息技术股份有限公司 一种动态密码认证服务器智能时间补偿方法
CN102636614A (zh) * 2012-04-25 2012-08-15 梅思安(中国)安全设备有限公司 固体和便携式气体检测仪零点漂移修正方法
CN102882672A (zh) * 2012-09-18 2013-01-16 深圳市文鼎创数据科技有限公司 动态令牌时钟校准方法及装置
CN103149832A (zh) * 2013-01-18 2013-06-12 深圳市文鼎创数据科技有限公司 动态口令令牌的时钟校准方法及动态口令令牌
CN103634121A (zh) * 2013-12-18 2014-03-12 上海众人网络安全技术有限公司 一种提高动态令牌时间可靠性的系统和方法
CN103716165B (zh) * 2013-12-18 2017-02-08 北京海泰方圆科技股份有限公司 动态口令令牌和认证系统的时间因子生成方法及校验方法
CN104394145B (zh) 2014-11-25 2015-09-23 飞天诚信科技股份有限公司 一种具有日志功能的动态令牌及其工作方法
US9838385B2 (en) * 2015-06-30 2017-12-05 International Business Machines Corporation Password generation based on dynamic factors
CN117348686B (zh) * 2023-12-04 2024-04-30 芯海科技(深圳)股份有限公司 时钟信号温漂修正方法、电路、芯片及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1610836A (zh) * 2001-10-30 2005-04-27 SiRF技术公司 用于低功率运行期间全球定位系统信号获取的校准实时时钟
CN101202531A (zh) * 2007-11-12 2008-06-18 华为技术有限公司 温度补偿的方法、装置和接入点
US20090153398A1 (en) * 2007-12-17 2009-06-18 Motorola, Inc. Method and apparatus for calibrating a global positioning system oscillator
CN201408333Y (zh) * 2009-05-26 2010-02-17 北京飞天诚信科技有限公司 利用gps进行时钟校准的时间令牌
CN101854147A (zh) * 2010-03-29 2010-10-06 北京飞天诚信科技有限公司 校正动态口令令牌温漂的方法和动态口令令牌

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2341316A1 (en) * 2000-03-17 2001-09-17 Samir Kuliev Digital indirectly compensated crystal oscillators
JP4933222B2 (ja) * 2006-11-15 2012-05-16 株式会社日立製作所 インデックス処理方法及び計算機システム
CN101197667B (zh) * 2007-12-26 2010-07-14 北京飞天诚信科技有限公司 一种动态口令认证的方法
US7889030B2 (en) 2008-08-07 2011-02-15 Infineon Technologies Ag Passive temperature compensation of silicon MEMS devices

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1610836A (zh) * 2001-10-30 2005-04-27 SiRF技术公司 用于低功率运行期间全球定位系统信号获取的校准实时时钟
CN101202531A (zh) * 2007-11-12 2008-06-18 华为技术有限公司 温度补偿的方法、装置和接入点
US20090153398A1 (en) * 2007-12-17 2009-06-18 Motorola, Inc. Method and apparatus for calibrating a global positioning system oscillator
CN201408333Y (zh) * 2009-05-26 2010-02-17 北京飞天诚信科技有限公司 利用gps进行时钟校准的时间令牌
CN101854147A (zh) * 2010-03-29 2010-10-06 北京飞天诚信科技有限公司 校正动态口令令牌温漂的方法和动态口令令牌

Also Published As

Publication number Publication date
CN101854147B (zh) 2012-04-18
US20120117618A1 (en) 2012-05-10
CN101854147A (zh) 2010-10-06
US8443432B2 (en) 2013-05-14

Similar Documents

Publication Publication Date Title
WO2011120408A1 (zh) 校正动态口令令牌温漂的方法和动态口令令牌
JP5952836B2 (ja) 温度検出装置、および、温度検出装置を備える集積回路
US20080244301A1 (en) Real-time clock correction methods and apparatus
JP6034663B2 (ja) 半導体装置
TWI411804B (zh) 補償一時脈偏差之方法以及裝置
RU2579716C2 (ru) Коррекция тактового генератора низкой точности
JP2013064677A5 (zh)
CN101171754A (zh) 用于确定休眠时钟计时的设备和方法
CN102163041B (zh) 实时时钟宽范围温度误差补偿方法及其系统
US7656635B2 (en) Overheat detection in thermally controlled devices
JP2012160790A (ja) 発振装置
JP2011199481A (ja) クロックシステム
US7496741B2 (en) System and method for reconfiguring a real time clock time of a computer
TW201205262A (en) Method and system for controlling a supply voltage
WO2015032132A1 (zh) 石英电子表高精度守时方法
TWI522756B (zh) 溫度補償式計時信號產生器
JP5027265B2 (ja) Pll装置
JP2010258491A (ja) 温度補償型水晶発振器、温度補償型水晶発振器を実装したプリント基板、及び温度補償型水晶発振器を搭載した電子機器
JP6055708B2 (ja) 水晶発振器及び発振装置
JP2017108443A (ja) 温度補償型水晶発振器
TWI451695B (zh) 時脈電路以及其重置電路與方法
TW201813303A (zh) 用於產生時脈之電子電路及其方法
JP2002311173A (ja) 電子時計、電子時計の時刻誤差補正方法および時刻誤差補正プログラム
US8630386B2 (en) Clock recovery in a battery powered device
Liu et al. An ovenized CMOS-MEMS oscillator with isothermal resonator and sub-mW heating power

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 13258156

Country of ref document: US

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

Ref document number: 11761982

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11761982

Country of ref document: EP

Kind code of ref document: A1