CN1859616A - Method for correcting terminal device local time and terminal device - Google Patents
Method for correcting terminal device local time and terminal device Download PDFInfo
- Publication number
- CN1859616A CN1859616A CNA2006100016522A CN200610001652A CN1859616A CN 1859616 A CN1859616 A CN 1859616A CN A2006100016522 A CNA2006100016522 A CN A2006100016522A CN 200610001652 A CN200610001652 A CN 200610001652A CN 1859616 A CN1859616 A CN 1859616A
- Authority
- CN
- China
- Prior art keywords
- time
- short message
- timing
- receiving
- terminal device
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 74
- 230000005540 biological transmission Effects 0.000 claims abstract description 20
- 238000012545 processing Methods 0.000 claims description 129
- 238000012937 correction Methods 0.000 claims description 83
- 238000004364 calculation method Methods 0.000 claims description 17
- 239000000284 extract Substances 0.000 claims description 7
- 238000004891 communication Methods 0.000 abstract description 9
- 238000005516 engineering process Methods 0.000 abstract description 2
- 230000006870 function Effects 0.000 description 18
- 239000013078 crystal Substances 0.000 description 8
- 238000005259 measurement Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000009825 accumulation Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Images
Landscapes
- Mobile Radio Communication Systems (AREA)
Abstract
The present invention relates to communication technology, specially relating to correcting terminal unit local zone time method and terminal unit. Said invented method includes 1, instant timing method utilizing special timing message transmission time, time of reception and retransmission time to make accuracy timing; 2, random timing method utilizing one message or continuously received at least two message receiving time and retransmission time to make compensating timing; said invention also providing terminal unit for realizing above-mentioned one or all method. Said method can be realized in terminal side without any change to network side.
Description
Technical Field
The present invention relates to communications technologies, and in particular, to a method for correcting local time of a terminal device and a terminal device.
Background
The mobile phone is a most common terminal device, and becomes a very convenient communication tool in the current life. The clock function on the mobile phone also becomes the most convenient way for people to master time, but most of the mobile phones on the market at present do not have the automatic time calibration function, and after a user purchases the mobile phone, the user generally performs manual time calibration on the mobile phone first, and the manual time calibration operation is troublesome. When the mobile phone is in use, time difference between the time on the mobile phone and the standard time may exist due to frequency deviation of the internal crystal, dropping of the mobile phone, long-time power failure of a battery and the like, and at this time, a user needs to perform timing again. In general, there is no problem in manually modifying the mobile phone time by using the television and the broadcast time as references, but if the mobile phone is outdoors, it is troublesome to find a good time correction reference.
The existing part of base stations is added with a protocol for timing the mobile phone, and according to the stipulation of the timing protocol, the mobile phone performs timing through the following steps:
1. the mobile phone sends a timing request command to the base station;
2. after receiving the timing request command, the base station inquires the local time on the equipment and returns the time information to the mobile phone through the timing protocol;
3. after receiving the time information of the base station, the mobile phone updates the local time to the time of the base station, thereby realizing automatic time correction.
However, this technique requires the handset and the base station device to support the timing protocol at the same time, and requires the base station device in the whole network to support the protocol. Because the timing protocol is developed later, only part of manufacturer base stations support the protocol at present, and many base stations on the current GSM network are old base stations and do not support the timing protocol, the automatic timing can not be realized in the whole network. Also, since this protocol does not form a standard in the handset industry, only a portion of handsets can now support this protocol. In addition, the operator does not gain revenue from the agreement and it is difficult to ensure that the functionality of the agreement is supported for a long time.
Disclosure of Invention
The invention provides a method for correcting local time of terminal equipment and the terminal equipment, which are used for solving the problems that the manual time correction operation of the conventional terminal equipment is complex and the correction accuracy is limited by a reference source.
A method for correcting local time of terminal equipment comprises the following steps:
A. the terminal equipment sends the timing short message received by the terminal to the short message processing equipment at the network side, and records the sending time T1 of the timing short message;
B. the network side short message processing equipment adds the forwarding time T3 of the short message in the timing short message and forwards the timing short message to the terminal equipment;
C. the terminal equipment receives the timing short message, records the receiving time T2 of the timing short message and extracts the forwarding time T3;
D. the terminal device calculates a standard time T ═ T3+ (T2-T1) ÷ 2+ Δ T4, and corrects the local time to the standard time T, where: and the delta T4 is more than or equal to 0 and is determined according to the processing capacity of the terminal equipment.
The method also comprises the following steps:
a 1', when a terminal device receives a short message, acquiring the receiving time and the forwarding time of the short message and calculating the deviation value of local time relative to standard time when receiving the short message: the forwarding time is added with the one-way transmission time of the short message between the network side short message processing equipment and the terminal equipment, and then the receiving time is subtracted;
b1 ', the terminal equipment returns to the step A1' after compensating the local time by an offset value.
Or, the method also comprises the following steps:
a 2', the terminal device respectively obtains a receiving time t2 and a forwarding time t3 of N continuous short messages, and respectively calculates a deviation value Δ t of local time relative to standard time when each short message is received, which is (t3+ Δ t3) -t2, wherein N is greater than or equal to 2, and Δ t3 is one-way transmission time of the short message between the network side short message processing device and the terminal device;
b2 ', the terminal equipment calculates the statistical deviation value delta t' of the N short messages, compensates the local time by the statistical deviation value delta t ', and returns to the step A2'.
Wherein, the step A2' specifically comprises the following steps:
a21', clearing the number count value of the short message;
a22 ', judging whether a short message is received, if yes, obtaining t2 and t3 corresponding to the short message, calculating the delta t of the short message to be t3+ delta t3-t2, storing the calculation result and executing the step A23', otherwise, continuing the judgment;
a23 ', judging whether the count value is equal to N, if yes, executing step B2 ', otherwise returning to step A22 '.
In the method, a threshold value of receiving time length of N continuous short messages is set, in the step B2 ', whether the receiving time interval of a first short message and a last short message in the N short messages is less than or equal to the threshold value is judged, if yes, the statistical deviation value delta t ' is calculated again, local time is compensated, and then the step A21 ' is returned; otherwise, deleting the time information of the first short message, subtracting 1 from the count value and returning to the step A22'.
Wherein Δ t' is: average of N Δ t; or when N is more than or equal to 4, after the maximum value and the minimum value in N delta t are removed, the average value of N-2 delta t is remained; or when N is more than or equal to 6, arranging N deltat in sequence, and removing the average value of the remaining N-4 deltat after the first two and the second two.
And D, calculating and updating by the terminal equipment each time step D is executed.
After the terminal device executes the step B1 'or B2' each time, it first determines whether the standard transmission time is saved, if yes, assigns Δ t3 to the standard transmission time, otherwise assigns Δ t3 to the empirical transmission time.
In the method, the terminal equipment starts the step A according to a user timing instruction, wherein the user timing instruction is input by operating a timing function key arranged on the terminal or confirming a timing function option in a menu.
The content of the timing short message is empty or the set timing information.
According to the same technical concept, the other method for correcting the local time of the terminal equipment, provided by the invention, comprises the following steps:
a1, when the terminal equipment receives a short message, acquiring the receiving time and the forwarding time of the short message and calculating the deviation value of the local time relative to the standard time when receiving the short message, wherein the deviation value of the local time relative to the standard time is as follows: the forwarding time is added with the one-way transmission time of the short message between the network side short message processing equipment and the terminal equipment, and then the receiving time is subtracted;
b1, the terminal equipment returns to the step a1 after compensating the local time by an offset value.
According to the same technical concept, the invention further provides a method for correcting the local time of the terminal equipment, which comprises the following steps:
a2, the terminal device respectively obtains a receiving time t2 and a forwarding time t3 of N continuous short messages, and respectively calculates an offset value delta t of local time relative to standard time when each short message is received, which is (t3+ delta t3) -t2, wherein N is more than or equal to 2, and delta t3 is one-way transmission time of the short message between the network side short message processing device and the terminal device;
b2, the terminal equipment calculates the statistical deviation value delta t 'of the N short messages, compensates the local time by the statistical deviation value delta t', and returns to the step a 2.
The step a2 specifically comprises the following steps:
a21, clearing the number count value of the short messages;
a22, judging whether a short message is received, if so, acquiring t2 and t3 corresponding to the short message, calculating the delta t corresponding to the short message to be t3+ delta t3-t2, storing the calculation result and executing the step a13, otherwise, continuing to judge;
a23, judging whether the count value is equal to N, if yes, executing step b2, otherwise, returning to step a 22.
In the method, a threshold value of the receiving time length of N continuous short messages is set, in the step b2, whether the receiving time interval of the first short message and the last short message in the N short messages is less than or equal to the threshold value is judged, if yes, the statistical deviation value delta t' is calculated again, the local time is compensated, and then the step a21 is returned; otherwise, deleting the time information of the first short message, subtracting 1 from the count value, and returning to the step a 22.
In step b2, Δ t' is:
average of N Δ t; or,
when N is more than or equal to 4, after the maximum value and the minimum value in N delta t are removed, the average value of N-2 delta t is remained; or,
when N is more than or equal to 6, the N deltat are arranged in sequence, and the average value of the remaining N-4 deltat after the first two and the second two are removed.
The invention also provides terminal equipment for realizing the first method of the invention, which comprises a short message processing module, a real-time clock chip connected with the short message processing module, and a timing module connected between the short message processing module and the real-time clock chip;
the time correction module triggers the short message processing module to send the time correction short message according to the time correction instruction of the user, the short message processing module returns the sending time, the receiving time and the forwarding time on the network side short message processing equipment of the time correction short message to the time correction module, and the time correction module corrects the local time count value in the real-time clock chip according to the time information of the time correction short message.
Wherein, the short message processing module comprises:
the timing short message generating unit generates the timing short message according to the triggering of the timing module;
the short message receiving and sending unit is used for sending the timing short message and outputting the sending time of the timing short message; or receiving the timing short message and outputting the timing short message and the receiving time thereof;
the short message processing unit is connected with the short message receiving and sending unit, identifies the timing short message, extracts the forwarding time of the timing short message, and then outputs the receiving time and the forwarding time of the timing short message together;
the timing module comprises:
the timing trigger unit generates a trigger signal when receiving a timing instruction of a user and outputs the trigger signal to the timing short message generation unit;
the first timing processing unit receives the information of the sending time, the receiving time and the forwarding time of the timing short message from the short message receiving and sending unit and the short message processing unit respectively and calculates standard time;
and the timing execution unit is connected between the first timing processing unit and the real-time clock chip and corrects the local time count value in the real-time clock chip into standard time.
The timing module further comprises: the second timing processing unit is connected between the short message processing unit and the real-time clock chip;
the short message processing unit outputs the receiving time and the forwarding time of each short message to the second timing processing unit, the second timing processing unit calculates the correction time according to the receiving time and the forwarding time of one short message or at least two short messages continuously received and outputs the calculation result to the timing execution unit, and the timing execution unit corrects the local time count value in the real-time clock chip according to the calculation result.
The second timing processing unit comprises an information storage subunit, and is used for temporarily storing the receiving time and the forwarding time of the short message and storing the related parameters.
The invention further provides a terminal device for realizing the second and third methods of the invention, which comprises a short message processing module, a real-time clock chip connected with the short message processing module, and a timing module connected between the short message processing module and the real-time clock chip;
the short message processing module outputs the receiving time of each short message and the forwarding time of the short message on the network side short message processing equipment to the timing module, and the timing module calculates the correction time according to the receiving time and the forwarding time of one short message or at least two continuously received short messages and corrects the local time count value in the real-time clock chip according to the calculation result.
Wherein, the short message processing module comprises:
the short message receiving and sending unit is used for receiving and sending short messages and outputting the received short messages and the receiving time thereof;
the short message processing unit is connected with the short message receiving and sending unit, extracts the forwarding time of the short message from the received short message and outputs the receiving time and the forwarding time of the short message together;
the timing module comprises:
the time correction processing unit receives the information of the receiving time and the forwarding time of the short message from the short message processing unit, calculates the correction time and outputs the calculation result;
and the timing execution unit is connected between the timing processing unit and the real-time clock chip and used for correcting the local time count value in the real-time clock chip according to the calculation result.
The time correction processing unit comprises an information storage subunit, and is used for temporarily storing the receiving time and the forwarding time of the short message and storing the related parameters.
The invention has the following beneficial effects:
the method only needs to add a relevant processing flow at the terminal equipment side, calculates standard time information by sending the timing short message, according to the sending time and the receiving time of the timing short message and the time of forwarding the short message at the network side, corrects the local time according to the standard time information, and completely realizes a correction mechanism at the terminal side without changing software and hardware of communication equipment of an existing network side operator, so that the method is applied to communication networks of various existing systems, and a correction reference source of the method is the accurate time at the network side, thereby ensuring the correction accuracy;
the invention also provides a time correction method for automatically compensating the timing error caused by the crystal oscillator frequency offset by utilizing the receiving time and the forwarding time of one or at least two common short messages, which can be used independently or matched with the accurate time correction method of the invention, automatically compensates the timing error caused by the crystal oscillator frequency offset, and can control the error of local time within a set range without any cost or operation of a user;
the invention also provides terminal equipment with one or two functions of the automatic timing function, and the terminal equipment is compatible with the network of any existing system and provides convenience for users to use;
the method and the terminal equipment of the invention provide a new profit point for the operator, and the operator obtains the profit of a short message expense once the time is automatically corrected, thereby ensuring that the service has long-term development conditions.
Drawings
FIG. 1 is a flowchart of a method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a terminal device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a terminal device according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a terminal device according to a fifth embodiment of the present invention.
Detailed Description
In the process of receiving the short message by the terminal equipment, the network side short message processing equipment not only sends the content of the short message and the number of the terminal equipment of a sender to the terminal equipment, but also sends time information when the short message is forwarded. The time is actually the time of the operator's equipment, and since the time of the operator's equipment is related to the accuracy of charging and the normality of communication, the operator generally has a professional time synchronization network to ensure the accuracy of the time of the equipment. Thus, the accuracy of the time reference is ensured.
The invention has the technical idea that the automatic timing is realized by utilizing the short message receiving and sending function of the existing terminal equipment through the time information of receiving and sending the short message and the forwarding time information of the network side short message processing equipment carried in the existing short message without changing any processing flow on the network side.
Embodiment one, real-time timing method
The terminal equipment sends a short message with the number of the target terminal equipment consistent with that of the terminal equipment, and records the time information of the current terminal equipment at the sending moment, the network side short message processing equipment sends the short message back to the terminal equipment according to the number of the target terminal equipment of the short message after receiving the short message, and meanwhile, the time information of the current network side short message processing equipment is added in the short message. After receiving the short message returned by the network side, the terminal equipment records the time information of the current terminal equipment at the receiving moment, acquires the forwarding moment information of the network side from the short message, and then immediately performs timing processing according to the relevance between the time information. Therefore, the terminal equipment only needs one short message to realize the automatic timing function, the invention refers to the short message with the consistent target terminal equipment number and the terminal equipment number as the timing short message, the concrete steps are shown in figure 1, and the method comprises the following steps:
s101, the terminal side sends the timing short message received by the terminal side to the network side, and records the sending time T1 of the timing short message;
firstly, setting a timing function option or a key on a terminal device, executing the function option or pressing the key to trigger a timing command by a user, triggering and sending a timing short message after the terminal device receives the timing command of the user, wherein the number of a target terminal device of the timing short message is the number of the terminal device, the content of the short message can be null (recommended to reduce the information quantity), and also can be the content preset by a manufacturer, and recording the sending time information of the timing short message as T1;
s102, after receiving the timing short message, the network side short message processing equipment forwards the timing short message according to the number of the target terminal equipment in the short message according to the existing short message processing flow, and automatically increases the forwarding time T3 during forwarding. The number of the destination terminal equipment of the timing short message is consistent with that of the sending terminal equipment, so that the timing short message returns to the terminal equipment sending the timing short message along the original path;
s103, when the terminal equipment side receives the short message, recording the time T2 of the terminal equipment receiving the timing short message, and extracting the forwarding time T3 of the network side short message processing equipment carried in the timing short message;
s104, the terminal device calculates a standard time T and corrects the local time to the standard time T, wherein the standard time T is T3+ (T2-T1) ÷ 2+ delta T4, and the standard time T is time data written into a real clock chip of the terminal device;
wherein: the time-correcting short message receiving and sending delay is T2-T1, considering that the information path from the terminal device to the network-side short message processing device is consistent with the information path from the terminal device to the network-side short message processing device, and the elapsed time is also considered to be the same, through practical tests, the interval from the sending time T1 to the receiving time T2 is generally very small, so the time difference between the short message round-trip elapsed time is very small, and the difference can be accepted during the time correction of the terminal device, so the time-correcting short message receiving and sending delay parameter between the network-side short message processing device and the terminal device can be considered as Δ T3 ═ T2-T1 ÷ 2, and the standard time when the terminal device receives the time-correcting short message is T3+ Δ T3 ÷ (T2-T1) ÷ T3+ (T2-T1) ÷ 2;
Δ T4 is a time interval from when the terminal device receives the short message to when the terminal device specifically executes the time calibration, and then the standard time T when the terminal device specifically executes the time calibration is T3+ (T2-T1) ÷ 2+ Δ T4, and the time interval Δ T4 is greater than or equal to 0, and is determined according to the processing capability of the terminal device, and is generally a constant, and the stronger the processing capability of the terminal device is, the smaller Δ T4 should be, and can even be ignored, and according to different terminal devices, technicians can accurately measure the value of Δ T4.
After the terminal device calculates the standard time T, the time deviation of the terminal device is automatically adjusted through software, and automatic time correction is achieved.
The method only needs to increase a relevant processing flow at the terminal side, calculates standard time information by sending the timing short message, according to the sending time and the receiving time of the timing short message and the time of forwarding the short message at the network side, and corrects the local time according to the standard time information, and a correction mechanism is completely realized at the terminal side without changing software and hardware of communication equipment of an existing network side operator, so that the method can be applied to communication networks of various existing systems, and a correction reference source of the method is the accurate time at the network side, thereby ensuring the correction accuracy; the user spends the cost of 1 short message to realize accurate time correction, has good real-time performance, and is suitable for the conditions of time correction of newly-installed battery terminal equipment, urgent need of accurate time and the like.
Example two, random timing method
In the using process of the terminal equipment, due to the frequency deviation of the internal crystal, the falling of the terminal equipment, the long-time no electricity of the battery and the like, the deviation between the clock time and the standard time of the terminal equipment can be caused, and in order to compensate the deviation caused by the reasons, the invention also provides a method for randomly calibrating the time by utilizing the receiving time and the forwarding time of the common short message.
The random timing method can be executed when each short message is received, namely when the terminal equipment receives a short message, the receiving time and the forwarding time of the short message are obtained, and the deviation value of the local time relative to the standard time when the short message is received is calculated as follows: the forwarding time is added with the one-way transmission time of the short message between the network side short message processing equipment and the terminal equipment, and then the receiving time is subtracted; the local time is then compensated by an offset value.
The random timing method can also be realized by using a plurality of continuous short messages, and the timing principle is as follows: assuming that the receiving time of a normal short message is t2, the forwarding time is t3, and the one-way transceiving delay parameter of the short message between the network-side short message processing device and the terminal device is Δ t3, when the short message is received, the difference Δ t between the terminal device and the network-side standard time is t3+ Δ t3-t2, and Δ t is generally generated by crystal oscillator frequency deviation accumulation, so that after the difference is compensated for the local time, the local time can be corrected to be consistent with the network-side standard time, where: if the random correction method of this embodiment is applied alone, Δ t3 may be set according to an empirical value, and if the random correction method of this embodiment is applied in combination with the embodiment, an accurate measurement value of Δ t3 may be calculated according to the time information of the correction short message of the first embodiment as follows: the empirical and precise values of Δ T3 are stored in dedicated memory areas, respectively, at 3 ═ Δ T3 ═ T2-T1 ÷ 2.
According to the statistical principle, considering that the time information carried or recorded by a single short message may be wrong, and the position of the terminal device may be changed, in order to avoid unreasonable compensation caused by the wrong time information, more accurate deviation compensation is achieved, generally, correction is not performed at any time according to the time information of the single short message, after receiving N short messages, the time information of the N short messages is comprehensively counted for correction, generally, N can be set to be more than or equal to 10 and less than or equal to 20, and any one of the following methods can be selected by the comprehensive statistical method:
1. taking the average value of N deltat obtained by respectively calculating according to N short messages as a corrected difference value delta t';
2. after the maximum value and the minimum value of the N delta t are removed, the average value of the remaining N-2 delta t is used as a corrected difference value delta t';
3. all N Δ t's are sorted sequentially and then the average of the remaining N-4 Δ t's after the first two and the last two are removed is taken as the corrected difference Δ t '.
Therefore, after receiving the short message each time, the terminal device calculates and stores the difference delta t between the receiving time of the short message and the standard time, and when the difference delta t of the accumulated and stored short messages reaches the set N number, the terminal device calculates delta t ' according to one of the three methods, and compensates the local time by delta t ', namely, the local time is increased by delta t '. When the method is executed, the terminal equipment preferentially selects the accurate measurement value of the delta t3 to calculate, namely, whether the accurate measurement value of the delta t3 is stored or not is judged, if yes, the delta t and the delta t' are calculated by using the accurate measurement value, and otherwise, the set empirical value is used for calculating.
In order to prevent the terminal from accumulating too large deviation and causing precision errors, an effective receiving time length threshold M for compensating and correcting N short messages can be set, for example, M is 5 days, if the receiving span of the first short message and the N short message is more than 5 days, the time information of the first short message is deleted when the time correction is not performed, and after the next short message is received, whether the time correction is performed or not is judged according to the time length threshold M.
It should be noted that, in general, the time taken for the short message to be forwarded from the network device to the terminal device is uncertain, and has a large relationship with the geographical location of the wireless communication network where the sending terminal device and the receiving terminal device are located. However, the time value is generally small (generally less than 1 second), the influence of the deviation generated by the time correction is not large, a constant value can be set to approximately replace the time value, so that the deviation is further reduced, and the final time correction result is acceptable for the ordinary terminal equipment user.
For the following description in detail by taking random timing using a plurality of consecutive short messages as an example, after empirical values of the receiving time length threshold M and Δ t3 of N, N short messages in total number of short messages used for random timing are first set, the specific steps of the random timing method are shown in fig. 2, and include:
s201, after each random timing execution, the terminal equipment clears the total number count value I of the short messages and assigns a value to delta t 3;
if the method is used in combination with the instant correction method described in the first embodiment, after the instant correction is performed, the terminal device stores the accurate value of Δ t3, after each random timing is performed, the terminal device should first read the accurate value of Δ t3 and perform value assignment, and if the storage area of the accurate value is empty, then read the empirical value of Δ t3 and perform value assignment.
S202, monitoring whether a short message is received, if so, continuing to step S203, otherwise, circulating the step S202;
s203, acquiring a receiving time t2 and a forwarding time t3 of the short message, calculating a difference value delta t between the standard time of the terminal equipment and the standard time of the network side when the short message is received, namely t3+ delta t3-t2, and then increasing a count value I by 1;
s204, judging whether I is equal to N, if so, continuing to step S205, otherwise, returning to step S202;
s205, judging whether the time interval between the receiving time of the earliest short message and the receiving time of the last short message in the N short messages is less than or equal to M, if so, continuing to step S206, otherwise, deleting the time information of the earliest short message, reducing I by 1, and returning to step S202;
s206, calculating delta t';
s207, compensating the local time by delta t ', namely adding delta t' to the time before compensation by the compensated local time. The process returns to step S201.
According to the above method, the local time deviation can be controlled within a certain range, for example, if the deviation is negative millionth, every 100 ten thousand seconds, that is, about 12 days, the local time of the terminal device will slow down by 1 second, and if M is set to 5 days, the local time deviation can be controlled within 1 second.
When the method is used independently, compensation is randomly carried out according to the received short message on the basis of manual time correction of a user, even if the accuracy of the manual time correction of the user is poor, after several times of compensation, the deviation can be continuously reduced, and the timing error caused by the frequency deviation of the crystal oscillator can be automatically compensated. If the method is matched with an accurate timing method of the embodiment, the timing error caused by the frequency deviation of the crystal oscillator can be automatically compensated, and the accuracy of the local time can be basically maintained without any cost or operation of a user.
The essence of the two timing methods of the present invention is that the timing is realized by using the standard time of the network side device carried in the short message as a reference, and the timing is completely and automatically realized at the terminal side without modifying any processing flow of the network side device.
Third embodiment, terminal device with instant timing function
In order to implement the instant correction method of the present invention, a terminal device with an instant timing function is further provided, as shown in fig. 3, the terminal device of the present invention includes a short message processing module and a real-time clock chip connected to the short message processing module, wherein the short message processing module is used for receiving and sending short messages and processing the short messages, the real-time clock chip includes a counter for timing according to a pulse per second generated by a crystal oscillator, and a count value of the counter is stored in a corresponding storage unit;
the terminal device further includes: the time correcting module is connected between the short message processing module and the real-time clock chip; wherein:
the time correction module triggers the short message processing module to send the time correction short message according to the time correction instruction of the user, the short message processing module returns the sending time, the receiving time and the forwarding time on the network side short message processing equipment of the time correction short message to the time correction module, and the time correction module corrects the local time count value in the real-time clock chip according to the time information of the time correction short message.
To accomplish the above method, the short message processing module may further include:
the timing short message generating unit generates the timing short message according to the trigger signal;
the short message receiving and sending unit is used for sending the timing short message and outputting the sending time of the timing short message; or receiving the timing short message returned by the network side and outputting the timing short message and the receiving time thereof;
the short message processing unit is used for identifying the timing short message, extracting the forwarding time of the timing short message and then outputting the receiving time and the forwarding time of the timing short message;
the timing module may further include:
the time correction triggering unit receives a time correction instruction of a user and outputs a triggering signal to the time correction short message generating unit;
the timing processing unit is used for receiving the relevant time information of the timing short message and calculating standard time, wherein the relevant time information comprises a sending time T1, a receiving time T2 and a network side forwarding time T3, and the standard time T is T3+ (T2-T1) ÷ 2;
and the timing execution unit is connected between the timing short message processing unit and the real-time clock chip and synchronously points the standard time T into a counting value storage unit in the real-time clock chip.
By using the terminal equipment, a user only needs to operate a time correction function key once or confirm a time correction function option once, and can realize accurate time correction by spending 1 short message expense, and the terminal equipment is compatible with the network of any existing system.
Fourth embodiment, terminal device with random timing function
As shown in fig. 4, the terminal device includes a short message processing module and a real-time clock chip connected to the short message processing module, and the terminal device further includes a timing module connected between the short message processing module and the real-time clock chip;
the short message processing module outputs the receiving time of each short message and the forwarding time of the short message on the network side short message processing equipment to the time correcting module, the time correcting module calculates the correction time according to the receiving time and the forwarding time of one short message or the set N short messages respectively, and corrects the local time count value in the real-time clock chip according to the calculation result.
In order to implement the random correction function of the present invention, the short message processing module may further include:
the short message receiving and sending unit is used for receiving and sending short messages and outputting the received short messages and the receiving time thereof;
the short message processing unit extracts the forwarding time of the short message on the network side short message processing equipment from the received short message and outputs the receiving time and the forwarding time of the short message together;
the timing module may further include:
the timing processing unit is used for receiving the information of the receiving time and the forwarding time of the short messages, calculating the correction time according to the time information of the N continuously received short messages and outputting the calculation result;
and the timing execution unit is connected between the timing processing unit and the real-time clock chip and used for correcting the local time count value in the real-time clock chip according to the calculation result.
And the time correction processing unit comprises an information storage subunit, and is used for temporarily storing the receiving time and the forwarding time of the N short messages received successively and storing relevant parameters, wherein the relevant parameters mainly comprise an empirical value of delta t.
By using the terminal equipment, a user does not need any operation, the terminal equipment automatically corrects the time difference according to the received short messages and controls the error of the local time within a set range, and the terminal equipment is also compatible with the network of any existing system.
Fifth embodiment, terminal device having both instant timing function and random correction function
As shown in fig. 5, in the third and fourth embodiments, the timing module includes a first timing unit and a second timing unit, and the working process is briefly described as follows:
the time correction triggering unit receives an instant time correction instruction of a user and triggers the time correction short message generating unit to generate a time correction short message, and the short message receiving and sending unit sends the time correction short message and transmits the sending time of the time correction short message to the first time correction processing unit;
after the short message processing unit identifies the short message with the same number of the sending terminal and the receiving terminal, the receiving time and the forwarding time of the short message are sent to the first timing unit and the second timing unit at the same time;
the first timing processing unit is used for carrying out instant timing according to the timing short message, receiving the phase sending time, the receiving time and the forwarding time of the timing short message, calculating standard time and outputting the standard time to the timing execution unit; and the first timing processing unit calculates an accurate measurement value of the delta T3 according to the relevant information of the timing short message every time the first timing processing unit executes instant timing, wherein the delta T3 is delta T3 (T2-T1) ÷ 2, and sends the value to the second timing processing unit to be stored or updated into the storage subunit, and relevant parameters stored by the storage subunit mainly comprise an empirical value and an accurate value of the delta T.
The user can also send the short message to the user, the short message processing unit does not need to distinguish whether the short message is a special time correction short message, the receiving time and the forwarding time of the short message are sent to the first time correction processing unit as long as the number of the sending terminal is the same as that of the receiving terminal, and the received time information is discarded if the sending time of the short message is not stored in the first time correction processing unit at the moment. Or, the timing trigger unit may also output a trigger signal to the first timing processing unit while triggering the timing short message generating unit, the first timing processing unit sets an instant correction flag bit after receiving the trigger signal, determines whether to perform the instant correction according to the flag bit when receiving the first receiving time and the first forwarding time, and cancels the flag bit after performing the instant correction, which may also prevent the above situations.
The working process of the second timing processing unit is the same as that of the fourth embodiment, the short message processing flow sends the receiving time and the forwarding time of each received short message to the second timing processing unit, and the second timing processing unit performs timing according to the preset processing flow and the related parameter information stored in the information storage subunit, which is not described herein again.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (22)
1. A method for correcting local time of terminal equipment is characterized by comprising the following steps:
A. the terminal equipment sends the timing short message received by the terminal to the short message processing equipment at the network side, and records the sending time T1 of the timing short message;
B. the network side short message processing equipment adds the forwarding time T3 of the short message in the timing short message and forwards the timing short message to the terminal equipment;
C. the terminal equipment receives the timing short message, records the receiving time T2 of the timing short message and extracts the forwarding time T3;
D. the terminal device calculates a standard time T ═ T3+ (T2-T1) ÷ 2+ Δ T4, and corrects the local time to the standard time T, where: and the delta T4 is more than or equal to 0 and is determined according to the processing capacity of the terminal equipment.
2. The method of claim 1, further comprising the steps of:
a 1', when a terminal device receives a short message each time, acquiring the receiving time and the forwarding time of the short message and calculating the deviation value of local time relative to standard time when receiving the short message, wherein: the forwarding time is added with the one-way transmission time of the short message between the network side short message processing equipment and the terminal equipment, and then the receiving time is subtracted;
b1 ', the terminal equipment returns to the step A1' after compensating the local time by an offset value.
3. The method of claim 1, further comprising the steps of:
a 2', the terminal device respectively obtains a receiving time t2 and a forwarding time t3 of N continuous short messages, and respectively calculates a deviation value Δ t of local time relative to standard time when each short message is received, which is (t3+ Δ t3) -t2, wherein N is greater than or equal to 2, and Δ t3 is one-way transmission time of the short message between the network side short message processing device and the terminal device;
b2 ', the terminal equipment calculates the statistical deviation value delta t' of the N short messages, compensates the local time by the statistical deviation value delta t ', and returns to the step A2'.
4. The method according to claim 3, wherein the step A2' comprises the following steps:
a21', clearing the number count value of the short message;
a22 ', judging whether a short message is received, if yes, obtaining t2 and t3 corresponding to the short message, calculating the delta t of the short message to be t3+ delta t3-t2, storing the calculation result and executing the step A23', otherwise, continuing the judgment;
a23 ', judging whether the count value is equal to N, if yes, executing step B2 ', otherwise returning to step A22 '.
5. The method as claimed in claim 4, wherein a threshold value of the receiving duration of N consecutive short messages is set, and in the step B2 ', it is determined whether the receiving time interval of the first short message and the last short message in the N short messages is less than or equal to the threshold value, if yes, the statistical deviation value Δ t ' is calculated and the local time is compensated, and then the step a21 ' is returned; otherwise, deleting the time information of the first short message, subtracting 1 from the count value and returning to the step A22'.
6. The method of claim 3, wherein Δ t' is:
average of N Δ t; or,
when N is more than or equal to 4, after the maximum value and the minimum value in N delta t are removed, the average value of N-2 delta t is remained; or,
when N is more than or equal to 6, the N deltat are arranged in sequence, and the average value of the remaining N-4 deltat after the first two and the second two are removed.
7. The method as claimed in claim 2 or 3, wherein the one-way transmission time between the network-side short message processing device and the terminal device includes a pre-stored empirical transmission time and a standard transmission time, wherein the standard transmission time is equal to half of the difference between the receiving time and the sending time of the timing short message, and is calculated and updated by the terminal device each time step D is executed.
8. The method of claim 7, wherein the method further comprises, after each time step B1 'or B2' is executed by the terminal device, first determining whether the standard transmission time is saved, and if so, assigning Δ t3 to the standard transmission time, otherwise, assigning Δ t3 to an empirical transmission time.
9. The method of claim 1, wherein the terminal device starts step a according to a user timing instruction, wherein the user timing instruction is input by operating a timing function key provided on the terminal or confirming a timing function option in a menu.
10. The method of claim 1, wherein the content of the timing short message is null or set timing information.
11. A method for correcting local time of terminal equipment is characterized by comprising the following steps:
a1, when the terminal equipment receives a short message, acquiring the receiving time and the forwarding time of the short message and calculating the deviation value of the local time relative to the standard time when receiving the short message, wherein the deviation value of the local time relative to the standard time is as follows: the forwarding time is added with the one-way transmission time of the short message between the network side short message processing equipment and the terminal equipment, and then the receiving time is subtracted;
b1, the terminal equipment returns to the step a1 after compensating the local time by an offset value.
12. A method for correcting local time of terminal equipment is characterized by comprising the following steps:
a2, the terminal device respectively obtains a receiving time t2 and a forwarding time t3 of N continuous short messages, and respectively calculates an offset value delta t of local time relative to standard time when each short message is received, which is (t3+ delta t3) -t2, wherein N is more than or equal to 2, and delta t3 is one-way transmission time of the short message between the network side short message processing device and the terminal device;
b2, the terminal equipment calculates the statistical deviation value delta t 'of the N short messages, compensates the local time by the statistical deviation value delta t', and returns to the step a 2.
13. The method as claimed in claim 12, wherein the step a2 includes the following steps:
a21, clearing the number count value of the short messages;
a22, judging whether a short message is received, if so, acquiring t2 and t3 corresponding to the short message, calculating the delta t corresponding to the short message to be t3+ delta t3-t2, storing the calculation result and executing the step a13, otherwise, continuing to judge;
a23, judging whether the count value is equal to N, if yes, executing step b2, otherwise, returning to step a 22.
14. The method of claim 13, wherein a threshold value of the receiving duration of N consecutive short messages is set, and in step b2, it is determined whether the receiving time interval between the first short message and the last short message in the N short messages is less than or equal to the threshold value, if yes, the statistical deviation value Δ t' is calculated and the local time is compensated, and then the step a21 is returned; otherwise, deleting the time information of the first short message, subtracting 1 from the count value, and returning to the step a 22.
15. The method of claim 12, wherein in step b2, Δ t' is:
average of N Δ t; or,
when N is more than or equal to 4, after the maximum value and the minimum value in N delta t are removed, the average value of N-2 delta t is remained; or,
when N is more than or equal to 6, the N deltat are arranged in sequence, and the average value of the remaining N-4 deltat after the first two and the second two are removed.
16. A terminal device comprises a short message processing module and a real-time clock chip connected with the short message processing module, and is characterized by also comprising a timing module connected between the short message processing module and the real-time clock chip;
the time correction module triggers the short message processing module to send the time correction short message according to the time correction instruction of the user, the short message processing module returns the sending time, the receiving time and the forwarding time on the network side short message processing equipment of the time correction short message to the time correction module, and the time correction module corrects the local time count value in the real-time clock chip according to the time information of the time correction short message.
17. The terminal device of claim 16,
the short message processing module comprises:
the timing short message generating unit generates the timing short message according to the triggering of the timing module;
the short message receiving and sending unit is used for sending the timing short message and outputting the sending time of the timing short message; or receiving the timing short message and outputting the timing short message and the receiving time thereof;
the short message processing unit is connected with the short message receiving and sending unit, identifies the timing short message, extracts the forwarding time of the timing short message, and then outputs the receiving time and the forwarding time of the timing short message together;
the timing module comprises:
the timing trigger unit generates a trigger signal when receiving a timing instruction of a user and outputs the trigger signal to the timing short message generation unit;
the first timing processing unit receives the information of the sending time, the receiving time and the forwarding time of the timing short message from the short message receiving and sending unit and the short message processing unit respectively and calculates standard time;
and the timing execution unit is connected between the first timing processing unit and the real-time clock chip and corrects the local time count value in the real-time clock chip into standard time.
18. The terminal device of claim 17, wherein the timing module further comprises: the second timing processing unit is connected between the short message processing unit and the real-time clock chip;
the short message processing unit outputs the receiving time and the forwarding time of each short message to the second timing processing unit, the second timing processing unit calculates the correction time according to the receiving time and the forwarding time of one short message or at least two short messages continuously received and outputs the calculation result to the timing execution unit, and the timing execution unit corrects the local time count value in the real-time clock chip according to the calculation result.
19. The terminal device of claim 18, wherein the second timing processing unit comprises an information storage subunit, configured to temporarily store the receiving time and the forwarding time of the short message and store the relevant parameters.
20. A terminal device comprises a short message processing module and a real-time clock chip connected with the short message processing module, and is characterized by also comprising a timing module connected between the short message processing module and the real-time clock chip;
the short message processing module outputs the receiving time of each short message and the forwarding time of the short message on the network side short message processing equipment to the time correcting module, the time correcting module calculates the correcting time according to the receiving time and the forwarding time of one short message or at least two short messages continuously received respectively, and corrects the local time count value in the real-time clock chip according to the calculation result.
21. The terminal device of claim 20,
the short message processing module comprises:
the short message receiving and sending unit is used for receiving and sending short messages and outputting the received short messages and the receiving time thereof;
the short message processing unit is connected with the short message receiving and sending unit, extracts the forwarding time of the short message from the received short message and outputs the receiving time and the forwarding time of the short message together;
the timing module comprises:
the time correction processing unit receives the information of the receiving time and the forwarding time of the short message from the short message processing unit, calculates the correction time and outputs the calculation result;
and the timing execution unit is connected between the timing processing unit and the real-time clock chip and used for correcting the local time count value in the real-time clock chip according to the calculation result.
22. The terminal device of claim 21, wherein the timing processing unit includes an information storage subunit, configured to temporarily store a receiving time and a forwarding time of the short message, and store the relevant parameters.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100016522A CN100455051C (en) | 2006-01-20 | 2006-01-20 | Method for correcting terminal device local time and terminal device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100016522A CN100455051C (en) | 2006-01-20 | 2006-01-20 | Method for correcting terminal device local time and terminal device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1859616A true CN1859616A (en) | 2006-11-08 |
CN100455051C CN100455051C (en) | 2009-01-21 |
Family
ID=37298468
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2006100016522A Expired - Fee Related CN100455051C (en) | 2006-01-20 | 2006-01-20 | Method for correcting terminal device local time and terminal device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100455051C (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101442797B (en) * | 2007-11-19 | 2011-03-02 | 中兴通讯股份有限公司 | Method for processing network time |
CN103645960A (en) * | 2013-12-23 | 2014-03-19 | 北京安兔兔科技有限公司 | Method and system for determining whether performance test is valid |
CN103874040A (en) * | 2012-12-18 | 2014-06-18 | 联芯科技有限公司 | Method for mobile terminal to process newly received short messages and mobile terminal |
CN105722210A (en) * | 2016-03-02 | 2016-06-29 | 广东欧珀移动通信有限公司 | Crystal oscillator static frequency error calibration method and system |
CN109871923A (en) * | 2019-02-19 | 2019-06-11 | 深圳市西克智能技术有限公司 | Time-correcting method, terminal device and storage medium based on two dimensional code |
CN111263320A (en) * | 2020-01-16 | 2020-06-09 | 北京北科驿唐科技有限公司 | Method and device for clock synchronization through short message |
CN111431649A (en) * | 2019-11-27 | 2020-07-17 | 杭州海康威视数字技术股份有限公司 | Timing processing method and device |
CN114006674A (en) * | 2021-12-31 | 2022-02-01 | 深圳市海清视讯科技有限公司 | Time correction method, device, equipment and storage medium for attendance equipment |
CN114125799A (en) * | 2021-11-12 | 2022-03-01 | 中国电信股份有限公司 | Communication time length metering method and device |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE69813742T2 (en) * | 1997-12-15 | 2003-12-24 | Koninklijke Philips Electronics N.V., Eindhoven | Cordless phone and timer management method |
DE10040035B4 (en) * | 2000-08-11 | 2005-10-06 | T-Mobile Deutschland Gmbh | Method for synchronizing the internal clock of a mobile station with the local time |
KR100396785B1 (en) * | 2001-10-19 | 2003-09-02 | 엘지전자 주식회사 | Apparatus and method for compensating time error of gsm terminal |
CN1428965A (en) * | 2001-12-25 | 2003-07-09 | 深圳市中兴通讯股份有限公司上海第二研究所 | Method for correcting clock ageing of telecommunication equipment |
KR100424336B1 (en) * | 2003-06-24 | 2004-03-22 | 주식회사 엠솔테크 | Method for setting time of mobile terminal of Global System for Mobile communications |
-
2006
- 2006-01-20 CN CNB2006100016522A patent/CN100455051C/en not_active Expired - Fee Related
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101442797B (en) * | 2007-11-19 | 2011-03-02 | 中兴通讯股份有限公司 | Method for processing network time |
CN103874040A (en) * | 2012-12-18 | 2014-06-18 | 联芯科技有限公司 | Method for mobile terminal to process newly received short messages and mobile terminal |
CN103645960A (en) * | 2013-12-23 | 2014-03-19 | 北京安兔兔科技有限公司 | Method and system for determining whether performance test is valid |
CN103645960B (en) * | 2013-12-23 | 2017-07-21 | 北京安兔兔科技有限公司 | Whether performance test effectively determines method and system |
CN105722210A (en) * | 2016-03-02 | 2016-06-29 | 广东欧珀移动通信有限公司 | Crystal oscillator static frequency error calibration method and system |
CN105722210B (en) * | 2016-03-02 | 2019-03-08 | Oppo广东移动通信有限公司 | A kind of calibration method and calibration system of the static frequency error of crystal oscillator |
CN109871923A (en) * | 2019-02-19 | 2019-06-11 | 深圳市西克智能技术有限公司 | Time-correcting method, terminal device and storage medium based on two dimensional code |
CN111431649A (en) * | 2019-11-27 | 2020-07-17 | 杭州海康威视数字技术股份有限公司 | Timing processing method and device |
CN111431649B (en) * | 2019-11-27 | 2022-09-02 | 杭州海康威视数字技术股份有限公司 | Timing processing method and device |
CN111263320A (en) * | 2020-01-16 | 2020-06-09 | 北京北科驿唐科技有限公司 | Method and device for clock synchronization through short message |
CN114125799A (en) * | 2021-11-12 | 2022-03-01 | 中国电信股份有限公司 | Communication time length metering method and device |
CN114125799B (en) * | 2021-11-12 | 2024-06-07 | 中国电信股份有限公司 | Communication duration metering method and device |
CN114006674A (en) * | 2021-12-31 | 2022-02-01 | 深圳市海清视讯科技有限公司 | Time correction method, device, equipment and storage medium for attendance equipment |
CN114006674B (en) * | 2021-12-31 | 2022-04-01 | 深圳市海清视讯科技有限公司 | Time correction method, device, equipment and storage medium for attendance equipment |
Also Published As
Publication number | Publication date |
---|---|
CN100455051C (en) | 2009-01-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN1859616A (en) | Method for correcting terminal device local time and terminal device | |
CN1311655C (en) | Wireless communication system and method which improves reliability and throughput of communication and retransmission timeout determining method | |
CN1729709A (en) | Cordless communication network and flow control methods | |
CN1529965A (en) | Common Channel flow control method and system | |
CN1822532A (en) | Method for preventing retransmissions due to delay in a wireless network and communication devices using the method | |
CN1794838A (en) | Mobile terminal control program and mobile terminal equipment | |
CN1498009A (en) | Radio Communication terminal | |
CN1478345A (en) | Flow control in packet-switched communication network using leaky bucket algorithm | |
CN1855935A (en) | Information processing apparatus and method, program, and recording medium | |
CN1535045A (en) | Communication terminal, base station, server, network system and switching method | |
CN1620766A (en) | Method for scheduling transmission of MBMS data in UMTS | |
CN1946047A (en) | Radio communication system, radio communication apparatus and computer program | |
CN101043661A (en) | Method and apparatus for processing PoC service media request | |
CN1677850A (en) | Automatic gain control device, automatic gain control method, radio communication terminal, system and method | |
CN1649371A (en) | Storing query results to reduce number portability queries in wireless network | |
CN1870719A (en) | Method and system for receiving-end and source-end synchonous of broadcast TV service | |
CN1810018A (en) | Method for controlling a service performed in a radiocommunication device for optimising the management of the charge of the battery, and corresponding control device | |
CN1647461A (en) | Communication control method in connection-type communication, related relay device, and accounting management device | |
CN101047517A (en) | Block service charging method, system and its equipment | |
CN1852347A (en) | Dff-line fault information report method, device and off-line fault reason positioning system | |
CN1848001A (en) | Electronic device, time correction method and time correction program thereof | |
CN101047880A (en) | Message transmission method and system | |
CN1265597C (en) | Local proxy server | |
CN1879351A (en) | Adapting playout buffer based on audio burst length | |
CN1507174A (en) | Mobile communication system, radio base station control system and radio base station control method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20090121 Termination date: 20140120 |