CN109104261A - Local zone time acquisition methods, terminal and storage medium based on LBS - Google Patents

Local zone time acquisition methods, terminal and storage medium based on LBS Download PDF

Info

Publication number
CN109104261A
CN109104261A CN201811137958.XA CN201811137958A CN109104261A CN 109104261 A CN109104261 A CN 109104261A CN 201811137958 A CN201811137958 A CN 201811137958A CN 109104261 A CN109104261 A CN 109104261A
Authority
CN
China
Prior art keywords
time
terminal
information
base station
zone
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.)
Pending
Application number
CN201811137958.XA
Other languages
Chinese (zh)
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.)
Gaoxing Wulian Technology Co., Ltd.
Original Assignee
Shenzhen Gao Xin Xing Lian Technology 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 Shenzhen Gao Xin Xing Lian Technology Co Ltd filed Critical Shenzhen Gao Xin Xing Lian Technology Co Ltd
Priority to CN201811137958.XA priority Critical patent/CN109104261A/en
Publication of CN109104261A publication Critical patent/CN109104261A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/02Services making use of location information
    • H04W4/025Services making use of location information using location based information parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements

Abstract

The embodiment of the invention discloses a kind of local zone time acquisition methods, terminal and storage medium based on LBS, belongs to the communications field.The terminal includes LBS interface and pre-stored time zone and the longitude table of comparisons, wherein this method comprises: obtaining UTC time to ntp server;The base station information connecting with the terminal is obtained by the LBS interface;Signaling is sent to the base station to obtain the longitude information of the base station based on the base station information;The time zone and the longitude table of comparisons are inquired, by the time zone and the longitude table of comparisons, time-zone information of the time zone corresponding with the longitude information of the base station as the terminal;The local zone time of the terminal is calculated according to the UTC time and the time-zone information.The embodiment of the present invention, which solves terminal, must be manually set time, and the problem that time precision is inadequate, greatly facilitate the application range of various industries terminal device, reduce the manual operation of user.

Description

Local zone time acquisition methods, terminal and storage medium based on LBS
Technical field
The present invention relates to field of communication technology, in particular to a kind of local zone time acquisition methods based on LBS, terminal and deposit Storage media.
Background technique
As the continuous explosion type of global Internet of Things develops, the terminal based on mobile wireless network using more and more extensive, More and more terminals obtain local precise time by urgent need, for helping various civilian or industrial terminal equipment to provide Precision clock is supported.
But since most of terminal is all without battery, or can not keep powering to terminal for a long time, so Terminal may all lose clock information at any time, lead to the terminal for much needing precise time in this way, it is necessary to when providing artificial setting The interface or method of clock, it is very troublesome in this way, it is highly inconvenient, and the time is also very inaccurate, both increased terminal at This investment also causes much not being available the very high equipment of time required precision, this is clearly to internet of things equipment each The universal of industry has a significant impact, and is a problem to be solved.
Summary of the invention
In view of this, the purpose of the present invention is to provide a kind of local zone time acquisition methods, terminal and storage based on LBS Time, and the problem that time precision is inadequate must be manually set to solve terminal in medium.
It is as follows that the embodiment of the present invention solves technical solution used by above-mentioned technical problem:
According to an aspect of an embodiment of the present invention, a kind of local zone time acquisition methods based on LBS are provided, are applied to eventually End, the terminal include based on location-based service (Location Based Service, LBS) interface and pre-stored time zone with The longitude table of comparisons, this method comprises:
UTC time is obtained to ntp server;
The base station information connecting with the terminal is obtained by the LBS interface;
The longitude information of the base station is obtained based on the base station information;
The time zone and the longitude table of comparisons are inquired, by the time zone and the longitude table of comparisons, is believed with the longitude of the base station Cease time-zone information of the corresponding time zone as the terminal;
The local zone time of the terminal is calculated according to the UTC time and the time-zone information.
Another aspect according to an embodiment of the present invention provides a kind of terminal, which includes being based on location-based service (Location Based Service, LBS) interface and pre-stored time zone and the longitude table of comparisons, which at least also wraps It includes: memory, communication bus and processor, in which: the memory obtains program for storing the local zone time based on LBS; The communication bus, for realizing the connection communication between processor and memory;The processor, for executing in memory The local zone time based on LBS of storage obtains program, the step of to realize the above-mentioned local zone time acquisition methods based on LBS.
Another aspect according to an embodiment of the present invention provides a kind of storage medium, and calculating is stored on the storage medium Machine program when computer program is executed by processor, realizes the above-mentioned local zone time acquisition methods based on LBS applied to terminal The step of.
Local zone time acquisition methods, terminal and storage medium provided in an embodiment of the present invention based on LBS, is taken by NTP Business device obtains accurate UTC time, and the longitude information of base station locating for terminal is obtained by LBS interface, and inquiry is preset at terminal In time zone and the longitude table of comparisons, obtain terminal present position time-zone information, finally by by UTC time plus time zone letter Breath, to calculate the accurate local time.To solve terminal it must be manually set the time, and time precision is inadequate Problem greatly facilitates the application range of various industries terminal device, reduces the manual operation of user, and reduces terminal Design cost, have biggish cost-effectiveness.
Detailed description of the invention
In attached drawing (it is not necessarily drawn to scale), similar appended drawing reference can describe phase in different views As component.Similar reference numerals with different letter suffix can indicate the different examples of similar component.Attached drawing with example and Unrestricted mode generally shows each embodiment discussed herein.
A kind of hardware structural diagram of Fig. 1 terminal of each embodiment to realize the present invention;
Fig. 2 is a kind of communications network system architecture diagram provided in an embodiment of the present invention;
Fig. 3 is the process for the local zone time acquisition methods based on LBS applied to terminal that the embodiment of the present invention one provides Figure;
Fig. 4 is the step flow chart provided by Embodiment 2 of the present invention that UTC time is obtained to ntp server;
Fig. 5 is that a kind of terminal of the present invention forms structural schematic diagram.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
In order to be clearer and more clear technical problems, technical solutions and advantages to be solved, tie below Drawings and examples are closed, the present invention will be described in further detail.It should be appreciated that specific embodiment described herein is only To explain the present invention, it is not intended to limit the present invention.
In subsequent description, it is only using the suffix for indicating such as " module ", " component " or " unit " of element Be conducive to explanation of the invention, itself there is no a specific meaning.Therefore, " module ", " component " or " unit " can mix Ground uses.
Terminal can be implemented in a variety of manners.For example, terminal described in the present invention may include such as mobile phone, plate Computer, laptop, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portable Media player (Portable Media Player, PMP), navigation device, terminal, Intelligent bracelet, pedometer etc. are mobile eventually End, and the fixed terminals such as number TV, desktop computer.
It will be illustrated by taking terminal as an example in subsequent descriptions, it will be appreciated by those skilled in the art that in addition to being used in particular for Except the element of mobile purpose, the construction of embodiment according to the present invention can also apply to the terminal of fixed type.
Referring to Fig. 1, a kind of hardware structural diagram of its terminal of each embodiment to realize the present invention, the terminal 100 may include: radio frequency unit (Radio Frequency, RF) 101, WiFi module 102, audio output unit 103, A/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, storage The components such as device 109, processor 110 and power supply 111.It will be understood by those skilled in the art that mobile terminal shown in Fig. 1 Structure does not constitute the restriction to mobile terminal, and terminal may include components more more or fewer than diagram, or combine certain Component or different component layouts.
It is specifically introduced below with reference to all parts of the Fig. 1 to terminal 100:
Radio frequency unit 101 can be used for receiving and sending messages or communication process in, signal sends and receivees, specifically, by base station Downlink information receive after, to processor 110 handle;In addition, the data of uplink are sent to base station.In general, radio frequency unit 101 Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier, duplexer etc..In addition, penetrating Frequency unit 101 can also be communicated with network and other equipment by wireless communication.Any communication can be used in above-mentioned wireless communication Standard or agreement, including but not limited to global system for mobile communications (Global System of Mobile Communication, GSM), general packet radio service (General Packet Radio Service, GPRS), code it is point more Location 2000 (Code Division Multiple Access 2000, CDMA2000), wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA), TD SDMA (Time Division- Synchronous Code Division Multiple Access, TD-SCDMA), frequency division duplex long term evolution (Frequency Division Duplexing-Long Term Evolution, FDD-LTE) and time division duplex long term evolution (Time Division Duplexing-Long Term Evolution, TDD-LTE) etc..
WiFi belongs to short range wireless transmission technology, and mobile terminal can help user to receive and dispatch electricity by WiFi module 102 Sub- mail, browsing webpage and access streaming video etc., it provides wireless broadband internet access for user.Although Fig. 1 shows Go out WiFi module 102, but it is understood that, and it is not belonging to must be configured into for mobile terminal, it completely can be according to need It to omit within the scope of not changing the essence of the invention.
Audio output unit 103 can be in call signal reception pattern, call mode, logging mode, language in terminal 100 It is radio frequency unit 101 or WiFi module 102 is received or depositing when under the isotypes such as sound recognition mode, broadcast reception mode The audio data stored in reservoir 109 is converted into audio signal and exports to be sound.Moreover, audio output unit 103 may be used also To provide audio output relevant to the specific function that terminal 100 executes (for example, call signal receives sound, message sink sound Sound etc.).Audio output unit 103 may include loudspeaker, buzzer etc..
A/V input unit 104 is for receiving audio or video signal.A/V input unit 104 may include graphics processor (Graphics Processing Unit, GPU) 1041 and microphone 1042, graphics processor 1041 is in video acquisition mode Or the image data of the static images or video obtained in image capture mode by image capture apparatus (such as camera) carries out Reason.Treated, and picture frame may be displayed on display unit 106.Through graphics processor 1041, treated that picture frame can be deposited Storage is sent in memory 109 (or other storage mediums) or via radio frequency unit 101 or WiFi module 102.Mike Wind 1042 can connect in telephone calling model, logging mode, speech recognition mode etc. operational mode via microphone 1042 Quiet down sound (audio data), and can be audio data by such acoustic processing.Audio that treated (voice) data can To be converted to the format output that can be sent to mobile communication base station via radio frequency unit 101 in the case where telephone calling model. Microphone 1042 can be implemented various types of noises elimination (or inhibition) algorithms and send and receive sound to eliminate (or inhibition) The noise generated during frequency signal or interference.
Terminal 100 further includes at least one sensor 105, such as optical sensor, motion sensor and other sensors. Specifically, optical sensor includes ambient light sensor and proximity sensor, wherein ambient light sensor can be according to ambient light Light and shade adjusts the brightness of display panel 1061, and proximity sensor can close display panel when terminal 100 is moved in one's ear 1061 and/or backlight.As a kind of motion sensor, accelerometer sensor can detect in all directions (generally three axis) and add The size of speed can detect that size and the direction of gravity when static, can be used to identify application (such as the horizontal/vertical screen of mobile phone posture Switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap) etc.;Also as mobile phone Configurable fingerprint sensor, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer, hygrometer, temperature The other sensors such as meter, infrared sensor, details are not described herein.
Display unit 106 is for showing information input by user or being supplied to the information of user.Display unit 106 can wrap Display panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used Forms such as (Organic Light-Emitting Diode, OLED) configure display panel 1061.
User input unit 107 can be used for receiving the number or character information of input, and generate the use with mobile terminal Family setting and the related key signals input of function control.Specifically, user input unit 107 may include touch panel 1071 with And other input equipments 1072.Touch panel 1071, also referred to as touch screen collect the touch operation of user on it or nearby (for example user uses any suitable objects or attachment such as finger, stylus on touch panel 1071 or in touch panel 1071 Neighbouring operation), and corresponding attachment device is driven according to preset formula.Touch panel 1071 may include touch detection Two parts of device and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation band The signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by it It is converted into contact coordinate, then gives processor 110, and order that processor 110 is sent can be received and executed.In addition, can To realize touch panel 1071 using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves.In addition to touch panel 1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can wrap It includes but is not limited in physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, operating stick etc. It is one or more, specifically herein without limitation.
Further, touch panel 1071 can cover display panel 1061, when touch panel 1071 detect on it or After neighbouring touch operation, processor 110 is sent to determine the type of touch event, is followed by subsequent processing device 110 according to touch thing The type of part provides corresponding visual output on display panel 1061.Although in Fig. 1, touch panel 1071 and display panel 1061 be the function that outputs and inputs of realizing mobile terminal as two independent components, but in certain embodiments, it can The function that outputs and inputs of terminal is realized so that touch panel 1071 and display panel 1061 is integrated, is not limited herein specifically It is fixed.
Interface unit 108 be used as at least one external device (ED) connect with terminal 100 can by interface.For example, external Device may include wired or wireless headphone port, external power supply (or battery charger) port, wired or wireless number According to port, memory card port, port, the port audio input/output (I/O), view for connecting the device with identification module The port frequency I/O, ear port etc..Interface unit 108 can be used for receiving the input from external device (ED) (for example, data are believed Breath, electric power etc.) and by one or more elements that the input received is transferred in terminal 100 or can be used at end Data are transmitted between end 100 and external device (ED).
Memory 109 can be used for storing software program and various data.Memory 109 can mainly include storing program area The storage data area and, wherein storing program area can (such as the sound of application program needed for storage program area, at least one function Sound playing function, image player function etc.) etc.;Storage data area can store according to mobile phone use created data (such as Audio data, phone directory etc.) etc..In addition, memory 109 may include high-speed random access memory, it can also include non-easy The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is the control centre of mobile terminal, utilizes each of various interfaces and the entire mobile terminal of connection A part by running or execute the software program and/or module that are stored in memory 109, and calls and is stored in storage Data in device 109 execute the various functions and processing data of mobile terminal, to carry out integral monitoring to mobile terminal.Place Managing device 110 may include one or more processing units;Preferably, processor 110 can integrate application processor and modulatedemodulate is mediated Manage device, wherein the main processing operation system of application processor, user interface and application program etc., modem processor is main Processing wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110.
Terminal 100 can also include the power supply 111 (such as battery) powered to all parts, it is preferred that power supply 111 can be with It is logically contiguous by power-supply management system and processor 110, thus by power-supply management system realize management charging, electric discharge, with And the functions such as power managed.
Although Fig. 1 is not shown, terminal 100 can also be including bluetooth module etc., and details are not described herein.
Embodiment to facilitate the understanding of the present invention, the communications network system being based below to terminal of the invention are retouched It states.
Referring to Fig. 2, Fig. 2 is a kind of communications network system architecture diagram provided in an embodiment of the present invention, the communication network system System is the LTE system of universal mobile communications technology, which includes the user equipment (User of successively communication connection Equipment, UE) 201, evolved UMTS Terrestrial radio access network (Evolved UMTS Terrestrial Radio Access Network, E-UTRAN) 202, evolved packet-based core networks (Evolved Packet Core, EPC) 203 and operation The IP operation 204 of quotient.
Generally, UE201 can be above-mentioned terminal 100, and details are not described herein again.
E-UTRAN202 includes eNodeB2021 and other eNodeB2022 etc..Wherein, eNodeB2021 can be by returning Journey (backhaul) (such as X2 interface) is connect with other eNodeB2022, and eNodeB2021 is connected to EPC203, ENodeB2021 can provide the access of UE201 to EPC203.
EPC203 may include mobility management entity (Mobility Management Entity, MME) 2031, ownership Client server (Home Subscriber Server, HSS) 2032, other MME2033, SGW (Serving Gate Way, Gateway) 2034, PGW (PDN Gate Way, grouped data network gateway) 2035 and policy and rate functional entity (Policy and Charging Rules Function, PCRF) 2036 etc..Wherein, MME2031 be processing UE201 and The control node of signaling, provides carrying and connection management between EPC203.HSS2032 is all to manage for providing some registers Such as the function of home location register (not shown) etc, and preserves some related service features, data rates etc. and use The dedicated information in family.All customer data can be sent by SGW2034, and PGW2035 can provide the IP of UE 201 Address distribution and other functions, PCRF2036 are strategy and the charging control strategic decision-making of business data flow and IP bearing resource Point, it selects and provides available strategy and charging control decision with charge execution function unit (not shown) for strategy.
IP operation 204 may include internet, Intranet, IP multimedia subsystem (IP Multimedia Subsystem, IMS) or other IP operations etc..
Although above-mentioned be described by taking LTE system as an example, those skilled in the art should know the present invention is not only Suitable for LTE system, be readily applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA with And the following new network system etc., herein without limitation.
Based on above-mentioned mobile terminal hardware configuration and communications network system, each embodiment of the method for the present invention is proposed.
Embodiment one
As shown in figure 3, the step of showing the local zone time acquisition methods based on LBS of the offer of the embodiment of the present invention one stream Cheng Tu.The sequence for executing step is defined it should be understood that the flow chart in this method embodiment is not used in.This method is answered For terminal, the terminal includes based on location-based service (Location Based Service, LBS) interface and pre-stored Time zone and the longitude table of comparisons, this method comprises:
S300, coordinated universal time is obtained to Network Time Protocol (Network Time Protocol, NTP) server (Universal Time Coordinated,UTC)。
Ntp server is for making a kind of computer time synchronized agreement, it can make computer to its server Or clock source (such as quartz clock, GPS etc.) synchronizes, it can provide the time adjustment of high accurancy and precision, and (LAN is upper and standard room Difference is less than 1 millisecond, WAN upper a few tens of milliseconds), and vicious protocol attack can be prevented by the mode of encrypted acknowledgment.
In general, it is believed that UTC time and Greenwich Mean Time (Greenwich Mean Time, GMT) be it is the same, be Universal time is the zebra time after being corrected to earth speed cycle sex differernce.Therefore, in the present embodiment when UTC Between can also be called Greenwich Mean Time.Wherein, will implement to the specific steps that ntp server obtains UTC time in the present invention Example two (Fig. 4) is described in detail.
S302, the base station information connecting with the terminal is obtained by the LBS interface.
Generally, LBS interface mainly calculates the position where terminal by the base station signal difference of mobile communication.Base Information stand in simple terms, is by position area identification code (Location Area Identification, LAI) and base station number (Cell Tower Identity, CID) composition.
Wherein, LAI is by Mobile Country Code MCC (Mobile country code, MCC)+Mobile Network Code (Mobile Network code, MNC)+location area code (Location Area Code, LAC) composition.LAC is 2 byte longs Hexadecimal binary-coded decimal (not including 0000 and FFFE).CID is the hexadecimal binary-coded decimal of 2 byte longs.It can by LAI and CID To realize base station location, to obtain the base station of terminal connection.Wherein, it realizes that base station location belongs to by LAI and CID to compare into Ripe technology, this case repeat no more.
S304, the longitude information that the base station is obtained based on the base station information.
Currently, working as terminal successful registration mobile cellular network, a variety of mobile network's standards can be supported, honeycomb covering the whole world moves Dynamic network.Therefore, after terminal registration network success, necessary network insertion configuration is carried out, data dial is initiated to base station and asks It asks, base station is waited to be successfully accessed.
After data dial success, the warp that the base station is obtained based on the base station information is accomplished by the following way in terminal The step of spending information:
The base station that terminal is accessed by the LBS interface to terminal sends signaling to obtain LAI and the CID letter of the base station Breath forms HTTP request then according to the LAI of base station information and cid information and preset GIS server request address.Eventually End sends the HTTP request to specified GIS server, to obtain the latitude and longitude information of this base station, especially longitude information.
The GIS server obtains the longitude information of the base station based on the LAI and cid information, and passes through message Form returns to GIS server, and terminal receives the message of GIS server passback, and the message returned according to the GIS server Parse the longitude information of the base station.
S306, the inquiry time zone and the longitude table of comparisons, by the warp in the time zone and the longitude table of comparisons, with the base station Spend time-zone information of the corresponding time zone of information as the terminal.
Table 1 is the time zone and the longitude table of comparisons that terminal prestores, and has recorded the corresponding relationship of whole world time zone and longitude.Currently, In the world by global subdivision be 24 time zones, since 0 ° of longitude eastwards, westwards respectively for 7.5 ° be zero zone, by 7.5 ° of E (E tables Show eastwards) eastwards every 15 ° be divided into a time zone, be respectively designated as Dong Yiqu, the eastern No.12 District Dong Erqu ....By 7.5 ° of W (W tables Show eastwards) westwards every 15 ° be divided into a time zone.It is respectively designated as Xi Yiqu, the western No.12 District Xi Erqu ....
Table 1
Latitude and longitude information where the base station that terminal receives the terminal access of GIS server passback, especially longitude After information, terminal is by inquiry time zone time zone corresponding with the available base station longitude information of the longitude table of comparisons, to obtain end Time-zone information where holding.For example, when the longitude where the base station of GIS server passback is 20 ° of east longitude (20 ° of E), then by looking into Ask mono- area time zone Wei Dong where time zone and the available terminal of the longitude table of comparisons.
S308, the local zone time that the terminal is calculated according to the UTC time and the time-zone information.
Terminal is according to UTC time (or Greenwich Mean Time) and the time-zone information, by described in the calculating of preset algorithm The local zone time of terminal.In the present embodiment, preset algorithm is as shown in table 2.Specifically, when it is eastern for obtaining the time zone where terminal Qu Shi, local zone time=UTC standard time+time zone numerical value * 1 hour.It is local when obtaining the time zone where terminal is western time zone Time=UTC standard time-time zone * 1 hour.When obtaining the time zone where terminal is zero zone, local zone time=UTC standard Time.For example, the local zone time of terminal is+1 hour UTC standard time when obtaining time zone mono- area Wei Dong where terminal, than It such as, is 11:00:am when the UTC standard time, then local zone time is 12:00:am.
Table 2
Further, terminal is also corrected the time of terminal based on the resulting local zone time of calculating, and shows In the application interface of terminal.
By implementing aforesaid way, accurate UTC time is obtained by ntp server, terminal institute is obtained by LBS interface The longitude information of the base station at place inquires preset time zone in the terminal and the longitude table of comparisons, obtains the time zone of terminal present position Information adds time-zone information finally by by UTC time, to calculate the accurate local time.It must to solve terminal Time, and the problem that time precision is inadequate must be manually set, greatly facilitate the application range of various industries terminal device, subtract The manual operation of user is lacked, and has reduced the design cost of terminal, there is biggish cost-effectiveness.
Embodiment two
As shown in figure 4, showing the step process provided by Embodiment 2 of the present invention for obtaining UTC time to ntp server Figure.The sequence for executing step is defined it should be understood that the flow chart in this method embodiment is not used in.The step is specific Include:
S400, initialization terminal.
S402, starting search mobile network, judge the terminal whether normal registration network.
Specifically, endpoint to register mobile cellular network, can support a variety of mobile network's standards, and honeycomb covering the whole world is mobile Network.
S404, when the network of the terminal is normal, log-on data dial request is to judge whether the terminal successfully builds Vertical data connection.
Specifically, after terminal registration network success, network insertion configuration is carried out, then log-on data dial request is to sentence Whether the terminal of breaking is successfully established data connection, and the access permission of base station is waited to respond.When terminal data dial-up success, then It is logical data can be provided for the LBS service in Network Time Protocol (Network Time Protocol, NTP) and above-described embodiment It supports in road.
S406, when the terminal is successfully established data connection, start NTP service.
Wherein, NTP service is the agreement of the time of each computer in synchronizing network.
S408, TCP time service request is sent to the IP of the ntp server.
Wherein, ntp server is the ntp server at preset time service center, and developer can preset more as needed The ntp server IP address at center when a.Preferably, each continent can preset an IP address, all over the world.
In the present embodiment, terminal sends transmission control protocol according to preset time service central server IP address, poll (Transmission Control Protocol, TCP) time service request.
S410, the time service message that the ntp server returns is received.
If receiving time service central server response message, terminal can report time service message.If parsing failure, terminal meeting The next time service central server IP of poll, the time service message until successfully obtaining time service central server.
S412, UTC time is gone out according to the time service packet parsing.
In this way, terminal can parse the UTC standard time after successfully obtaining the time service message of time service central server.Specifically Analysis mode, belong to the technology of comparative maturity, this case repeats no more.
Embodiment three
The embodiment of the present invention provides a kind of terminal, and Fig. 5 is the composed structure schematic diagram of terminal of the present invention, and the terminal is at least It include: memory 501, communication bus 502 and processor 503, in which:
The memory 501 obtains program for storing the local zone time based on LBS;
The communication bus 502, for realizing the connection communication between processor and memory;
The processor 503 obtains program for executing the local zone time based on LBS stored in memory, to realize The step of local zone time acquisition methods based on LBS of above method embodiment.
It should be noted that the terminal of the present embodiment, belongs to same with the local zone time acquisition methods embodiment based on LBS Design, specific implementation process is shown in embodiment of the method in detail, and the technical characteristic in embodiment of the method is right in the present embodiment It should be applicable in, which is not described herein again.
Example IV
The embodiment of the invention also provides a kind of computer readable storage medium, it is stored on computer readable storage medium Computer program when computer program is executed by processor, realizes any embodiment into embodiment two of above-described embodiment one The step of local zone time acquisition methods based on LBS.
It should be noted that the computer readable storage medium of the embodiment of the present invention, obtains with the local zone time based on LBS Embodiment of the method belongs to same design, and specific implementation process is shown in embodiment of the method in detail, and the technology in embodiment of the method is special Sign is corresponding in a computer-readable storage medium to be applicable in, and which is not described herein again.
Local zone time acquisition methods, terminal and storage medium provided in an embodiment of the present invention based on LBS, is taken by NTP Business device obtains accurate UTC time, and the longitude information of base station locating for terminal is obtained by LBS interface, and inquiry is preset at terminal In time zone and the longitude table of comparisons, obtain terminal present position time-zone information, finally by by UTC time plus time zone letter Breath, to calculate the accurate local time.To solve terminal it must be manually set the time, and time precision is inadequate Problem greatly facilitates the application range of various industries terminal device, reduces the manual operation of user, and reduces terminal Design cost, have biggish cost-effectiveness.
It will appreciated by the skilled person that whole or certain steps, system, dress in method disclosed hereinabove Functional module/unit in setting may be implemented as software, firmware, hardware and its pond appropriate and close.
In hardware embodiment, the division between functional module/unit referred in the above description is not necessarily corresponded to In the division of physics pond part;If for example, a physics pond part can have multiple functions or a function or step can be by Dry is managed the cooperation of pond part and is executed.Certain physics ponds part or all physics ponds part may be implemented as by processor, such as central processing The software that device, digital signal processor or microprocessor execute, is perhaps implemented as hardware or is implemented as integrated circuit, Such as specific integrated circuit.Such software can be distributed on a computer-readable medium, and computer-readable medium may include meter Calculation machine storage medium (or non-transitory medium) and communication media (or fugitive medium).As known in those of ordinary skill in the art , term computer storage medium is included in for storing information (such as computer readable instructions, data structure, program module Or other data) any method or technique in implement volatile and non-volatile, removable and nonremovable medium.It calculates Machine storage medium includes but is not limited to RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storages, magnetic holder, tape, disk storage or other magnetic memory apparatus or can be used for storing desired Information and any other medium that can be accessed by a computer.In addition, known to a person of ordinary skill in the art be, communication Medium generally comprises computer readable instructions, data structure, program module or such as carrier wave or other transmission mechanisms etc Other data in modulated data signal, and may include any information delivery media.
Preferred embodiments of the present invention have been described above with reference to the accompanying drawings, not thereby limiting the scope of the invention.This Field technical staff without departing from the scope and spirit of the invention in made by any modifications, equivalent replacements, and improvements, should all this Within the interest field of invention.

Claims (10)

1. a kind of local zone time acquisition methods based on LBS are applied to terminal, which is characterized in that the terminal includes being based on position The service of setting (Location Based Service, LBS) interface and pre-stored time zone and the longitude table of comparisons, this method packet It includes:
UTC time is obtained to ntp server;
The base station information connecting with the terminal is obtained by the LBS interface;
The longitude information of the base station is obtained based on the base station information;
The time zone and the longitude table of comparisons are inquired, by the longitude information pair in the time zone and the longitude table of comparisons, with the base station Time-zone information of the time zone answered as the terminal;
The local zone time of the terminal is calculated according to the UTC time and the time-zone information.
2. the local zone time acquisition methods according to claim 1 based on LBS, which is characterized in that the described method includes:
It is corrected based on time of the local zone time to the terminal, and is shown in the application interface of the terminal.
3. the local zone time acquisition methods according to claim 1 based on LBS, which is characterized in that described to ntp server The step of obtaining UTC time, specifically includes:
Start NTP service, sends TCP time service request to the IP of the ntp server;
Receive the time service message that the ntp server returns;
Go out the UTC time according to the time service packet parsing.
4. the local zone time acquisition methods according to claim 3 based on LBS, which is characterized in that taken in the starting NTP Before the step of business, the method also includes:
Initialize the terminal;
Starting search mobile network, judge the terminal whether normal registration network;
When the network of the terminal is normal, log-on data dial request is connected with judging whether the terminal is successfully established data It connects;
When the terminal is successfully established data connection, start the NTP service.
5. the local zone time acquisition methods according to claim 4 based on LBS, which is characterized in that described to be based on the base Stand base station described in acquisition of information longitude information the step of, specifically include:
By the LBS interface obtain the base station position area identification code (Location Area Identification, ) and base station number (Cell Tower Identity, CID) information LAI;
The LAI and cid information are sent to GIS server;
Receive the message of the GIS server return, wherein the GIS server is based on the LAI and cid information obtains institute State the longitude information of base station;
Go out the longitude information of the base station according to the packet parsing that the GIS server is returned.
6. a kind of terminal, which is characterized in that the terminal include based on location-based service (Location Based Service, LBS) interface and pre-stored time zone and the longitude table of comparisons, the terminal also include at least: memory, communication bus and processing Device, in which:
The memory obtains program for storing the local zone time based on LBS;
The communication bus, for realizing the connection communication between processor and memory;
The processor obtains program for executing the local zone time based on LBS stored in memory, to realize following step It is rapid:
UTC time is obtained to ntp server;
The base station information connecting with the terminal is obtained by the LBS interface;
The longitude information of the base station is obtained based on the base station information;
The time zone and the longitude table of comparisons are inquired, by the longitude information pair in the time zone and the longitude table of comparisons, with the base station Time-zone information of the time zone answered as the terminal;
The local zone time of the terminal is calculated according to the UTC time and the time-zone information.
7. terminal according to claim 6, which is characterized in that it is described that the local zone time based on LBS obtains program When processor executes, following steps are also realized:
It is corrected based on time of the local zone time to the terminal, and is shown in the application interface of the terminal.
8. terminal according to claim 6, which is characterized in that described the step of obtaining UTC time to ntp server, tool Body includes:
Start NTP service, sends TCP time service request to the IP of the ntp server;
Receive the time service message that the ntp server returns;
Go out the UTC time according to the time service packet parsing.
9. terminal according to claim 6, which is characterized in that the warp for obtaining the base station based on the base station information The step of spending information, specifically includes:
The LAI and cid information of the base station are obtained by the LBS interface;
The LAI and cid information are sent to GIS server;
Receive the message of the GIS server return, wherein the GIS server is based on the LAI and cid information obtains institute State the longitude information of base station;
Go out the longitude information of the base station according to the packet parsing that the GIS server is returned.
10. a kind of storage medium, which is characterized in that be stored with computer program, the computer program on the storage medium When being executed by processor, realize that the local zone time based on LBS as described in any one of claim 1 to 5 claim obtains The step of taking method.
CN201811137958.XA 2018-09-28 2018-09-28 Local zone time acquisition methods, terminal and storage medium based on LBS Pending CN109104261A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811137958.XA CN109104261A (en) 2018-09-28 2018-09-28 Local zone time acquisition methods, terminal and storage medium based on LBS

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811137958.XA CN109104261A (en) 2018-09-28 2018-09-28 Local zone time acquisition methods, terminal and storage medium based on LBS

Publications (1)

Publication Number Publication Date
CN109104261A true CN109104261A (en) 2018-12-28

Family

ID=64867535

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811137958.XA Pending CN109104261A (en) 2018-09-28 2018-09-28 Local zone time acquisition methods, terminal and storage medium based on LBS

Country Status (1)

Country Link
CN (1) CN109104261A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110312154A (en) * 2019-06-03 2019-10-08 深圳创维-Rgb电子有限公司 A kind of time zone automatic setting method, DTV and storage medium
CN111766772A (en) * 2020-07-02 2020-10-13 浙江昱能科技有限公司 Time calibration method, device and system and computer readable storage medium
CN112105004A (en) * 2020-09-15 2020-12-18 努比亚技术有限公司 Electronic price tag network detection method, device and computer readable storage medium
CN114390666A (en) * 2022-01-28 2022-04-22 高新兴物联科技有限公司 Communication module time synchronization method, device and computer readable storage medium
CN114415492A (en) * 2021-12-08 2022-04-29 深圳优美创新科技有限公司 Method for acquiring time in offline state, terminal and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101677426A (en) * 2008-09-17 2010-03-24 货通达信息技术(北京)有限公司 Locating terminal, system and method for realizing locating service by using same
EP2169481A1 (en) * 2008-09-30 2010-03-31 Siemens Programm- und Systementwicklung Gmbh & Co. KG Central clock assembly
CN102340567A (en) * 2010-07-20 2012-02-01 上海闻泰电子科技有限公司 Mobile phone and method for automatically setting time according to positioning of global positioning system (GPS)
CN106993327A (en) * 2017-03-14 2017-07-28 广东欧珀移动通信有限公司 Network locating method, device and computer equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101677426A (en) * 2008-09-17 2010-03-24 货通达信息技术(北京)有限公司 Locating terminal, system and method for realizing locating service by using same
EP2169481A1 (en) * 2008-09-30 2010-03-31 Siemens Programm- und Systementwicklung Gmbh & Co. KG Central clock assembly
CN102340567A (en) * 2010-07-20 2012-02-01 上海闻泰电子科技有限公司 Mobile phone and method for automatically setting time according to positioning of global positioning system (GPS)
CN106993327A (en) * 2017-03-14 2017-07-28 广东欧珀移动通信有限公司 Network locating method, device and computer equipment

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110312154A (en) * 2019-06-03 2019-10-08 深圳创维-Rgb电子有限公司 A kind of time zone automatic setting method, DTV and storage medium
CN111766772A (en) * 2020-07-02 2020-10-13 浙江昱能科技有限公司 Time calibration method, device and system and computer readable storage medium
CN111766772B (en) * 2020-07-02 2021-07-13 昱能科技股份有限公司 Time calibration method, device and system and computer readable storage medium
CN112105004A (en) * 2020-09-15 2020-12-18 努比亚技术有限公司 Electronic price tag network detection method, device and computer readable storage medium
CN114415492A (en) * 2021-12-08 2022-04-29 深圳优美创新科技有限公司 Method for acquiring time in offline state, terminal and storage medium
CN114415492B (en) * 2021-12-08 2023-12-08 深圳优美创新科技有限公司 Method, terminal and storage medium for acquiring time in offline state
CN114390666A (en) * 2022-01-28 2022-04-22 高新兴物联科技有限公司 Communication module time synchronization method, device and computer readable storage medium
CN114390666B (en) * 2022-01-28 2023-08-15 高新兴物联科技股份有限公司 Communication module time synchronization method, equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN109104261A (en) Local zone time acquisition methods, terminal and storage medium based on LBS
CN108391025B (en) Network access management method, mobile terminal and computer readable storage medium
CN107566980B (en) Mobile terminal positioning method and mobile terminal
CN108924364A (en) Message prompt method, mobile terminal and computer readable storage medium
CN107862217B (en) Position information acquisition method, mobile terminal and computer storage medium
CN109144441A (en) A kind of screen adjustment method, terminal and computer readable storage medium
CN109379735A (en) ESIM card operating method, mobile terminal and eSIM card apparatus
CN110012157A (en) A kind of application display alarm method, terminal and computer readable storage medium
CN110180181A (en) Screenshot method, device and the computer readable storage medium of Wonderful time video
CN107770368B (en) Alarm clock application reminding method based on terminal and terminal
CN109462700A (en) A kind of call method, mobile terminal and computer readable storage medium
CN108494943A (en) Message sink sends processing method, terminal and computer readable storage medium
CN109062678A (en) A kind of Working mode switching method, wearable device and computer storage medium
CN110213717A (en) A kind of localization method, localization message remind terminal and localization message system for prompting
CN109639834A (en) A kind of synchronizing information processing method, system and mobile terminal
CN108449736A (en) A kind of data transmission method, terminal and computer readable storage medium
CN108306856A (en) A kind of interface merging method, client, server and computer readable storage medium
CN107885988A (en) A kind of unlocking screen method, terminal and computer-readable recording medium
CN109257739A (en) ESIM card operating method, mobile terminal and eSIM card apparatus
CN109089258A (en) ESIM card operating method, mobile terminal and eSIM card apparatus
CN109151184A (en) A kind of method for controlling mobile terminal, mobile terminal and computer readable storage medium
CN109219039A (en) ESIM card operating method, mobile terminal and eSIM card apparatus
CN110072272A (en) A kind of method of power consumption control, wireless terminal and cordless communication network equipment
CN107734493A (en) A kind of main screen shows regular adaptation method, device and computer-readable recording medium
CN107277801A (en) Querying method, mobile terminal and the readable storage medium storing program for executing of call forwarding state

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20190517

Address after: 518000 Guangdong, Shenzhen, Nanshan District, Guangdong Province, Nanshan District high tech Industrial Park, South Korea 12 road, MINDRAY Building 2 floor B area, zone 12

Applicant after: Gaoxing Wulian Technology Co., Ltd.

Address before: 518000 Guangdong, Shenzhen, Nanshan District, Guangdong Province, Nanshan District high tech Industrial Park, South Korea 12 road, MINDRAY Building 2 floor B area, zone 12

Applicant before: Shenzhen Gao Xin Xing Lian Technology Co., Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181228