CN106453560A - Time acquisition method and apparatus - Google Patents

Time acquisition method and apparatus Download PDF

Info

Publication number
CN106453560A
CN106453560A CN201610900371.4A CN201610900371A CN106453560A CN 106453560 A CN106453560 A CN 106453560A CN 201610900371 A CN201610900371 A CN 201610900371A CN 106453560 A CN106453560 A CN 106453560A
Authority
CN
China
Prior art keywords
server
time
current location
location information
destination server
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
Application number
CN201610900371.4A
Other languages
Chinese (zh)
Other versions
CN106453560B (en
Inventor
冯超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201610900371.4A priority Critical patent/CN106453560B/en
Publication of CN106453560A publication Critical patent/CN106453560A/en
Application granted granted Critical
Publication of CN106453560B publication Critical patent/CN106453560B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1021Server selection for load balancing based on client or server locations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/52Network services specially adapted for the location of the user terminal

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention provides a time acquisition method and apparatus. The method comprises the following steps: when a preset position information acquisition condition is satisfied, acquiring current position information of a home terminal device; determining a target server corresponding to the current position information according to the current position information; and sending a time request to the target server so as to acquire a universal time through the target server. By adoption of the technical scheme, when the preset position information acquisition condition is satisfied, the target server corresponding to the current position information and having a smaller distance can be determined according to the current position information, and the time request is sent to the target server so as to acquire the universal time accurately in time through the target server having the smaller distance, thereby avoiding the problem that the time must be requested from an American server, resulting in that the request time is too long or the universal time cannot be requested in time.

Description

Time obtaining method and device
Technical field
It relates to field of terminal technology, more particularly, to time obtaining method and device.
Background technology
It is known that system time is extremely important for terminal, when the time not pair when, can cause very many different Often, for example:Cannot live on time, cannot accurately and timely, possibly even cannot surf the Net, cannot realize normally positioning, but phase The server only one of which of terminal request time in the technology of pass, for terminal, can be supplied, but also be in the U.S., this leads Cause probably to lead to because can not access the server of the U.S. can not obtain in time accurately in much local terminal Time.
Content of the invention
The embodiment of the present disclosure provides time obtaining method and device.Described technical scheme is as follows:
According to the embodiment of the present disclosure in a first aspect, provide a kind of time obtaining method, including:
When meeting default positional information acquisition condition, obtain the current location information of local device;
According to described current location information, determine destination server corresponding with described current location information;
To ask the time to send to described destination server, so that universal time is obtained by described destination server.
In one embodiment, according to described current location information, determine mesh corresponding with described current location information Before mark server, methods described also includes:
Obtain the address of each server and its corresponding band of position in local server list;
Described destination server corresponding with described current location information is determined according to described current location information, including:
According to described server list, determine the band of position belonging to described current location information;
Determine described destination server from the corresponding server in the described affiliated band of position.
In one embodiment, determine described destination service the described corresponding server from the described affiliated band of position Device, including:
When the corresponding server in the described affiliated band of position includes at least two, according to default screening conditions from described Described destination server is selected at least two servers.
In one embodiment, described select described target according to default screening conditions from described at least two servers Server, including:
Select following any server according to default screening conditions from described at least two servers;
Determine that described any server is described destination server, wherein, described any server includes:
The server closest with described current location information, receive described time request in historical time section Number of times highest server or the server that the time described in fastest response asks in historical time section.
In one embodiment, methods described also includes:
Do not receive described destination server and be directed to the described generation that described time request returns in the first preset time period During boundary standard time, send described time request to other servers, wherein, other servers described include:Described at least two A server in addition to described destination server or adjacent with the described affiliated band of position neighbouring in individual server Server in the band of position.
In one embodiment, described default positional information obtains condition and includes:
The described universal time of predetermined server transmission is not received in the second preset time period;Or
Monitor described time request.
According to the second aspect of the embodiment of the present disclosure, provide a kind of time acquisition device, including:
First acquisition module, for when meeting default positional information acquisition condition, obtaining the present bit of local device Confidence ceases;
Determining module, for according to described current location information, determining target clothes corresponding with described current location information Business device;
First sending module, for asking the time to send to described destination server, with by described destination server Obtain universal time.
In one embodiment, described device also includes:
Second acquisition module, for, before determining destination server corresponding with described current location information, obtaining this The address of each server and its corresponding band of position in the server list on ground;
Described determining module includes:
First determination sub-module, for according to described server list, determining the position belonging to described current location information Region;
Second determination sub-module, for determining described destination service from the corresponding server in the described affiliated band of position Device.
In one embodiment, described second determination sub-module includes:
Select unit, for when the corresponding server in the described affiliated band of position includes at least two, according to default Screening conditions select described destination server from described at least two servers.
In one embodiment, described select unit includes:
Select subelement, for arbitrary service below selecting from described at least two servers according to default screening conditions Device;
Determination subelement, for determining that described any server is described destination server, wherein, described any server Including:
The server closest with described current location information, receive described time request in historical time section Number of times highest server or the server that the time described in fastest response asks in historical time section.
In one embodiment, described device also includes:
Second sending module, is directed to the described time for not receiving described destination server in the first preset time period During the described universal time that request returns, send described time request, wherein, other servers described to other servers Including:In described at least two servers a server in addition to described destination server or with described affiliated position Server in the adjacent close position region in region.
In one embodiment, described default positional information obtains condition and includes:
The described universal time of predetermined server transmission is not received in the second preset time period;Or
Monitor described time request.
A kind of third aspect according to the embodiment of the present disclosure, there is provided time acquisition device, including:
Processor;
For storing the memorizer of processor executable;
Wherein, described processor is configured to:
When meeting default positional information acquisition condition, obtain the current location information of local device;
According to described current location information, determine destination server corresponding with described current location information;
To ask the time to send to described destination server, so that universal time is obtained by described destination server.
The technical scheme that embodiment of the disclosure provides can include following beneficial effect:
The technical scheme that embodiment of the disclosure provides, when meeting default positional information acquisition condition, by deserving Front position information it may be determined that going out the destination server corresponding, close together with this current location information, and then by this time Request sends to this destination server, to get this generation exactly and in time by this destination server close together Boundary's standard time, it is to avoid request time must be led to long to the server request time of the U.S. or cannot ask in time Seek this universal time.
It should be appreciated that above general description and detailed description hereinafter are only exemplary and explanatory, not The disclosure can be limited.
Brief description
Accompanying drawing herein is merged in description and constitutes the part of this specification, shows the enforcement meeting the disclosure Example, and be used for explaining the principle of the disclosure together with description.
Fig. 1 is a kind of flow chart of the time obtaining method according to an exemplary embodiment.
Fig. 2 is the flow chart of another kind of time obtaining method according to an exemplary embodiment.
Fig. 3 is the flow chart of another time obtaining method according to an exemplary embodiment one.
Fig. 4 is the flow chart of another time obtaining method according to an exemplary embodiment one.
Fig. 5 is the flow chart of another time obtaining method according to an exemplary embodiment one.
Fig. 6 is a kind of block diagram of the time acquisition device according to an exemplary embodiment.
Fig. 7 is the block diagram of another kind of time acquisition device according to an exemplary embodiment.
Fig. 8 is the block diagram of another the time acquisition device according to an exemplary embodiment.
Fig. 9 is the block diagram being applied to time acquisition device according to an exemplary embodiment.
Specific embodiment
Here will in detail exemplary embodiment be illustrated, its example is illustrated in the accompanying drawings.Explained below is related to During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represent same or analogous key element.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with the disclosure.On the contrary, they be only with such as appended The example of the consistent apparatus and method of some aspects being described in detail in claims, the disclosure.
It is known that system time is extremely important for terminal, when the time not pair when, can cause very many different Often, for example:Cannot live on time, cannot accurately and timely, possibly even cannot surf the Net, cannot realize normally positioning, but phase The server only one of which of terminal request time in the technology of pass, for terminal, can be supplied, but also be in the U.S., this leads Cause probably to lead to because can not access the server of the U.S. can not obtain in time accurately in much local terminal Time.
In order to solve above-mentioned technical problem, the embodiment of the present disclosure provides a kind of time obtaining method, and the method can be used for Time obtains program, in system or device, and the corresponding executive agent of the method (i.e. local device) can be mobile phone, flat board, PC (personal computer, personal computer) etc., as shown in figure 1, the method comprising the steps of S101 is to step S103:
In step S101, when meeting default positional information acquisition condition, obtain the present bit confidence of local device Breath;
Wherein, default positional information obtains condition and can include:
Do not receive the universal time of predetermined server transmission in the second preset time period, predetermined server is permissible It is in the NTP time server of the U.S., you can first to attempt directly to obtain this world standard from U.S.'s NTP time server Time, if this universal time that the NTP time server not receiving the U.S. in the second preset time period sends, Obtain this current location information again;Or
Monitor that this time asks, wherein, this time request monitoring can be real-time generation or according to default Time interval generates, and in order to get this universal time in time, this prefixed time interval is little as far as possible;
GPS system (the Global that can be installed by local device during the current location information obtaining local device Positioning System, global positioning system) obtained or by local device searched to obtain or by base station WiFi network information (the i.e. signal intensity of each WiFi network in WiFi network list and WiFi network list and the name that rope arrives Claim etc.) obtaining.
In step s 102, according to current location information, determine destination server corresponding with current location information;
Destination server corresponding with this current location information can be this current location information region server, Or the server in the region adjacent with this current location information region, that is, nearer apart from this current location information Server.
In addition, destination server can be NTP time server, and NTP is Network Time Protocol, network Time protocol.
By this current location information it may be determined that going out the destination server nearer with this current location information distance.
In step s 103, will ask the time to send to destination server, to obtain world standard by destination server Time, wherein universal time are also known as Coordinated Universal Time(UTC) (Coordinated Universal Time).
By this current location information it may be determined that going out the target clothes corresponding, close together with this current location information Business device, and then the request of this time is sent to this destination server, with by this destination server close together come exactly And get this universal time in time, it is to avoid request time mistake must be led to the server request time of the U.S. Grow or this universal time cannot be asked in time.
As shown in Fig. 2 in one embodiment, before execution step S102, the method shown in above-mentioned Fig. 1 also can be wrapped Include:
In step s 201, obtain the address of each server and its corresponding position area in local server list Domain;
Each server is arranged on the NTP time server of all parts of the world, and the address corresponding position area of each server Domain can be each server be located administrative area, state, provincial capital, urban district etc..
By obtaining the address of each server and its corresponding band of position in local server list, it is easy to the later stage Server corresponding, close together is determined according to this current location information, and according to this service close together Device is obtaining this universal time.
In addition, this server list corresponding record can the address of each server and each server institute in table form The band of position unique mark, the address of each server can be IP address (the Internet Protocol of each server Address, internet protocol address) etc. information, and the unique mark of the band of position that each server is located can be each server The title of the band of position, significant landscape figure or landmark figure of being located etc..
Step S102 shown in above-mentioned Fig. 1 can be performed as:
In step A1, according to server list, determine the band of position belonging to current location information;
In step A2, determine destination server from the corresponding server in the affiliated band of position.
When determining this destination server, position that can first according to belonging to this server list determines this current location information Put region, and then the corresponding server in the band of position belonging to from this, accurately determine that the corresponding target of current location information takes Business device, and because this destination server is the server of this current location information affiliated area, thus, this destination server be away from Server close to this current location information, passing through in order to the later stage can pole by this time request this destination server of transmission The earth facilitates user, it is to avoid local device must send time request to the ntp server of the U.S. and just can get world's mark Between punctual, it also avoid because all of terminal is required for sending time request to the server of the U.S. and lead to request time mistake Grow or lead to not ask this universal time in time, which also saves the request time of local device, increased this End equipment can get the probability of accurate universal time in time.
As shown in figure 3, in one embodiment, step A2 shown in above-mentioned Fig. 2 can include:
In step bl is determined., when the corresponding server in the affiliated band of position includes at least two, according to default screening bar Part selection target server from least two servers.
When the corresponding server in the band of position belonging to when this includes at least two, can also be automatically from least two clothes Select to meet the destination server of default screening conditions in business device, and then will ask the time to send to destination server, to pass through Destination server to get accurate universal time in time.
In addition, by selecting to meet pre-conditioned destination server from least two servers, can be somebody's turn to do from distance Filter out further in the nearer server of current location information and meet user's use habit or the condition such as response speed is the fastest Server.
As shown in figure 4, in one embodiment, step B1 shown in above-mentioned Fig. 3 can include:
In step C1, select following any server from least two servers according to default screening conditions;
In step C2, determine that any server is destination server, wherein, any server includes:With current location The nearest server of information distance, receive in historical time section the time request number of times highest server or in history The server of fastest response time request in time period.
This historical time section can be that this sends a period of time before the request of this time and this historical time section is permissible Freely set, the server of this time of fastest response request refer to send from local device to certain server the request of this time start to Local device receives this server and asks the service the shortest of this process used time of universal time of feedback for this time Device.
Further, since default screening conditions can be distance restrictive conditions the shortest, receive time request number of times Highest restrictive condition or be in response to restrictive condition the fastest, thus, can be from multiple services according to this default screening conditions Select in device apart from a nearest server of this current location information distance, or historical time section receives time request Responding the request of this time in the most frequently used server of number of times highest user, or historical time section should to return to local device Universal time takes the server the shortest, response speed is the fastest as final destination server.
As shown in figure 5, in one embodiment, the method shown in above-mentioned Fig. 3 may also include:
In step S501, do not receive destination server in the first preset time period and be directed to the generation that time request returns During boundary standard time, send time request to other servers, wherein, other servers include:Remove at least two servers A server outside destination server or the server in the close position region adjacent with the affiliated band of position.
Do not receive destination server and be directed to the universal time that the request of this time returns in the first preset time period When, time request can be sent to other servers, to obtain this universal time in time by other servers, thus Can be effectively prevented from because destination server cannot respond the request of this time in time and lead to not get in time this The problem of universal time.
In addition, this other server can be a service in this at least two server in addition to destination server Device, for example:Can be the nearest clothes of this current location information of distance in addition to destination server in this at least two server Business device or be in addition to destination server receive in historical time section the time request number of times highest server, Or the server of the request of this time of fastest response in historical time section in addition to destination server;Or
This other server can also be in the close position region adjacent with the band of position belonging to current location information Server, wherein, when the close position region adjacent with the band of position belonging to this has multiple, can be from the plurality of neighbouring Arbitrarily select a band of position in the band of position, and then the server determining in this band of position optional is this other Automatically select in server, or the server from the plurality of close position region apart from this current location information nearest one Individual server is as this other server.
In one embodiment, default positional information obtains condition and can include:
Do not receive the universal time of predetermined server transmission in the second preset time period, predetermined server is permissible It is in the NTP time server of the U.S., you can first to attempt directly to obtain this world standard from U.S.'s NTP time server Time, if this universal time that the NTP time server not receiving the U.S. in the second preset time period sends, Obtain this current location information again, wherein, the second preset time period can freely customize;
Or
Monitor this time request initiated.
In one embodiment, the method shown in above-mentioned Fig. 1 may also include:
Receive destination server be directed to the time request return universal time when, determine current location information with Default time zone between preset location is poor, and wherein, time zone (Time Zone) is tellurian region using fixed at the same time Justice, in order to overcome temporal chaotic it is stipulated that being 24 time zones by global subdivision.
This preset location is the reference location of universal time, i.e. the XX place of Britain;
And this default time zone difference is exactly on the basis of the universal time of this preset location, this current location information is compared Poor in the time zone of this preset location, can be for just or be negative, specifically, if this is pre- for the time lead of this current location information If the time in place, then this default time zone difference is negative, whereas if this preset location time lag of this current location information Time, then this default time zone difference is for just.
Poor according to universal time and default time zone, determine the current time of current location information, and by current time It is shown on local device.
When this universal time is got in time by destination server, can according to this universal time and This default time zone is poor, is accurately obtained the current time of current location information, and then this current time showing is set in local terminal For upper so that local device can obtain in time and show correct current time, can be correct according to this in order to the later stage Current time carry out various operations, such as correctly timing, live on time etc..
The above-mentioned time obtaining method that the corresponding embodiment of the present disclosure provides, the embodiment of the present disclosure also provides a kind of time to obtain Device, as shown in fig. 6, this device includes:
First acquisition module 601, is configured to, when meeting default positional information acquisition condition, obtain local device Current location information;
Determining module 602, is configured to, according to current location information, determine destination service corresponding with current location information Device;
Destination server corresponding with this current location information can be this current location information region server, Or the server in the region adjacent with this current location information region, that is, nearer apart from this current location information Server.
In addition, destination server can be NTP time server, and NTP is Network Time Protocol, network Time protocol.
By this current location information it may be determined that going out the destination server nearer with this current location information distance.
First sending module 603, is configured to send time request to destination server, to obtain by destination server Take universal time.
By this current location information it may be determined that going out the target clothes corresponding, close together with this current location information Business device, and then the request of this time is sent to this destination server, with by this destination server close together come exactly And get this universal time in time, it is to avoid request time mistake must be led to the server request time of the U.S. Grow or this universal time cannot be asked in time.
As shown in fig. 7, in one embodiment, the device shown in above-mentioned Fig. 6 may also include:
Second acquisition module 701, is configured to, before determining destination server corresponding with current location information, obtain The address of each server and its corresponding band of position in local server list;
Each server is arranged on the NTP time server of all parts of the world, and the address corresponding position area of each server Domain can be each server be located administrative area, state, provincial capital etc..
By obtaining the address of each server and its corresponding band of position in local server list, it is easy to the later stage Server corresponding, close together is determined according to this current location information, and according to this service close together Device is obtaining this universal time.
In addition, this server list corresponding record can the address of each server and each server institute in table form The band of position unique mark, the address of each server can be IP address (the Internet Protocol of each server Address, internet protocol address) etc. information, and the unique mark of the band of position that each server is located can be each server The title of the band of position, significant landscape figure or landmark figure of being located etc..
Determining module 602 can include:
First determination sub-module 6021, is configured to according to server list, determines the position belonging to current location information Region;
Second determination sub-module 6022, is configured to determine destination service from the corresponding server in the affiliated band of position Device.
When determining this destination server, position that can first according to belonging to this server list determines this current location information Put region, and then the corresponding server in the band of position belonging to from this, accurately determine that the corresponding target of current location information takes Business device, and because this destination server is the server of this current location information affiliated area, thus, this destination server be away from Server close to this current location information, passing through in order to the later stage can pole by this time request this destination server of transmission The earth facilitates user, it is to avoid local device must send time request to the ntp server of the U.S. and just can get world's mark Between punctual, it also avoid because all of terminal is required for sending time request to the server of the U.S. and lead to request time mistake Grow or lead to not ask this universal time in time, which also saves the request time of local device, increased this End equipment can get the probability of accurate universal time in time.
In one embodiment, the second determination sub-module 6022 includes:
Select unit, be configured as belonging to the corresponding server in band of position when including at least two, according to default Screening conditions selection target server from least two servers.
When the corresponding server in the band of position belonging to when this includes at least two, can also be automatically from least two clothes Select to meet the destination server of default screening conditions in business device, and then will ask the time to send to destination server, to pass through Destination server to get accurate universal time in time.
In addition, by selecting to meet pre-conditioned destination server from least two servers, can be somebody's turn to do from distance Filter out further in the nearer server of current location information and meet user's use habit or the condition such as response speed is the fastest Server.
In one embodiment, select unit includes:
Select subelement, be configured to according to default screening conditions select from least two servers below arbitrary service Device;
Determination subelement, is configured to determine that any server is destination server, wherein, any server includes:
The server closest with current location information, receive the number of times highest of time request in historical time section Server or in historical time section the fastest response time request server.
This historical time section can be that this sends a period of time before the request of this time and this historical time section is permissible Freely set, the server of this time of fastest response request refer to send from local device to certain server the request of this time start to Local device receives this server and asks the service the shortest of this process used time of universal time of feedback for this time Device.
Further, since default screening conditions can be distance restrictive conditions the shortest, receive time request number of times Highest restrictive condition or be in response to restrictive condition the fastest, thus, can be from multiple services according to this default screening conditions Select in device apart from a nearest server of this current location information distance, or historical time section receives time request Responding the request of this time in the most frequently used server of number of times highest user, or historical time section should to return to local device Universal time takes the server the shortest, response speed is the fastest as final destination server.
As shown in figure 8, in one embodiment, device also includes:
Second sending module 801, is configured to not receive destination server in the first preset time period for the time During the universal time that request returns, send time request to other servers, wherein, other servers include:At least two A server in addition to destination server or the close position region adjacent with the affiliated band of position in individual server In server.
Do not receive destination server and be directed to the universal time that the request of this time returns in the first preset time period When, time request can be sent to other servers, to obtain this universal time in time by other servers, thus Can be effectively prevented from because destination server cannot respond the request of this time in time and lead to not get in time this The problem of universal time.
In addition, this other server can be a service in this at least two server in addition to destination server Device, for example:Can be the nearest clothes of this current location information of distance in addition to destination server in this at least two server Business device or be in addition to destination server receive in historical time section the time request number of times highest server, Or the server of the request of this time of fastest response in historical time section in addition to destination server;Or
This other server can also be in the close position region adjacent with the band of position belonging to current location information Server, wherein, when the close position region adjacent with the band of position belonging to this has multiple, can be from the plurality of neighbouring Arbitrarily select a band of position in the band of position, and then the server determining in this band of position optional is this other Automatically select in server, or the server from the plurality of close position region apart from this current location information nearest one Individual server is as this other server.
In one embodiment, default positional information obtains condition and includes:
The universal time of predetermined server transmission is not received in the second preset time period;
Or
Monitor that the time asks.
According to the third aspect of the embodiment of the present disclosure, provide a kind of time acquisition device, including:
Processor;
For storing the memorizer of processor executable;
Wherein, processor is configured to:
When meeting default positional information acquisition condition, obtain the current location information of local device;
According to described current location information, determine destination server corresponding with described current location information;
To ask the time to send to described destination server, so that universal time is obtained by described destination server.
Above-mentioned processor is also configured to:
According to described current location information, before determination destination server corresponding with described current location information, institute Method of stating also includes:
Obtain the address of each server and its corresponding band of position in local server list;
Described destination server corresponding with described current location information is determined according to described current location information, including:
According to described server list, determine the band of position belonging to described current location information;
Determine described destination server from the corresponding server in the described affiliated band of position.
Above-mentioned processor is also configured to:
Described destination server is determined the described corresponding server from the described affiliated band of position, including:
When the corresponding server in the described affiliated band of position includes at least two, according to default screening conditions from described Described destination server is selected at least two servers.
Above-mentioned processor is also configured to:
Described select described destination server according to default screening conditions from described at least two servers, including:
Select following any server according to default screening conditions from described at least two servers;
Determine that described any server is described destination server, wherein, described any server includes:
The server closest with described current location information, receive described time request in historical time section Number of times highest server or the server that the time described in fastest response asks in historical time section.
Above-mentioned processor is also configured to:
Methods described also includes:
Do not receive described destination server and be directed to the described generation that described time request returns in the first preset time period During boundary standard time, send described time request to other servers, wherein, other servers described include:Described at least two A server in addition to described destination server or adjacent with the described affiliated band of position neighbouring in individual server Server in the band of position.
Above-mentioned processor is also configured to:
Described default positional information obtains condition and includes:
The described universal time of predetermined server transmission is not received in the second preset time period;Or
Monitor described time request.
Fig. 9 is a kind of block diagram for time acquisition device 900 according to an exemplary embodiment, and this device is suitable for In terminal unit.For example, device 900 can be mobile phone, computer, digital broadcast terminal, messaging devices, game control Platform processed, tablet device, armarium, body-building equipment, individual number assistant etc..
With reference to Fig. 9, device 900 can be included with next or at least two assemblies:Process assembly 902, memorizer 904, Power supply module 906, multimedia groupware 908, audio-frequency assembly 910, input/output (I/O) interface 912, sensor cluster 914, with And communication component 916.
The integrated operation of the usual control device 900 of process assembly 902, such as with display, call, data communication, phase Machine operation and record operate associated operation.Process assembly 902 can include one or at least two processors 920 to execute Instruction, to complete all or part of step of above-mentioned method.Additionally, process assembly 902 can include one or at least two Module, is easy to the interaction between process assembly 902 and other assemblies.For example, process assembly 902 can include multi-media module, To facilitate the interaction between multimedia groupware 908 and process assembly 902.
Memorizer 904 is configured to store various types of data to support the operation in device 900.The showing of these data Example include on device 900 operation any storage object or method instruction, contact user data, telephone book data, Message, picture, video etc..Memorizer 904 can by any kind of volatibility or non-volatile memory device or they Combination is realized, such as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM), erasable can Program read-only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory Reservoir, disk or CD.
Power supply module 906 provides power supply for the various assemblies of device 900.Power supply module 906 can include power management system System, one or at least two power supplys, and other generate, manage and distribute, with for device 900, the assembly that power supply is associated.
Multimedia groupware 908 includes the screen of one output interface of offer between described device 900 and user.One In a little embodiments, screen can include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen Curtain may be implemented as touch screen, to receive the input signal from user.Touch panel includes one or at least two touches Sensor is with the gesture on sensing touch, slip and touch panel.Described touch sensor can not only sensing touch or slip The border of action, but also the detection persistent period related to described touch or slide and pressure.In certain embodiments, Multimedia groupware 908 includes a front-facing camera and/or post-positioned pick-up head.When device 900 is in operator scheme, such as shoot mould When formula or video mode, front-facing camera and/or post-positioned pick-up head can receive outside multi-medium data.Each preposition shooting Head and post-positioned pick-up head can be the optical lens system of a fixation or have focusing and optical zoom capabilities.
Audio-frequency assembly 910 is configured to output and/or input audio signal.For example, audio-frequency assembly 910 includes a Mike Wind (MIC), when device 900 is in operator scheme, during as call model, logging mode and speech recognition mode, mike is joined It is set to reception external audio signal.The audio signal being received can be further stored in memorizer 904 or via communication set Part 916 sends.In certain embodiments, audio-frequency assembly 910 also includes a speaker, for exports audio signal.
, for providing interface between process assembly 902 and peripheral interface module, above-mentioned peripheral interface module can for I/O interface 912 To be keyboard, click wheel, button etc..These buttons may include but be not limited to:Home button, volume button, start button and lock Determine button.
Sensor cluster 914 includes one or at least two sensors, for providing the state of various aspects for device 900 Assessment.For example, sensor cluster 914 can detect/the closed mode of opening of device 900, the relative localization of assembly, such as institute State the display that assembly is device 900 and keypad, sensor cluster 914 can be with detection means 900 or 900 1 groups of device The position change of part, user is presence or absence of with what device 900 contacted, device 900 orientation or acceleration/deceleration and device 900 Temperature change.Sensor cluster 914 can include proximity transducer, is configured to the inspection when not having any physical contact Survey the presence of object nearby.Sensor cluster 914 can also include optical sensor, such as CMOS or ccd image sensor, for Use in imaging applications.In certain embodiments, this sensor cluster 914 can also include acceleration transducer, and gyroscope passes Sensor, Magnetic Sensor, pressure transducer or temperature sensor.
Communication component 916 is configured to facilitate the communication of wired or wireless way between device 900 and other equipment.Device 900 can access the wireless network based on communication standard, such as WiFi, 2G or 3G, or combinations thereof.In an exemplary enforcement In example, communication component 916 receives broadcast singal or the broadcast related information from external broadcasting management system via broadcast channel. In one exemplary embodiment, described communication component 916 also includes near-field communication (NFC) module, to promote junction service.Example As, RF identification (RFID) technology can be based in NFC module, Infrared Data Association (IrDA) technology, ultra broadband (UWB) technology, Bluetooth (BT) technology and other technologies are realizing.
In the exemplary embodiment, device 900 can be by one or at least two application specific integrated circuits (ASIC), number Word signal processor (DSP), digital signal processing appts (DSPD), PLD (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic building bricks are realized, for executing said method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided As included the memorizer 904 instructing, above-mentioned instruction can be executed by the processor 920 of device 900 to complete said method.For example, Described non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk With optical data storage devices etc..
A kind of non-transitorycomputer readable storage medium, when the instruction in described storage medium is by said apparatus 900 So that said apparatus 900 are able to carry out a kind of time obtaining method during computing device, including:
When meeting default positional information acquisition condition, obtain the current location information of local device;
According to described current location information, determine destination server corresponding with described current location information;
To ask the time to send to described destination server, so that universal time is obtained by described destination server.
In one embodiment, according to described current location information, determine mesh corresponding with described current location information Before mark server, methods described also includes:
Obtain the address of each server and its corresponding band of position in local server list;
Described destination server corresponding with described current location information is determined according to described current location information, including:
According to described server list, determine the band of position belonging to described current location information;
Determine described destination server from the corresponding server in the described affiliated band of position.
In one embodiment, determine described destination service the described corresponding server from the described affiliated band of position Device, including:
When the corresponding server in the described affiliated band of position includes at least two, according to default screening conditions from described Described destination server is selected at least two servers.
In one embodiment, described select described target according to default screening conditions from described at least two servers Server, including:
Select following any server according to default screening conditions from described at least two servers;
Determine that described any server is described destination server, wherein, described any server includes:
The server closest with described current location information, receive described time request in historical time section Number of times highest server or the server that the time described in fastest response asks in historical time section.
In one embodiment, methods described also includes:
Do not receive described destination server and be directed to the described generation that described time request returns in the first preset time period During boundary standard time, send described time request to other servers, wherein, other servers described include:Described at least two A server in addition to described destination server or adjacent with the described affiliated band of position neighbouring in individual server Server in the band of position.
In one embodiment, described default positional information obtains condition and includes:
The described universal time of predetermined server transmission is not received in the second preset time period;Or
Monitor described time request.
Art technology user person, after considering description and putting into practice disclosure disclosed herein, will readily occur to the disclosure Other embodiments.The application is intended to any modification, purposes or the adaptations of the disclosure, these modifications, purposes Or adaptations follow the disclosure general principle and include the disclosure undocumented in the art known often Know or conventional techniques.Description and embodiments be considered only as exemplary, the true scope of the disclosure and spirit by following Claim point out.
It should be appreciated that the disclosure is not limited to be described above and precision architecture illustrated in the accompanying drawings, and And various modifications and changes can carried out without departing from the scope.The scope of the present disclosure only to be limited by appended claim.

Claims (13)

1. a kind of time obtaining method is it is characterised in that include:
When meeting default positional information acquisition condition, obtain the current location information of local device;
According to described current location information, determine destination server corresponding with described current location information;
To ask the time to send to described destination server, so that universal time is obtained by described destination server.
2. method according to claim 1 it is characterised in that
According to described current location information, before determination destination server corresponding with described current location information, described side Method also includes:
Obtain the address of each server and its corresponding band of position in local server list;
Described destination server corresponding with described current location information is determined according to described current location information, including:
According to described server list, determine the band of position belonging to described current location information;
Determine described destination server from the corresponding server in the described affiliated band of position.
3. method according to claim 2 it is characterised in that
Described destination server is determined the described corresponding server from the described affiliated band of position, including:
When the corresponding server in the described affiliated band of position includes at least two, according to default screening conditions from described at least Described destination server is selected in two servers.
4. method according to claim 3 is it is characterised in that described take from described at least two according to default screening conditions Described destination server is selected in business device, including:
Select following any server according to default screening conditions from described at least two servers;
Determine that described any server is described destination server, wherein, described any server includes:
The server closest with described current location information, receive the number of times of described time request in historical time section Highest server or the server that the time described in fastest response asks in historical time section.
5. the method according to claim 3 or 4 is it is characterised in that methods described also includes:
Do not receive described destination server and be directed to the described world mark that described time request returns in the first preset time period When between punctual, send described time request to other servers, wherein, other servers described include:Described at least two clothes A server in addition to described destination server or the close position adjacent with the described affiliated band of position in business device Server in region.
6. method according to any one of claim 1 to 4 it is characterised in that
Described default positional information obtains condition and includes:
The described universal time of predetermined server transmission is not received in the second preset time period;Or
Monitor described time request.
7. a kind of time acquisition device is it is characterised in that include:
First acquisition module, for when meeting default positional information acquisition condition, obtaining the present bit confidence of local device Breath;
Determining module, for according to described current location information, determining destination server corresponding with described current location information;
First sending module, for asking the time to send to described destination server, to be obtained by described destination server Universal time.
8. device according to claim 7 is it is characterised in that described device also includes:
Second acquisition module, for, before determining destination server corresponding with described current location information, obtaining local The address of each server and its corresponding band of position in server list;
Described determining module includes:
First determination sub-module, for according to described server list, determining the band of position belonging to described current location information;
Second determination sub-module, for determining described destination server from the corresponding server in the described affiliated band of position.
9. device according to claim 8 it is characterised in that
Described second determination sub-module includes:
Select unit, for when the corresponding server in the described affiliated band of position includes at least two, according to default screening Condition selects described destination server from described at least two servers.
10. device according to claim 9 it is characterised in that
Described select unit includes:
Select subelement, for selecting following any server according to default screening conditions from described at least two servers;
Determination subelement, for determining that described any server is described destination server, wherein, described any server bag Include:
The server closest with described current location information, receive the number of times of described time request in historical time section Highest server or the server that the time described in fastest response asks in historical time section.
11. devices according to claim 9 or 10 are it is characterised in that described device also includes:
Second sending module, is directed to described time request for not receiving described destination server in the first preset time period During the described universal time returning, send described time request, wherein, other server bags described to other servers Include:In described at least two servers a server in addition to described destination server or with described affiliated position area Server in the adjacent close position region in domain.
12. devices according to any one of claim 7 to 10 it is characterised in that
Described default positional information obtains condition and includes:
The described universal time of predetermined server transmission is not received in the second preset time period;Or
Monitor described time request.
A kind of 13. time acquisition device are it is characterised in that include:
Processor;
For storing the memorizer of processor executable;
Wherein, described processor is configured to:
When meeting default positional information acquisition condition, obtain the current location information of local device;
According to described current location information, determine destination server corresponding with described current location information;
To ask the time to send to described destination server, so that universal time is obtained by described destination server.
CN201610900371.4A 2016-10-14 2016-10-14 Time obtaining method and device Active CN106453560B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610900371.4A CN106453560B (en) 2016-10-14 2016-10-14 Time obtaining method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610900371.4A CN106453560B (en) 2016-10-14 2016-10-14 Time obtaining method and device

Publications (2)

Publication Number Publication Date
CN106453560A true CN106453560A (en) 2017-02-22
CN106453560B CN106453560B (en) 2019-12-03

Family

ID=58174021

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610900371.4A Active CN106453560B (en) 2016-10-14 2016-10-14 Time obtaining method and device

Country Status (1)

Country Link
CN (1) CN106453560B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112332939A (en) * 2020-11-04 2021-02-05 广州朗国电子科技有限公司 Time synchronization method and device of android system, terminal device and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1487752A (en) * 2002-08-16 2004-04-07 Lg������ʽ���� System and method for synchronous service GPRs supporting node and gateway GPRs supporting mode
CN1529460A (en) * 2003-10-14 2004-09-15 北京邮电大学 Whole load equalizing method based on global network positioning
US7263036B2 (en) * 2002-05-27 2007-08-28 Nec Corporation Time correction system in cluster system
EP2077642A1 (en) * 2006-10-27 2009-07-08 Huawei Technologies Co., Ltd. A method, system and time server for adjusting network time
CN102158805A (en) * 2009-11-16 2011-08-17 株式会社日立工业设备技术 Wireless transmission/reception device, and mobile management system
CN105099987A (en) * 2014-04-24 2015-11-25 华为技术有限公司 Terminal service access method, device and system
CN105246052A (en) * 2015-10-14 2016-01-13 中国联合网络通信集团有限公司 Data distribution method and device
CN105553588A (en) * 2015-09-11 2016-05-04 宇龙计算机通信科技(深圳)有限公司 Time updating method and related equipment
CN105654749A (en) * 2014-11-17 2016-06-08 胡乐乐 Vehicle-mounted signal lamp receiving device
CN105682218A (en) * 2016-01-13 2016-06-15 广东欧珀移动通信有限公司 Positioning method and device of mobile terminal and mobile terminal

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7263036B2 (en) * 2002-05-27 2007-08-28 Nec Corporation Time correction system in cluster system
CN1487752A (en) * 2002-08-16 2004-04-07 Lg������ʽ���� System and method for synchronous service GPRs supporting node and gateway GPRs supporting mode
CN1529460A (en) * 2003-10-14 2004-09-15 北京邮电大学 Whole load equalizing method based on global network positioning
EP2077642A1 (en) * 2006-10-27 2009-07-08 Huawei Technologies Co., Ltd. A method, system and time server for adjusting network time
CN102158805A (en) * 2009-11-16 2011-08-17 株式会社日立工业设备技术 Wireless transmission/reception device, and mobile management system
CN105099987A (en) * 2014-04-24 2015-11-25 华为技术有限公司 Terminal service access method, device and system
CN105654749A (en) * 2014-11-17 2016-06-08 胡乐乐 Vehicle-mounted signal lamp receiving device
CN105553588A (en) * 2015-09-11 2016-05-04 宇龙计算机通信科技(深圳)有限公司 Time updating method and related equipment
CN105246052A (en) * 2015-10-14 2016-01-13 中国联合网络通信集团有限公司 Data distribution method and device
CN105682218A (en) * 2016-01-13 2016-06-15 广东欧珀移动通信有限公司 Positioning method and device of mobile terminal and mobile terminal

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112332939A (en) * 2020-11-04 2021-02-05 广州朗国电子科技有限公司 Time synchronization method and device of android system, terminal device and storage medium

Also Published As

Publication number Publication date
CN106453560B (en) 2019-12-03

Similar Documents

Publication Publication Date Title
EP2975821B1 (en) Network connection method and apparatus
CN104580730B (en) Alarm clock prompting method and device
CN104990560A (en) Navigation route generation method and device
CN104105064A (en) Device locating method and device
CN104361486A (en) Alarm clock reminding method and device
CN106203650A (en) Call a taxi and ask sending method and device
CN107105517A (en) Method for connecting network and device
CN107423386A (en) Generate the method and device of electronic card
CN105549300A (en) Automatic focusing method and device
CN107202574A (en) Motion track information modification method and device
CN107241770A (en) Method for connecting network and device
CN106533913A (en) Method and apparatus for sharing position information
CN105554087A (en) Information setting method and device
CN107945552A (en) Become method, apparatus and the storage medium that the lamp time is prompted to signal lamp
CN105050163A (en) Method and device for network connection
CN104539497B (en) Method for connecting network and device
CN105843894A (en) Information recommending method and device
CN106453774A (en) Method and apparatus for displaying contact information
CN106572003A (en) User information recommendation method and device
CN104063423B (en) A kind of method and device for determining position
CN107872620A (en) video recording method and device
CN107819836A (en) The remapping method and device of facility information
CN104065877A (en) Picture pushing method, picture pushing device and terminal equipment
CN106228086A (en) Obtain the method and device of positional information
CN106453560A (en) Time acquisition method and apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant