Summary of the invention
The embodiment of the invention provides a kind of method and device of automatic adjustment sun set/raise time, in order to solve the problem that the sun set/raise time that calculates in the prior art can not satisfy local habitual custom.
The embodiment of the invention provides a kind of method of automatic adjustment sun set/raise time, comprising:
Obtain current latitude and longitude information;
Obtain the GMT (Greenwich mean time) and the current time-zone information of sunrise sunset according to described latitude and longitude information;
Obtain the habitual time-zone information of administrative division at place, current time zone from network side;
Utilize the habitual time-zone information of administrative division at the GMT (Greenwich mean time) of described sunrise sunset, current time-zone information and place, current time zone, obtain the sun set/raise time in the habitual time zone of administrative division at place, current time zone.
The embodiment of the invention provides a kind of device of automatic adjustment sun set/raise time, comprising:
The longitude and latitude acquiring unit is used to obtain current latitude and longitude information;
Computing unit is used for the latitude and longitude information obtained according to described longitude and latitude acquiring unit, obtains the GMT (Greenwich mean time) and the current time-zone information of sunrise sunset;
Habitually practise the time zone acquiring unit, be used for obtaining the habitual time-zone information of administrative division at place, current time zone from network side;
The temporal information acquiring unit, be used to utilize the GMT (Greenwich mean time) and the current time-zone information of the described sunrise sunset that described computing unit obtains, and the habitual time-zone information of the administrative division that utilizes the place, current time zone that described habitual time zone acquiring unit obtains, obtain the sun set/raise time in the habitual time zone of administrative division at place, current time zone.
The method and the device of the automatic adjustment sun set/raise time that the embodiment of the invention provides, by the habitual time-zone information of the administrative division of obtaining current time zone from network side, and the sun set/raise time on the same day that obtains the administrative division at place, current time zone according to the administrative division signal, make the sun set/raise time on the same day that terminal shows according to longitude and latitude, the time zone of using with the country of locality is consistent automatically, realized that under the situation that the time zone changes be the user is moving under the situation in another time zone from a time zone, used terminal can be automatically with the same day sun set/raise time adjust to and meet the local time of being accustomed to.
Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention clearer, below in conjunction with the accompanying drawing in the embodiment of the invention, technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The process flow diagram of the method for the automatic adjustment sun set/raise time that Fig. 1 provides for the embodiment of the invention.As shown in Figure 1, this method comprises:
Step 1, obtain current latitude and longitude information.
Particularly, can pass through GPS (Global Positioning System, GPS), positioning systems such as GLONASS, Galileo, the Big Dipper, maybe can pass through base station, Wireless Fidelity (Wireless Fidelity, WIFI) obtain current latitude and longitude information in real time or regularly, also current latitude and longitude information is obtained in the instruction of the demonstration sun set/raise time that can send according to the user.When obtaining current latitude and longitude information, also can comprise before the step 1 receiving the instruction that shows sun set/raise time according to the instruction of user's the demonstration sun set/raise time that sends.
Step 2, obtain the GMT (Greenwich mean time) and the current time-zone information of sunrise sunset according to described latitude and longitude information.This step can utilize prior art to calculate the GMT (Greenwich mean time) and the current time-zone information of sunrise sunset.
Step 3, obtain the habitual time-zone information of administrative division at place, current time zone from network side.
As passing through current time zone CDMA (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (WCDMA) (Wideband Code Division Multiple Access, WCDMA) or network such as TD obtain the habitual time-zone information of administrative division at place, current time zone.
Time-zone information is habitually practised in the administrative division at step 4, the GMT (Greenwich mean time) of utilizing described sunrise sunset, current time-zone information and place, current time zone, obtains the sun set/raise time in the habitual time zone of administrative division at place, current time zone.Supposing that the active user is positioned at the 6th time zone, Urumchi, is that Chinese habitual time zone is the i.e. sun set/raise time in the current time zone of time showing in the 8th time zone in Beijing with the i.e. administrative division in the 6th time zone in current time zone then.
Above-mentioned steps can be carried out by mobile communication terminal such as mobile phone or the positioning navigation device with communication function, and above-mentioned steps 3 can be carried out simultaneously with step 2.
In the present embodiment, by the habitual time-zone information of the administrative division of obtaining current time zone from network side, and the sun set/raise time on the same day that obtains the administrative division at place, current time zone according to the administrative division signal, make the sun set/raise time on the same day that terminal shows according to longitude and latitude, the time zone time of habitually practising with local belonging country or area is consistent automatically, realized that under the situation that the time zone changes be the user is moving under the situation in another time zone from a time zone, used terminal can be automatically with the same day sun set/raise time adjust to and meet the local time of being accustomed to.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be finished by the relevant hardware of programmed instruction, aforesaid program can be stored in the computer read/write memory medium, this program is carried out the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
The structural representation of the device of the automatic adjustment sun set/raise time that Fig. 2 provides for the embodiment of the invention.As shown in Figure 2, comprising: longitude and latitude acquiring unit 21, computing unit 22, habitual time zone acquiring unit 23 and time information acquisition unit 24.
Longitude and latitude acquiring unit 21 passes through positioning systems such as GPS, GLONASS, Galileo, the Big Dipper, or obtains current latitude and longitude information in real time or regularly by base station, WIFI.Perhaps, the device of the automatic adjustment sun set/raise time that the embodiment of the invention provides can further comprise receiving element 25, be used to receive the instruction of the demonstration sun set/raise time that the user sends, the instruction that longitude and latitude acquiring unit 21 receives according to receiving element 25 is obtained current latitude and longitude information by above-mentioned positioning system, base station or WIFI etc.
Computing unit 22 is used for obtaining according to longitude and latitude acquiring unit 21 GMT (Greenwich mean time) and the current time-zone information of sunrise sunset on the same day.Habitual time zone acquiring unit 23 is used for obtaining from network side the habitual time-zone information of administrative division at place, current time zone, habitually practises time-zone information as the administrative division that CDMA, WCDMA or TD network by current time zone obtain place, current time zone.Temporal information acquiring unit 24 is used to utilize the GMT (Greenwich mean time) and the current time-zone information of the sunrise sunset that computing unit 22 obtains, and the habitual time-zone information of administrative division that utilizes the place, current time zone that habitual time zone acquiring unit 23 obtains, obtain to meet the sun set/raise time on the same day that the local time shows custom.
The device of the automatic adjustment sun set/raise time that the embodiment of the invention provides also can comprise display unit 26, is used to show that temporal information acquiring unit 24 obtains as meeting the sun set/raise time on the same day that the local time shows custom.Avoid being provided with in addition display device and come the demonstration time.
The device of the automatic adjustment sun set/raise time that the foregoing description provides can be mobile communication terminals such as mobile phone, also can be the positioning navigation device with communication function.
Transferring to Urumchi from the location in other time zones with a user is example, suppose that this user carries the device of the automatic adjustment sun set/raise time that the foregoing description provides, then longitude and latitude acquiring unit 21 in real time, regularly or according to user's instruction obtain the longitude and latitude that the locality is Urumchi: 43 ° of 54 ' 26.00 " 87 ° 28 ' 27.00 of N " E, computing unit 22 obtain the sun set/raise time in geographical time zone, Urumchi one day (+6): 05:40|18:33 according to this latitude and longitude information.Habitual time zone acquiring unit 23 obtains local administrative division from network side and belongs to China, and its habitual time zone is the 8th time zone.Temporal information acquiring unit 24 is according to the sun set/raise time of habitual the 8th time zone, time zone and geographical time zone (+6): 05:40|18:33, sun set/raise time is adjusted into 07:40|20:33, thereby realized the time showing of automatic adjustment sun set/raise time, having solved in the prior art hand-held set can only be by manually being provided with the time zone or relying on geographical time zone fully, and the sun set/raise time of acquisition shows the problem that may mislead the user.
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.