Movatterモバイル変換


[0]ホーム

URL:


CN107040892B - Position information acquisition method and device of mobile terminal and mobile terminal - Google Patents

Position information acquisition method and device of mobile terminal and mobile terminal
Download PDF

Info

Publication number
CN107040892B
CN107040892BCN201710240307.2ACN201710240307ACN107040892BCN 107040892 BCN107040892 BCN 107040892BCN 201710240307 ACN201710240307 ACN 201710240307ACN 107040892 BCN107040892 BCN 107040892B
Authority
CN
China
Prior art keywords
mobile terminal
location information
location
information
service
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.)
Expired - Fee Related
Application number
CN201710240307.2A
Other languages
Chinese (zh)
Other versions
CN107040892A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp LtdfiledCriticalGuangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201710240307.2ApriorityCriticalpatent/CN107040892B/en
Publication of CN107040892ApublicationCriticalpatent/CN107040892A/en
Application grantedgrantedCritical
Publication of CN107040892BpublicationCriticalpatent/CN107040892B/en
Expired - Fee Relatedlegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The embodiment of the invention discloses a method and a device for acquiring position information of a mobile terminal and the mobile terminal. The method comprises the following steps: when a positioning request initiated by a first LBS application in a mobile terminal through an SDK is received, the type information of a plurality of network positioning services bound with the NLP of the mobile terminal, which are created in advance, is obtained; judging whether a target network positioning service with the same network positioning service type as the network positioning service corresponding to the SDK exists in the multiple network positioning services according to the type information; and when the target network positioning service is judged to exist, the position information of the mobile terminal is obtained by calling the target network positioning service. By adopting the technical scheme, various network positioning services bound by the NLP of the mobile terminal can be fully utilized, position information can be acquired by various LBS applications in the mobile terminal in a network positioning service mode, resources of the mobile terminal and a positioning server can be saved to a greater extent, and the utilization rate of the resources is improved.

Description

Translated fromChinese
移动终端的位置信息获取方法、装置及移动终端Method, device and mobile terminal for acquiring location information of mobile terminal

技术领域technical field

本发明实施例涉及移动终端技术领域,尤其涉及一种移动终端的位置信息获取方法、装置及移动终端。Embodiments of the present invention relate to the technical field of mobile terminals, and in particular, to a method, an apparatus, and a mobile terminal for acquiring location information of a mobile terminal.

背景技术Background technique

随着信息技术的发展,移动终端(如手机、平板电脑等等)的使用也越来越普遍,移动终端成为了人们生活的必需品。目前,越来越多移动终端上的APP(Application,应用)需要获取用户当前的位置信息,如天气、导航等LBS(Location Based Service,基于位置服务)应用,以为用户提供更好的服务。With the development of information technology, the use of mobile terminals (such as mobile phones, tablet computers, etc.) is becoming more and more common, and mobile terminals have become necessities of people's lives. Currently, more and more APPs (Applications) on mobile terminals need to obtain the current location information of users, such as LBS (Location Based Service) applications such as weather and navigation, to provide users with better services.

目前绝大多数LBS应用均通过内置的SDK(Software Development Kit,软件开发工具包)获取位置信息。当LBS应用需要位置信息时,发起定位请求,并通过内置的SDK从百度、高德或腾讯等定位服务提供商的定位服务器获取用户当前的位置信息。At present, most LBS applications obtain location information through a built-in SDK (Software Development Kit, software development kit). When the LBS application needs location information, it initiates a location request, and obtains the user's current location information from the location server of location service providers such as Baidu, AutoNavi, or Tencent through the built-in SDK.

每个LBS应用通过内部的SDK访问对应的定位服务器,获取用户位置信息,存在一定的缺陷,需要进一步改进。Each LBS application accesses the corresponding location server through the internal SDK to obtain user location information, which has certain defects and needs to be further improved.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供一种移动终端的位置信息获取方法、装置及移动终端,可以节省移动终端和定位服务器的资源,提高资源的利用率。Embodiments of the present invention provide a method, a device, and a mobile terminal for acquiring location information of a mobile terminal, which can save resources of the mobile terminal and a positioning server and improve the utilization rate of resources.

第一方面,本发明实施例提供了一种移动终端的位置信息获取方法,包括:In a first aspect, an embodiment of the present invention provides a method for acquiring location information of a mobile terminal, including:

当接收到移动终端中的第一LBS应用通过SDK发起的定位请求时,获取预先创建的与所述移动终端的NLP(Network Location Provider,网络定位提供者)所绑定的多种网络定位服务的类型信息;When receiving a positioning request initiated by the first LBS application in the mobile terminal through the SDK, obtain pre-created information about multiple network positioning services bound to the NLP (Network Location Provider) of the mobile terminal. type information;

根据所述类型信息判断所述多种网络定位服务中是否存在与所述SDK对应的网络定位服务类型相同的目标网络定位服务;According to the type information, determine whether there is a target network location service of the same type as the network location service corresponding to the SDK in the multiple network location services;

在判断存在所述目标网络定位服务时,通过调用所述目标网络定位服务获取所述移动终端的位置信息。When it is determined that the target network positioning service exists, the location information of the mobile terminal is acquired by invoking the target network positioning service.

第二方面,本发明实施例提供了一种移动终端的位置信息获取装置,包括:In a second aspect, an embodiment of the present invention provides a device for acquiring location information of a mobile terminal, including:

类型信息获取模块,用于当接收到移动终端中的第一LBS应用通过SDK发起的定位请求时,获取预先创建的与所述移动终端的NLP所绑定的多种网络定位服务的类型信息;a type information acquisition module, configured to acquire pre-created type information of multiple network positioning services bound to the NLP of the mobile terminal when receiving a positioning request initiated by the first LBS application in the mobile terminal through the SDK;

网络定位服务判断模块,用于根据所述类型信息判断所述多种网络定位服务中是否存在与所述SDK对应的网络定位服务类型相同的目标网络定位服务;a network location service judgment module, configured to judge, according to the type information, whether there is a target network location service of the same type as the network location service corresponding to the SDK in the multiple network location services;

位置信息获取模块,用于在判断存在所述目标网络定位服务时,通过调用所述目标网络定位服务获取所述移动终端的位置信息。The location information acquisition module is configured to acquire the location information of the mobile terminal by invoking the target network location service when it is determined that the target network location service exists.

第三方面,本发明实施例提供了一种移动终端,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:In a third aspect, an embodiment of the present invention provides a mobile terminal, including a memory, a processor, and a computer program stored in the memory and running on the processor, where the processor implements the following steps when executing the computer program:

当接收到移动终端中的第一LBS应用通过SDK发起的定位请求时,获取预先创建的与所述移动终端的NLP所绑定的多种网络定位服务的类型信息;When receiving a positioning request initiated by the first LBS application in the mobile terminal through the SDK, obtain pre-created type information of multiple network positioning services bound to the NLP of the mobile terminal;

根据所述类型信息判断所述多种网络定位服务中是否存在与所述SDK对应的网络定位服务类型相同的目标网络定位服务;According to the type information, determine whether there is a target network location service of the same type as the network location service corresponding to the SDK in the multiple network location services;

在判断存在所述目标网络定位服务时,通过调用所述目标网络定位服务获取所述移动终端的位置信息。When it is determined that the target network positioning service exists, the location information of the mobile terminal is acquired by invoking the target network positioning service.

本发明实施例中提供的移动终端的位置信息获取方法,当接收到移动终端中的第一LBS应用通过SDK发起的定位请求时,获取预先创建的与移动终端的NLP所绑定的多种网络定位服务的类型信息;根据类型信息判断多种网络定位服务中是否存在与SDK对应的网络定位服务类型相同的目标网络定位服务;在判断存在目标网络定位服务时,通过调用目标网络定位服务获取移动终端的位置信息。通过采用上述技术方案,可以充分利用移动终端的NLP所绑定的多种网络定位服务,实现移动终端中多类LBS应用均可以通过网络定位服务的方式获取位置信息,能够更大程度节省移动终端和定位服务器的资源,提高资源的利用率,而且可以快速获取移动终端的位置信息。In the method for obtaining the location information of the mobile terminal provided in the embodiment of the present invention, when receiving the positioning request initiated by the first LBS application in the mobile terminal through the SDK, obtain the pre-created multiple networks bound to the NLP of the mobile terminal Type information of the location service; according to the type information, determine whether there is a target network location service of the same type as the network location service corresponding to the SDK in various network location services; when judging that there is a target network location service, obtain mobile The location information of the terminal. By adopting the above technical solutions, various network location services bound by the NLP of the mobile terminal can be fully utilized, so that various types of LBS applications in the mobile terminal can obtain location information through the network location service, which can save the mobile terminal to a greater extent. and positioning server resources, improve the utilization of resources, and can quickly obtain the location information of the mobile terminal.

附图说明Description of drawings

图1a为本实施例提供的通过SDK访问定位服务器获取位置信息的过程示意图;1a is a schematic diagram of a process for obtaining location information by accessing a positioning server through SDK provided by the present embodiment;

图1b为本发明实施例提供的一种移动终端的位置信息获取方法的流程示意图;1b is a schematic flowchart of a method for acquiring location information of a mobile terminal according to an embodiment of the present invention;

图2为本发明实施例提供的另一种移动终端的位置信息获取方法的流程示意图;2 is a schematic flowchart of another method for obtaining location information of a mobile terminal according to an embodiment of the present invention;

图3为本发明实施例提供的另一种移动终端的位置信息获取方法的流程示意图;3 is a schematic flowchart of another method for acquiring location information of a mobile terminal provided by an embodiment of the present invention;

图4为本发明实施例提供的另一种移动终端的位置信息获取方法的流程示意图;4 is a schematic flowchart of another method for obtaining location information of a mobile terminal according to an embodiment of the present invention;

图5为本发明实施例提供的一种移动终端的位置信息获取装置的结构框图;5 is a structural block diagram of a device for obtaining location information of a mobile terminal according to an embodiment of the present invention;

图6为本发明实施例提供的一种移动终端的结构示意图。FIG. 6 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention.

具体实施方式Detailed ways

下面结合附图并通过具体实施方式来进一步说明本发明的技术方案。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部结构。The technical solutions of the present invention are further described below with reference to the accompanying drawings and through specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, the drawings only show some but not all structures related to the present invention.

在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各步骤描述成顺序的处理,但是其中的许多步骤可以被并行地、并发地或者同时实施。此外,各步骤的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。Before discussing the exemplary embodiments in greater detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowchart depicts the steps as a sequential process, many of the steps may be performed in parallel, concurrently, or concurrently. Furthermore, the order of the steps can be rearranged. The process may be terminated when its operation is complete, but may also have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, subroutines, and the like.

每个LBS应用发起定位请求时均通过内部的SDK访问定位服务器,获取用户位置信息。图1a为本实施例提供的通过SDK访问定位服务器获取位置信息的过程示意图。如图1a所示,当用户打开移动终端中某LBS应用,并需要通过LBS应用获取当前位置信息时,用户向移动终端中的LBS应用发起定位请求,LBS应用接受定位请求,并将该定位请求发送给LBS应用中的SDK,其中SDK可以为高德SDK,如高德地图的软件开发工具包,也可以为百度SDK,如百度地图的软件开发工具包,还可以为腾讯SDK,如微信的软件开发工具包,本实施例对此并不做限定。SDK接收到LBS应用发起的定位请求时,扫描网络连接信息以获取移动终端连接的基站信息或WIFI热点信息,并将基站信息或WIFI热点信息与定位请求打包发送给定位服务器。定位服务器根据移动终端当前连接的基站信息或WIFI热点信息计算出移动终端当前的位置信息,并将该位置信息通过SDK发送移动终端,移动终端最终将位置信息反馈给用户。通过SDK访问定位服务器获取位置信息的技术方案浪费了移动终端系统和定位服务器的资源,资源的利用率较低。并且SDK直接访问定位服务器的方式需要时间较长,不能快速响应用户的请求。When each LBS application initiates a positioning request, it accesses the positioning server through the internal SDK to obtain user location information. FIG. 1a is a schematic diagram of a process of obtaining location information by accessing a location server through an SDK according to this embodiment. As shown in Figure 1a, when a user opens an LBS application in the mobile terminal and needs to obtain the current location information through the LBS application, the user initiates a positioning request to the LBS application in the mobile terminal, and the LBS application accepts the positioning request and sends the positioning request Send to the SDK in the LBS application, where the SDK can be the AutoNavi SDK, such as the software development kit of AutoNavi Maps, or the Baidu SDK, such as the software development kit of Baidu Maps, or the Tencent SDK, such as WeChat's A software development kit, which is not limited in this embodiment. When the SDK receives the positioning request initiated by the LBS application, it scans the network connection information to obtain the base station information or WIFI hotspot information connected to the mobile terminal, and packages the base station information or WIFI hotspot information and the positioning request to the positioning server. The positioning server calculates the current location information of the mobile terminal according to the base station information or WIFI hotspot information currently connected to the mobile terminal, and sends the location information to the mobile terminal through the SDK, and the mobile terminal finally feeds back the location information to the user. The technical solution of accessing the positioning server through the SDK to obtain the position information wastes the resources of the mobile terminal system and the positioning server, and the utilization rate of the resources is low. Moreover, the way that the SDK directly accesses the location server takes a long time and cannot respond quickly to the user's request.

为了解决这个问题,提出了如下技术方案:当LBS应用通过SDK发起定位请求时,判断所述SDK对应的网络定位服务类型是否与移动终端的NLP所绑定的网络定位服务类型相同,若相同,则拦截SDK向定位服务器发起的定位请求,通过调用NLP所绑定的网络定位服务获取位置信息,否则通过SDK与定位服务器通信获取位置信息。由于移动终端的NLP只绑定一种网络定位服务,所以只能使其中一类LBS应用快速获取位置信息,该类LBS应用是指内置的SDK对应的网络定位服务类型与移动终端的NLP绑定的网络定位服务类型相同的LBS应用,无法使其他类型的LBS应用通过移动终端的NLP绑定的网络定位服务获取位置信息,其中,其他类型的LBS应用是指内置的SDK对应的网络定位服务类型与移动终端的NLP绑定的网络定位服务类型不一致的LBS应用,从而无法达到节省移动终端和定位服务器的资源,提高资源利用率的目的。基于以上原因,本发明实施例提供以下移动终端的位置信息获取方法。In order to solve this problem, the following technical solution is proposed: when the LBS application initiates a positioning request through the SDK, it is judged whether the network positioning service type corresponding to the SDK is the same as the network positioning service type bound to the NLP of the mobile terminal. Then intercept the positioning request initiated by the SDK to the positioning server, and obtain the position information by calling the network positioning service bound to the NLP, otherwise obtain the position information through the SDK and the positioning server communication. Since the NLP of the mobile terminal is only bound to one type of network location service, only one type of LBS application can be used to quickly obtain location information. This type of LBS application refers to the type of network location service corresponding to the built-in SDK that is bound to the NLP of the mobile terminal. LBS applications of the same type of network location service cannot enable other types of LBS applications to obtain location information through the network location service bound to the NLP of the mobile terminal, where other types of LBS applications refer to the built-in SDK corresponding to the network location service type The LBS application that is inconsistent with the network location service type bound to the NLP of the mobile terminal cannot achieve the purpose of saving the resources of the mobile terminal and the location server and improving the resource utilization rate. Based on the above reasons, the embodiments of the present invention provide the following method for acquiring location information of a mobile terminal.

图1b为本发明实施例提供的移动终端的位置信息获取方法的流程示意图,该方法可以由移动终端的位置信息获取装置执行,其中该装置可由软件和/或硬件实现,一般可集成在移动终端中。如图1b所示,该方法包括:1b is a schematic flowchart of a method for acquiring location information of a mobile terminal according to an embodiment of the present invention. The method can be executed by a device for acquiring location information of a mobile terminal, wherein the device can be implemented by software and/or hardware, and can generally be integrated in the mobile terminal. middle. As shown in Figure 1b, the method includes:

步骤101、当接收到移动终端中的第一LBS应用通过SDK发起的定位请求时,获取预先创建的与移动终端的NLP所绑定的多种网络定位服务的类型信息。Step 101: When receiving a positioning request initiated by the first LBS application in the mobile terminal through the SDK, obtain pre-created type information of various network positioning services bound to the NLP of the mobile terminal.

在本实施例中,LBS应用是需要通过获取用户当前位置信息的应用软件,通过获取用户的位置信息以为用户提供更好的服务。如天气应用,当用户需要通过天气应用获取用户所在地区的天气信息时,由于各个地区的天气情况不尽相同,因此天气应用需要通过定位用户所在地区的位置信息,以更精确的为用户提供准确的天气信息。当接收到移动终端中的第一LBS应用通过SDK发起的定位请求时,获取预先创建的与所述移动终端的NLP所绑定的多种网络定位服务的类型信息。其中,第一LBS应用可以为一个,也可以为多个,本实施例对第一LBS应用的数量不做限定。移动终端的NLP所绑定的多种类型网络定位服务可以包括高德网络定位服务、百度网络定位服务、腾讯网络定位服务、谷歌网络定位服务及搜狗网络定位服务中的任意两种或多种,还可以包括其他类型的网络定位服务,本实施例对网络定位服务的具体类型不做限定。In this embodiment, the LBS application is application software that needs to acquire the user's current location information, and provides better services for the user by acquiring the user's location information. For example, a weather application, when a user needs to obtain the weather information of the user's area through the weather application, since the weather conditions in each area are different, the weather application needs to locate the location information of the user's area in order to provide users with more accurate information. weather information. When receiving the positioning request initiated by the first LBS application in the mobile terminal through the SDK, obtain the pre-created type information of various network positioning services bound to the NLP of the mobile terminal. The number of the first LBS application may be one or multiple, and the number of the first LBS application is not limited in this embodiment. The various types of network location services bound by the NLP of the mobile terminal may include any two or more of AutoNavi network location services, Baidu network location services, Tencent network location services, Google network location services and Sogou network location services. Other types of network location services may also be included, and this embodiment does not limit the specific types of network location services.

步骤102、根据类型信息判断多种网络定位服务中是否存在与SDK对应的网络定位服务类型相同的目标网络定位服务。Step 102: Determine, according to the type information, whether there is a target network location service of the same type as the network location service corresponding to the SDK among the various network location services.

在本实施例中,判断通过SDK发起定位请求的第一LBS应用中的SDK所对应的网络定位服务类型具体属于多种网络定位服务中的哪种,并将其作为目标网络定位服务。示例性的,微信是通过腾讯SDK发起定位请求的,与腾讯SDK所对应的网络定位服务类型为腾讯网络定位服务,若腾讯网络定位服务属于移动终端的NLP所绑定的多种网络定位服务,则将腾讯网络定位服务作为目标网络定位服务。In this embodiment, it is determined which network location service type corresponding to the SDK in the first LBS application that initiates the location request through the SDK specifically belongs to a variety of network location services, and it is used as the target network location service. Exemplarily, WeChat initiates a location request through Tencent SDK, and the type of network location service corresponding to Tencent SDK is Tencent Network Location Service. If Tencent Network Location Service belongs to various network location services bound by NLP of mobile terminals, Then the Tencent network location service is used as the target network location service.

步骤103、在判断存在目标网络定位服务时,通过调用目标网络定位服务获取移动终端的位置信息。Step 103 , when it is determined that the target network positioning service exists, obtain the location information of the mobile terminal by invoking the target network positioning service.

在本实施例中,每个移动终端中均包含至少一个NLP,NLP由NLP统一接口和网络定位服务两部分组成。其中,NLP统一接口是提供给应用通过系统的途径获取位置信息的接口,网络定位服务是指网络定位方案商提供的获取移动终端位置信息的解决方案。当移动终端的NLP所绑定的多种网络定位服务中存在与通过SDK发起定位请求的第一LBS应用中的SDK所对应的网络定位服务类型相同的目标网络定位服务时,通过调用目标网络定位服务获取移动终端的位置信息。In this embodiment, each mobile terminal includes at least one NLP, and the NLP is composed of two parts, an NLP unified interface and a network location service. Among them, the NLP unified interface is an interface provided for applications to obtain location information through a system approach, and the network location service refers to a solution provided by a network location solution provider to obtain the location information of a mobile terminal. When there is a target network positioning service of the same type as the network positioning service corresponding to the SDK in the first LBS application that initiates the positioning request through the SDK, the target network positioning service is called by calling the target network positioning service. The service obtains the location information of the mobile terminal.

具体的,为了实现NLP绑定多种网络定位服务,需要预先为移动终端创建多种网络定位服务,并使各网络定位服务处于运行状态,各网络定位服务和NLP统一接口均运行在不同的进程中,建立NLP统一接口的进程与多种网络定位服务的进程的绑定关系。针对各个处于运行状态的网络定位服务,分别创建一个独立的存储空间,该存储空间用于存放NLP统一接口与对应网络定位服务交互所使用的接口变量,每个接口变量包含多个API(Application Programming Interface,应用程序编程接口)。不同的处于运行状态的网络定位服务,其对应的存储空间中存放的接口变量也不同。Specifically, in order to realize NLP binding multiple network location services, it is necessary to create multiple network location services for the mobile terminal in advance, and make each network location service in the running state, and each network location service and NLP unified interface are running in different processes. , establish the binding relationship between the process of the NLP unified interface and the process of various network location services. For each running network location service, create an independent storage space, which is used to store the interface variables used by the NLP unified interface to interact with the corresponding network location service. Each interface variable contains multiple APIs (Application Programming Interface, application programming interface). Different network location services that are running have different interface variables stored in their corresponding storage spaces.

当需要调用一个或多个网络定位服务获取移动终端的位置信息时,NLP统一接口通过远程调用的方法分别调用该一个或多个处于运行状态的网络定位服务,从该一个或多个处于运行状态的网络定位服务的存储空间中分别获取其对应的接口变量,再分别调用各接口变量中的API,使各API分别向对应的定位服务器发起定位请求。NLP统一接口通过接口变量接收到定位服务器反馈的定位结果,并将定位结果最终反馈给LBS应用。比如,当需要调用目标网络定位服务获取移动终端的位置信息时,NLP统一接口通过远程调用的方法调用处于运行状态的目标网络定位服务,从该目标网络定位服务的存储空间中获取其对应的接口变量,再调用该接口变量中的API,使该API向定位服务器发起定位请求,NLP统一接口通过该接口变量接收到定位服务器反馈的定位结果,并将该定位结果最终反馈给发起定位请求的LBS应用。When it is necessary to call one or more network location services to obtain the location information of the mobile terminal, the NLP unified interface respectively calls the one or more network location services in the running state through the method of remote invocation, and selects the one or more network location services in the running state from the one or more network location services. The corresponding interface variables are obtained from the storage space of the network location service of the server respectively, and then the APIs in each interface variable are called respectively, so that each API respectively initiates a location request to the corresponding location server. The NLP unified interface receives the positioning result fed back by the positioning server through the interface variable, and finally feeds back the positioning result to the LBS application. For example, when it is necessary to call the target network location service to obtain the location information of the mobile terminal, the NLP unified interface calls the running target network location service through the remote calling method, and obtains its corresponding interface from the storage space of the target network location service. variable, and then call the API in the interface variable to make the API initiate a positioning request to the positioning server. The NLP unified interface receives the positioning result fed back by the positioning server through this interface variable, and finally feeds the positioning result back to the LBS that initiated the positioning request. application.

本发明实施例中提供的移动终端的位置信息获取方法,当接收到移动终端中的第一LBS应用通过SDK发起的定位请求时,获取预先创建的与移动终端的NLP所绑定的多种网络定位服务的类型信息;根据类型信息判断多种网络定位服务中是否存在与SDK对应的网络定位服务类型相同的目标网络定位服务;在判断存在目标网络定位服务时,通过调用目标网络定位服务获取移动终端的位置信息。通过采用上述技术方案,可以充分利用移动终端的NLP所绑定的多种网络定位服务,实现移动终端中多类LBS应用均可以通过网络定位服务的方式获取位置信息,能够更大程度节省移动终端和定位服务器的资源,提高资源的利用率,而且可以快速获取移动终端的位置信息。In the method for obtaining the location information of the mobile terminal provided in the embodiment of the present invention, when receiving the positioning request initiated by the first LBS application in the mobile terminal through the SDK, obtain the pre-created multiple networks bound to the NLP of the mobile terminal Type information of the location service; according to the type information, determine whether there is a target network location service of the same type as the network location service corresponding to the SDK in various network location services; when judging that there is a target network location service, obtain mobile The location information of the terminal. By adopting the above technical solutions, various network location services bound by the NLP of the mobile terminal can be fully utilized, so that various types of LBS applications in the mobile terminal can obtain location information through the network location service, which can save the mobile terminal to a greater extent. and positioning server resources, improve the utilization of resources, and can quickly obtain the location information of the mobile terminal.

图2为本发明实施例提供的另一种移动终端的位置信息获取方法的流程示意图,本实施例的方法包括如下步骤:FIG. 2 is a schematic flowchart of another method for obtaining location information of a mobile terminal according to an embodiment of the present invention. The method in this embodiment includes the following steps:

步骤201、为移动终端创建多种网络定位服务,并使多种网络定位服务保持运行状态,创建的多种网络定位服务与移动终端的NLP相绑定。Step 201: Create multiple network location services for the mobile terminal, keep the multiple network location services running, and bind the created multiple network location services to the NLP of the mobile terminal.

其中,多种网络定位服务分别对应的类型组成的集合中,包含所述移动终端中各LBS应用的SDK所对应的网络定位服务类型。Wherein, the set consisting of types corresponding to various network location services respectively includes network location service types corresponding to SDKs of each LBS application in the mobile terminal.

现有技术中,移动终端的NLP只绑定一种网络定位服务,示例性的,每个移动终端的NLP只绑定高德网络定位服务、百度网络定位服务、腾讯网络定位服务中的一种。当移动终端中的第一LBS应用通过SDK发起定位请求时,判断当前移动终端的NLP所绑定的网络定位服务是否与通过SDK发起定位请求的第一LBS应用中的SDK所对应的网络定位服务类型相同。若相同,则通过移动终端NLP所绑定的网络定位服务获取位置信息,否则只能通过SDK与定位服务器通信获取位置信息。上述方案只能实现同一类的网络定位服务的位置信息共享,不能达到资源的最大利用率。In the prior art, the NLP of the mobile terminal is only bound to one type of network location service. Exemplarily, the NLP of each mobile terminal is only bound to one of the AutoNavi network location service, the Baidu network location service, and the Tencent network location service. . When the first LBS application in the mobile terminal initiates a location request through the SDK, determine whether the network location service bound to the NLP of the current mobile terminal is the network location service corresponding to the SDK in the first LBS application that initiates the location request through the SDK same type. If they are the same, the location information is obtained through the network location service bound to the NLP of the mobile terminal; otherwise, the location information can only be obtained by communicating with the location server through the SDK. The above solution can only realize the location information sharing of the same type of network location service, and cannot achieve the maximum utilization of resources.

有鉴于此,在本实施例中,为移动终端创建多种网络定位服务,并使多种网络定位服务保持运行状态。且多种网络定位服务的类型构成的集合均包含移动终端中各LBS应用的SDK所对应的网络定位服务类型。即移动终端中的每个LBS应用的SDK所对应的网络定位服务均为多种网络定位服务中的一种,以使每个LBS应用通过SDK发起定位请求时,均可以通过与发起定位请求的LBS应用中的SDK对应的网络定位服务获取位置信息。In view of this, in this embodiment, multiple network location services are created for the mobile terminal, and the multiple network location services are kept running. In addition, the set formed by the types of various network location services includes the network location service types corresponding to the SDKs of each LBS application in the mobile terminal. That is, the network location service corresponding to the SDK of each LBS application in the mobile terminal is one of various network location services, so that when each LBS application initiates a location request through the SDK, it can pass the same location request as the one that initiates the location request. The network location service corresponding to the SDK in the LBS application obtains the location information.

步骤202、当接收到移动终端中的第一LBS应用通过SDK发起的定位请求时,获取预先创建的与移动终端的NLP所绑定的多种网络定位服务的类型信息。Step 202: When receiving a positioning request initiated by the first LBS application in the mobile terminal through the SDK, obtain pre-created type information of various network positioning services bound to the NLP of the mobile terminal.

步骤203、根据类型信息判断多种网络定位服务中是否存在与SDK对应的网络定位服务类型相同的目标网络定位服务。Step 203: Determine, according to the type information, whether there is a target network location service of the same type as the network location service corresponding to the SDK among the various network location services.

步骤204、在判断存在目标网络定位服务时,通过调用目标网络定位服务获取移动终端的位置信息。Step 204 , when it is determined that the target network positioning service exists, obtain the location information of the mobile terminal by invoking the target network positioning service.

本发明实施例中提供的移动终端的位置信息获取方法,通过为移动终端创建多种网络定位服务,并使多种网络定位服务保持运行状态,其中,多种网络定位服务分别对应的类型组成的集合中,包含所述移动终端中各LBS应用的SDK所对应的网络定位服务类型的技术方案,进一步充分利用了移动终端的NLP所绑定的多种网络定位服务,实现移动终端中多类LBS应用均可以通过网络定位服务的方式获取位置信息,能够更大程度节省移动终端和定位服务器的资源,提高资源的利用率,而且可以快速获取移动终端的位置信息。The method for obtaining the location information of a mobile terminal provided in the embodiment of the present invention creates multiple network location services for the mobile terminal and keeps the multiple network location services in a running state. In the collection, the technical solutions of the network location service types corresponding to the SDKs of the LBS applications in the mobile terminal are included, and the various network location services bound by the NLP of the mobile terminal are further fully utilized to realize the multi-type LBS in the mobile terminal. All applications can obtain location information by means of network location services, which can save the resources of the mobile terminal and the location server to a greater extent, improve the utilization rate of resources, and can quickly obtain the location information of the mobile terminal.

图3为本发明实施例提供的另一种移动终端的位置信息获取方法的流程示意图,本实施例的方法包括如下步骤:FIG. 3 is a schematic flowchart of another method for acquiring location information of a mobile terminal according to an embodiment of the present invention. The method in this embodiment includes the following steps:

步骤301、为移动终端创建多种网络定位服务,并使多种网络定位服务保持运行状态,创建的多种网络定位服务与移动终端的NLP相绑定。Step 301: Create multiple network location services for the mobile terminal, keep the multiple network location services running, and bind the created multiple network location services to the NLP of the mobile terminal.

步骤302、在接收到移动终端中的第二LBS应用通过NLP发起的定位请求时,调用与NLP所绑定的多种网络定位服务分别获取移动终端的位置信息,并将最先获取到的位置信息提供给第二LBS应用。Step 302: When receiving the positioning request initiated by the second LBS application in the mobile terminal through NLP, call various network positioning services bound to the NLP to obtain the position information of the mobile terminal respectively, and use the first obtained position. The information is provided to the second LBS application.

当接收到移动终端中的第二LBS应用通过NLP发起的定位请求时,调用与NLP所绑定的多种网络定位服务分别获取移动终端的位置信息,并将最先获取到的位置信息提供给第二LBS应用。可选的,每种网络定位服务分别将自身获取到移动终端的位置信息进行保存。示例性的,移动终端的NLP所绑定的多种网络定位服务包括高德网络定位服务、百度网络定位服务、腾讯网络定位服务,移动终端中的天气应用是通过NLP方式获取位置信息的。当天气应用通过NLP发起定位请求时,高德网络定位服务、百度网络定位服务、腾讯网络定位服务同时向各自对应的定位服务器发起定位请求,并将最先获取得到的位置信息通过NLP接口提供给天气应用,例如,百度网络定位服务最先获得位置信息,就将百度网络定位服务获取的位置信息返回给天气应用。由于高德网络定位服务、百度网络定位服务、腾讯网络定位服均向各自对应的定位服务器发起了定位请求,最终都会获得各自服务器返回的位置信息,并将获取的位置信息分别保存在各自的缓存区域。When receiving a positioning request initiated by the second LBS application in the mobile terminal through NLP, call various network positioning services bound with NLP to obtain the position information of the mobile terminal respectively, and provide the first obtained position information to the Second LBS application. Optionally, each network location service saves the location information of the mobile terminal obtained by itself. Exemplarily, various network location services bound by NLP of the mobile terminal include AutoNavi network location service, Baidu network location service, and Tencent network location service. The weather application in the mobile terminal obtains location information through NLP. When the weather application initiates a positioning request through NLP, AutoNavi, Baidu, and Tencent simultaneously initiate a positioning request to their corresponding positioning servers, and provide the first obtained location information through the NLP interface to The weather application, for example, the Baidu network location service first obtains the location information, and then returns the location information obtained by the Baidu network location service to the weather application. Since AutoNavi, Baidu, and Tencent all initiate positioning requests to their corresponding positioning servers, they will eventually obtain the location information returned by their respective servers, and save the obtained location information in their respective caches. area.

需要说明的是,步骤302与步骤303没有明显的时序关系,可以先执行步骤302,也可以先执行步骤303,本实施例对此不做限定。It should be noted that, there is no obvious timing relationship between step 302 and step 303, and step 302 may be performed first, or step 303 may be performed first, which is not limited in this embodiment.

步骤303、当接收到移动终端中的第一LBS应用通过SDK发起的定位请求时,获取预先创建的与移动终端的NLP所绑定的多种网络定位服务的类型信息。Step 303: When receiving the positioning request initiated by the first LBS application in the mobile terminal through the SDK, obtain pre-created type information of various network positioning services bound to the NLP of the mobile terminal.

步骤304、根据类型信息判断多种网络定位服务中是否存在与SDK对应的网络定位服务类型相同的目标网络定位服务。Step 304: Determine, according to the type information, whether there is a target network location service of the same type as the network location service corresponding to the SDK among the various network location services.

步骤305、在判断存在目标网络定位服务时,通过调用目标网络定位服务获取移动终端的位置信息。Step 305 , when it is determined that the target network positioning service exists, obtain the location information of the mobile terminal by invoking the target network positioning service.

本发明实施例中提供的移动终端的位置信息获取方法,在接收到移动终端中的第二LBS应用通过NLP发起的定位请求时,调用与NLP所绑定的多种网络定位服务分别获取移动终端的位置信息,并将最先获取到的位置信息提供给第二LBS应用,并每种网络定位服务分别将自身获取到所述移动终端的位置信息进行保存。通过采用上述技术方案,无论是LBS应用通过NLP发起定位请求,还是通过SDK发起定位请求,均可以充分利用移动终端的NLP所绑定的多种网络定位服务,实现移动终端中多类LBS应用均可以通过网络定位服务的方式获取位置信息,能够更大程度节省移动终端和定位服务器的资源,提高资源的利用率,而且可以有效减少访问定位服务器的频率,快速获取移动终端的当前位置信息。In the method for acquiring location information of a mobile terminal provided in the embodiment of the present invention, when receiving a location request initiated by a second LBS application in the mobile terminal through NLP, various network location services bound to the NLP are invoked to acquire the mobile terminal respectively. The location information obtained first is provided to the second LBS application, and each network positioning service stores the location information obtained by itself of the mobile terminal. By adopting the above technical solutions, whether the LBS application initiates the positioning request through NLP or the SDK initiates the positioning request, the various network positioning services bound by the NLP of the mobile terminal can be fully utilized, so that various types of LBS applications in the mobile terminal can be fully utilized. The location information can be obtained through the network location service, which can save the resources of the mobile terminal and the location server to a greater extent, improve the utilization rate of resources, and can effectively reduce the frequency of accessing the location server, and quickly obtain the current location information of the mobile terminal.

图4为本发明实施例提供的另一种移动终端的位置信息获取方法的流程示意图,本实施例是上述实施例的一个优选方案,相应的,如图4所示,本实施例的方法包括如下步骤:FIG. 4 is a schematic flowchart of another method for obtaining location information of a mobile terminal according to an embodiment of the present invention. This embodiment is a preferred solution of the above-mentioned embodiment. Correspondingly, as shown in FIG. 4 , the method of this embodiment includes: Follow the steps below:

步骤401、为移动终端创建多种网络定位服务,并使多种网络定位服务保持运行状态,创建的多种网络定位服务与移动终端的NLP相绑定。Step 401: Create multiple network location services for the mobile terminal, keep the multiple network location services running, and bind the created multiple network location services to the NLP of the mobile terminal.

步骤402、在接收到移动终端中的第二LBS应用通过NLP发起的定位请求时,调用与NLP所绑定的多种网络定位服务分别获取移动终端的位置信息,并将最先获取到的位置信息提供给第二LBS应用。Step 402: When receiving the positioning request initiated by the second LBS application in the mobile terminal through NLP, call a variety of network positioning services bound to the NLP to obtain the position information of the mobile terminal, respectively, and use the position obtained first. The information is provided to the second LBS application.

步骤403、每种网络定位服务分别将自身获取到所述移动终端的位置信息进行保存。Step 403: Each network positioning service saves the location information of the mobile terminal obtained by itself.

步骤404、当接收到移动终端中的第一LBS应用通过SDK发起的定位请求时,获取预先创建的与移动终端的NLP所绑定的多种网络定位服务的类型信息。Step 404: When receiving a positioning request initiated by the first LBS application in the mobile terminal through the SDK, obtain pre-created type information of various network positioning services bound to the NLP of the mobile terminal.

步骤405、根据类型信息判断多种网络定位服务中是否存在与SDK对应的网络定位服务类型相同的目标网络定位服务,若是,则执行步骤406,否则执行步骤409。Step 405 , according to the type information, determine whether there is a target network location service of the same type as the network location service corresponding to the SDK in the various network location services, if yes, go to step 406 , otherwise go to step 409 .

步骤406、判断目标网络定位服务是否保存有移动终端的位置信息,若是,则执行步骤407,否则,执行步骤409。Step 406 , determine whether the location information of the mobile terminal is stored in the target network location service, if so, go to step 407 , otherwise, go to step 409 .

在本实施例中,在移动终端中的第一LBS应用通过SDK发起定位请求前,已经存在移动终端中的第二LBS应用通过NLP发起的定位请求,并获取位置信息时,目标网络定位服务中保存有移动终端的位置信息。或者与当前通过SDK发起定位请求的第一LBS应用具有相同目标网络定位服务的其他第一LBS应用已经获取或位置信息时,目标网络定位服务中保存有移动终端的位置信息。In this embodiment, before the first LBS application in the mobile terminal initiates a positioning request through the SDK, there is a positioning request initiated by the second LBS application in the mobile terminal through NLP, and when the location information is obtained, the target network location service The location information of the mobile terminal is stored. Or when other first LBS applications that have the same target network location service as the first LBS application that currently initiates the location request through the SDK have already obtained or obtained location information, the location information of the mobile terminal is stored in the target network location service.

步骤407、判断保存的移动终端的位置信息是否有效,若是,则执行步骤408,否则执行步骤409。Step 407 , determine whether the stored location information of the mobile terminal is valid, if so, go to step 408 , otherwise go to step 409 .

可选的,当所述保存的移动终端的位置信息对应的第一时间戳与所述移动终端的当前时间戳的差值小于预设阈值时,判断保存的所述移动终端的位置信息有效。Optionally, when the difference between the first timestamp corresponding to the stored location information of the mobile terminal and the current timestamp of the mobile terminal is less than a preset threshold, it is determined that the stored location information of the mobile terminal is valid.

第一时间戳反映了移动终端获取第一位置信息的时间信息,当前时间戳反映了移动终端需要获取位置时的时间信息。相应的,在判断移动终端的位置信息是否有效性时,可以判断第一位置信息对应的第一时间戳与移动终端的当前时间戳的差值是否小于预设阈值。当第一时间戳与移动终端的当前时间戳的差值小于预设阈值时,则判断移动终端的位置信息为有效信息,否则判断移动终端的位置信息为无效信息。其中,预设阈值的大小可以根据用户需要进行适应性调整,当预设阈值设定的越小,判断移动终端的位置信息的有效性的准确度越高。The first timestamp reflects the time information when the mobile terminal acquires the first location information, and the current timestamp reflects the time information when the mobile terminal needs to acquire the location. Correspondingly, when judging whether the location information of the mobile terminal is valid, it can be determined whether the difference between the first timestamp corresponding to the first location information and the current timestamp of the mobile terminal is less than a preset threshold. When the difference between the first time stamp and the current time stamp of the mobile terminal is less than the preset threshold, it is determined that the location information of the mobile terminal is valid information, otherwise it is determined that the location information of the mobile terminal is invalid information. The size of the preset threshold can be adaptively adjusted according to user needs, and the smaller the preset threshold is set, the higher the accuracy of judging the validity of the location information of the mobile terminal.

可选的,当获取保存的移动终端的位置信息使用的第一基站信息或第一WIFI热点信息与当前所述移动终端连接的第二基站信息或第二WIFI热点信息相同时,判断保存的所述移动终端的位置信息有效。当获取所述移动终端的位置信息使用的第一基站信息与第二基站信息相同或第一WIFI热点信息与第二WIFI热点信息相同时,则判断移动终端的位置信息为有效信息,否则判断移动终端的位置信息为无效信息。Optionally, when the first base station information or the first WIFI hotspot information used to obtain the saved location information of the mobile terminal is the same as the second base station information or the second WIFI hotspot information currently connected to the mobile terminal, determine that the saved location information is the same as the second base station information or the second WIFI hotspot information. The location information of the mobile terminal is valid. When the first base station information used to obtain the location information of the mobile terminal is the same as the second base station information or the first WIFI hotspot information is the same as the second WIFI hotspot information, it is determined that the location information of the mobile terminal is valid information; otherwise, the mobile terminal is determined to be mobile The location information of the terminal is invalid information.

步骤408、将移动终端的位置信息提供给第一LBS应用。Step 408: Provide the location information of the mobile terminal to the first LBS application.

步骤409、通过目标网络定位服务与定位服务器通信获取移动终端的位置信息。Step 409: Obtain the location information of the mobile terminal by communicating with the location server through the target network location service.

本发明实施例中提供的移动终端的位置信息获取方法,当接收到移动终端中的第一LBS应用通过SDK发起的定位请求时,获取预先创建的与移动终端的NLP所绑定的多种网络定位服务的类型信息;根据类型信息判断多种网络定位服务中是否存在与SDK对应的网络定位服务类型相同的目标网络定位服务;在判断存在目标网络定位服务时,通过调用目标网络定位服务获取移动终端的位置信息。通过采用上述技术方案,可以充分利用移动终端的NLP所绑定的多种网络定位服务,实现移动终端中多类LBS应用均可以通过网络定位服务的方式获取位置信息,能够更大程度节省移动终端和定位服务器的资源,提高资源的利用率,,而且可以有效减少访问定位服务器的频率,快速获取移动终端的当前位置信息。In the method for obtaining the location information of the mobile terminal provided in the embodiment of the present invention, when receiving the positioning request initiated by the first LBS application in the mobile terminal through the SDK, obtain the pre-created multiple networks bound to the NLP of the mobile terminal Type information of the location service; according to the type information, determine whether there is a target network location service of the same type as the network location service corresponding to the SDK in various network location services; when judging that there is a target network location service, obtain mobile The location information of the terminal. By adopting the above technical solutions, various network location services bound by the NLP of the mobile terminal can be fully utilized, so that various types of LBS applications in the mobile terminal can obtain location information through the network location service, which can save the mobile terminal to a greater extent. and the resources of the positioning server, improve the utilization rate of the resources, and can effectively reduce the frequency of accessing the positioning server, and quickly obtain the current position information of the mobile terminal.

图5为本发明实施例提供的移动终端的位置信息获取装置的结构框图,该装置可由软件和/或硬件实现,一般集成在移动终端中,可通过执行移动终端的位置信息获取方法来获取移动终端的位置信息。如图5所示,该装置包括:类型信息获取模块501、网络定位服务判断模块502和位置信息获取模块503。5 is a structural block diagram of an apparatus for obtaining location information of a mobile terminal according to an embodiment of the present invention. The apparatus may be implemented by software and/or hardware, and is generally integrated in a mobile terminal. The mobile terminal may be acquired by executing a method for obtaining location information of a mobile terminal. The location information of the terminal. As shown in FIG. 5 , the apparatus includes: a type information acquisition module 501 , a network location service judgment module 502 and a location information acquisition module 503 .

其中,类型信息获取模块501,用于当接收到移动终端中的第一LBS应用通过SDK发起的定位请求时,获取预先创建的与所述移动终端的NLP所绑定的多种网络定位服务的类型信息;网络定位服务判断模块502,用于根据所述类型信息判断所述多种网络定位服务中是否存在与所述SDK对应的网络定位服务类型相同的目标网络定位服务;位置信息获取模块503,用于在判断存在所述目标网络定位服务时,通过调用所述目标网络定位服务获取所述移动终端的位置信息。Wherein, the type information obtaining module 501 is configured to obtain the pre-created information of multiple network positioning services bound to the NLP of the mobile terminal when receiving the positioning request initiated by the first LBS application in the mobile terminal through the SDK. type information; a network location service determination module 502, configured to determine whether there is a target network location service of the same type as the network location service corresponding to the SDK in the multiple network location services according to the type information; a location information acquisition module 503 is used to obtain the location information of the mobile terminal by invoking the target network location service when it is determined that the target network location service exists.

本发明实施例中提供的移动终端的位置信息获取装置,通过调用目标网络定位服务获取移动终端的位置信息,可以充分利用移动终端的NLP所绑定的多种网络定位服务,实现移动终端中多类LBS应用均可以通过网络定位服务的方式获取位置信息,能够更大程度节省移动终端和定位服务器的资源,提高资源的利用率,而且可以快速获取移动终端的位置信息。The device for obtaining the location information of the mobile terminal provided in the embodiment of the present invention acquires the location information of the mobile terminal by invoking the target network location service. All LBS-like applications can obtain location information through network location services, which can save resources of mobile terminals and location servers to a greater extent, improve resource utilization, and can quickly obtain location information of mobile terminals.

在上述实施例的基础上,还包括:On the basis of the above embodiment, it also includes:

网络定位服务创建模块,用于在接收到移动终端中的第一LBS应用通过SDK发起的定位请求之前,为所述移动终端创建多种网络定位服务,并使所述多种网络定位服务保持运行状态;A network location service creation module, used to create multiple network location services for the mobile terminal before receiving the location request initiated by the first LBS application in the mobile terminal through the SDK, and keep the multiple network location services running state;

其中,所述多种网络定位服务分别对应的类型组成的集合中,包含所述移动终端中各LBS应用的SDK所对应的网络定位服务类型。Wherein, the set composed of the types corresponding to the various network location services respectively includes the network location service types corresponding to the SDKs of the LBS applications in the mobile terminal.

在上述实施例的基础上,还包括:On the basis of the above embodiment, it also includes:

网络定位服务调用模块,用于在接收到所述移动终端中的第二LBS应用通过所述NLP发起的定位请求时,调用与所述NLP所绑定的多种网络定位服务分别获取所述移动终端的位置信息,并将最先获取到的位置信息提供给所述第二LBS应用。A network location service invocation module, configured to call a variety of network location services bound to the NLP to obtain the mobile location information of the terminal, and provide the first acquired location information to the second LBS application.

在上述实施例的基础上,还包括:On the basis of the above embodiment, it also includes:

位置信息保存模块,用于每种网络定位服务分别将自身获取到所述移动终端的位置信息进行保存;a location information storage module, used for each network location service to store the location information acquired by itself of the mobile terminal;

所述位置信息获取模块,包括:The location information acquisition module includes:

位置信息判断单元,用于判断所述目标网络定位服务是否保存有所述移动终端的位置信息以及保存的所述移动终端的位置信息是否有效,若是,则将判断有效的所述移动终端的位置信息提供给第一LBS应用。a location information judging unit for judging whether the target network location service has stored the location information of the mobile terminal and whether the stored location information of the mobile terminal is valid, and if so, will determine the valid location of the mobile terminal Information is provided to the first LBS application.

在上述实施例的基础上,所述位置信息判断单元,用于:On the basis of the above embodiment, the location information determination unit is used for:

当所述保存的移动终端的位置信息对应的第一时间戳与所述移动终端的当前时间戳的差值小于预设阈值时,判断保存的所述移动终端的位置信息有效。When the difference between the first timestamp corresponding to the stored location information of the mobile terminal and the current timestamp of the mobile terminal is less than a preset threshold, it is determined that the stored location information of the mobile terminal is valid.

在上述实施例的基础上,所述位置信息判断单元,用于:On the basis of the above embodiment, the location information determination unit is used for:

当获取所述保存的移动终端的位置信息使用的第一基站信息或第一WIFI热点信息与当前所述移动终端连接的第二基站信息或第二WIFI热点信息相同时,判断保存的所述移动终端的位置信息有效。When the first base station information or the first WIFI hotspot information used to obtain the stored location information of the mobile terminal is the same as the second base station information or the second WIFI hotspot information currently connected to the mobile terminal, it is determined that the stored mobile The location information of the terminal is valid.

本发明实施例提供了一种移动终端,该移动终端中可集成本发明实施例提供的移动终端的位置信息获取装置。该移动终端包括存储器,处理器及存储在存储器上并可在处理器运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:当接收到移动终端中的第一LBS应用通过SDK发起的定位请求时,获取预先创建的与所述移动终端的NLP所绑定的多种网络定位服务的类型信息;根据所述类型信息判断所述多种网络定位服务中是否存在与所述SDK对应的网络定位服务类型相同的目标网络定位服务;在判断存在所述目标网络定位服务时,通过调用所述目标网络定位服务获取所述移动终端的位置信息。An embodiment of the present invention provides a mobile terminal, in which the apparatus for acquiring location information of the mobile terminal provided by the embodiment of the present invention can be integrated. The mobile terminal includes a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implements the following steps when executing the computer program: when the first LBS application in the mobile terminal is received, the SDK is used When a positioning request is initiated, obtain pre-created type information of multiple network positioning services bound to the NLP of the mobile terminal; according to the type information, determine whether there is a relationship with the SDK in the multiple network positioning services The corresponding target network location service of the same type of network location service; when it is determined that the target network location service exists, the location information of the mobile terminal is obtained by invoking the target network location service.

图6为本发明实施例提供的一种移动终端的结构示意图。如图6所示,该移动终端可以包括:壳体(图中未示出)、存储器601、中央处理器(Central Processing Unit,CPU)602(又称处理器,以下简称CPU)、电路板(图中未示出)和电源电路(图中未示出)。所述电路板安置在所述壳体围成的空间内部;所述CPU602和所述存储器601设置在所述电路板上;所述电源电路,用于为所述移动终端的各个电路或器件供电;所述存储器601,用于存储可执行程序代码;所述CPU602通过读取所述存储器601中存储的可执行程序代码来运行与所述可执行程序代码对应的程序。FIG. 6 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention. As shown in FIG. 6 , the mobile terminal may include: a casing (not shown in the figure), a memory 601 , a central processing unit (Central Processing Unit, CPU) 602 (also known as a processor, hereinafter referred to as CPU), a circuit board ( not shown in the figure) and power supply circuit (not shown in the figure). The circuit board is arranged inside the space enclosed by the casing; the CPU 602 and the memory 601 are arranged on the circuit board; the power circuit is used to supply power to each circuit or device of the mobile terminal ; the memory 601 is used for storing executable program codes; the CPU 602 runs a program corresponding to the executable program codes by reading the executable program codes stored in the memory 601 .

所述移动终端还包括:外设接口603、RF(Radio Frequency,射频)电路605、音频电路606、扬声器611、电源管理芯片608、输入/输出(I/O)子系统605、触摸屏612、其他输入/控制设备610以及外部端口604,这些部件通过一个或多个通信总线或信号线607来通信。The mobile terminal further includes: a peripheral interface 603, an RF (Radio Frequency, radio frequency) circuit 605, an audio circuit 606, a speaker 611, a power management chip 608, an input/output (I/O) subsystem 605, a touch screen 612, and others Input/control devices 610 and external ports 604, these components communicate through one or more communication buses or signal lines 607.

应该理解的是,图示移动终端600仅仅是移动终端的一个范例,并且移动终端600可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。It should be understood that the illustrated mobile terminal 600 is only an example of a mobile terminal, and that the mobile terminal 600 may have more or fewer components than those shown in the figure, two or more components may be combined, Or can have different component configurations. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.

下面就本实施例提供的用于获取移动终端位置信息的移动终端进行详细的描述,该移动终端以手机为例。The following describes the mobile terminal provided in this embodiment for acquiring the location information of the mobile terminal in detail. The mobile terminal is a mobile phone as an example.

存储器601,所述存储器601可以被CPU602、外设接口603等访问,所述存储器601可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件、闪存器件、或其他易失性固态存储器件。存储器601可以包括EMMC等内置存储卡。Memory 601, which can be accessed by CPU 602, peripheral interface 603, etc., said memory 601 can include high-speed random access memory, and can also include non-volatile memory, such as one or more disk storage devices, flash memory devices , or other volatile solid-state storage devices. The memory 601 may include a built-in memory card such as EMMC.

外设接口603,所述外设接口603可以将设备的输入和输出外设连接到CPU602和存储器601。A peripheral interface 603 that can connect the input and output peripherals of the device to the CPU 602 and the memory 601 .

I/O子系统609,所述I/O子系统609可以将设备上的输入输出外设,例如触摸屏612和其他输入/控制设备610,连接到外设接口603。I/O子系统609可以包括显示控制器6091和用于控制其他输入/控制设备610的一个或多个输入控制器6092。其中,一个或多个输入控制器6092从其他输入/控制设备610接收电信号或者向其他输入/控制设备610发送电信号,其他输入/控制设备610可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮。值得说明的是,输入控制器6092可以与以下任一个连接:键盘、红外端口、USB接口以及诸如鼠标的指示设备。I/O subsystem 609 , which can connect input and output peripherals on the device, such as touch screen 612 and other input/control devices 610 , to peripherals interface 603 . The I/O subsystem 609 may include a display controller 6091 and one or more input controllers 6092 for controlling other input/control devices 610 . Wherein, one or more input controllers 6092 receive electrical signals from or send electrical signals to other input/control devices 610, which may include physical buttons (push buttons, rocker buttons, etc. ), dial pad, slide switch, joystick, click wheel. Notably, the input controller 6092 can be connected to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.

触摸屏612,所述触摸屏612是用户终端与用户之间的输入接口和输出接口,将可视输出显示给用户,可视输出可以包括图形、文本、图标、视频等。The touch screen 612, which is an input interface and an output interface between the user terminal and the user, displays visual output to the user, and the visual output may include graphics, text, icons, videos, and the like.

I/O子系统609中的显示控制器6091从触摸屏612接收电信号或者向触摸屏612发送电信号。触摸屏612检测触摸屏上的接触,显示控制器6091将检测到的接触转换为与显示在触摸屏612上的用户界面对象的交互,即实现人机交互,显示在触摸屏612上的用户界面对象可以是运行游戏的图标、联网到相应网络的图标等。值得说明的是,设备还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。Display controller 6091 in I/O subsystem 609 receives electrical signals from touch screen 612 or sends electrical signals to touch screen 612 . The touch screen 612 detects the contact on the touch screen, and the display controller 6091 converts the detected contact into interaction with the user interface object displayed on the touch screen 612, that is, to realize human-computer interaction, and the user interface object displayed on the touch screen 612 can be run. Icons for games, icons for connecting to the corresponding network, etc. It is worth noting that the device may also include a light mouse, which is a touch-sensitive surface that does not display visual output, or an extension of the touch-sensitive surface formed by a touch screen.

RF电路605,主要用于建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息、电子邮件等。具体地,RF电路605接收并发送RF信号,RF信号也称为电磁信号,RF电路605将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路605可以包括用于执行这些功能的已知电路,其包括但不限于天线系统、RF收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、CODEC(COder-DECoder,编译码器)芯片组、用户标识模块(Subscriber Identity Module,SIM)等等。The RF circuit 605 is mainly used to establish the communication between the mobile phone and the wireless network (ie, the network side), and realize the data reception and transmission between the mobile phone and the wireless network. Such as sending and receiving text messages, e-mails, etc. Specifically, the RF circuit 605 receives and transmits RF signals, also known as electromagnetic signals, the RF circuit 605 converts electrical signals into electromagnetic signals or converts electromagnetic signals into electrical signals, and communicates with communication networks and other devices through the electromagnetic signals to communicate. RF circuitry 605 may include known circuitry for performing these functions including, but not limited to, antenna systems, RF transceivers, one or more amplifiers, tuners, one or more oscillators, digital signal processors, CODECs ( COder-DECoder, codec) chip set, subscriber identity module (Subscriber Identity Module, SIM) and so on.

音频电路606,主要用于从外设接口603接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器611。The audio circuit 606 is mainly used for receiving audio data from the peripheral interface 603 , converting the audio data into an electrical signal, and sending the electrical signal to the speaker 611 .

扬声器611,用于将手机通过RF电路605从无线网络接收的语音信号,还原为声音并向用户播放该声音。The speaker 611 is used to restore the voice signal received by the mobile phone from the wireless network through the RF circuit 605 to sound and play the sound to the user.

电源管理芯片608,用于为CPU602、I/O子系统及外设接口所连接的硬件进行供电及电源管理。The power management chip 608 is used for power supply and power management for the hardware connected to the CPU 602, the I/O subsystem and the peripheral interface.

上述实施例中提供的移动终端的位置信息获取装置及移动终端可执行本发明任意实施例所提供的移动终端的位置信息获取方法,具备执行该方法相应的功能模块和有益效果。未在上述实施例中详尽描述的技术细节,可参见本发明任意实施例所提供的移动终端的位置信息获取方法。The device for obtaining location information of a mobile terminal and the mobile terminal provided in the above embodiments can execute the method for obtaining location information of a mobile terminal provided by any embodiment of the present invention, and have corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in the foregoing embodiments, reference may be made to the method for obtaining location information of a mobile terminal provided by any embodiment of the present invention.

注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention. The scope is determined by the scope of the appended claims.

Claims (9)

CN201710240307.2A2017-04-132017-04-13Position information acquisition method and device of mobile terminal and mobile terminalExpired - Fee RelatedCN107040892B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201710240307.2ACN107040892B (en)2017-04-132017-04-13Position information acquisition method and device of mobile terminal and mobile terminal

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201710240307.2ACN107040892B (en)2017-04-132017-04-13Position information acquisition method and device of mobile terminal and mobile terminal

Publications (2)

Publication NumberPublication Date
CN107040892A CN107040892A (en)2017-08-11
CN107040892Btrue CN107040892B (en)2019-08-30

Family

ID=59536430

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201710240307.2AExpired - Fee RelatedCN107040892B (en)2017-04-132017-04-13Position information acquisition method and device of mobile terminal and mobile terminal

Country Status (1)

CountryLink
CN (1)CN107040892B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109246605A (en)*2018-10-122019-01-18连尚(新昌)网络科技有限公司Using method, electronic equipment and the medium for obtaining geographical location information in terminal
CN111918386B (en)*2020-07-032023-09-29Oppo广东移动通信有限公司Positioning method, positioning device, storage medium and electronic equipment
CN112073462B (en)*2020-08-052023-10-27长沙市到家悠享网络科技有限公司Positioning method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102215449A (en)*2010-04-022011-10-12中兴通讯股份有限公司Secure user plane location (SUPL)-enabled terminal (SET) positioning method, device and system
CN105704662A (en)*2016-01-132016-06-22广东欧珀移动通信有限公司 A method and device for adaptive network positioning

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
KR102035771B1 (en)*2011-05-202019-10-24삼성전자주식회사Apparatus and method for compensating position information in portable terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102215449A (en)*2010-04-022011-10-12中兴通讯股份有限公司Secure user plane location (SUPL)-enabled terminal (SET) positioning method, device and system
CN105704662A (en)*2016-01-132016-06-22广东欧珀移动通信有限公司 A method and device for adaptive network positioning

Also Published As

Publication numberPublication date
CN107040892A (en)2017-08-11

Similar Documents

PublicationPublication DateTitle
CN106851583A (en) Method and device for acquiring location information of mobile terminal and mobile terminal
EP3570163B1 (en)Method for launching application, storage medium, and terminal
US20200036217A1 (en)Device for performing wireless charging and method thereof
CN107835033B (en)Antenna tuning switch control method and device, terminal equipment and storage medium
US10455192B2 (en)Method and apparatus for transmitting video during voice call
CN109982423A (en)Antenna power method of adjustment, device, storage medium and intelligent terminal
CN107861773A (en) Management and control method, device, storage medium and mobile terminal for association activation
CN106484547B (en) A management method, device and terminal for multi-opening applications
CN108111974A (en)Control method and device of positioning module, storage medium and terminal
CN104978176A (en)Application program interface calling method and device
CN108829320A (en)Interaction method, device, storage medium, mobile terminal and interaction system
CN106776385A (en) A kind of transmission method, device and terminal of log log information
CN106502808B (en)Method, device and terminal for copying files
CN107040892B (en)Position information acquisition method and device of mobile terminal and mobile terminal
CN107831886B (en)Control method and device for associated starting application, storage medium and intelligent terminal
CN109495573A (en)Data transmission method, device, storage medium and terminal
CN106776259B (en)Mobile terminal frame rate detection method and device and mobile terminal
CN106294027A (en) A data backup method, device, operator server and mobile terminal
CN111656347B (en)Project display method and terminal
CN116491110A (en)Electronic device for performing edge computing service and operating method of electronic device
CN111314900B (en)Wireless connection method, wireless connection device and mobile terminal
CN117440376A (en)Data transmission method, device, medium and equipment
CN106953852B (en) Registration method, device and terminal device for broadcast receiver
CN108072885A (en)Collocation method, device, storage medium and the terminal of locating module
CN106302782A (en)A kind of method for network access control and mobile terminal

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
CB02Change of applicant information

Address after:Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after:GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before:Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before:GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CB02Change of applicant information
GR01Patent grant
GR01Patent grant
CF01Termination of patent right due to non-payment of annual fee

Granted publication date:20190830

CF01Termination of patent right due to non-payment of annual fee

[8]ページ先頭

©2009-2025 Movatter.jp