CN106940665B - Time correction control method and system based on mobile terminal and mobile terminal - Google Patents
Time correction control method and system based on mobile terminal and mobile terminal Download PDFInfo
- Publication number
- CN106940665B CN106940665B CN201710182527.4A CN201710182527A CN106940665B CN 106940665 B CN106940665 B CN 106940665B CN 201710182527 A CN201710182527 A CN 201710182527A CN 106940665 B CN106940665 B CN 106940665B
- Authority
- CN
- China
- Prior art keywords
- counter
- value
- mobile terminal
- time
- set threshold
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 29
- 238000001514 detection method Methods 0.000 claims description 6
- 230000005611 electricity Effects 0.000 abstract description 8
- 230000003068 static effect Effects 0.000 abstract description 8
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000001934 delay Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0751—Error or fault detection not based on redundancy
- G06F11/0754—Error or fault detection not based on redundancy by exceeding limits
- G06F11/0757—Error or fault detection not based on redundancy by exceeding limits by exceeding a time limit, i.e. time-out, e.g. watchdogs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0751—Error or fault detection not based on redundancy
- G06F11/0754—Error or fault detection not based on redundancy by exceeding limits
- G06F11/076—Error or fault detection not based on redundancy by exceeding limits by exceeding a count or rate limit, e.g. word- or bit count limit
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Telephone Function (AREA)
Abstract
The invention discloses a time correction control method, a system and a mobile terminal based on the mobile terminal, wherein the method detects the value of a counter every other set time by starting a timer, and compares the value of the counter with the set threshold; when the value of the counter is larger than a set threshold, acquiring that the current time is K; the value of the counter is reset and corresponds to the current time K. When the value of the counter is accidentally modified due to factors such as static electricity, a magnetic field, falling or chip quality problems in the environment, secondary time display errors caused by overflow of the counter can be effectively avoided, the accuracy of time display is improved, and therefore the counter is convenient for users to use.
Description
Technical Field
The invention relates to the field of mobile terminals, in particular to a time correction control method and system based on a mobile terminal and the mobile terminal.
Background
Besides the basic communication function, the mobile terminal is also regarded as an electronic tool for viewing time by many users because the time is accurately timed and clearly displayed; in the prior art, the time of the mobile terminal is obtained by counting a main clock of the mobile terminal according to a counter of the mobile terminal and then adding an accurate basic time, and the specific steps are as follows:
when the mobile terminal corrects the time, the value of the counter is P1, and the time to be corrected is K1; after the calibration is completed, the counter P1 is incremented by 1 in each mobile terminal master clock cycle, and the master clock cycle is set to T1, then when the value of the counter is P2, the time K2 of the mobile terminal should be:
K2=K1+(P2-P1)*T1。
at present, a counter in a mobile terminal is always absolutely sufficient, and counting from zero can be generally used for hundreds of years; however, due to the characteristics of portability and the like of the mobile terminal, the value of the counter is difficult to be modified due to factors such as static electricity, magnetic field, falling or chip quality problems in the environment in daily use of the mobile terminal; when the value of the counter is modified accidentally, the time of the mobile terminal is incorrect firstly, and then the user can correct the time through a network or manually; however, when the value of the counter is accidentally modified to be close to the overflow value, after a user uses a network or manually for correcting time (which may be as short as one hour, and may be as long as five years), the time is displayed incorrectly for the second time due to the overflow of the counter, which causes trouble to the user and even delays the user.
That is, in the prior art, for example, the value of the counter is accidentally modified to P3 due to static electricity, magnetic field, dropping or chip quality problems in the environment, and P3 is very close to the maximum value P4 of the counter; when the user finds that the time is incorrect, the time is corrected through a network or manually, but after a period of time, the value of the counter reaches the maximum value P4, and then the counter is overflowed and becomes zero; at this time, the value of the counter becomes zero, which causes a time display error, and brings trouble to the user, even delays the user.
Accordingly, the prior art is yet to be improved and developed.
Disclosure of Invention
The present invention provides a time correction control method and system based on a mobile terminal, and a mobile terminal, aiming at the above-mentioned defects in the prior art. A method for preventing a mobile terminal from time-overflowing is provided.
The technical scheme adopted by the invention for solving the technical problem is as follows:
a time correction control method based on a mobile terminal comprises the following steps:
A. the mobile terminal starts a timer to detect the value of a counter every other set time, and compares the value of the counter with the set threshold;
b, when the value of the counter is larger than a set threshold, acquiring that the current time is K;
c, resetting the value of the counter and corresponding to the current time K.
The time correction control method based on the mobile terminal, wherein the step A comprises the following steps:
a1, starting a timer;
a2, detecting the value of the counter when the timer is overtime;
a3, comparing the value of the counter with the set threshold.
The time correction control method based on the mobile terminal, wherein the timeout time of the timer in the step A2 is the maximum value P4 clock frequency 10%.
The mobile terminal-based time correction control method is characterized in that the set threshold is 80% of the maximum value P4 of the counter.
A time correction control system based on a mobile terminal, comprising:
the counter value detection and comparison module is used for controlling the mobile terminal to start the timer to detect the value of the counter every other set time and comparing the value of the counter with the set threshold;
the time acquisition module is used for acquiring the current time as K when the value of the counter is greater than a set threshold;
and the reset corresponding module is used for resetting the value of the counter and corresponds to the current time K.
The mobile terminal-based time correction control system, wherein the counter value detection and comparison module comprises:
the starting unit is used for starting the timer;
a detecting unit for detecting a value of the counter when the timer times out;
and the comparison unit is used for comparing the value of the counter with the set threshold.
The time correction control system based on the mobile terminal is characterized in that the timeout time of the timer is equal to the maximum value P4 multiplied by 10% of the clock frequency of the counter.
The mobile terminal based time correction control system, wherein the set threshold is 80% of the maximum value P4 of the counter.
A mobile terminal comprises any one of the mobile terminal-based time correction control systems, and is realized by adopting any one of the mobile terminal-based time correction control methods.
The invention provides a time correction control method, a system and a mobile terminal based on the mobile terminal, wherein the method detects the value of a counter every other set time by starting a timer, and compares the value of the counter with the set threshold; when the value of the counter is larger than a set threshold, acquiring that the current time is K; the value of the counter is reset and corresponds to the current time K. When the value of the counter is accidentally modified due to factors such as static electricity, a magnetic field, falling or chip quality problems in the environment, secondary time display errors caused by overflow of the counter can be effectively avoided, the accuracy of time display is improved, and therefore the counter is convenient for users to use.
Drawings
Fig. 1 is a flowchart of a time correction control method based on a mobile terminal according to a preferred embodiment of the present invention.
Fig. 2 is a functional block diagram of a preferred embodiment of the mobile terminal based time correction control system of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating a time calibration control method based on a mobile terminal according to a preferred embodiment of the present invention. As shown in fig. 1, the time correction control method based on a mobile terminal according to the embodiment of the present invention includes the following steps:
s100, the mobile terminal starts a timer to detect the value of a counter every other set time, and compares the value of the counter with the set threshold;
specifically, the set threshold is preferably 80% of the maximum value P4 of the counter, for example, the maximum count value P4 of the counter of the mobile terminal is stored in a 16-bit register, and the maximum count value P4 is 16 times of 2 minus 1, and the set threshold is preferably 80% of (16 times of 2 minus 1).
The timer, whose timeout time is the maximum counter value P4 multiplied by the clock frequency multiplied by 10%, for example, the main clock frequency of the mobile terminal is 100000000Hz, the maximum counter value P4 is stored in a 16-bit register, the maximum counter value P4 is the 16 th power of 2 minus 1, and the timeout time of the timer is set to 10% of the product of (the 16 th power of 2 minus 1) and 100000000;
further, step S100 includes the steps of:
starting a timer;
detecting a value of the counter when the timer times out;
the value of the counter is compared with the set threshold.
S200, when the value of the counter is larger than a set threshold, acquiring that the current time is K;
that is, in the present invention, when the value of the counter is greater than the set threshold (for example, the set threshold is preferably (the power 16 of 2 minus 1) 80%), the current time is K, for example, 11.00 whole.
When the value of the counter is accidentally modified (for example, greater than a set threshold) due to factors such as static electricity, magnetic field, falling or chip quality problems in the environment, secondary time display errors caused by overflow of the counter can be effectively avoided, the accuracy of time display is improved, and therefore the use of a user is facilitated.
In the implementation of the present invention, for example, the count value of the mobile terminal is stored in a 16-bit register, and the current value of the 16-bit register is 0000000000000011 (binary representation); the value of the 16-bit register is then modified to 0100000000000011 (binary representation) by accidental modification due to static electricity, magnetic fields, dropouts, or chip quality issues in the environment.
Note: 0000000000000011 (binary representation) is decimal 3 and 0100000000000011 (binary representation) is decimal 16387
Clearly 3 is very different from 16387; 16387 if the threshold is 16000, the threshold is exceeded.
In the invention, when the value of the counter is greater than the set threshold, the current time is acquired to be K.
And S300, resetting the value of the counter and corresponding to the current time K.
Specifically, by resetting the counter even if the value of the counter is zero, the value of the counter is then corresponded to the current time K acquired in step S200 as a new correction time; in this case, when the value of the counter is P2, the time K2 of the mobile terminal should be K2 ═ K1 + (P2-P1) _ T1; where T1 is the master clock cycle, P1 is the count value (i.e., zero) corresponding to time K after the reset in step S3, and K1 is K.
For example: assuming that the master clock cycle T1 is 0.001 second, the current time K obtained in step S200 is 199.99 seconds, and the value P1 of the counter is 0 (P1 is the count value corresponding to the time K after being reset in step S3, that is, zero); the current time K is mapped as a new correction time, i.e. K1= K =199.99 seconds;
when the time is over, the value P2 of the counter is 1000, and the time K2 of the mobile terminal is K2 ═ K1 + (P2-P1) _ T1=199.99 seconds + (1000-0) × 0.001 seconds = 200.99 seconds.
In view of the above, the present invention provides a time correction control method based on a mobile terminal, which detects the value of a counter every set time by starting a timer, and compares the value of the counter with the set threshold; when the value of the counter is larger than a set threshold, acquiring that the current time is K; the value of the counter is reset and corresponds to the current time K. When the value of the counter is accidentally modified due to factors such as static electricity, a magnetic field, falling or chip quality problems in the environment, secondary time display errors caused by overflow of the counter can be effectively avoided, the accuracy of time display is improved, and therefore the counter is convenient for users to use.
Based on the above method embodiment, an embodiment of the present invention further provides a time correction control system based on a mobile terminal, where the time correction control system includes:
a counter value detection and comparison module 210, configured to control the mobile terminal to start a timer, detect a counter value every other set time, and compare the counter value with a set threshold; as described above.
The time obtaining module 220 is configured to obtain a current time K when the value of the counter is greater than a set threshold; as described above.
A reset corresponding module 230 for resetting the value of the counter and corresponding to the current time K; as described above.
Further, the mobile terminal based time correction control system, wherein the counter value detection and comparison module comprises:
the starting unit is used for starting the timer; as described above.
A detecting unit for detecting a value of the counter when the timer times out; as described above.
The comparison unit is used for comparing the value of the counter with the set threshold; as described above.
The time correction control system based on the mobile terminal is characterized in that the overtime time of the timer is the maximum value P4 multiplied by 10% of the clock frequency of the counter; as described above.
The mobile terminal-based time correction control system, wherein the set threshold is 80% of the maximum value P4 of the counter; as described above.
Further, an embodiment of the present invention further provides a mobile terminal, where the mobile terminal of this embodiment includes the mobile terminal-based time correction control system described in the above embodiment, and is implemented by using the mobile terminal-based time correction control method described in the above embodiment.
In summary, in the time correction control method, the time correction control system and the mobile terminal provided by the invention, the method detects the value of the counter every set time by starting the timer, and compares the value of the counter with the set threshold; when the value of the counter is larger than a set threshold, acquiring that the current time is K; the value of the counter is reset and corresponds to the current time K. When the value of the counter is accidentally modified due to factors such as static electricity, a magnetic field, falling or chip quality problems in the environment, secondary time display errors caused by overflow of the counter can be effectively avoided, the accuracy of time display is improved, and therefore the counter is convenient for users to use.
Of course, it will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program instructing relevant hardware (such as a processor, a controller, etc.), and the program may be stored in a computer readable storage medium, and when executed, the program may include the processes of the above method embodiments. The storage medium may be a memory, a magnetic disk, an optical disk, etc.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.
Claims (5)
1. A time correction control method based on a mobile terminal is characterized by comprising the following steps:
A. the mobile terminal starts a timer to detect the value of a counter every other set time, and compares the value of the counter with the set threshold;
b, when the value of the counter is larger than a set threshold, acquiring that the current time is K;
c, resetting the value of the counter and corresponding to the current time K;
the step A comprises the following steps:
a1, starting a timer;
a2, detecting the value of the counter when the timer is overtime;
a3, comparing the value of the counter with the set threshold;
the timeout time of the timer in the step A2 is the maximum value P4 multiplied by 10% of the clock frequency.
2. The mobile terminal-based time correction control method according to claim 1, wherein the set threshold is 80% of a maximum value P4 of the counter.
3. A time correction control system based on a mobile terminal is characterized by comprising:
the counter value detection and comparison module is used for controlling the mobile terminal to start the timer to detect the value of the counter every other set time and comparing the value of the counter with the set threshold;
the time acquisition module is used for acquiring the current time as K when the value of the counter is greater than a set threshold;
a reset corresponding module for resetting the value of the counter and corresponding to the current time K;
the counter value detection and comparison module comprises:
the starting unit is used for starting the timer;
a detecting unit for detecting a value of the counter when the timer times out;
the comparison unit is used for comparing the value of the counter with the set threshold;
the overtime time of the timer is the maximum value P4 multiplied by the clock frequency multiplied by 10%.
4. The mobile terminal based time correction control system of claim 3, wherein said set threshold is 80% of the counter maximum value P4.
5. A mobile terminal, characterized in that it includes the mobile terminal-based time correction control system of any one of claims 3-4, and is implemented by using the mobile terminal-based time correction control method of any one of claims 1-2.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710182527.4A CN106940665B (en) | 2017-03-24 | 2017-03-24 | Time correction control method and system based on mobile terminal and mobile terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710182527.4A CN106940665B (en) | 2017-03-24 | 2017-03-24 | Time correction control method and system based on mobile terminal and mobile terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106940665A CN106940665A (en) | 2017-07-11 |
CN106940665B true CN106940665B (en) | 2021-04-20 |
Family
ID=59463479
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710182527.4A Active CN106940665B (en) | 2017-03-24 | 2017-03-24 | Time correction control method and system based on mobile terminal and mobile terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106940665B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110077125B (en) * | 2019-04-17 | 2021-01-01 | 上海红箭自动化设备有限公司 | Printing ink-jet control system |
CN113828529B (en) * | 2021-11-26 | 2022-02-11 | 南京派格测控科技有限公司 | Processing method and system based on concatenation abnormity of serial measurement data |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1673926A (en) * | 2004-03-26 | 2005-09-28 | 联发科技股份有限公司 | Timer system and related method capable of dynamically compensating a difference of a timer |
CN101075146A (en) * | 2006-05-19 | 2007-11-21 | 联发科技股份有限公司 | Method and apparatus for correcting |
CN101159532A (en) * | 2006-10-03 | 2008-04-09 | 日本电气株式会社 | Clock synchronization circuit |
CN102023565A (en) * | 2010-12-15 | 2011-04-20 | 中兴通讯股份有限公司 | Device and method for outputting time information |
US8325704B1 (en) * | 2007-05-16 | 2012-12-04 | Dust Networks, Inc. | Time correction and distance measurement in wireless mesh networks |
CN103257670A (en) * | 2012-02-21 | 2013-08-21 | 北京国微集成技术有限公司 | Embedded system and timing method thereof |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6115591B2 (en) * | 2015-06-24 | 2017-04-19 | カシオ計算機株式会社 | Satellite radio wave receiver, electronic clock, date acquisition method and program |
-
2017
- 2017-03-24 CN CN201710182527.4A patent/CN106940665B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1673926A (en) * | 2004-03-26 | 2005-09-28 | 联发科技股份有限公司 | Timer system and related method capable of dynamically compensating a difference of a timer |
CN101075146A (en) * | 2006-05-19 | 2007-11-21 | 联发科技股份有限公司 | Method and apparatus for correcting |
CN101159532A (en) * | 2006-10-03 | 2008-04-09 | 日本电气株式会社 | Clock synchronization circuit |
US8325704B1 (en) * | 2007-05-16 | 2012-12-04 | Dust Networks, Inc. | Time correction and distance measurement in wireless mesh networks |
CN102023565A (en) * | 2010-12-15 | 2011-04-20 | 中兴通讯股份有限公司 | Device and method for outputting time information |
CN103257670A (en) * | 2012-02-21 | 2013-08-21 | 北京国微集成技术有限公司 | Embedded system and timing method thereof |
Also Published As
Publication number | Publication date |
---|---|
CN106940665A (en) | 2017-07-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110248110B (en) | Shooting parameter setting method, setting device, terminal equipment and readable storage medium | |
CN111781987B (en) | Real-time clock calibration method and related device | |
US20080244301A1 (en) | Real-time clock correction methods and apparatus | |
CN106940665B (en) | Time correction control method and system based on mobile terminal and mobile terminal | |
US20200204113A9 (en) | Systems and methods for frequency compensation of real-time-clock systems | |
CN107450305B (en) | Time correction method and device for clock chip and intelligent equipment | |
CN109283967A (en) | A kind of micro-control unit MCU clock correcting method and relevant device | |
CN111800249A (en) | Method and system for improving error tolerance range of baud rate of serial communication | |
CN111596802B (en) | Touch screen calibration method and device and computer readable storage medium | |
US10274601B2 (en) | Communications system | |
JP2023101509A (en) | Semiconductor device and method for detecting remaining amount of battery | |
CN113126815A (en) | Key response control method and device, terminal equipment and storage medium | |
US7854544B2 (en) | Correction apparatus and clock device using the same | |
KR20160006501A (en) | Frequency correction system and correcting method thereof | |
US20180211278A1 (en) | Information release method, information release apparatus, and storage medium | |
WO2021135303A1 (en) | Fpga-based design method and device for equally dividing interval | |
CN106026220B (en) | It is a kind of charge sampled voltage compensation method and mobile terminal | |
CN109213589B (en) | Message processing method and device | |
CN110391861B (en) | Method, device, equipment and storage medium for correcting timer | |
JP2012058115A (en) | Management apparatus, management method, and management program | |
CN113032232B (en) | Correlation method, correlation device and equipment for performance detection of equipment | |
WO2008132644A1 (en) | Electronic device and method of correcting clock signal deviations in an electronic device | |
CN103973804B (en) | Method and device for setting terminal time | |
CN116192101A (en) | Clock correction method and device based on external crystal oscillator and electric energy meter | |
TWI484142B (en) | A multi-sensing element correction system, a correction method and a recording medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20240108 Address after: 518000, 109-111, Building 17, Maker Town, No. 4109 Liuxian Avenue, Pingshan Community, Taoyuan Street, Nanshan District, Shenzhen, Guangdong Province Patentee after: Yuanyuan (Shenzhen) Technology Transfer Co.,Ltd. Address before: 516006 Zhongkai hi tech Zone, Huizhou, Guangdong, 86 Chang seven Road West Patentee before: HUIZHOU TCL MOBILE COMMUNICATION Co.,Ltd. |
|
TR01 | Transfer of patent right |