CN106658412A - Locating method and apparatus - Google Patents

Locating method and apparatus Download PDF

Info

Publication number
CN106658412A
CN106658412A CN201611151060.9A CN201611151060A CN106658412A CN 106658412 A CN106658412 A CN 106658412A CN 201611151060 A CN201611151060 A CN 201611151060A CN 106658412 A CN106658412 A CN 106658412A
Authority
CN
China
Prior art keywords
terminal
application
positional information
wireless network
network identification
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
CN201611151060.9A
Other languages
Chinese (zh)
Other versions
CN106658412B (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 CN201611151060.9A priority Critical patent/CN106658412B/en
Publication of CN106658412A publication Critical patent/CN106658412A/en
Application granted granted Critical
Publication of CN106658412B publication Critical patent/CN106658412B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/023Services making use of location information using mutual or relative location information between multiple location based services [LBS] targets or of distance thresholds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W64/00Locating users or terminals or network equipment for network management purposes, e.g. mobility management
    • H04W64/006Locating users or terminals or network equipment for network management purposes, e.g. mobility management with additional information processing, e.g. for direction or speed determination
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The invention provides a locating method and apparatus, and belongs to the technical field of networks. The method comprises the following steps: when a first locating request of a first application is received, judging whether terminal position information is cached in local, when the terminal position information is cached in local, judging whether the first application is running in the foreground of a terminal at present, when the first application is not running in the foreground of the terminal at present, obtaining pre-cached terminal position information from the local, and sending the terminal position information to the first application. When the first application is not running in the foreground of the terminal at present, it indicates that a user does not use the first application at present, therefore when the first application requests the locating of the terminal, the pre-cached terminal position information can be directly sent t the first terminal, that is, the terminal does not execute a locating operation, therefore when a plurality of applications run in the background of the terminal, the terminal is prevented from frequently executing the locating operation, thereby saving the power consumption.

Description

Localization method and device
Technical field
It relates to networking technology area, more particularly to a kind of localization method and device.
Background technology
With the fast development of network technology, the terminal of such as mobile phone or the like is widely used.Using process In, various applications can be installed in terminal, wherein, some applications can obtain the positional information of terminal by location technology, from And various functions are realized, and for example, the application such as " drop oozes row ".
In the related, application can be positioned with triggering terminal, for example, when application starts, can trigger the end End performs positioning action, additionally, the application in the terminal in running background also can be every preset duration, triggering the terminal is carried out Positioning.After terminal positioning, the positional information for getting is sent to and triggers the application that the terminal is positioned so that the application can To realize corresponding function using the positional information.
The content of the invention
To overcome problem present in correlation technique, the disclosure to provide a kind of localization method and device.
First aspect, there is provided a kind of localization method, methods described includes:
When the first Location Request of the first application is received, whether judgement is locally cached with terminal positional information;
When local cache has the terminal positional information, the current foreground for whether being in terminal of first application is judged Operation, first application is the arbitrary application installed in the terminal;
When the described first application is not currently in the front stage operation of the terminal, from the local terminal for obtaining caching in advance Positional information;
The terminal positional information is sent into first application.
In a kind of possible implementation, methods described also includes:
When the second Location Request of the second application is received, wireless network is scanned, to obtain at least one wireless network Mark, second application is the application of the front stage operation in the terminal;
Based at least one wireless network identification, the terminal positional information is obtained;
The terminal positional information is cached to local.
It is described based at least one wireless network identification in a kind of possible implementation, obtain the terminal Positional information, including:
At least one wireless network identification is sent into location-server;
The corresponding positional information of at least one wireless network identification is received from the location-server;
The positional information of reception is defined as into the terminal positional information.
It is described that the terminal positional information is sent to after first application in a kind of possible implementation, Also include:
At least one wireless network identification and the terminal positional information are sent into given server, it is described to specify Server is used to be the Terminal for service.
In a kind of possible implementation, the wireless network identification includes MAC address.
Second aspect, there is provided a kind of positioner, described device includes:
First judge module, for when the first Location Request of the first application is received, whether judgement to be locally cached with Terminal positional information;
Second judge module, it is current for when local cache has the terminal positional information, judging first application Whether the front stage operation of terminal is in, and first application is the arbitrary application installed in the terminal;
First acquisition module, for before the judge module determines that first application is not currently in the terminal When platform runs, from the local terminal positional information for obtaining caching in advance;
First sending module, for the terminal positional information that first acquisition module is obtained to be sent into described One application.
In a kind of possible implementation, described device also includes:
Scan module, for when the second Location Request of the second application is received, scanning wireless network, to obtain at least One wireless network identification, second application is the application of the front stage operation in the terminal;
Second acquisition module, for based at least one wireless network identification, obtaining the terminal positional information;
Cache module, for the terminal positional information to be cached to local.
In a kind of possible implementation, second acquisition module includes:
Sending submodule, at least one wireless network identification to be sent into location-server;
Receiving submodule, for receiving the corresponding position of at least one wireless network identification from the location-server Confidence ceases;
Determination sub-module, for the positional information of reception to be defined as into the terminal positional information.
In a kind of possible implementation, described device also includes:
Second sending module, at least one wireless network identification and the terminal positional information to be sent into finger Determine server, the given server is used to be the Terminal for service.
In a kind of possible implementation, the wireless network identification includes MAC address.
The third aspect, there is provided a kind of positioner, described device includes:
Processor;
For storing the memory of processor executable;
Wherein, the processor is configured to:
When the first Location Request of the first application is received, whether judgement is locally cached with terminal positional information;
When local cache has the terminal positional information, the current foreground for whether being in terminal of first application is judged Operation, first application is the arbitrary application installed in the terminal;
When the described first application is not currently in the front stage operation of the terminal, from the local terminal for obtaining caching in advance Positional information;
The terminal positional information is sent into first application.
The technical scheme that embodiment of the disclosure is provided can include following beneficial effect:
In the disclosed embodiments, when the first Location Request of the arbitrary application installed in receiving terminal, this is judged Whether ground is cached with terminal positional information, when local cache has the terminal positional information, judges that first application is current whether In the front stage operation of terminal, if first application is not currently in the front stage operation of the terminal, illustrate that user does not currently make With first application, in that case, the terminal positional information of local cache can be sent to first application, that is, be not required to Positioning action is performed, thus, when the multiple applications of the running background of the terminal, it is to avoid the terminal frequently executes positioning action, Save the consumption of the electricity of the terminal.
It should be appreciated that the general description of the above and detailed description hereinafter are only exemplary and explanatory, not The disclosure can be limited.
Description of the drawings
Accompanying drawing herein is merged in specification and constitutes the part of this specification, shows the enforcement for meeting the disclosure Example, and be used to explain the principle of the disclosure together with specification.
Figure 1A is a kind of implementation environment schematic diagram according to an exemplary embodiment.
Figure 1B is a kind of flow chart of the localization method according to an exemplary embodiment.
Fig. 2 is a kind of flow chart of the localization method for implementing to exemplify according to another exemplary.
Fig. 3 A are a kind of block diagrams of the positioner according to an exemplary embodiment.
Fig. 3 B are a kind of block diagrams of the positioner for implementing to exemplify according to another exemplary.
Fig. 3 C are a kind of block diagrams of the positioner for implementing to exemplify according to another exemplary.
Fig. 4 is a kind of block diagram of the positioner 400 according to an exemplary embodiment.
Specific embodiment
Here exemplary embodiment will be illustrated in detail, 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.Conversely, they be only with it is such as appended The example of the consistent apparatus and method of some aspects described in detail in claims, the disclosure.
Figure 1A is a kind of implementation environment schematic diagram according to an exemplary embodiment.Mainly include in the implementation environment Terminal 110, location-server 120, the Wireless Communication Equipment 140 of given server 130 and at least one (are exemplarily shown in Figure 1A Two are gone out).Wherein, the terminal 110 can be taken respectively by the wireless network that Wireless Communication Equipment 140 is provided with the positioning Business device 120 and given server 130 set up connection.
Wherein, the terminal 110 is used to realize the localization method that the embodiment of the present disclosure is provided.Wherein, can be with the terminal 110 Multiple applications are installed and run, the terminal 110 can be the equipment of such as mobile phone, panel computer, computer or the like, the disclosure Embodiment is not construed as limiting to this.
Wherein, the location-server 120 may be used for the terminal 110 and provide terminal positional information, the location-server 120 can be provided by third party, and for example, the location-server 120 can be Baidu map server, or high moral map Server etc., the embodiment of the present disclosure is not limited this.
Wherein, the given server 130 can be the server for providing service for the terminal 110, for example, when the end When end 110 is mobile phone, the server for providing service for mobile phone that the given server 130 can be provided for cell phone manufacturer. The given server 130 is mainly used in storing the terminal positional information and at least one wireless network mark acquired in the terminal 110 Corresponding relation between knowledge, in order to the later stage of terminal 110 terminal location letter directly can be inquired about from the given server 130 Breath.
Wherein, at least one Wireless Communication Equipment 140 can be the equipment of such as router or the like, the terminal 110 By performing scanning wireless network operations, at least one wireless network near the present position of terminal 110 can be obtained The wireless network identification of equipment 140, so as to be based on the wireless network identification of at least one Wireless Communication Equipment 140, from positioning Terminal positional information is obtained in server 120.
Figure 1B is a kind of flow chart of the localization method according to an exemplary embodiment, as shown in Figure 1B, the positioning Method may comprise steps of.
In a step 101, when the first Location Request of the first application is received, whether judgement is locally cached with terminal position Confidence ceases;
In a step 102, when local cache has terminal positional information, judge that first application is current whether in terminal Front stage operation, first application is arbitrary application for installing in the terminal.
In step 103, when first application is not currently in the front stage operation of the terminal, obtain slow in advance from local The terminal positional information deposited.
At step 104, the terminal positional information is sent into first application.
In the disclosed embodiments, when the first Location Request of the arbitrary application installed in receiving terminal, this is judged Whether ground is cached with terminal positional information, when local cache has the terminal positional information, judges that first application is current whether In the front stage operation of terminal, if first application is not currently in the front stage operation of the terminal, illustrate that user does not currently make With first application, in that case, the terminal positional information of local cache can be sent to first application, that is, be not required to Positioning action is performed, thus, when the multiple applications of the running background of the terminal, it is to avoid the terminal frequently executes positioning action, Save the consumption of the electricity of the terminal.
In a kind of possible implementation, the method also includes:
When the second Location Request of the second application is received, wireless network is scanned, to obtain at least one wireless network Mark, second application is the application of the front stage operation in the terminal;
Based at least one wireless network identification, the terminal positional information is obtained;
The terminal positional information is cached to local.
In a kind of possible implementation, based at least one wireless network identification, the terminal positional information is obtained, Including:
At least one wireless network identification is sent into location-server;
The corresponding positional information of at least one wireless network identification is received from the location-server;
The positional information of reception is defined as into the terminal positional information.
In a kind of possible implementation, the terminal positional information is sent to after first application, is also included:
At least one wireless network identification and the terminal positional information are sent into given server, the given server For for the Terminal for service.
In a kind of possible implementation, the wireless network identification includes MAC address.
Above-mentioned all optional technical schemes, can be according to the alternative embodiment for arbitrarily combining to form the disclosure, disclosure reality Apply example no longer to repeat this one by one.
Fig. 2 is a kind of flow chart of the localization method according to an exemplary embodiment, as shown in Fig. 2 the positioning side Method is used in terminal, and the localization method is comprised the following steps:
In step 201, when the first Location Request of the first application is received, whether judgement is locally cached with terminal position Confidence ceases.
When the first Location Request of the first application is received, illustrate that first application needs to obtain terminal positional information, Now, whether terminal judges are locally cached with terminal positional information.When local cache has the terminal positional information, step is performed Rapid 202.There is terminal positional information when locally uncached, then need the terminal to perform positioning action, wherein, terminal performs positional operand The process that implements made may refer to following steps 2031 to step 2032, and terminal is performed after positioning action, will can positioned The terminal positional information for obtaining is cached to local.
In step 202., when local cache has the terminal positional information, judge whether first application is currently in The front stage operation of terminal, first application is the arbitrary application installed in the terminal, if it is, positioning action is performed, if not, Execution step 203.
At present, the application for running in terminal generally includes two kinds of situations:In the case of one kind, the application is likely to be at the terminal Front stage operation, in that case, illustrate that user may be currently in use the application.In the case of another kind, the application is also possible to In the running background of the terminal, and when application is in the running background of the terminal, it may be determined that user currently makes Applied with this.
However, in the case of for above-mentioned second, although user is not used the application of the running background in the terminal, This is applied during running background, still can constantly be triggered the terminal and be performed certain operations, and for example, the application may be triggered frequently The terminal is positioned, thus, causing terminal to need to frequently execute positioning action, exacerbates the consumption of electricity.
Therefore, in the disclosed embodiments, when the first Location Request of the arbitrary application installed in detecting the terminal, The terminal needs to judge the current front stage operation for whether being in terminal of first application, so as to according to the shape of the first application operation State, decides whether to perform positioning action.That is to say, in the disclosed embodiments, before first application is currently at terminal When platform runs, illustrate that user is being currently used first application, in that case, in order to ensure that user can be known in real time The position of the terminal, the terminal needs to perform positioning action, and it implements process and also refers to step 2031 to step 2032, And when first application is not currently in the front stage operation of terminal, execution step 203.
Wherein, above-mentioned terminal judges first application current whether front stage operation in terminal realizes that process can be wrapped Include:Whether the currently displaying interface of the terminal judges belongs to the interface of first application, if currently displaying interface belongs to this The interface of the first application, then can determine that first application is currently at the front stage operation of the terminal, whereas if currently displaying Interface be not belonging to the interface of first application, then can determine that first application is not currently in the front stage operation of the terminal.
It should be noted that the realization for judging the current front stage operation for whether being in terminal of first application of above-mentioned offer Mode is only exemplary, in another embodiment, can also otherwise judge whether first application is currently located In the front stage operation of terminal, the embodiment of the present disclosure is not limited this.
In step 203, when first application is not currently in the front stage operation of the terminal, obtain slow in advance from local The terminal positional information deposited.
As it was noted above, when first application is not currently in the front stage operation of the terminal, illustrating that the user is not used First application, in that case, it is believed that first application need not in real time obtain the terminal positional information of the terminal, Therefore, the terminal does not perform positioning action, but from the local terminal positional information for obtaining caching in advance.
As can be seen here, terminal positional information is cached with advance in the terminal.In fact, as it was noted above, the terminal location Information can be by first apply it is upper once detect it is local it is uncached have terminal positional information when, obtained by positioning action Obtain.Or, the terminal positional information can also be acquired by positioning action by the second application of front stage operation, its tool Body refers to following steps 2031 to step 2032:
2031:When the second Location Request of the second application is received, wireless network is scanned, it is wireless to obtain at least one Network identity, second application is the application of the front stage operation in the terminal.
Wherein, each wireless network identification at least one wireless network identification may be incorporated for unique mark one Wireless network.
In a kind of possible implementation, the wireless network identification includes MAC (Media Access Control, matchmaker Body access control) address.
Certainly, it should be noted that in the disclosed embodiments, only it is to be including MAC Address with the wireless network identification Example illustrate, in another embodiment, the wireless network identification can also include other information, the embodiment of the present disclosure to this not Limit.
That is to say, when second application is the application in the front stage operation of the terminal, illustrate that user may use Second application, therefore, when the terminal detects second Location Request of the second application of the front stage operation in the terminal, The terminal needs to perform positioning action, the terminal positional information current to obtain the terminal.
Wherein, the terminal can be positioned by way of scanning wireless network.Due to the current institute in the terminal At least one Wireless Communication Equipment is there may be near position, therefore, the terminal is performed after scan operation, may be got At least one wireless network identification.
Currently, it should be noted that in the disclosed embodiments, only it is to be said as a example by being positioned by wireless network It is bright, in another embodiment, can also be positioned by other networks, for example, it is also possible to pass through GPS (Global Positioning System, global positioning system) or dipper system being positioned, the embodiment of the present disclosure is not limited this It is fixed.
2032:Based at least one wireless network identification, the terminal positional information is obtained, and by the terminal positional information Cache to local.
Wherein, based at least one wireless network identification, obtain the terminal positional information realizes that process can include: At least one wireless network identification is sent into location-server, so that the location-server is based at least one wireless network Network is identified from the corresponding relation of the wireless network identification and positional information that prestore, obtains and return this at least one wireless The corresponding positional information of network identity, receives the corresponding position letter of at least one wireless network identification from the location-server Breath, and the positional information of reception is defined as into the terminal positional information.
That is to say, the terminal by scan wireless network get after at least one wireless network identification, by this at least one Individual wireless network identification is sent to location-server.Wherein, as it was noted above, the location-server can be provided by third party Server, for example, the location-server is Baidu map server etc..Be stored with wireless network identification in the location-server Corresponding relation between positional information, in a kind of possible implementation, third party can be by artificial gathered data etc. Mode obtains the corresponding relation between the wireless network identification and positional information, and prestores into the location-server, this Open embodiment is not limited this.
For example, in a kind of possible implementation, the wireless network identification prestored in the location-server and position Corresponding relation between confidence breath is as shown in table 1 below.
Table 1
Wireless network identification Positional information
A、B、C Address 1
E、F、G Address 2
Certainly, it should be noted that being here only exemplary prestore in the location-server wireless of showing Corresponding relation between network identity and positional information, in another embodiment, the location-server can also pass through other shapes Formula stores the corresponding relation between the wireless network identification and positional information, and the embodiment of the present disclosure is not limited this.
The location-server is received after at least one wireless network identification that the terminal sends, you can from what is prestored In corresponding relation between wireless network identification and positional information, the corresponding position letter of at least one wireless network identification is obtained Breath.For example, if at least one wireless network identification includes A, B and M, it is corresponding with M that the location-server can obtain A, the B Positional information be " address 1 ".
The location-server is got after the corresponding positional information of at least one wireless network identification, by the positional information The terminal is sent to, thus, the terminal can get the terminal positional information of itself present position, the terminal can be obtained The terminal positional information got is sent to second application.
The terminal is got after the terminal positional information, also the terminal positional information is cached to local, in order in inspection When measuring the first Location Request of above-mentioned first application, can be from locally getting the terminal positional information.
In addition, also, it should be noted that during above-mentioned realization, when the location-server receives what the terminal sent During at least one wireless network identification, can also be to the corresponding relation between the wireless network identification of itself storage and positional information It is updated, for example, when at least one wireless network identification that the terminal sends includes A, B and M, the location-server can be with The corresponding wireless network identification in address 1 is updated into A, B, C and M, the embodiment of the present disclosure is not limited this.
In step 204, the terminal positional information is sent into first application.
The terminal is obtained after the terminal positional information of caching in advance from local, by the terminal positional information be sent to this first Using thus, the terminal is not in the case where positioning action is performed, still the terminal positional information can be sent into first should With so as to reach the purpose of positioning.
It should be noted that when the first application is not at the front stage operation of the terminal, process is realized by above-mentioned, can be with The terminal positional information of advance caching is sent into first application, i.e., positioning action need not be performed, thus, avoiding terminal Positioning action is frequently executed, the purpose of the consumption for saving terminal power has been reached.
In addition, in the disclosed embodiments, after terminal gets the terminal positional information, can also by this at least one Wireless network identification and the terminal positional information are stored, and specifically refer to following steps 205.
In step 205, at least one wireless network identification and the terminal positional information are sent into given server, The given server is used to be the Terminal for service.
Wherein, in a kind of possible implementation, passive supplier, example can be registered with the system of the terminal Such as, in Android system, the passive supplier is passive supplier (passive provider), and the passive supplier can use In the renewal for monitoring the terminal positional information, that is to say, when the terminal receives terminal positional information, the passive Provider will get the terminal positional information that the terminal is received.
In the disclosed embodiments, after the passive supplier obtains the terminal positional information, terminal is from the passive offer At least one wireless network identification obtained by the last network sweep is obtained in person, afterwards, by the terminal positional information and At least one wireless network identification is sent to given server.Wherein, the given server be used for be the Terminal for service, For example, if the terminal is mobile phone, the clothes for providing service for mobile phone that the given server can be provided for cell phone manufacturer Business device.
Correspondingly, the given server receives at least one wireless network identification and terminal location that the terminal sends After information, at least one wireless network identification and the terminal positional information are carried out into correspondence storage, thus, working as the SS later When needing positioning, you can to determine the terminal positional information of terminal by sending inquiry request to the given server.
It is above-mentioned need not manually gathered data, you can by terminal positional information and at least one wireless network identification pair Should store into the given server, improve the convenience of operation.
In the disclosed embodiments, when the first Location Request of the arbitrary application installed in receiving terminal, this is judged Whether ground is cached with terminal positional information, when local cache has the terminal positional information, judges that first application is current whether In the front stage operation of terminal, if first application is not currently in the front stage operation of the terminal, illustrate that user does not currently make With first application, in that case, the terminal positional information of local cache can be sent to first application, that is, be not required to Positioning action is performed, thus, when the multiple applications of the running background of the terminal, it is to avoid the terminal frequently executes positioning action, Save the consumption of the electricity of the terminal.
Fig. 3 A are a kind of block diagrams of the positioner according to an exemplary embodiment.Reference picture 3A, the positioner Including the first judge module 310, the second judge module 312, the first acquisition module 320 and the first sending module 330.
First judge module 310, for when the first Location Request of the first application is received, whether judgement locally to cache There is terminal positional information;
Second judge module 312, it is current for when local cache has the terminal positional information, judging first application Whether the front stage operation of terminal is in, and first application is the arbitrary application installed in the terminal;
First acquisition module 320, for before the judge module 310 determines that first application is not currently in the terminal When platform runs, from the local terminal positional information for obtaining caching in advance;
First sending module 330, for by the terminal positional information that first acquisition module 320 is obtained be sent to this One application.
In a kind of possible implementation, Fig. 3 B to Fig. 3 C are refer to, the device also includes:
Scan module 340, for when the second Location Request of the second application is received, scanning wireless network, to obtain At least one wireless network identification, second application is the application of the front stage operation in the terminal;
Second acquisition module 350, for based at least one wireless network identification, obtaining the terminal positional information;
Cache module 360, for the terminal positional information to be cached to local.
In a kind of possible implementation, second acquisition module 350 includes:
Sending submodule, at least one wireless network identification to be sent into location-server;
Receiving submodule, for receiving the corresponding position letter of at least one wireless network identification from the location-server Breath;
Determination sub-module, for the positional information of reception to be defined as into the terminal positional information.
In a kind of possible implementation, the device also includes:
Second sending module 370, at least one wireless network identification and the terminal positional information to be sent into finger Determine server, the given server is used to be the Terminal for service.
In a kind of possible implementation, the wireless network identification includes MAC address.
In the disclosed embodiments, when the first Location Request of the arbitrary application installed in receiving terminal, this is judged Whether ground is cached with terminal positional information, when local cache has the terminal positional information, judges that first application is current whether In the front stage operation of terminal, if first application is not currently in the front stage operation of the terminal, illustrate that user does not currently make With first application, in that case, the terminal positional information of local cache can be sent to first application, that is, be not required to Positioning action is performed, thus, when the multiple applications of the running background of the terminal, it is to avoid the terminal frequently executes positioning action, Save the consumption of the electricity of the terminal.
With regard to the device in above-described embodiment, wherein modules perform the concrete mode of operation in relevant the method Embodiment in be described in detail, explanation will be not set forth in detail herein.
Fig. 4 is a kind of block diagram of the positioner 400 according to an exemplary embodiment.For example, device 400 can be Mobile phone, computer, digital broadcast terminal, messaging devices, game console, tablet device, Medical Devices, body-building sets It is standby, personal digital assistant etc..
With reference to Fig. 4, device 400 can include following one or more assemblies:Process assembly 402, memory 404, power supply Component 406, multimedia groupware 408, audio-frequency assembly 410, the interface 412 of input/output (I/O), sensor cluster 414, and Communication component 416.
The integrated operation of the usual control device 400 of process assembly 402, such as with display, call, data communication, phase Machine operates and records the associated operation of operation.Process assembly 402 can refer to including one or more processors 420 to perform Order, to complete all or part of step of above-mentioned method.Additionally, process assembly 402 can include one or more modules, just Interaction between process assembly 402 and other assemblies.For example, process assembly 402 can include multi-media module, many to facilitate Interaction between media component 408 and process assembly 402.
Memory 404 is configured to store various types of data to support the operation in device 400.These data are shown Example includes the instruction of any application program for operating on device 400 or method, and contact data, telephone book data disappears Breath, picture, video etc..Memory 404 can be by any kind of volatibility or non-volatile memory device or their group Close and realize, such as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM) is erasable to compile Journey read-only storage (EPROM), programmable read only memory (PROM), read-only storage (ROM), magnetic memory, flash Device, disk or CD.
Power supply module 406 provides power supply for the various assemblies of device 400.Power supply module 406 can include power management system System, one or more power supplys, and other generate, manage and distribute the component that power supply is associated with for device 400.
Multimedia groupware 408 is included in the screen of one output interface of offer between described device 400 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 more touch sensings Device is with the gesture on sensing touch, slip and touch panel.The touch sensor can not only sensing touch or sliding action Border, but also detect and the touch or slide related duration and pressure.In certain embodiments, many matchmakers Body component 408 includes a front-facing camera and/or post-positioned pick-up head.When device 400 be in operator scheme, such as screening-mode or During video mode, front-facing camera and/or post-positioned pick-up head can receive outside multi-medium data.Each front-facing camera and Post-positioned pick-up head can be a fixed optical lens system or with focusing and optical zoom capabilities.
Audio-frequency assembly 410 is configured to output and/or input audio signal.For example, audio-frequency assembly 410 includes a Mike Wind (MIC), when device 400 is in operator scheme, such as call model, logging mode and speech recognition mode, microphone is matched somebody with somebody It is set to reception external audio signal.The audio signal for being received can be further stored in memory 404 or via communication set Part 416 sends.In certain embodiments, audio-frequency assembly 410 also includes a loudspeaker, for exports audio signal.
, to provide interface between process assembly 402 and peripheral interface module, above-mentioned peripheral interface module can for I/O interfaces 412 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 414 includes one or more sensors, and the state for providing various aspects for device 400 is commented Estimate.For example, sensor cluster 414 can detect the opening/closed mode of device 400, and the relative positioning of component is for example described Component is the display and keypad of device 400, and sensor cluster 414 can be with 400 1 components of detection means 400 or device Position change, user is presence or absence of with what device 400 was contacted, the orientation of device 400 or acceleration/deceleration and device 400 Temperature change.Sensor cluster 414 can include proximity transducer, be configured to be detected when without any physical contact The presence of object nearby.Sensor cluster 414 can also include optical sensor, such as CMOS or ccd image sensor, for into As used in application.In certain embodiments, the sensor cluster 414 can also include acceleration transducer, gyro sensors Device, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 416 is configured to facilitate the communication of wired or wireless way between device 400 and other equipment.Device 400 can access based on the wireless network of communication standard, such as WiFi, 2G or 3G, or combinations thereof.In an exemplary enforcement In example, communication component 416 receives the broadcast singal or broadcast related information from external broadcasting management system via broadcast channel. In one exemplary embodiment, the communication component 416 also includes near-field communication (NFC) module, to promote junction service.Example Such as, NFC module can be based on RF identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra broadband (UWB) technology, Bluetooth (BT) technology and other technologies are realizing.
In the exemplary embodiment, device 400 can be by one or more application specific integrated circuits (ASIC), numeral letter Number processor (DSP), digital signal processing appts (DSPD), PLD (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components realizations, for performing said method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided Such as include the memory 404 of instruction, above-mentioned instruction can be performed to complete said method by the processor 420 of device 400.For example, The 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 the storage medium is by the processor of mobile terminal During execution so that mobile terminal is able to carry out a kind of localization method, the method includes:
When the first Location Request of the first application is received, whether judgement is locally cached with terminal positional information;
When local cache has the terminal positional information, judge that the current foreground for whether being in terminal of first application is transported OK, first application is the arbitrary application installed in the terminal;
When first application is not currently in the front stage operation of the terminal, from the local terminal location for obtaining caching in advance Information;
The terminal positional information is sent into first application.
In a kind of possible implementation, when first application is not currently in the front stage operation of the terminal, from this Ground is obtained before the terminal positional information of caching in advance, is also included:
When the second Location Request of the second application is received, wireless network is scanned, to obtain at least one wireless network Mark, second application is the application of the front stage operation in the terminal;
Based at least one wireless network identification, the terminal positional information is obtained;
The terminal positional information is cached to local.
In a kind of possible implementation, based at least one wireless network identification, the terminal positional information is obtained, Including:
At least one wireless network identification is sent into location-server;
The corresponding positional information of at least one wireless network identification is received from the location-server;
The positional information of reception is defined as into the terminal positional information.
In a kind of possible implementation, the terminal positional information is sent to after first application, is also included:
At least one wireless network identification and the terminal positional information are sent into given server, the given server For for the Terminal for service.
In a kind of possible implementation, the wireless network identification includes MAC address.
In the disclosed embodiments, when the first Location Request of the arbitrary application installed in receiving terminal, this is judged Whether ground is cached with terminal positional information, when local cache has the terminal positional information, judges that first application is current whether In the front stage operation of terminal, if first application is not currently in the front stage operation of the terminal, illustrate that user does not currently make With first application, in that case, the terminal positional information of local cache can be sent to first application, that is, be not required to Positioning action is performed, thus, when the multiple applications of the running background of the terminal, it is to avoid the terminal frequently executes positioning action, Save the consumption of the electricity of the terminal.
Those skilled in the art will readily occur to its of the disclosure after considering specification and putting into practice invention disclosed herein Its embodiment.The application is intended to any modification, purposes or the adaptations of the disclosure, these modifications, purposes or Person's adaptations follow the general principle of the disclosure and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.Description and embodiments are considered only as exemplary, and the true scope of the disclosure and spirit are by following Claim is pointed out.
It should be appreciated that the disclosure is not limited to the precision architecture for being described above and being shown in the drawings, and And can without departing from the scope carry out various modifications and changes.The scope of the present disclosure is only limited by appended claim.

Claims (11)

1. a kind of localization method, it is characterised in that methods described includes:
When the first Location Request of the first application is received, whether judgement is locally cached with terminal positional information;
When local cache has the terminal positional information, judge that the current foreground for whether being in terminal of first application is transported OK, first application is the arbitrary application installed in the terminal;
When the described first application is not currently in the front stage operation of the terminal, from the local terminal location for obtaining caching in advance Information;
The terminal positional information is sent into first application.
2. the method for claim 1, it is characterised in that methods described also includes:
When the second Location Request of the second application is received, wireless network is scanned, to obtain at least one wireless network identification, Second application is the application of the front stage operation in the terminal;
Based at least one wireless network identification, the terminal positional information is obtained;
The terminal positional information is cached to local.
3. method according to claim 2, it is characterised in that described based at least one wireless network identification, obtains The terminal positional information is taken, including:
At least one wireless network identification is sent into location-server;
The corresponding positional information of at least one wireless network identification is received from the location-server;
The positional information of reception is defined as into the terminal positional information.
4. method according to claim 1, it is characterised in that described that the terminal positional information is sent into described first Using after, also include:
At least one wireless network identification and the terminal positional information are sent into given server, the specified services Device is used to be the Terminal for service.
5. method according to claim 1, it is characterised in that the wireless network identification includes media access control MAC Address.
6. a kind of positioner, it is characterised in that described device includes:
First judge module, for when the first Location Request of the first application is received, whether judgement to be locally cached with terminal Positional information;
Second judge module, for when local cache has the terminal positional information, judging that first application is current whether In the front stage operation of terminal, first application is the arbitrary application installed in the terminal;
First acquisition module, for determining that first application is not currently in the foreground fortune of the terminal when the judge module During row, from the local terminal positional information for obtaining caching in advance;
First sending module, should for the terminal positional information that first acquisition module is obtained to be sent into described first With.
7. device according to claim 6, it is characterised in that described device also includes:
Scan module, for when the second Location Request of the second application is received, wireless network being scanned, to obtain at least one Wireless network identification, second application is the application of the front stage operation in the terminal;
Second acquisition module, for based at least one wireless network identification, obtaining the terminal positional information;
Cache module, for the terminal positional information to be cached to local.
8. device according to claim 7, it is characterised in that second acquisition module includes:
Sending submodule, at least one wireless network identification to be sent into location-server;
Receiving submodule, for receiving the corresponding position letter of at least one wireless network identification from the location-server Breath;
Determination sub-module, for the positional information of reception to be defined as into the terminal positional information.
9. device according to claim 6, it is characterised in that described device also includes:
Second sending module, at least one wireless network identification and the terminal positional information to be sent into specified clothes Business device, the given server is used to be the Terminal for service.
10. device according to claim 6, it is characterised in that the wireless network identification includes media access control MAC Address.
11. a kind of positioners, it is characterised in that described device includes:
Processor;
For storing the memory of processor executable;
Wherein, the processor is configured to:
When the first Location Request of the first application is received, whether judgement is locally cached with terminal positional information;
When local cache has the terminal positional information, judge that the current foreground for whether being in terminal of first application is transported OK, first application is the arbitrary application installed in the terminal;
When the described first application is not currently in the front stage operation of the terminal, from the local terminal location for obtaining caching in advance Information;
The terminal positional information is sent into first application.
CN201611151060.9A 2016-12-14 2016-12-14 Positioning method and device Active CN106658412B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611151060.9A CN106658412B (en) 2016-12-14 2016-12-14 Positioning method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611151060.9A CN106658412B (en) 2016-12-14 2016-12-14 Positioning method and device

Publications (2)

Publication Number Publication Date
CN106658412A true CN106658412A (en) 2017-05-10
CN106658412B CN106658412B (en) 2020-07-03

Family

ID=58825136

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611151060.9A Active CN106658412B (en) 2016-12-14 2016-12-14 Positioning method and device

Country Status (1)

Country Link
CN (1) CN106658412B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019223667A1 (en) * 2018-05-24 2019-11-28 华为技术有限公司 Information query method for terminal, and terminal
CN114205455A (en) * 2021-12-07 2022-03-18 郑州阿帕斯数云信息科技有限公司 Application positioning processing method, device, equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013152349A1 (en) * 2012-04-06 2013-10-10 Yang Shaofeng Intelligent power saving method for mobile devices running location based service (lbs) applications
CN103428361A (en) * 2012-04-30 2013-12-04 苹果公司 Operating Geographic Location Systems
US20150011196A1 (en) * 2013-07-03 2015-01-08 Qualcomm Incorporated Methods and apparatuses for use in providing location parameters to mobile applications
CN105094285A (en) * 2015-07-31 2015-11-25 北京金山安全软件有限公司 Power-saving processing method and device for application program
CN105208215A (en) * 2015-10-22 2015-12-30 小米科技有限责任公司 Locating control method, device and terminal
CN105491523A (en) * 2015-12-08 2016-04-13 小米科技有限责任公司 Method and device for acquiring position information
CN105553963A (en) * 2015-12-10 2016-05-04 小米科技有限责任公司 Control method and device of positioning services
CN105933521A (en) * 2016-04-22 2016-09-07 广东小天才科技有限公司 Mobile terminal positioning mode selection method and device
CN106203008A (en) * 2016-06-28 2016-12-07 宇龙计算机通信科技(深圳)有限公司 Terminal control method, terminal control mechanism and terminal

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013152349A1 (en) * 2012-04-06 2013-10-10 Yang Shaofeng Intelligent power saving method for mobile devices running location based service (lbs) applications
CN103428361A (en) * 2012-04-30 2013-12-04 苹果公司 Operating Geographic Location Systems
US20150011196A1 (en) * 2013-07-03 2015-01-08 Qualcomm Incorporated Methods and apparatuses for use in providing location parameters to mobile applications
CN105094285A (en) * 2015-07-31 2015-11-25 北京金山安全软件有限公司 Power-saving processing method and device for application program
CN105208215A (en) * 2015-10-22 2015-12-30 小米科技有限责任公司 Locating control method, device and terminal
CN105491523A (en) * 2015-12-08 2016-04-13 小米科技有限责任公司 Method and device for acquiring position information
CN105553963A (en) * 2015-12-10 2016-05-04 小米科技有限责任公司 Control method and device of positioning services
CN105933521A (en) * 2016-04-22 2016-09-07 广东小天才科技有限公司 Mobile terminal positioning mode selection method and device
CN106203008A (en) * 2016-06-28 2016-12-07 宇龙计算机通信科技(深圳)有限公司 Terminal control method, terminal control mechanism and terminal

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019223667A1 (en) * 2018-05-24 2019-11-28 华为技术有限公司 Information query method for terminal, and terminal
CN110598085A (en) * 2018-05-24 2019-12-20 华为技术有限公司 Information query method for terminal and terminal
US11650993B2 (en) 2018-05-24 2023-05-16 Huawei Technologies Co., Ltd. Information query method for terminal and terminal
CN114205455A (en) * 2021-12-07 2022-03-18 郑州阿帕斯数云信息科技有限公司 Application positioning processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN106658412B (en) 2020-07-03

Similar Documents

Publication Publication Date Title
CN104780155B (en) Apparatus bound method and device
CN104159275B (en) Method for connecting network and device
CN103986969B (en) application management method, device and system
CN105915627A (en) Service request processing method and service request processing device
CN106254467A (en) Sharing files method and device
CN105511907A (en) Application program upgrade method, device and system
CN106126685A (en) Page loading method and device
CN104836924A (en) Number marking method and device
CN104580637A (en) Telephone number marking method, terminal and cloud server
CN106203650A (en) Call a taxi and ask sending method and device
CN105956486A (en) Remote control method and apparatus
CN106528617A (en) Webpage picture display method and apparatus
CN107423394A (en) Page display method and device
CN107241770A (en) Method for connecting network and device
CN106648730A (en) Processing method and device of abnormal application
CN105979480A (en) Method and device for updating time of mobile equipment
CN107220059A (en) The display methods and device of application interface
CN106533913A (en) Method and apparatus for sharing position information
CN105515923A (en) Equipment control method and device
CN105763552A (en) Transmission method, device and system in remote control
CN107943370A (en) Advertisement display method, device and storage medium
CN106708967A (en) Page display method and device
CN106453774A (en) Method and apparatus for displaying contact information
CN106658412A (en) Locating method and apparatus
CN104063423B (en) A kind of method and device for determining position

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
GR01 Patent grant
GR01 Patent grant