Background technology
In current communication system, in order to reduce the power consumption of chip, chip is generally in when not working
Sleep state.When chip is after sleep state is switched to duty, terminal needs and base station was done on the time
Synchronization.Two kinds of mode of operations, normal count mode and slow timing is operationally provided for this intervalometer
Device pattern.Under normal count mode, the intervalometer sampling clock of this pattern (is produced by fast clock division
Raw) counting, for GSM mode, count frequency is 1.08MHz, for TD pattern, counting frequency
Rate is 1/8 chip, i.e. 10.24MHz, for TD-LTE and LTE fdd mode, counting frequency
Rate is 30.72MHz.Under slow Timer modes, (clock is general for slow intervalometer Slow Clock counting
Use 32.768KHz), no matter which kind of pattern.When chip normally works, runs is normally
Count mode, when certain pattern enters low power consumpting state, can arrange this mode timers and be operated in the most calmly
Time device pattern time, then intervalometer is switched to slow Timer modes, when all intervalometers all work
When slow Timer modes, and other need the module of fast clock the most operationally, and now chip is permissible
Entering sleep, and when arriving the wakeup time set, can send sleep awakening operation, chip will be by
Waking up up, then intervalometer can automatically switch to normal count mode.During because hardware can compensate slow automatically
Clock deviation, as a example by TD intervalometer, when normal count mode is switched to slow Timer modes, regularly
Device counts always, during until the rising edge of a slow clock arrives, is transmitted by the current count value of intervalometer
To slow intervalometer, intervalometer stops counting simultaneously, and now runs is at slow Timer modes, fixed slowly
Time device counting clock be 32.768KHz, it is not to add 1 by count value in each clock cycle,
But (i.e. the 32.768KHz clock cycle for a standard is equal to 312.5 to add 312.5
The 10.24MHz clock cycle, this value is obtained by 32K calibration module, thus can be automatic by hardware
Compensate the error of slow clock).When arranging intervalometer after slow Timer modes is switched to normal count mode,
When the rising edge of a slow clock arrives, slow intervalometer stops counting, simultaneously by the integer portion of count value
Dividing and pass to intervalometer, intervalometer continues counting, and now runs is at normal count mode.So
Intervalometer both patterns can accomplish seamless switching, this ensures that theres at chip after sleep,
Intervalometer remains to keep and the time synchronization information of base station.During system sleep, only slow clock runs, but
The precision and stability of slow clock crystal oscillator is limited, does not loses for lock in time after ensureing sleep, and needs are high
This Slow Clock is calibrated by speed stabilizing clock.By calculating the slow timer clock cycle specifying number
The clock cycle number (this value comprises decimal) of interior normal enumerator, thus obtain the school of speed intervalometer
Quasi-value.Baseband chip can be according to the state (whether entering sleep state) of each mode timers, each
Whether CPU enters sleep pattern, and other module (such as DMA:Direct Memory Access,
HWA:Hardware Accelerator etc.) whether enter idle condition, judge baseband chip and other
Module (such as power module, radio-frequency module, audio-frequency module etc.), if enter low-power consumption and (be designated as the degree of depth
Sleep state).Under deep sleep, the fast clock of input that whole system is closed, and relevant to fast clock
Electricity under functional module, to reach the purpose of deep power-saving.
As it has been described above, in the condition of baseband chip sound sleep, have whether each mode timers enters sleep
State, (Real-Time Clock, during general employing 32K namely to judge whether use RTC by intervalometer
Clock) clock counts.When a kind of pattern does not has task in certain period of time, software is needed to be cut by intervalometer
Changing to sleep pattern, until contemplating that the moment point of task, intervalometer automatically switches to after counting expires
Duty.Intervalometer in a sleep mode, uses RTC clock counting, although slow clock is to have passed through
Fast clock alignment, but there are two problems here, influence whether the timing of intervalometer under sleep state
Precision.One is to calibrate slow enumerator due to fast enumerator to have certain calibration accuracy, general calibration electricity
The realization on road is to use fixed-point computation, certainly exists the loss of significance of certain calculating.It addition, intervalometer
Can change with the clock of RTC in sleep procedure in a calibration process, this change is especially to variations in temperature
Sensitive.To ensure high RTC precision, being necessary for there is higher requirement at two aspects, one is to improve
RTC calibrates circuit counting precision, so can increase hard-wired complexity;It addition, improve calibration
Frequency, especially variations in temperature faster time, increase RTC calibration frequency, this way meeting
The power consumption of temperature detection, software controlling strategies, and baseband chip is had and compares large effect.
For second aspect selective analysis, this kind of mode has the disadvantage in that owing to temperature is to RTC clock
Impact maximum, therefore calibrate effect to reach preferable RTC, usual board increase temperature detection electricity
Road, detects board (especially around RTC) variations in temperature, in real time when rate of temperature change reaches certain
The when of thresholding, just start RTC calibration.Here temperature sensing circuit, and detection temperature certainly will be added
The power consumption that degree brings.Further, since the strategy of RTC calibration is relative complex, and the duty of terminal,
The flow process of protocol stack sofeware, and the physical characteristic of terminal is relevant, especially at multi-mode and multi-standby (standby)
In system, this calibration will be more complicated.Only start calibration circuit by software and eliminate the shakiness of RTC
Qualitative, it is extremely difficult in actual application.Again, RTC calibration module is work when
Needing fast clock, when system reaches sleep condition when, system originally can enter deep sleep modes, but
Owing to calibration circuit is in work, whole system is caused to cannot be introduced into sound sleep.Owing to RTC calibration module is usual
Work time in hundred ms (millisecond) rank, so the optimization to the power consumption of system is to have a great impact.
When having an access module in system in working order, the intervalometer of its correspondence is to be operated in normally to count shape
State, then even if the intervalometer of other patterns is switched to sleep state, whole system still can not enter deeply
Sleep state.Now fast clock is to exist, and is Tong Bu with network, and its precision is guaranteed.But
Now the intervalometer of non-operating mode has been switched to sleep pattern, then after its time precision is just by calibrating
RTC clock precision determine, then certainly exist the damage of accuracy of timekeeping analyzed in foregoing description
Lose.
Summary of the invention
It is an object of the invention to provide compensation method and the electronic equipment of a kind of sleep awakening timing offset,
Avoid first timer and cause asking of timing offset owing to sleep switches slow clock after sleep awakening
Topic, the offset issue of the system that efficiently solves auxiliary mode timers sleep awakening timing, it is ensured that pass through
The timing of the intervalometer of sleep and network time keep synchronizing.
For solving above-mentioned technical problem, the invention provides the compensation side of a kind of sleep awakening timing offset
Method, comprises the steps of and obtains the sleep duration that need to enter dormant first timer;According to
One intervalometer enters dormant time point T1 and sleep duration, calculates when waking up up of first timer
Carve;Obtain and be introduced into the time point that dormant second timer records when waking up first timer up
T2;According to the error waking up the moment up of T2 Yu calculating, adjust the timing offset of first timer.
Present invention also offers a kind of electronic equipment, comprise: sleep duration acquisition module, being used for obtaining needs
Enter the sleep duration of dormant first timer;Computing module, for entering according to first timer
Entering dormant time point T1 and sleep duration, calculate first timer wakes up the moment up;Time point
Acquisition module, is introduced into dormant second timer record when waking up first timer up for acquisition
Time point T2;Adjusting module, for the error waking up the moment up according to T2 Yu calculating, adjusts first
The timing offset of intervalometer.
Embodiment of the present invention in terms of existing technologies, based on one not through dormant
Two intervalometers, realize waking up the sleep timing in moment to one up through dormant first timer
The timing-compensation of error, thus avoid first timer after sleep awakening owing to sleep switches slow clock
The problem of the timing offset caused, the system that efficiently solves auxiliary mode timers sleep awakening timing offset
Problem.
It addition, the pattern timing that first timer and second timer are respectively under different wireless communication pattern
Device.In mobile communication system, having various wireless communication pattern and deposit, each pattern has a set of distinctive meter
Time device.Sleep if the whole intervalometers under a certain wireless communications mode need to configure entrance within a certain period of time
Dormancy state, the most now needs not enter into dormant intervalometer to this under another wireless communications mode
The timing in the sleep awakening moment of the intervalometer of wireless communications mode is calibrated;Thus it is wireless to avoid this
Enter dormant intervalometer under communication pattern to cause owing to sleep switches slow clock after sleep awakening
The problem of timing offset.
It addition, in adjusting the step of timing offset of first timer, comprise following sub-step: according to
The error waking up the moment up calculated, adjusts the frame header position of first timer timing.Fixed by adjusting first
Time device frame header position, compensate the timing offset that first timer produces in the sleep awakening moment, thus
Make second timer that first timer to be calibrated in the timing in sleep awakening moment.It is effectively reduced
The frequency of RTC period regulation, changes into judging whether that entering RTC calibrates by adjustment offset, permissible
Reduce unnecessary RTC calibration, thus reduce system overall power.
It addition, when obtaining first timer before the step of the time point T2 of record, also comprise: inspection
Survey whether to exist and be introduced into dormant second timer, obtain the second timing if it is present enter
The step of the time point T2 that device records when waking up first timer up;If it does not exist, then below Zhi Hanging
Step: according to the synchronous signal obtaining local zone time received and the relativeness of network time;According to acquisition
Relativeness determine a frame header position and periodically produce the frame synchronization moment;During the frame synchronization that will produce
Carve as network time.If there is no being introduced into dormant second timer, will be unable to obtain
The timing offset that one intervalometer produced in the sleep awakening moment.When now needing to obtain local zone time and network
Between relativeness, and adjust frame header position with this, and then compensate first timer when sleep awakening
Carve the timing offset produced.
Detailed description of the invention
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to this
Bright each embodiment is explained in detail.But, it will be understood by those skilled in the art that
In each embodiment of the present invention, propose many technology to make reader be more fully understood that the application thin
Joint.But, even if there is no these ins and outs and many variations based on following embodiment and amendment,
The application each claim technical scheme required for protection can also be realized.
First embodiment of the present invention relates to the compensation method of a kind of sleep awakening timing offset.In this reality
Executing in mode, intervalometer based on a kind of Mode B, it is operated in fast clock technology state, with this timing
The timing information of device synchronizes the intervalometer of another one Mode A, and this intervalometer uses slow clock to count;
In moment after being waken up up by the intervalometer of software compensation Mode A, eliminate what slow clock brought to Mode A
Time error.In present embodiment, the intervalometer (i.e. first timer) of A and Mode B in mode
As a example by intervalometer (i.e. second timer) is respectively the mode timers under different wireless communication pattern, enter
Row explanation, idiographic flow is as shown in Figure 2.
In step 201, acquisition need to enter the sleep duration of dormant first timer.
Specifically, first according to the wireless communications mode belonging to first timer, the getting frame cycle.Ratio
As said, the wireless communications mode belonging to first timer is TD-SCDMA pattern, due to TD-SCDMA
Frame period under pattern is 5ms, then the frame period understanding wireless communications mode belonging to first timer is
5ms.Then, according to the frame period obtained, and the sleep frame number of configuration, calculate sleep duration.Pin
To above-mentioned case, it is assumed that the sleep frame number of configuration is N frame, then a length of during the sleep of first timer
N*5ms。
Then, in step 202., enter dormant time point T1 according to first timer and sleep
Dormancy duration, calculate first timer wakes up the moment up.
Specifically, first timer receives and enters dormant instruction and i.e. enter sleep state, when the
One intervalometer is when entering sleep state, and electronic equipment can start a timer, when recording current
Between put T1, and save it in the assembly that electronic equipment is relevant;Or according to electronic equipment built-in time
Between record unit, obtain current time point T1, and save it in the time record corresponding form of unit
In.The acquisition mode that can also use other obtains first timer and enters dormant time point T1.
Such as, as it is shown on figure 3, under the TD-SCDMA pattern belonging to first timer, at frame head
Enter sleep N frame for configuration during FH1, and be that FH2 wakes up up at frame head.Due to the most
Getting a length of N*5ms during sleep, therefore combining FH1 moment point is T1, can be calculated and wake up up
Time frame head FH2 moment point be T1+ (N*5) ms.
Then, step 203 is entered, it may be judged whether exist and be introduced into dormant second timer.As
Fruit exists, then enter step 204;If it does not exist, then enter step 206.
Specifically, if the communication pattern of terminal unit support is TD-SCDMA and TD-LTE, and
When TD-LTE pattern is in fast clock count state all the time (as shown in Figure 3), can it is determined that the presence of not
Enter dormant second timer (i.e. the mode timers of TD-LTE), then enter step 204;
If TD-LTE pattern is also into slow clock count state (as shown in Figure 4), and there are not other
The mode timers of communication pattern, i.e. can determine that not exist and is introduced into dormant second timer, then
Enter step 206.
In step 204, the time point T2 that second timer records is obtained when waking up first timer up.
All the time sleep state, i.e. second timer it is introduced into the most in running order due to second timer, because of
This is at sleep awakening moment FH2, can by with second timer (i.e. the mode timers of TD-LTE)
It is timed synchronization, it is thus achieved that the moment point (T2) of current frame head.
Then, enter step 205, according to the error waking up the moment up of T2 Yu calculating, adjust the first timing
The frame header position of device timing.
Specifically, moment point T1+ (N*5) ms waking up frame head FH2 up will be calculated.With acquisition
Current frame head moment point T2 subtract each other can obtain in sleep procedure introduce slow clocking error
Δ=(T1+N × 5)-T2, then by adjusting the frame header position of frame timing after sleep awakening, sleeps to compensate
The error that dormancy introduces, thus keep consistent with the Timing Synchronization of network.Specifically, according to obtain slow time
The time error of clock, the value in amendment comparator, the current time is adjusted forward or backward, thus
The time calculated after guarantee does not has error.
If in step 203, it is determined that do not exist and be introduced into dormant second timer, then enter
Step 206.
As shown in Figure 4, first timer (i.e. mode timers under TD-SCDMA pattern) is at frame
At head FH1, configuration enters sleep N frame, and while TD-SCDMA switches into low-power consumption, second is fixed
Time device (mode timers under TD-LTE pattern) be also at sleep state, at TD-SCDMA
Intervalometer wakes up up when frame head is FH2, utilizes known moment point T1 obtained when frame head is for FH1,
Can be calculated and wake up the moment point of frame frame head FH2 up is T1+ (N*5) ms, and when sleep awakening
Can be T2 by obtaining the moment point of current frame head with TD-LTE intervalometer Timing Synchronization when carving FH2,
The result of Δ=(T1+N × 5)-T2 that two moment point are subtracted each other acquisition should be 0, now cannot obtain
The error that the slow clock of TD-SCDMA pattern introduces.Therefore, it is introduced into dormant second when not existing
Intervalometer, then enter step 206.
In step 206, close according to the synchronous signal obtaining local zone time received is relative with network time
System.
Specifically, first timer is cycle count, as the intervalometer under TD-SCDMA pattern is
In units of 1/8chip, cycle period is 51200, and count value count down to 51199 from 0, a frame week
Phase is that 5ms, UE (subscriber equipment) obtain local zone time and network time by receiving synchronizing signal
Relativeness.
Then, enter step 207, determine the position of frame head according to the relativeness obtained, and by fixed
Time adjust old frame head is adjusted to new frame header position.
Owing to there is an initial frame header position when searching net, reception signal is waited to confirm real network
After frame header position, according to relativeness, current frame header position can be adjusted to new frame header position, the most permissible
This purpose realizing producing the frame synchronization moment.
Wherein, relativeness is the relativeness of local zone time and network time.
Then, step 208 is entered, using the frame synchronization moment of generation as network time.
Specifically, as it is shown in figure 5, N, N+1 etc. are frame head position, 0 indicates shown position
For 0 moment point of cycle counter, the frame synchronization moment is to be produced by comparator, when the value in comparator
Interruption is then triggered, as the reference position of transceiving data with frame head equal to the loop count of current timer
On the basis of position.The value of comparator is setting after software and Network Synchronization, for LTE, starts
It is 30719, after searching net, then i.e. determines network time and the deviation of local hardware intervalometer, so
Rear drive can revise the value of comparator, reaches hardware timer and interrupts and the effect of the first cause of network frame.
So being calculated timing offset after sleep awakening, can be by adjusting the comparison in comparator
Value changes the position of network frame head, and as shown in the arrow between Fig. 5 chain lines and dotted line, frame head is just
It is adjusted to dotted line position, after ensureing that the data receiving afterwards and sending use adjustment from chain-dotted line
Time point.
It is noted that in the present embodiment, it is to be introduced into the pattern of sleep in multimode terminal
Intervalometer (second timer) is calibrated into the timing of the mode timers (first timer) of sleep
Illustrate as a example by adjustment, but in actual applications, intervalometer was produced through the sleep awakening moment
Time point error compensates mode and is not limited to the mode timers compensation to mode timers, also can use
Can carry out synchronizing to calculate error with mode timers, other that can carry out speed intervalometer switching are hard
Part intervalometer, by the position of frame head after adjustment sleep awakening, to reach the purpose of Timing Synchronization.Specifically
Ground is said, as long as can determine that the relative time relationship of two intervalometers just can realize compensating, and such as pattern
Intervalometer has run X cycle (cycle) within a period of time, and another one non-mode intervalometer
Having run Y cycle, if being both accurate, the unified time on a time shaft should
It is the same, but the clock source variant conversion caused to being actually likely to be due to two intervalometers
Have an error on time shaft, for such scene, present embodiment determining low precision can be passed through
Time device become more accurate by compensation.
Embodiments of the present invention can not only meet the needs of multimode system protocol stack sofeware timing, simultaneously
Mutual Timing Synchronization between multiple arithmetic processors can also be met in communication equipment.The most current intelligent hands
Machine generally includes application processor and communication processor, includes again two or more in each processor
Arithmetic processor.Owing to this intervalometer realizes more common, it is possible to as the timing base between multinuclear
Accurate.And present embodiment is applicable not only to wireless communication system, to other single modes, multi-mode communication system
Also it is suitable for.
Presently filed embodiment by entering dormant intervalometer and can not enter into determining of sleep
Time device synchronize, it is ensured that in the case of sound sleep each pattern introduce sleep error identical, can solve to sleep
The multi-mode preemption gap after waking up up that sleeps distributes time conflict problem.The non-industry of multimode system can be effectively improved
The precision of the Timing Synchronization of business pattern.
Second embodiment of the present invention relates to a kind of electronic equipment.As shown in Figure 6, comprise: during sleep
Long acquisition module, for obtaining the sleep duration that need to enter dormant first timer;Computing module,
For entering dormant time point T1 and sleep duration according to first timer, calculate the first timing
Device wake up the moment up;Time point acquisition module, is introduced into dormant second timer for acquisition and exists
The time point T2 of record when waking up first timer up;Adjusting module, for waking up up according to T2 and calculating
The error in moment, adjusts the timing offset of first timer.
Further, electronic equipment is the terminal unit supporting at least two wireless communications mode;First is fixed
Time device and second timer be respectively the mode timers under different wireless communication pattern.
Further, sleep duration acquisition module comprises following submodule: the frame period obtains submodule, uses
Frame period in the wireless communications mode obtained belonging to first timer;Duration calculation submodule, for root
According to the frame period obtained, and the sleep frame number of configuration, calculate sleep duration.
Further, adjusting module, according to the error waking up the moment up calculated, adjusts first timer timing
Frame header position.
Owing to having various wireless communication pattern in mobile communication system and depositing, and each pattern has a set of spy
Some time sets.If the whole intervalometers under a certain wireless communications mode need to configure within a certain period of time
Enter sleep state, the most now need to utilize one not through dormant second timer, come real
Now one is mended in the timing of the sleep timing error waking up the moment up through dormant first timer
Repay, thus avoid the timing that first timer causes owing to sleep switches slow clock after sleep awakening
The problem of deviation, the system that efficiently solves auxiliary mode timers sleep awakening timing offset problem.
It is seen that, present embodiment is the apparatus embodiments corresponding with the first embodiment, this enforcement
Mode can be worked in coordination enforcement with the first embodiment.The relevant technical details mentioned in first embodiment
The most effective, in order to reduce repetition, repeat no more here.Correspondingly, this enforcement
The relevant technical details mentioned in mode is also applicable in the first embodiment.
It is noted that each module involved in present embodiment is logic module, in reality
In application, a logical block can be a physical location, it is also possible to be one of a physical location
Point, it is also possible to realize with the combination of multiple physical locations.Additionally, for the innovative part highlighting the present invention,
Not by the unit the closest with solving technical problem relation proposed by the invention in present embodiment
Introduce, but this is not intended that in present embodiment the unit that there is not other.
It will be understood by those skilled in the art that the respective embodiments described above are realize the present invention concrete
Embodiment, and in actual applications, can to it, various changes can be made in the form and details, and the most inclined
From the spirit and scope of the present invention.