CN106658412B - Positioning method and device - Google Patents

Positioning method and device Download PDF

Info

Publication number
CN106658412B
CN106658412B CN201611151060.9A CN201611151060A CN106658412B CN 106658412 B CN106658412 B CN 106658412B CN 201611151060 A CN201611151060 A CN 201611151060A CN 106658412 B CN106658412 B CN 106658412B
Authority
CN
China
Prior art keywords
terminal
application
position information
wireless network
positioning
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.)
Active
Application number
CN201611151060.9A
Other languages
Chinese (zh)
Other versions
CN106658412A (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

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The disclosure relates to a positioning method and a positioning device, which belong to the technical field of networks, and the method comprises the following steps: when receiving a first positioning request of a first application, judging whether terminal position information is cached locally, when the terminal position information is cached locally, judging whether the first application is currently operated in the foreground of the terminal, when the first application is not in the foreground operation of the terminal, the pre-cached terminal position information is acquired from the local, the terminal position information is sent to the first application, since the first application is not currently used by the user when the first application is not currently running in the foreground of the terminal, the first application is not currently used by the user, when the first application requests the terminal to be located, the pre-cached terminal location information may be directly transmitted to the first application, the terminal does not execute the positioning operation, so that when the background of the terminal runs a plurality of applications, the terminal is prevented from frequently executing the positioning operation, and the consumption of electric quantity is saved.

Description

Positioning method and device
Technical Field
The present disclosure relates to the field of network technologies, and in particular, to a positioning method and apparatus.
Background
With the rapid development of network technology, terminals such as mobile phones and the like are widely used. During the use process, various applications can be installed in the terminal, wherein some applications can acquire the position information of the terminal by means of positioning technology, so as to realize various functions, such as application of 'drip travel'.
In the related art, an application may trigger a terminal to perform positioning, for example, when the application is started, the terminal may be triggered to perform positioning operation, and in addition, an application running in a background in the terminal may also trigger the terminal to perform positioning every preset time period. After the terminal is positioned, the acquired position information is sent to an application triggering the terminal to be positioned, so that the application can utilize the position information to realize a corresponding function.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a positioning method and apparatus.
In a first aspect, a positioning method is provided, and the method includes:
when a first positioning request of a first application is received, judging whether terminal position information is cached locally;
when the terminal position information is cached locally, judging whether the first application is currently operated in a foreground of the terminal, wherein the first application is any application installed in the terminal;
when the first application is not currently in the foreground operation of the terminal, acquiring the terminal position information cached in advance from the local;
and sending the terminal position information to the first application.
In one possible implementation, the method further includes:
when a second positioning request of a second application is received, scanning a wireless network to obtain at least one wireless network identifier, wherein the second application is an application running in a foreground of the terminal;
acquiring the terminal position information based on the at least one wireless network identifier;
and caching the terminal position information to the local.
In a possible implementation manner, the obtaining the terminal location information based on the at least one radio network identifier includes:
transmitting the at least one radio network identification to a location server;
receiving the position information corresponding to the at least one wireless network identification from the positioning server;
and determining the received position information as the terminal position information.
In a possible implementation manner, after sending the terminal location information to the first application, the method further includes:
and sending the at least one wireless network identifier and the terminal position information to a designated server, wherein the designated server is used for providing service for the terminal.
In one possible implementation, the wireless network identification includes a media access control, MAC, address.
In a second aspect, there is provided a positioning device, the device comprising:
the first judgment module is used for judging whether the terminal position information is cached locally or not when a first positioning request of a first application is received;
the second judgment module is used for judging whether the first application is currently operated in a foreground of the terminal or not when the terminal position information is locally cached, wherein the first application is any application installed in the terminal;
the first obtaining module is used for obtaining the terminal position information cached in advance from the local when the judging module determines that the first application is not currently operated in the foreground of the terminal;
and the first sending module is used for sending the terminal position information acquired by the first acquiring module to the first application.
In one possible implementation, the apparatus further includes:
the scanning module is used for scanning a wireless network to obtain at least one wireless network identifier when a second positioning request of a second application is received, wherein the second application is an application running in the foreground of the terminal;
a second obtaining module, configured to obtain the terminal location information based on the at least one wireless network identifier;
and the cache module is used for caching the terminal position information to the local.
In one possible implementation manner, the second obtaining module includes:
the sending submodule is used for sending the at least one wireless network identifier to a positioning server;
the receiving submodule is used for receiving the position information corresponding to the at least one wireless network identification from the positioning server;
and the determining submodule is used for determining the received position information as the terminal position information.
In one possible implementation, the apparatus further includes:
and the second sending module is used for sending the at least one wireless network identifier and the terminal position information to a designated server, and the designated server is used for providing service for the terminal.
In one possible implementation, the wireless network identification includes a media access control, MAC, address.
In a third aspect, a positioning apparatus is provided, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
when a first positioning request of a first application is received, judging whether terminal position information is cached locally;
when the terminal position information is cached locally, judging whether the first application is currently operated in a foreground of the terminal, wherein the first application is any application installed in the terminal;
when the first application is not currently in the foreground operation of the terminal, acquiring the terminal position information cached in advance from the local;
and sending the terminal position information to the first application.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
in the embodiment of the disclosure, when a first positioning request of any application installed in a terminal is received, whether the terminal position information is cached locally is judged, when the terminal position information is cached locally, whether the first application is currently in the foreground of the terminal is judged, if the first application is not currently in the foreground of the terminal, it is indicated that a user does not use the first application currently, under the condition, the locally cached terminal position information can be sent to the first application, that is, the positioning operation does not need to be executed, so when a plurality of applications are operated in the background of the terminal, the terminal is prevented from frequently executing the positioning operation, and the consumption of the electric quantity of the terminal is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1A is a schematic diagram illustrating one implementation environment in accordance with an illustrative embodiment.
Fig. 1B is a flow chart illustrating a method of positioning according to an example embodiment.
Fig. 2 is a flow chart illustrating a positioning method according to another exemplary embodiment.
FIG. 3A is a block diagram illustrating a positioning device according to an exemplary embodiment.
FIG. 3B is a block diagram illustrating a positioning device according to another exemplary embodiment.
FIG. 3C is a block diagram illustrating a positioning device according to another exemplary embodiment.
Fig. 4 is a block diagram illustrating a positioning device 400 according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
FIG. 1A is a schematic diagram illustrating one implementation environment in accordance with an illustrative embodiment. The environment of this implementation primarily includes a terminal 110, a location server 120, a designation server 130, and at least one wireless network device 140 (two are shown in fig. 1A by way of example). Wherein, the terminal 110 can establish a connection with the positioning server 120 and the designated server 130 respectively through a wireless network provided by the wireless network device 140.
The terminal 110 is configured to implement the positioning method provided by the embodiment of the present disclosure. A plurality of applications may be installed and run in the terminal 110, and the terminal 110 may be a device such as a mobile phone, a tablet computer, a computer, and the like, which is not limited in this disclosure.
The positioning server 120 may be configured to provide terminal location information for the terminal 110, and the positioning server 120 may be provided by a third party, for example, the positioning server 120 may be a Baidu map server, or a Gade map server, and the like, which is not limited in this disclosure.
The designated server 130 may be a server for providing services for the terminal 110, for example, when the terminal 110 is a mobile phone, the designated server 130 may be a server provided by a mobile phone manufacturer for providing services for the mobile phone. The designated server 130 is mainly used for storing the corresponding relationship between the terminal location information acquired by the terminal 110 and at least one wireless network identifier, so that the terminal 110 can directly inquire the terminal location information from the designated server 130 at a later stage.
Wherein the at least one wireless network device 140 may be a device such as a router, and the terminal 110 may obtain the wireless network identifier of the at least one wireless network device 140 near the location where the terminal 110 is currently located by performing a wireless network scanning operation, so as to obtain the terminal location information from the location server 120 based on the wireless network identifier of the at least one wireless network device 140.
Fig. 1B is a flow chart illustrating a positioning method according to an exemplary embodiment, which may include the following steps, as shown in fig. 1B.
In step 101, when a first positioning request of a first application is received, whether terminal position information is cached locally is judged;
in step 102, when the terminal location information is cached locally, it is determined whether the first application is currently running in the foreground of the terminal, where the first application is any application installed in the terminal.
In step 103, when the first application is not currently in the foreground operation of the terminal, the pre-cached terminal location information is obtained from the local.
In step 104, the terminal location information is sent to the first application.
In the embodiment of the disclosure, when a first positioning request of any application installed in a terminal is received, whether the terminal position information is cached locally is judged, when the terminal position information is cached locally, whether the first application is currently in the foreground of the terminal is judged, if the first application is not currently in the foreground of the terminal, it is indicated that a user does not use the first application currently, under the condition, the locally cached terminal position information can be sent to the first application, that is, the positioning operation does not need to be executed, so when a plurality of applications are operated in the background of the terminal, the terminal is prevented from frequently executing the positioning operation, and the consumption of the electric quantity of the terminal is reduced.
In one possible implementation, the method further includes:
when a second positioning request of a second application is received, scanning a wireless network to obtain at least one wireless network identifier, wherein the second application is an application running in the foreground of the terminal;
acquiring the terminal position information based on the at least one wireless network identifier;
and caching the terminal position information to the local.
In a possible implementation manner, the obtaining the terminal location information based on the at least one radio network identifier includes:
transmitting the at least one radio network identification to a location server;
receiving the position information corresponding to the at least one wireless network identification from the positioning server;
the received location information is determined as the terminal location information.
In a possible implementation manner, after sending the terminal location information to the first application, the method further includes:
and sending the at least one wireless network identifier and the terminal position information to a designated server, wherein the designated server is used for providing service for the terminal.
In one possible implementation, the radio network identification includes a medium access control, MAC, address.
All the above optional technical solutions can be combined arbitrarily to form optional embodiments of the present disclosure, and the embodiments of the present disclosure are not described in detail again.
Fig. 2 is a flowchart illustrating a positioning method according to an exemplary embodiment, where the positioning method is used in a terminal, as shown in fig. 2, and the positioning method includes the following steps:
in step 201, when a first positioning request of a first application is received, it is determined whether terminal location information is cached locally.
When a first positioning request of a first application is received, the first application needs to acquire terminal position information, and at the moment, the terminal judges whether the terminal position information is cached locally. And when the terminal position information is locally cached, executing step 202. When the terminal location information is not cached locally, the terminal is required to perform a positioning operation, wherein a specific implementation process of the terminal performing the positioning operation may be as follows in step 2031 to step 2032, and after the terminal performs the positioning operation, the terminal location information obtained by positioning may be cached locally.
In step 202, when the terminal location information is cached locally, it is determined whether the first application is currently running in the foreground of the terminal, where the first application is any application installed in the terminal, if so, a location operation is performed, and if not, step 203 is performed.
Currently, applications running in a terminal generally include two situations: in one case, the application may be running in the foreground of the terminal, in which case it is stated that the user may be using the application. In another case, the application may also be running in the background of the terminal, and when the application is running in the background of the terminal, it may be determined that the user is not currently using the application.
However, in the second case, although the user does not use the application running in the background of the terminal, the application may continuously trigger the terminal to perform some operations during the background running, for example, the application may frequently trigger the terminal to perform positioning, which results in that the terminal needs to frequently perform positioning operations, and power consumption is increased.
Therefore, in the embodiment of the present disclosure, when a first positioning request of any application installed in the terminal is detected, the terminal needs to determine whether the first application is currently in a foreground operation of the terminal, so as to determine whether to execute a positioning operation according to an operation state of the first application. That is, in this embodiment of the present disclosure, when the first application is currently in the foreground operation of the terminal, it indicates that the user is currently using the first application, in this case, in order to ensure that the user can know the position of the terminal in real time, the terminal needs to perform a positioning operation, and its specific implementation process also refers to step 2031 to step 2032, and when the first application is not currently in the foreground operation of the terminal, step 203 is performed.
The implementation process of the terminal determining whether the first application is currently in the foreground operation of the terminal may include: the terminal judges whether the currently displayed interface belongs to the interface of the first application, if the currently displayed interface belongs to the interface of the first application, the first application can be determined to be currently operated in the foreground of the terminal, otherwise, if the currently displayed interface does not belong to the interface of the first application, the first application can be determined not to be currently operated in the foreground of the terminal.
It should be noted that the implementation manner provided above for determining whether the first application is currently in the foreground of the terminal is only an exemplary implementation manner, and in another embodiment, it may also be determined whether the first application is currently in the foreground of the terminal by other manners, which is not limited in this disclosure.
In step 203, when the first application is not currently in the foreground operation of the terminal, the pre-cached terminal location information is obtained from the local.
As described above, when the first application is not currently in the foreground operation of the terminal, it indicates that the user does not use the first application, and in this case, it may be considered that the first application does not need to acquire the terminal location information of the terminal in real time, and therefore, the terminal does not perform the positioning operation but acquires the terminal location information cached in advance from the local.
Therefore, the terminal is cached with the terminal position information in advance. In fact, as described above, the terminal location information may be obtained by the first application through a positioning operation when the first application detects that the terminal location information is not cached locally. Alternatively, the terminal position information may also be obtained by the second application running in the foreground through a positioning operation, which is specifically referred to as the following step 2031 to step 2032:
2031: and when a second positioning request of a second application is received, scanning a wireless network to obtain at least one wireless network identifier, wherein the second application is an application running in the foreground of the terminal.
Wherein each of the at least one wireless network identifier may be configured to uniquely identify a wireless network.
In one possible implementation, the wireless network identifier includes a Media Access Control (MAC) address.
It should be noted that, in the embodiment of the present disclosure, the description is only given by taking the case that the radio network identifier includes the MAC address, and in another embodiment, the radio network identifier may further include other information, which is not limited in the embodiment of the present disclosure.
That is, when the second application is an application running in the foreground of the terminal, it indicates that the user may be using the second application, and therefore, when the terminal detects the second positioning request of the second application running in the foreground of the terminal, the terminal needs to perform a positioning operation to obtain the current terminal position information of the terminal.
Wherein, the terminal can be positioned by scanning wireless network. Since there may be at least one wireless network device near the current location of the terminal, after the terminal performs the scanning operation, at least one wireless network identifier may be acquired.
At present, it should be noted that, in the embodiment of the present disclosure, the positioning is only described by taking a wireless network as an example, and in another embodiment, the positioning may also be performed by other networks, for example, the positioning may also be performed by a GPS (global positioning System) or a beidou System, which is not limited in the embodiment of the present disclosure.
2032: and acquiring the terminal position information based on the at least one wireless network identifier, and caching the terminal position information to the local.
Wherein, based on the at least one wireless network identifier, the implementation process of obtaining the terminal location information may include: and sending the at least one wireless network identifier to a positioning server, so that the positioning server acquires and returns the position information corresponding to the at least one wireless network identifier from the corresponding relationship between the wireless network identifier and the position information which is stored in advance based on the at least one wireless network identifier, receives the position information corresponding to the at least one wireless network identifier from the positioning server, and determines the received position information as the terminal position information.
That is, after the terminal obtains at least one wireless network identifier by scanning a wireless network, the terminal sends the at least one wireless network identifier to the positioning server. As mentioned above, the positioning server may be a server provided by a third party, for example, the positioning server is a hundred-degree map server. The positioning server stores the corresponding relationship between the wireless network identifier and the position information, and in a possible implementation manner, a third party may acquire the corresponding relationship between the wireless network identifier and the position information in a manner of manually acquiring data and the like, and store the corresponding relationship in the positioning server in advance.
For example, in one possible implementation manner, the correspondence between the radio network identifier and the location information stored in the positioning server in advance is shown in table 1 below.
TABLE 1
Wireless network identification Location information
A、B、C Address 1
E、F、G Address 2
Of course, it should be noted that, here, the correspondence between the wireless network identifier and the location information pre-stored in the location server is shown only by way of example, in another embodiment, the location server may also store the correspondence between the wireless network identifier and the location information in other forms, which is not limited in this disclosure.
After receiving the at least one wireless network identifier sent by the terminal, the positioning server can obtain the position information corresponding to the at least one wireless network identifier from the corresponding relationship between the pre-stored wireless network identifier and the position information. For example, if the at least one wireless network identifier includes A, B and M, the location server may obtain the location information corresponding to A, B and M as "address 1".
And after the positioning server acquires the position information corresponding to the at least one wireless network identifier, the position information is sent to the terminal, so that the terminal can acquire the terminal position information of the current position of the terminal, and the terminal position information acquired by the terminal is sent to the second application.
After the terminal acquires the terminal position information, the terminal position information is cached to the local, so that the terminal position information can be acquired from the local when the first positioning request of the first application is detected.
In addition, it should be further noted that, in the implementation process, when the location server receives at least one wireless network identifier sent by the terminal, the location server may further update the correspondence between the wireless network identifiers stored in the location server and the location information, for example, when the at least one wireless network identifier sent by the terminal includes A, B and M, the location server may update the wireless network identifier corresponding to the address 1 to A, B, C and M, which is not limited in this disclosure.
In step 204, the terminal location information is sent to the first application.
The terminal acquires the terminal position information cached in advance from the local and then sends the terminal position information to the first application, so that the terminal can still send the terminal position information to the first application under the condition that the positioning operation is not executed, and the purpose of positioning is achieved.
It should be noted that, when the first application is not in the foreground operation of the terminal, the pre-cached terminal location information may be sent to the first application through the implementation process, that is, no positioning operation needs to be executed, so that frequent execution of positioning operation by the terminal is avoided, and the purpose of saving power consumption of the terminal is achieved.
In addition, in the embodiment of the present disclosure, after the terminal acquires the terminal location information, the at least one wireless network identifier and the terminal location information may also be stored, specifically refer to step 205 as follows.
In step 205, the at least one radio network identifier and the terminal location information are sent to a designated server, which is configured to provide a service for the terminal.
In a possible implementation manner, a passive provider may be registered in the system of the terminal, for example, in an android system, the passive provider is a passive provider (passive provider), and the passive provider may be configured to monitor updating of the terminal location information, that is, when the terminal receives the terminal location information, the passive provider may obtain the terminal location information received by the terminal.
In the embodiment of the present disclosure, after the passive provider obtains the location information of the terminal, the terminal obtains at least one wireless network identifier obtained by the last network scanning from the passive provider, and then sends the location information of the terminal and the at least one wireless network identifier to the designated server. The designated server is configured to provide a service for the terminal, for example, if the terminal is a mobile phone, the designated server may be a server provided by a mobile phone manufacturer and configured to provide a service for the mobile phone.
Correspondingly, after receiving the at least one wireless network identifier and the terminal position information sent by the terminal, the designated server correspondingly stores the at least one wireless network identifier and the terminal position information, so that when the terminal needs to be positioned subsequently, the designated server can send a query request to determine the terminal position information of the terminal.
The terminal position information and the at least one wireless network identifier can be correspondingly stored in the appointed server without manually acquiring data, so that the convenience of operation is improved.
In the embodiment of the disclosure, when a first positioning request of any application installed in a terminal is received, whether the terminal position information is cached locally is judged, when the terminal position information is cached locally, whether the first application is currently in the foreground of the terminal is judged, if the first application is not currently in the foreground of the terminal, it is indicated that a user does not use the first application currently, under the condition, the locally cached terminal position information can be sent to the first application, that is, the positioning operation does not need to be executed, so when a plurality of applications are operated in the background of the terminal, the terminal is prevented from frequently executing the positioning operation, and the consumption of the electric quantity of the terminal is reduced.
FIG. 3A is a block diagram illustrating a positioning device according to an exemplary embodiment. Referring to fig. 3A, the positioning apparatus includes a first determining module 310, a second determining module 312, a first obtaining module 320 and a first sending module 330.
A first determining module 310, configured to determine whether terminal location information is cached locally when a first positioning request of a first application is received;
a second determining module 312, configured to determine, when the terminal position information is locally cached, whether the first application is currently in a foreground of the terminal and is running, where the first application is any application installed in the terminal;
a first obtaining module 320, configured to obtain, when the determining module 310 determines that the first application is not currently in the foreground operation of the terminal, pre-cached terminal location information from a local location;
a first sending module 330, configured to send the terminal location information acquired by the first acquiring module 320 to the first application.
In a possible implementation manner, please refer to fig. 3B to 3C, the apparatus further includes:
a scanning module 340, configured to scan a wireless network to obtain at least one wireless network identifier when receiving a second positioning request of a second application, where the second application is an application running in a foreground of the terminal;
a second obtaining module 350, configured to obtain the terminal location information based on the at least one wireless network identifier;
the cache module 360 is configured to cache the terminal location information to a local location.
In one possible implementation, the second obtaining module 350 includes:
a sending submodule, configured to send the at least one radio network identifier to a positioning server;
the receiving submodule is used for receiving the position information corresponding to the at least one wireless network identifier from the positioning server;
and the determining submodule is used for determining the received position information as the terminal position information.
In one possible implementation, the apparatus further includes:
a second sending module 370, configured to send the at least one wireless network identifier and the terminal location information to a designated server, where the designated server is configured to provide a service for the terminal.
In one possible implementation, the radio network identification includes a medium access control, MAC, address.
In the embodiment of the disclosure, when a first positioning request of any application installed in a terminal is received, whether the terminal position information is cached locally is judged, when the terminal position information is cached locally, whether the first application is currently in the foreground of the terminal is judged, if the first application is not currently in the foreground of the terminal, it is indicated that a user does not use the first application currently, under the condition, the locally cached terminal position information can be sent to the first application, that is, the positioning operation does not need to be executed, so when a plurality of applications are operated in the background of the terminal, the terminal is prevented from frequently executing the positioning operation, and the consumption of the electric quantity of the terminal is reduced.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 4 is a block diagram illustrating a positioning device 400 according to an exemplary embodiment. For example, the apparatus 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 4, the apparatus 400 may include one or more of the following components: processing components 402, memory 404, power components 406, multimedia components 408, audio components 410, input/output (I/O) interfaces 412, sensor components 414, and communication components 416.
The processing component 402 generally controls overall operation of the apparatus 400, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 402 can include one or more modules that facilitate interaction between the processing component 402 and other components. For example, the processing component 402 can include a multimedia module to facilitate interaction between the multimedia component 408 and the processing component 402.
The memory 404 is configured to store various types of data to support operations at the apparatus 400. Examples of such data include instructions for any application or method operating on the device 400, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 404 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power supply components 406 provide power to the various components of device 400. The power components 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power supplies for the apparatus 400.
The multimedia component 408 includes a screen that provides an output interface between the device 400 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the apparatus 400 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 410 is configured to output and/or input audio signals. For example, audio component 410 includes a Microphone (MIC) configured to receive external audio signals when apparatus 400 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 404 or transmitted via the communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.
The I/O interface 412 provides an interface between the processing component 402 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 414 includes one or more sensors for providing various aspects of status assessment for the apparatus 400. For example, the sensor assembly 414 may detect an open/closed state of the apparatus 400, the relative positioning of the components, such as a display and keypad of the apparatus 400, the sensor assembly 414 may also detect a change in the position of the apparatus 400 or a component of the apparatus 400, the presence or absence of user contact with the apparatus 400, orientation or acceleration/deceleration of the apparatus 400, and a change in the temperature of the apparatus 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 416 is configured to facilitate wired or wireless communication between the apparatus 400 and other devices. The apparatus 400 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 404 comprising instructions, executable by the processor 420 of the apparatus 400 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions therein which, when executed by a processor of a mobile terminal, enable the mobile terminal to perform a positioning method, the method comprising:
when a first positioning request of a first application is received, judging whether terminal position information is cached locally;
when the terminal position information is cached locally, judging whether the first application is currently operated in a foreground of the terminal, wherein the first application is any application installed in the terminal;
when the first application is not currently in the foreground operation of the terminal, acquiring the terminal position information cached in advance from the local;
and sending the terminal position information to the first application.
In a possible implementation manner, before the obtaining the pre-cached terminal location information from the local when the first application is not currently in the foreground operation of the terminal, the method further includes:
when a second positioning request of a second application is received, scanning a wireless network to obtain at least one wireless network identifier, wherein the second application is an application running in the foreground of the terminal;
acquiring the terminal position information based on the at least one wireless network identifier;
and caching the terminal position information to the local.
In a possible implementation manner, the obtaining the terminal location information based on the at least one radio network identifier includes:
transmitting the at least one radio network identification to a location server;
receiving the position information corresponding to the at least one wireless network identification from the positioning server;
the received location information is determined as the terminal location information.
In a possible implementation manner, after sending the terminal location information to the first application, the method further includes:
and sending the at least one wireless network identifier and the terminal position information to a designated server, wherein the designated server is used for providing service for the terminal.
In one possible implementation, the radio network identification includes a medium access control, MAC, address.
In the embodiment of the disclosure, when a first positioning request of any application installed in a terminal is received, whether the terminal position information is cached locally is judged, when the terminal position information is cached locally, whether the first application is currently in the foreground of the terminal is judged, if the first application is not currently in the foreground of the terminal, it is indicated that a user does not use the first application currently, under the condition, the locally cached terminal position information can be sent to the first application, that is, the positioning operation does not need to be executed, so when a plurality of applications are operated in the background of the terminal, the terminal is prevented from frequently executing the positioning operation, and the consumption of the electric quantity of the terminal is reduced.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (7)

1. A method of positioning, the method comprising:
when a first positioning request of a first application is received, judging whether terminal position information is cached locally or not, wherein the terminal position information is obtained by positioning operation when the first application detects that the terminal position information is not cached locally last time, or the terminal position information is obtained by positioning operation of a second application running in a foreground of the terminal;
when the terminal position information is cached locally, judging whether the first application is currently operated in a foreground of the terminal, wherein the first application is any application installed in the terminal; when the first application is not currently in the foreground operation of the terminal, acquiring the terminal position information cached in advance from the local; sending the terminal position information to the first application;
when a second positioning request of the second application is received, scanning a wireless network to obtain at least one wireless network identifier, and sending the at least one wireless network identifier to a positioning server; each wireless network identifier in the at least one wireless network identifier can be used for uniquely identifying one wireless network, the corresponding relation between the wireless network identifier and the position information is stored in the positioning server, and the corresponding relation between the wireless network identifier and the position information is acquired and stored in a manual data acquisition mode;
receiving the position information corresponding to the at least one wireless network identifier from the positioning server, determining the received position information as the terminal position information, and caching the terminal position information to the local;
the judging whether the first application is currently in the foreground operation of the terminal includes:
judging whether the currently displayed interface belongs to the interface of the first application, if so, determining that the first application is currently in the foreground operation of the terminal, and if not, determining that the first application is not currently in the foreground operation of the terminal.
2. The method of claim 1, wherein after sending the terminal location information to the first application, further comprising:
and sending the at least one wireless network identifier and the terminal position information to a designated server, wherein the designated server is used for providing service for the terminal.
3. The method of claim 1, wherein the wireless network identification comprises a Media Access Control (MAC) address.
4. A positioning device, the device comprising:
the first judging module is used for judging whether terminal position information is cached locally or not when a first positioning request of a first application is received, wherein the terminal position information is obtained by positioning operation when the first application detects that the terminal position information is not cached locally last time, or the terminal position information is obtained by positioning operation of a second application running in a foreground of the terminal;
the second judgment module is used for judging whether the first application is currently operated in a foreground of the terminal or not when the terminal position information is locally cached, wherein the first application is any application installed in the terminal;
the first obtaining module is used for obtaining the terminal position information cached in advance from the local when the judging module determines that the first application is not currently operated in the foreground of the terminal;
a first sending module, configured to send the terminal location information acquired by the first acquiring module to the first application;
the second judging module is used for judging whether the currently displayed interface belongs to the interface of the first application, if the currently displayed interface belongs to the interface of the first application, the first application is determined to be currently operated in the foreground of the terminal, and if the currently displayed interface does not belong to the interface of the first application, the first application is determined not to be currently operated in the foreground of the terminal;
the device further comprises:
the scanning module is used for scanning a wireless network to obtain at least one wireless network identifier when a second positioning request of the second application is received;
a second obtaining module, configured to obtain the terminal location information based on the at least one wireless network identifier;
the cache module is used for caching the terminal position information to the local;
the second acquisition module includes:
the sending submodule is used for sending the at least one wireless network identifier to a positioning server, each wireless network identifier in the at least one wireless network identifier can be used for uniquely identifying one wireless network, the positioning server stores the corresponding relation between the wireless network identifier and the position information, and the corresponding relation between the wireless network identifier and the position information is acquired and stored in a manual data acquisition mode;
the receiving submodule is used for receiving the position information corresponding to the at least one wireless network identification from the positioning server;
and the determining submodule is used for determining the received position information as the terminal position information.
5. The apparatus of claim 4, further comprising:
and the second sending module is used for sending the at least one wireless network identifier and the terminal position information to a designated server, and the designated server is used for providing service for the terminal.
6. The apparatus of claim 4, wherein the wireless network identification comprises a Media Access Control (MAC) address.
7. A positioning device, the device comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
when a first positioning request of a first application is received, judging whether terminal position information is cached locally or not, wherein the terminal position information is obtained by positioning operation when the first application detects that the terminal position information is not cached locally last time, or the terminal position information is obtained by positioning operation of a second application running in a foreground of the terminal;
when the terminal position information is cached locally, judging whether the first application is currently operated in a foreground of the terminal, wherein the first application is any application installed in the terminal; when the first application is not currently in the foreground operation of the terminal, acquiring the terminal position information cached in advance from the local; sending the terminal position information to the first application;
when a second positioning request of the second application is received, scanning a wireless network to obtain at least one wireless network identifier, and sending the at least one wireless network identifier to a positioning server, wherein each wireless network identifier in the at least one wireless network identifier can be used for uniquely identifying one wireless network, a corresponding relation between the wireless network identifier and position information is stored in the positioning server, and the corresponding relation between the wireless network identifier and the position information is obtained and stored in a manual data acquisition mode;
receiving the position information corresponding to the at least one wireless network identifier from the positioning server, determining the received position information as the terminal position information, and caching the terminal position information to the local;
the judging whether the first application is currently in the foreground operation of the terminal includes:
judging whether the currently displayed interface belongs to the interface of the first application, if so, determining that the first application is currently in the foreground operation of the terminal, and if not, determining that the first application is not currently in the foreground operation of the terminal.
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 CN106658412A (en) 2017-05-10
CN106658412B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110598085B (en) * 2018-05-24 2023-11-10 华为技术有限公司 Information query method for terminal and terminal
CN114205455B (en) * 2021-12-07 2023-04-25 郑州阿帕斯数云信息科技有限公司 Application positioning processing method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103428361A (en) * 2012-04-30 2013-12-04 苹果公司 Operating Geographic Location Systems
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

Family Cites Families (3)

* 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
US9942718B2 (en) * 2013-07-03 2018-04-10 Qualcomm Incorporated Methods and apparatuses for use in providing location parameters to mobile applications
CN106203008A (en) * 2016-06-28 2016-12-07 宇龙计算机通信科技(深圳)有限公司 Terminal control method, terminal control mechanism and terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103428361A (en) * 2012-04-30 2013-12-04 苹果公司 Operating Geographic Location Systems
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

Also Published As

Publication number Publication date
CN106658412A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
CN109496439B (en) Method and device for establishing unicast connection based on object direct connection
CN109388625B (en) Method and device for processing configuration file in multi-distributed file system
CN108600529B (en) Information interaction method and device and computer readable storage medium
CN108810866B (en) Method and device for connecting intelligent equipment and storage medium
CN110769395B (en) Traffic-free service synchronization method and device
CN113783774A (en) Cross-cluster network configuration method and device, communication equipment and storage medium
CN110945883A (en) Paging signaling receiving method and device and paging signaling sending method and device
CN107395624B (en) Information processing method and device
CN109040651B (en) Video communication method and device
CN106878654B (en) Video communication method and device
CN106506808B (en) Method and device for prompting communication message
CN106658412B (en) Positioning method and device
EP2950242A1 (en) Method and apparatus for determining position
CN106412855B (en) Information reminding and transmitting method and device
CN109245992B (en) Request processing method and device, electronic equipment and storage medium
CN110764847A (en) User information processing method and device, electronic equipment and storage medium
CN107070816B (en) Application identification method and device and mobile terminal
CN107885464B (en) Data storage method, device and computer readable storage medium
CN106922005B (en) Method and device for accessing wireless access point and computer readable storage medium
CN106550482B (en) Communication connection establishing method and device and electronic equipment
CN106161808B (en) Method and device for updating information of telephone number, terminal equipment and server
CN114430370B (en) Method, device, equipment and storage medium for determining network slice
CN106792570B (en) Positioning method and device
CN106155696B (en) Method and device for deleting information
CN106060104B (en) Application management method and device

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