METHOD AND ASSOCIATED TIME MANAGER FOR MANAGING TIME RELATION BETWEEN SYSTEM TIMES OF DIFFERENT REMOTE SYSTEMS |
|||||||
申请号 | US15147941 | 申请日 | 2016-05-06 | 公开(公告)号 | US20170164306A1 | 公开(公告)日 | 2017-06-08 |
申请人 | MEDIATEK Inc.; | 发明人 | Sheng-Yu Huang; | ||||
摘要 | The present invention provides a method and an associated time manager for managing a time relation between system times of different remote systems, including: at a first moment, obtaining a first value of a first system time and accessing a periodically updating reference counter to obtain a first count; at a second moment, updating the time relation by: obtaining a second value of a second system time along with a second count, and calculating a second value of the first system time by summing the first value of the first system time and an extrapolation interval calculated according to a difference between the first count and the second count. Thus, when synchronization with a first remote system ends, a fourth value of the first system time may be calculated according to a fourth value of the second system time and a previously stored time relation. | ||||||
权利要求 | What is claimed is: |
||||||
说明书全文 | This application claims the benefit of U.S. provisional application Ser. No. 62/264,368, filed Dec. 8, 2015, the subject matter of which is incorporated herein by reference. The present invention relates to method and associated time manager for managing time relation between system times of different remote systems, and more particularly, to method and associated time manager for managing the time relation locally in a terminal without extra services and interoperation of the remote systems. Modern mobile equipment, such as smart phone, wearable gadget (eye glasses, wrist watch, etc.), portable computer, tablet computer, hand-held game console, automobile navigation device, digital camera and digital camcorder, etc., is equipped with wireless accessibilities to different remote systems for various services, including mobile telecommunication systems of different generations (e.g., 3G and 4G) for interchanging voice, text messages, e-mails and/or data, global navigation satellite positioning system (GLASS) for locating, and/or local network system (e.g., Wi-Fi network system) for interchanging information. To correctly and fully access and utilize services involving a remote system, the mobile equipment works as a terminal to synchronize with the remote system by adjusting local clock and/or local signal timing to keep on aligning timing received and/or retrieved from the remote system, e.g., aligning start, middle and/or end of symbol(s), frame(s), sub-frame(s), packet(s), beacon(s), pilot(s), header(s), delimiter(s) and/or synchronization word(s) in a remote signal received from the remote system. After achieving synchronization with a remote system, the terminal obtains a corresponding system time via synchronization with the remote system; for example, the terminal may obtain a value of the system time whenever timing alignment occurs during synchronization with the remote system, wherein value of the system will update (increase or decrease) with time, and therefore can reflect elapse of time. For example, if the remote system is a mobile telecommunication system, the corresponding system time may be valued in terms of SFN (system frame number), and timing alignments to the remote system may be achieved by performing frame synchronizations. If the remote system is GNSS, the corresponding system time may be valued in terms of TOW (time of week), and timing alignments to the remote system may be achieved by performing PVT (position, velocity, time) fixings. If the remote system is Wi-Fi network system, the corresponding system time may be valued in terms of symbol timing, and timing alignments to the remote system may be achieved by performing symbol synchronizations. When the synchronization with the remote system ends or is lost, e.g., when the terminal stops receiving remote signals from the remote system, the terminal cannot track and maintain the corresponding system time, since there is no remote signal for the terminal to align. While a terminal has accesses to multiple remote systems, the terminal tracks multiple system times respectively via synchronizations with the multiple remote systems. It is beneficial for the terminal to build, update and store a time relation between different system times during synchronization with different remote systems; for example, after synchronization with a first remote systems ends and resynchronization with the first remote system later desired, the terminal may speed up the resynchronization by locally exploiting the previously stored time relation and a system time of a second remote system which is still synchronized with the terminal. An objective of the invention is providing a method for managing a time relation between system times of different remote systems by a terminal (e.g., 10 in The method may further include (e.g., 612 in In an embodiment, calculating the aforementioned expansion interval may include: multiplying a unit timing duration (e.g., TS in In an embodiment, updating the time relation at the second moment may further include (e.g., 412 in In an embodiment, calculating the aforementioned extrapolation interval may include: multiplying a unit counter duration (e.g., Ttick in 606 of In an embodiment, calculating the aforementioned extrapolation interval may include: calculating a system time difference according to a difference between two preceding values of the first system time obtained via synchronization with the first remote system 102 respectively at two different preceding moments which are not later than the second moment, calculating a count difference according to a difference between two preceding counts of the reference counter respectively obtained at the two different preceding moments, calculating a second compensation factor (e.g., (1+Dtick) in Synchronizing with the first remote system may be achieved via a first interface circuit (e.g., one of 102 to 108 in In an embodiment, the method may further include (e.g., 812 in The first remote system with the first system time and the second remote system with the second system time may be different two of following: a GNSS with a system time valued in terms of TOW, a mobile telecommunication system with a system time valued in terms of SFN, and a Wi-Fi network system with a system time valued in terms of symbol timing. An objective of the invention is providing a time manager (e.g., 100 in At the second moment, the processor may update the time relation further by: calculating a first time difference according to a difference between two previous values of the first system time obtained via synchronization with the first remote system respectively at two different previous moments which are not later than the second moment, calculating a second time difference according to a difference between two prior values of the second system time obtained via synchronization with the second remote system respectively at two different prior moments which are not later than the second moment, calculating a clock drift according to a ratio of the first time difference and the second time difference, and storing the clock drift in the memory as a portion of the updated content of the time relation. Numerous objects, features and advantages of the present invention will be readily apparent upon a reading of the following detailed description of embodiments of the present invention when taken in conjunction with the accompanying drawings. However, the drawings employed herein are for the purpose of descriptions and should not be regarded as limiting. The above objects and advantages of the present invention will become more readily apparent to those ordinarily skilled in the art after reviewing the following detailed description and accompanying drawings, in which: Please refer to In the example of Along with Step 202: The interface circuit 102 may start executing the flowchart 200 during synchronization with the remote system 12. Step 204: When the interface circuit 102 achieves a PVT fixing, the interface circuit 102 obtains a value Tp of the system time T, and also accesses the reference counter 130 to obtain a count Tickp. Thus the value Tp is related to the count Tickp to reflect that the value Tp corresponds to the count Tickp. Step 206: The interface circuit 102 (or the processor 120) builds a time relation by a tuple (Tp,Tickp). While obtaining the value Tp and the count Tickp, the interface circuit 102 (or the processor 120) may compensate hardware latencies of the interface circuit 102 beforehand. The hardware latencies may include time elapsed between “wireless signals reaching antenna of the interface circuit 102” and “achieving PVT fixing according to the signals.” The hardware latencies may be estimated (e.g., by calibration) and subtracted from obtained value of the system counter T and/or obtained count of the reference counter 130, so the resultant time relation (Tp,Tickp,) excludes hardware latencies introduced by operations of the interface circuit 102. Step 208: The interface circuit 102 (or the processor 120) stores the time relation (Tp,Tickp) in the memory 140. Step 210: If time elapsed after step 208 is not longer than a threshold THTperiod, the interface circuit 102 continues waiting; when the time elapsed after step 208 becomes greater than or equal to a threshold THTperiod, the interface circuit 102 (or the processor 120) iterates back to step 204 to build and store a new time relation, e.g., (Tp+1,Tickp+1) with a new value Tp+1 of the system time T and a new count Tickp+1 obtained at a new PVT fixing. The threshold THTperiod may be decided according to clock drift between system time T and the reference counter 130, also according to time accuracy requirement. For example, if the local clock 152 for triggering the reference counter 130 suffers greater clock drift (variation of clock rate) with respect to the system time T, then the threshold THTperiod may be set shorter. Similarly, if higher time accuracy is required, the threshold THTperiod may be set shorter. Shorter threshold THTperiod may cause the time relation between the system time S and the reference counter 130 to be refreshed more frequently. Along with Following the flowcharts 200 and 300, the system times T and S are related to a common time axis marked by counts Tick of the reference counter 130. Although hardware latencies of the interface circuits 102 and 106 may be different, compensations at steps 206 and 306 suppress such difference respectively by tracking the system time T back to the moments when signals from the remote system 12 reach antenna of the interface circuits 102, and tracking the system time S back to the moments when signals from the remote system 16 reach antenna of the interface circuits 106. According to the time relations (T,Tick) and (S,Tick), the different system times T and S respectively obtained via synchronizations with the remote systems 12 and 16 may be related together by executing a flowchart 400 shown in Along with Step 402: The processor 120 starts the flowchart 400. Step 404: If both the interface circuits 102 and 106 are synchronized respectively with the remote systems 12 and 16 to keep the system times T and S active (available), the processor 120 proceeds to step 406, otherwise proceeds to step 408. Step 406: If both the time relations (T,Tick) and (S,Tick) are built (respectively by execution of the flowcharts 200 and 300), the processor 120 proceeds to step 410, otherwise proceeds to step 408. Step 408: The processor 120 keeps previous time relation (T,S,DS). Step 410: At a current moment t1, the interface circuit 106 performs a frame synchronization with the remote system 16 to obtain a value S1 of the system time 5, also concurrently accesses the reference counter 130 to obtain a count Tick1, so as to build a time relation (S1,Tick1) by executing step 306. According to the count Tick1 and a time relation (T0,Tick0) which is previously built at an earlier moment t0 by executing step 206 with a (latency compensated) value T0 of the system time T obtained by performing a PVT fixing with the remote system 12 at the moment t0 and a count Tick0 obtained by accessing the reference counter 130 at the moment t0, the processor 120 calculates an extrapolation interval according to a difference (Tick1−Tick0) between the counts Tick0 and Tick1, and calculates a value T1 of the system time T by summing the value T0 and the extrapolation interval. The resultant calculated value T1 may be regarded as a value of the system T at the moment t1, and the tuple (T1,S1) may be built to cross-correlate concurrent values of the system times T and S. Although the interface circuit 106 performs a frame synchronization at the moment t1 and therefore obtain the value S1 of the system time S, the interface circuit 102 does not have to perform a PVT fixing concurrently at the moment t1. Unlike the value T0 which is obtained via a PVT fixing at the moment t0, if the interface circuit 102 does not perform another PVT fixing at the moment t1, the value T1 of the system time T at the moment t1 cannot be obtained via PVT fixing. However, in order to build the relation (T1,S1) at the moment t1, the value T1 of the system time T is estimated by extrapolating the time relation (T0,Tick0) at the moment t0 to the moment t1 with help of the count Tick1 obtained at the moment t1. In an embodiment, the processor 120 calculates the extrapolation interval by multiplying a unit counter duration Ttick with the difference (Tick1−Tick0), and calculates a value T1 of the system time T by summing the value T0 and the extrapolation interval, hence the value T1 is calculated by T1=T0+(Tick1−Tick0)*Ttick, wherein the unit counter duration Ttick is associated with a time span per count of the reference counter 130. For example, assuming an ideal (expected) interval for count of the reference counter 130 to update (increase or decrease) by one is X seconds, and an ideal interval for value of the system time T to update by one is Y seconds, then an ideal value of the unit counter duration Ttick will equal X/Y. Equivalently, if an ideal interval for the reference counter 130 to update its count by A equals an ideal interval for the system time T to update its value by B, then an ideal value of the unit counter duration Ttick will equal B/A. However, since the local clock 152 may suffer unexpected drift with respect to the system time T, the unit counter duration Ttick may consequently drift away from its ideal value. To compensate the undesired drift, the processor 120 may calculate the expansion interval by multiplying the ideal value of the unit counter duration Ttick with a compensation factor (1+Dtick) and the difference (Tick1−Tick0), and calculate the value T1 by T1=T0+(Tick1−Tick0)*Ttick*(1+Dtick). The processor 120 may calculate the compensation factor (1+Dtick) by: calculating a system time difference (TA2−TA1) according to a difference between two preceding values TA1 and TA2 of the system time T obtained via synchronization (i.e., by performing PVT fixings) with the remote system 102 respectively at two different preceding moments tA1 and tA2 which are not later than the moment t1 (i.e., tA1<tA2≦t1); calculating a count difference (TickA2−TickA1) according to a difference between two preceding counts TickA1 and TickA2 of the reference counter 130 obtained by accessing the reference counter 130 respectively at the two different preceding moments tA1 and tA2; and calculating the compensation factor (1+Dtick), according to the ideal unit counter duration Ttick and a ratio of the system time difference (TA2−TA1) and the count difference (TickA2−TickA1) e.g., (1+Dtick)=((TA2−TA1)/(TickA2−TickA1))/Ttick. Step 412: The processor 120 further calculates a clock drift DS by: calculating a first time difference (TB2−TB1) according to a difference between two previous values TB1 and TB2 of the system time T obtained via synchronization with the remote system 12 (e.g., obtained by performing PVT fixings) respectively at two different previous moments tB1 and tB2 which are not later than the moment t1 (i.e., tB1<tB2≦t1); calculating a second time difference (SC2−SC1) according to a difference between two prior values SC1 and SC2 of the system time S obtained via synchronization with the remote system 16 (e.g., obtained by performing frame synchronizations) respectively at two different prior moments tC1 and tC2 which are not later than the second moment t1 (i.e., tC1<tC2≦t1); and calculating the clock drift DS according to an ideal value of a unit timing duration TS and a ratio of the first time difference (TS2−TS1) and the second time difference (SC2−SC1), e.g., DS=((TB2−TB1)/(SC2−SC1))/TS−1. The moments tB1, tB2, tC1 and tC2 may be different. The unit timing duration TS is associated with a time span per unit value of the system time S, as well as a time span per unit value of the system time T. For example, assuming an ideal (expected) interval for value of the system time S to update by one is XS seconds, and an ideal interval for value of the system time T to update by one is XT seconds, then an ideal value of the unit timing duration TS will equal XS/XT. Equivalently, if an ideal interval for the system time S to update its value by AS (e.g., increase its value from A0 to (A0+AS)) equals an ideal interval for the system time T to update its value by BT, then an ideal value of the unit counter duration TS will equals BT/AS. As will be described later in Step 414: The processor 120 stores values T1, S1 and the clock drift DS in the memory 140 as content of a cross-system time relation between the system times S and T. Along with Steps 410, 412 and 414 of the flowchart 400 may be repeated whenever the interface circuit 102 performs a PVT fixing and/or whenever the interface circuit 106 performs a frame synchronization, as shown in an operation 608 of The cross-system time relation (T,S,DS) associating the system times S and T are beneficial, e.g., for speeding up recovery of lost synchronization. In the example of Hence, when the interface circuit 102 attempts to resume synchronization with the remote system 12 at the moment tb, the stored time relation (Tx,Sx,DS) can be utilized to assistant the resynchronization, e.g., to shorten TTFF (time to first fix). Along with Step 502: The interface circuit 102, (e.g., a positioning engine (PE) of the interface circuit 102, not shown) or the processor 120 starts the flowchart 500 at a moment tn when the interface circuit 102 attempts to resume synchronization with the remote system 12. Step 504: If a previously stored cross-system time relation (e.g., (Tx,Sx,DS)) is available, proceed to step 506, otherwise proceed to step 512. Step 506: The interface circuit 102 or the processor 120 obtains a time relation (Sn,Tickn) built at the moment tn by the interface circuit 106 following steps 304, 306 and 308 of the flowchart 300. Step 508: The interface circuit 102 or the processor 120 accesses the stored time relation (Tx,Sx,DS) updated previously at the moment tx before the moment ta at which synchronization with the remote system 12 ends, so as to obtain the stored value Tx of the system time T and the stored value Sx of the system time S, then calculates an expansion interval according to a difference (Sn−Sx) between the value Sn of the system time S and the stored value Sx of the system time S, and sums the stored value Tx of the system time T and the expansion interval. In an embodiment, calculating the expansion interval may include: multiplying the ideal value of the unit timing duration TS (mentioned in step 412) with the difference (Sn−Sx); i.e., the expansion interval is calculated by TS*(Sn−Sx). In an embodiment, calculating the expansion interval may include: calculating a compensation factor (1+DS) according to the stored clock drift DS of the stored time relation (Tx,Sx, DS), multiplying the ideal value of the unit timing duration TS with the compensation factor (1+DS) and the difference (Sn−Sx), i.e., the expansion interval is calculated by TS*(Sn−Sx)*(1+DS), as shown in Step 510: The value Tn of the system T calculated in step 508 according to the stored time relation (Tx,Sx,DS) may be utilized (e.g., by a measurement engine (ME) of the interface circuit 102, not shown) as an accurate result of performing a first fixing with the satellites of the remote systems 12, TTFF of the interface circuit 102 may hence be effectively shortened. Step 512: If there is no available stored cross-system time relation between the system times S and T, the interface circuit 102 has to establish synchronization with the remote system 12 all over again without time assistance derived from the stored time relation (Tx1,Sx,DS) and the system time S, hence TTFF will be longer. Step 514: The flowchart 500 ends when the interface circuit 102 achieves synchronization with the remote system 12. While the cross-system time relation (S,T,DS) may provide timing assistance for resynchronization of the system time T as shown in the operation 612 of As shown in Steps 410, 412 and 414 of the flowchart 400 may be repeated whenever the interface circuit 102 performs a PVT fixing and/or whenever the interface circuit 106 performs a frame synchronization, as shown in an operation 808 of In the example of Hence, when the interface circuit 106 attempts to resume synchronization with the remote system 16 at the moment t′b, the stored time relation (T′x,S′x,DS) can be utilized to assistant the resynchronization by executing the flowchart 700 shown in Step 702: The interface circuit 106 or the processor 120 starts the flowchart 700 at a moment t′n when the interface circuit 106 attempts to resume synchronization with the remote system 16. Step 704: If previous cross-system time relation (e.g., (T′x,S′x,DS)) is available, proceed to step 706, otherwise proceed to step 712. Step 706: The interface circuit 106 or the processor 120 obtains a time relation (T′n,Tick′n) built at the moment t′n by the interface circuit 102 following steps 204, 206 and 208 of the flowchart 200. Step 708: The interface circuit 106 or the processor 120 accesses the time relation (T′x,S′x,DS) updated previously at the moment t′x before the moment t′a at which synchronization with the remote system 16 ends, so as to obtain the stored value T′x of the system time T and the stored value S′x of the system time S, then calculates an expansion interval (T′n−T′x)*TT*(1+DT) according to a difference (T′n−T′x) between the value T′n of the system time T and the stored value T′x of the system time T, and sums the stored value S′x of the system time S and the expansion interval TT*(Tn−Tx)*(1+DT). In an embodiment, calculating the expansion interval TT*(Tn−Tx)*(1+DT) may include: calculating a compensation factor (1+DT) according to the stored clock drift DS of the stored time relation (Tx,Sx,DS) by (1+DT)=1/(TS*(1+DS)*TS), and multiplying an ideal value of a unit timing duration TT (T1−1TS) with the compensation factor (1+DT) and the difference (T′n−T′x). Step 710: The value S′n of the system S calculated in step 508 according to the stored time relation (T′x,S′x,DS) may be utilized as an accurate result of performing a first frame synchronization with the remote systems 16, resynchronization of the interface circuit 102 may hence be effectively speeded up. Step 712: If there is no available stored cross-system time relation between the system times S and T, the interface circuit 106 has to establish synchronization with the remote system 16 all over again, without time assistance derived from the stored time relation (T′x,S′x,DS) and the system time T. Step 714: The flowchart 700 ends when the interface circuit 106 achieves synchronization with the remote system 16. Although aforementioned discussion assumes that the system time S is maintained by the interface circuit 106 ( In To sum up, the invention provides mechanism for managing relations of different system times which correspond to different remote systems. The management mechanism associates different system times with a same local reference counter of a terminal (e.g., While the invention has been described in terms of what is presently considered to be the most practical and preferred embodiments, it is to be understood that the invention needs not be limited to the disclosed embodiment. On the contrary, it is intended to cover various modifications and similar arrangements included within the spirit and scope of the appended claims which are to be accorded with the broadest interpretation so as to encompass all such modifications and similar structures. |