Summary of the invention
Technical matters solved by the invention is to provide a kind of method and device that upgrades the mobile terminal time, the time that can upgrade timely and accurately mobile terminal.
The embodiment of the present invention provides a kind of method of upgrading the mobile terminal time, comprising:
Search the directly-connected network account that can be used for Current Communication Network network; By the described directly-connected network account finding via described Current Communication Network network interconnection network server; From described webserver acquisition time information; According to mobile terminal current place time-zone information and described temporal information, obtain the time in time zone, the current place of mobile terminal; The system time that is described mobile terminal by described set of time.
Alternatively, described in, searching the directly-connected network account that can be used for Current Communication Network network comprises: search the Subscriber Identity Module of described mobile terminal, obtain the directly-connected network account that can be used for Current Communication Network network that described Subscriber Identity Module is corresponding.
Alternatively, in the time that the Subscriber Identity Module of described mobile terminal only has one, search the directly-connected network account that this Subscriber Identity Module is corresponding.
Alternatively, in the time that the quantity of the Subscriber Identity Module of described mobile terminal is more than or equal to 2, search successively the directly-connected network account that Subscriber Identity Module is corresponding, until obtain available direct network connection account.
Alternatively, the described webserver is at least two, uses described directly-connected network account interconnection network server successively, until successful connection.
Alternatively, the described webserver comprises SNTP server.
Alternatively, comprise from described webserver acquisition time information: send message to the described webserver, with request time information; Receive the temporal information from the described webserver.
Alternatively, described to webserver transmission message, with request time information, in the step of reception from webserver temporal information, the agreement of use comprises SNTP agreement.
Alternatively, obtained the information in time zone, the current place of described mobile terminal by the MCC value of the PLMN of the current registered network of described mobile terminal.
The embodiment of the present invention also provides a kind of device that upgrades the mobile terminal time, comprising: search unit, linkage unit, acquiring unit, time acquisition unit, setting unit;
The described unit of searching, for searching the directly-connected network account that can be used for Current Communication Network network;
Described linkage unit, for by the described directly-connected network account finding via described Current Communication Network network interconnection network server;
Described acquiring unit, for from described webserver acquisition time information;
The described time obtains unit, for according to mobile terminal current place time-zone information and described temporal information, obtains the time in time zone, the current place of mobile terminal;
Described setting unit, for the system time that is described mobile terminal by described set of time.
Alternatively, described in, searching unit also comprises: card is searched unit, for searching the Subscriber Identity Module of described mobile terminal; Account acquiring unit, for obtaining the directly-connected network account that can be used for Current Communication Network network that described Subscriber Identity Module is corresponding.
Alternatively, the described webserver that described linkage unit connects comprises SNTP server.
Alternatively, described acquiring unit comprises: transmitting element, sends message to the described webserver, with request time information; Receiving element, receives the temporal information from the described webserver.
Alternatively, obtained the information in time zone, the current place of described mobile terminal by the MCC value of the PLMN of the current registered network of described mobile terminal.
Compared with prior art, the present invention has following beneficial effect: by directly-connected network account from webserver acquisition time information, and the system time of mobile terminal is set according to described temporal information, thereby can improve accuracy and the success ratio of update time.As long as have network to exist, the time that can upgrade at any time mobile terminal, make update time timely, convenient.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can more be become apparent, below in conjunction with accompanying drawing, the specific embodiment of the present invention is described in detail.
Set forth detail in the following description so that fully understand the present invention.But the present invention can be different from alternate manner described here and implements with multiple, and those skilled in the art can do similar popularization without prejudice to intension of the present invention in the situation that.Therefore the present invention is not subject to the restriction of following public embodiment.
Fig. 1 is embodiment of the present invention applied environment schematic diagram.As shown in Figure 1, in an embodiment of the present invention, mobile terminal 110 is connected to the webserver 130 via communication network 120, and for upgrading the time of mobile terminal 110, mobile terminal 110 is from the webserver 130 acquisition time information.
Wherein, described mobile terminal 110 can be to have the multiple application functions such as time showing, and can be connected to by communication network 120 the electronic processing platform of internet.Particularly, described mobile terminal can comprise mobile phone, notebook, panel computer etc.
Described communication network 120, for communication network environment is provided, makes the mobile terminal 110 can be mutual with the webserver 130 by described communication network, to obtain temporal information.In inventive embodiment, described communication network 120 can comprise TD-SCDMA(Time Division-Synchronous CodeDivision Multiple Access, TD SDMA) network, WCDMA(Code DivisionMultiple Access, CDMA) network, GSM(Global System of Mobilecommunication, global system for mobile communications), CDMA2000(Code Division MultipleAccess 2000, a kind of 3G mobile communication standard) etc.
The webserver 130, for provide network time information.In inventive embodiment, the described webserver 130 comprises the SNTP webserver, NTP webserver equal time server.Those skilled in the art will recognize that and also comprise other webservers that temporal information can be provided.
Fig. 2 is that the embodiment of the present invention is upgraded mobile terminal time flow schematic diagram.As shown in Figure 2, the method for the renewal mobile terminal time that the embodiment of the present invention provides comprises:
Step S201, searches the directly-connected network account that can be used for Current Communication Network network.
In an embodiment of the present invention, described mobile terminal comprises mobile phone, notebook, panel computer etc.The described directly-connected network account that can be used for Current Communication Network network of searching comprises: search the Subscriber Identity Module that described mobile terminal can be used; Search the available directly-connected network account of Subscriber Identity Module.
Subscriber Identity Module can be SIM(Subscriber Identity Module, client identification module) card, USIM(Universal Subscriber Identity Module, whole world Subscriber Identity Module) card or UIM(UserIdentity Module, subscriber identification module) card etc.
The directly-connected network account of the described active user's of searching identification card comprises: find out all accounts informations of described active user's identification card, judge whether it is directly-connected network account according to the gateway address of accounts information.For example, if gateway address value is 0.0.0.0, be directly-connected network account, return to the relevant information of current directly-connected network account, comprise the data such as user name, password, APN (Access Point Name, APN), gateway address.
Step S202, by the described directly-connected network account finding via described Current Communication Network network interconnection network server.
In an embodiment of the present invention, start described Current Communication Network network, by AT instruction, the value of APN is made as to the value of the APN obtaining in step S201, interconnection network server.
The described webserver comprises SNTP(Simple Network Time Protocol, SNTP) webserver, but be not limited to the SNTP webserver, comprise that other can provide the webserver of temporal information as NTP (NetworkTime Protocol, NTP (Network Time Protocol)) etc.
Step S203, from described webserver acquisition time information.
In an embodiment of the present invention, the described method from webserver acquisition time comprises use SNTP agreement, sends request time message, obtains the time message of server, but is not limited only to the method.For example, can also comprise access network database, from database the temporal information in time zone, the current place of enquiry mobile terminal equipment etc. other obtain the method for temporal information from the webserver.
Step S204, according to mobile terminal current place time-zone information and described temporal information, obtains the time in time zone, the current place of mobile terminal.
In an embodiment of the present invention, the time obtaining from the described webserver is Greenwich Mean Time, obtained again the information in time zone, the current place of described mobile terminal by the MCC value of the PLMN of the current registered network of described mobile terminal, by described mobile terminal current place time-zone information and Greenwich Mean Time information obtain time in time zone, mobile terminal place.
Step S205, the system time that is described mobile terminal by described set of time.
Those skilled in the art will appreciate that the specific implementation that time of mobile terminal system is set can adopt existing various means, does not repeat them here.
For the ease of understanding, below take mobile phone as example, set forth the method for upgrading the mobile terminal time.
Fig. 3 is the renewal cell phone system time flow schematic diagram of the embodiment of the present invention.As shown in Figure 3, the method for the renewal cell phone system time that the embodiment of the present invention provides comprises:
Step S301, starts and upgrades cell phone system time function.
In enforcement of the present invention, there is number of ways can start this function.
For example, can, in the time of mobile phone power-on, automatically start and upgrade cell phone system time function.For another example, also can, by add the function menu of update time in cell phone system, start by menu the function of upgrading the cell phone system time at any time.
Step S302, searches the directly-connected network account that can be used for Current Communication Network network.
In an embodiment of the present invention, first mobile phone finds out current available Subscriber Identity Module number, according to the card number judgement of available subscribers identification card, if there is no available Subscriber Identity Module, cannot realize this and upgrade, and renewal process finishes.
If there is an available subscribers identification card, directly search the available directly-connected network account of this Subscriber Identity Module, return to directly-connected network accounts information.
If available subscribers identification card card number is more than or equal to 2, search successively available Subscriber Identity Module, find first available directly-connected network account just to stop searching, return to ID (Identity, the identification number) value of active user's identification card and the information of directly-connected network account.
With reference to figure 4, show the process of the directly-connected network account of specifically searching current available subscribers identification card in a kind of embodiment, described process comprises the following steps:
Step S3021, the internet account information of searching current available subscribers card.
In an embodiment of the present invention, mobile phone finds out its corresponding all internet accounts according to current available subscribers card, and described internet account comprises a lot of accounts informations, as direct-connected account, correspondent account, multimedia message accounts etc.For example, can find out China Mobile's dream net, China Mobile Internet, China Mobile's multimedia message etc. by the SIM card of a China Mobile.
Step S3022, judges whether it is directly-connected network account.
In an embodiment of the present invention, the gateway value of blocking the internet account finding out according to active user judges whether it is directly-connected network account, if its value is 0.0.0.0, determine that it is directly-connected network account, if gateway value is not 0.0.0.0, not directly-connected network account.
Step S3023, if directly-connected network account is returned to the information of APN in current internet account and the ID value of active user's identification card.
In an embodiment of the present invention, the relevant information of described current directly-connected network account, comprises the data such as user name, password, APN, gateway address.Wherein APN is that we are needed.We can find the SIM card of for example China Mobile its accounts information and be: the value of APN is cmnet.By the value of the APN of the current account obtaining, and the ID value of this Subscriber Identity Module is returned.
Step S3024, if not directly-connected network account, continues to search the directly-connected network account of next available subscribers identification card.
In an embodiment of the present invention, repeating step S3021 to S3024, the directly-connected network account of searching next available subscribers identification card.
Step S303, by the directly-connected network account finding, connects the SNTP webserver.
In an embodiment of the present invention, start communication network, by AT instruction, the value of APN is made as to the value of APN in the directly-connected network accounts information obtaining in step S302, then dial-up connection network, connects SNTP server.
Step S304, from SNTP server acquisition time information.
In an embodiment of the present invention, mobile phone is by SNTP protocol synchronization network time.Mobile phone sends the message of obtaining network time to a SNTP server address, waiting for server is returned to network time message.If wait for after 0.8 second and do not receive the time message that SNTP server returns, the message of just again attempting sending request the time, to SNTP server, is attempted at most three times.If also not free message is returned, just connect the address of next SNTP server, until connect the server of connecting to the Net, till obtaining network time message.
Step S305, according to mobile phone current place time-zone information and the temporal information obtained from SNTP, obtains the time in time zone, the current place of mobile phone.
In an embodiment of the present invention, the time of obtaining from S304 is Greenwich Mean Time, by the PLMN(Public Land Mobile Network of mobile telephone registration network, public land mobile network) can obtain the current place of mobile phone time-zone information, by mobile phone current place time-zone information and Greenwich Mean Time information obtain time in time zone, mobile phone place.
With reference to figure 5, show in a kind of embodiment, obtain the detailed process in time zone, the current place of mobile phone, described process comprises the following steps:
Step S3051, by the PLMN value of mobile telephone registration network, obtains MCC (Mobile CountryCode, Mobile Country Code MCC) value.
Step S3052, judges whether the country that MCC is corresponding exists multiple time zones.
In an embodiment of the present invention, draw the specifying information in national time zone corresponding to current MCC value according to MCC value and the judgement of national time-piece.
Step S3053, if obtain only having a time zone in step S3052, records this time zone value.
In an embodiment of the present invention, match current time zone value according to MCC and national time-piece.
Step S3054, if obtain the corresponding multiple time zones of MCC value in step S3052, obtains time zone value according to preset rules.
Particularly, in an embodiment of the present invention, if the national title in current MCC value and the current time zone of World clock is consistent, time zone, the current city value of acquisition time clock; If the national title in current MCC value and the current time zone of World clock is inconsistent, obtain the main acquiescence time zone value of the corresponding country of current MCC value.
Step S306 is the cell phone system time by set of time.
In an embodiment of the present invention, by the time by obtaining in step S305, be set to the system time of mobile phone.
Compared with the technology of upgrading system time with existing mobile phone, the present invention has following beneficial effect: by directly-connected network account from SNTP business device acquisition time information, and according to described temporal information, is set the cell phone system time, can improve accuracy and the success ratio of update time.As long as there is network to exist, can be at any time time of new cell-phone more, make update time timely, convenient.
Correspondingly, the embodiment of the present invention also provides the device of a kind of time of upgrading terminal device.
Take mobile phone as example, set forth the course of work of the device that upgrades the mobile terminal time below.
With reference to figure 6, show the schematic diagram of the device of embodiment of the present invention renewal cell phone system time.
The device of described renewal cell phone system time comprises: search unit 101, linkage unit 102, acquiring unit 103, time acquisition unit 104, setting unit 105.
Search unit 101, for searching the directly-connected network account that can be used for Current Communication Network network.
In an embodiment of the present invention, search unit and comprise: card is searched unit 1011, for searching the Subscriber Identity Module of described mobile terminal; Account acquiring unit 1012, for obtaining the directly-connected network account that can be used for Current Communication Network network that described Subscriber Identity Module is corresponding.
With reference to figure 7, show the structural representation of searching unit 101.
First mobile phone is searched unit 1011 by card and is obtained the Subscriber Identity Module that mobile phone can be used, then search card release and search the network account that available subscribers card that unit 1011 obtains comprises, judge whether it is directly-connected network account according to the gateway IP value in accounts information again, if value is 0.0.0.0, be judged to be directly-connected network account, obtain the information that this directly-connected network account comprises, be mainly the value that obtains APN, record the ID value of this available subscribers card simultaneously.
Linkage unit 102, for searching directly-connected network account that unit 101 finds via described Current Communication Network network interconnection network server by described.
In an embodiment of the present invention, obtain after the APN of directly-connected network account by searching unit 101, use this APN value dial-up connection network, connect the SNTP webserver.
Acquiring unit 103, for the webserver acquisition time information connecting from described linkage unit 102.
In an embodiment of the present invention, acquiring unit comprises: transmitting element 1031, receiving element 1032.
With reference to figure 8, show the structural representation of acquiring unit 103.
Transmitting element 1031 sends message for the webserver being connected to linkage unit 102, with request time information.In an embodiment of the present invention, send request the message of network time to SNTP server, wait for SNTP webserver time of return message, if wait for and do not receive the time message that SNTP server returns after 0.8 second, the message of just again attempting sending request the time, to SNTP server, is attempted at most three times.If also not free message is returned, just connect the address of next SNTP server, until connect the server of connecting to the Net.
The temporal information that receiving element 1032 returns for receiving the webserver that connects from linkage unit 102.
Time obtains unit 104, for the temporal information obtaining according to mobile terminal current place time-zone information and described acquiring unit 103, obtains the time in time zone, the current place of mobile terminal.
In an embodiment of the present invention, the network time being obtained by acquiring unit 103 is Greenwich Mean Time, adds time zone, the current place of mobile phone value, obtains the system time in time zone, the current place of mobile phone.
The described process of obtaining the current time zone of mobile phone value comprises: first obtain the PLMN value of current phone registered network, obtain MCC value from PLMN.Whether have multiple time zones according to current MCC value location, if only have a time zone, and national time-piece coupling obtains this time zone value; If multiple time zones are contained in the corresponding country of MCC value, determine time zone value in conjunction with mobile phone World clock, if national title corresponding to the local time zone of World clock is consistent with the MCC value obtaining, obtain the time zone, current city of World clock the inside from PLMN; If inconsistent, obtain the acquiescence time zone value of the corresponding country of MCC value obtaining from PLMN.
Setting unit 105, for obtaining the described time system time that the set of time of unit 104 gained is described mobile terminal.
In an embodiment of the present invention, the time obtains temporal information that unit 104 obtains and is set to the system time of mobile phone.
To sum up, the method for renewal mobile phone time information provided by the invention and device, at least have following beneficial effect:
Can effectively avoid the result that cannot upgrade of bringing due to the washability of various places operator due to technology such as using NITZ, by directly-connected network account from SNTP business device acquisition time information, and according to described temporal information, is set the cell phone system time, can improve accuracy and the success ratio of update time.As long as there is network to exist, can be at any time time of new cell-phone more, make update time timely, convenient.
The application can be used in numerous general or special purpose calculation element environment or configuration.For example: personal computer, server computer, handheld device or portable set, plate equipment, multi-processor device, comprise distributed computing environment of above any device or equipment etc.
The application can describe in the general context of the computer executable instructions of being carried out by computing machine, for example program module.Usually, program module comprises and carries out particular task or realize routine, program, object, assembly, data structure of particular abstract data type etc.Also can in distributed computing environment, put into practice the application, in these distributed computing environment, be executed the task by the teleprocessing equipment being connected by communication network.In distributed computing environment, program module can be arranged in the local and remote computer-readable storage medium including memory device.
Although the present invention with preferred embodiment openly as above; but it is not for limiting the present invention; any those skilled in the art without departing from the spirit and scope of the present invention; can utilize method and the technology contents of above-mentioned announcement to make possible variation and modification to technical solution of the present invention; therefore; every content that does not depart from technical solution of the present invention; any simple modification, equivalent variations and the modification above embodiment done according to technical spirit of the present invention, all belong to the protection domain of technical solution of the present invention.