技术领域technical field
本发明涉及网络技术领域,特别是涉及一种网络定位方法、装置及计算机设备。The present invention relates to the field of network technologies, and in particular, to a network positioning method, device and computer equipment.
背景技术Background technique
LBS(Location Based Service,基于位置服务)指的是通过电信或移动等运营商的无线电通讯网络,例如GSM(Global System for Mobile Communication,全球移动通信系统)网络、CDMA(Code Division Multiple Access,码多分址)网络等,或外部定位方式,例如GPS(Global Positioning System,全球定位系统)等,获取移动终端用户的位置信息,在GIS(Geographic Information System,地理信息系统)平台的支持下,为用户提供相应服务的一种增值业务。LBS (Location Based Service) refers to the radio communication network through telecom or mobile operators, such as GSM (Global System for Mobile Communication, Global System for Mobile Communication) network, CDMA (Code Division Multiple Access, Code Division Multiple Access) address) network, etc., or external positioning methods, such as GPS (Global Positioning System, global positioning system), etc., to obtain the location information of mobile terminal users, under the support of GIS (Geographic Information System, geographic information system) platform, provide users with A value-added service for the corresponding service.
各大网络定位提供商为了推广自身的LBS服务,通常会公布定位的SDK(SoftwareDevelopment Kit,软件开发工具包),传统的LBS应用大多都集成了由第三方网络定位提供商提供的SDK。由于SDK的独立性,移动终端上的每一个LBS应用在每次进行网络定位时,都需要扫描获取无线网络信息,才能实现网络定位。当被使用的LBS应用较多时,各LBS应用集成的SDK会频繁地主动发起无线网络信息扫描,导致移动终端上的系统功耗增大,并引起无线上网延迟等问题。In order to promote their own LBS services, major network positioning providers usually publish positioning SDKs (Software Development Kit, software development kits). Most traditional LBS applications integrate SDKs provided by third-party network positioning providers. Due to the independence of the SDK, each LBS application on the mobile terminal needs to scan to obtain wireless network information every time it performs network positioning, in order to achieve network positioning. When many LBS applications are used, the SDK integrated with each LBS application will frequently initiate wireless network information scanning actively, which increases the system power consumption on the mobile terminal and causes problems such as wireless Internet access delay.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供一种网络定位方法、装置及计算机设备,可以有效降低网络定位时的系统功耗,并减少无线上网延迟。Embodiments of the present invention provide a network positioning method, device, and computer equipment, which can effectively reduce system power consumption during network positioning and reduce wireless Internet access delay.
一种网络定位方法,包括:A network positioning method, comprising:
接收网络定位请求;Receive network positioning requests;
根据所述网络定位请求从共享文件中读取最新写入的无线网络信息,所述共享文件用于存储移动终端连接的无线网络信息;Read the newly written wireless network information from a shared file according to the network positioning request, where the shared file is used to store the wireless network information connected by the mobile terminal;
根据所述无线网络信息确定对应的位置信息。Corresponding location information is determined according to the wireless network information.
一种网络定位装置,包括:A network positioning device, comprising:
接收模块,用于接收网络定位请求;a receiving module for receiving a network positioning request;
读取模块,用于根据所述网络定位请求从共享文件中读取最新写入的无线网络信息,所述共享文件用于存储移动终端连接的无线网络信息;a reading module, configured to read the newly written wireless network information from a shared file according to the network positioning request, and the shared file is used to store the wireless network information connected by the mobile terminal;
确定模块,用于根据所述无线网络信息确定对应的位置信息。A determining module, configured to determine corresponding location information according to the wireless network information.
一种计算机设备,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上所述的网络定位方法。A computer device includes a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implements the network positioning method as described above when the processor executes the program.
上述网络定位方法、装置及计算机设备,接收网络定位请求,根据网络定位请求从共享文件中读取最新写入的无线网络信息,根据无线网络信息确定对应的位置信息,无需每次进行网络定位时都主动发起无线网络信息扫描,可降低扫描无线网络信息频率,从而有效降低网络定位时的系统功耗,并减少无线上网延迟。The above-mentioned network positioning method, device and computer equipment receive a network positioning request, read the newly written wireless network information from a shared file according to the network positioning request, and determine the corresponding position information according to the wireless network information, without needing to perform network positioning every time Both actively initiate wireless network information scanning, which can reduce the frequency of scanning wireless network information, thereby effectively reducing system power consumption during network positioning and reducing wireless Internet access delays.
附图说明Description of drawings
图1为一个实施例中终端的框图;1 is a block diagram of a terminal in one embodiment;
图2为一个实施例中网络定位方法的流程示意图;2 is a schematic flowchart of a network positioning method in one embodiment;
图3为一个实施例中对无线网络信息进行监听的流程示意图;3 is a schematic flowchart of monitoring wireless network information in one embodiment;
图4为一个实施例中从共享文件中读取无线网络信息的流程示意图;4 is a schematic flowchart of reading wireless network information from a shared file in one embodiment;
图5为一个实施例中根据无线网络信息确定对应的位置信息的流程示意图;5 is a schematic flowchart of determining corresponding location information according to wireless network information in one embodiment;
图6为另一个实施例中根据无线网络信息确定对应的位置信息的流程示意图;6 is a schematic flowchart of determining corresponding location information according to wireless network information in another embodiment;
图7为一个实施例中网络定位装置的框图;7 is a block diagram of a network positioning device in one embodiment;
图8为另一个实施例中网络定位装置的框图;8 is a block diagram of a network positioning apparatus in another embodiment;
图9为一个实施例中读取模块的框图;9 is a block diagram of a reading module in one embodiment;
图10为一个实施例中确定模块的框图;Figure 10 is a block diagram of a determination module in one embodiment;
图11为另一个实施例中确定模块的框图;11 is a block diagram of a determination module in another embodiment;
图12为一个实施例中计算机设备的框图。Figure 12 is a block diagram of a computer device in one embodiment.
具体实施方式Detailed ways
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and 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.
可以理解,本发明所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本发明的范围的情况下,可以将第一客户端称为第二客户端,且类似地,可将第二客户端称为第一客户端。第一客户端和第二客户端两者都是客户端,但其不是同一客户端。It will be understood that the terms "first", "second", etc., as used herein, may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, a first client could be referred to as a second client, and similarly, a second client could be referred to as a first client, without departing from the scope of this disclosure. Both the first client and the second client are clients, but they are not the same client.
图1为一个实施例中终端的内部结构示意图。如图1所示,该终端包括通过系统总线连接的处理器、非易失性存储介质、内存储器和网络接口、显示屏和输入装置。其中,终端的非易失性存储介质存储有操作系统。该处理器用于提供计算和控制能力,支撑整个终端的运行。终端中的内存储器为非易失性存储介质中的计算机可读指令的运行提供环境。网络接口用于与服务器进行网络通信,如向服务器发送无线网络信息、接收服务器返回的位置信息等。终端的显示屏可以是液晶显示屏或者电子墨水显示屏等,输入装置可以是显示屏上覆盖的触摸层,也可以是终端外壳上设置的按键、轨迹球或触控板,也可以是外接的键盘、触控板或鼠标等。该终端可以是手机、平板电脑或者个人数字助理或穿戴式设备等。本领域技术人员可以理解,图1中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的终端的限定,具体的终端可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。FIG. 1 is a schematic diagram of an internal structure of a terminal in an embodiment. As shown in FIG. 1 , the terminal includes a processor, a non-volatile storage medium, an internal memory and a network interface, a display screen and an input device connected through a system bus. The operating system is stored in the non-volatile storage medium of the terminal. The processor is used to provide computing and control capabilities to support the operation of the entire terminal. Internal memory in the terminal provides an environment for the execution of computer readable instructions in the non-volatile storage medium. The network interface is used for network communication with the server, such as sending wireless network information to the server, receiving location information returned by the server, and so on. The display screen of the terminal can be a liquid crystal display screen or an electronic ink display screen, etc., and the input device can be a touch layer covered on the display screen, a button, a trackball or a touchpad set on the terminal shell, or an external device. Keyboard, trackpad or mouse, etc. The terminal may be a mobile phone, a tablet computer, a personal digital assistant or a wearable device, or the like. Those skilled in the art can understand that the structure shown in FIG. 1 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the terminal to which the solution of the present application is applied. More or fewer components are shown in the figures, either in combination or with different arrangements of components.
如图2所示,在一个实施例中,提供一种网络定位方法,包括以下步骤:As shown in FIG. 2, in one embodiment, a network positioning method is provided, including the following steps:
步骤S210,接收网络定位请求。Step S210, receiving a network positioning request.
在本发明实施例中,当用户在移动终端上使用LBS应用上的网络定位功能时,LBS应用可向移动终端的操作系统发送网络定位请求,其中,移动终端可包括手机、个人数字助理、笔记本电脑及台式计算机等,LBS应用可包括社交型LBS应用、生活服务型LBS应用及游戏型LBS应用等。每个LBS应用中可集成有由第三方网络定位提供商提供的SDK,例如谷歌、高德及百度等提供的SDK。In the embodiment of the present invention, when the user uses the network positioning function on the LBS application on the mobile terminal, the LBS application may send a network positioning request to the operating system of the mobile terminal, where the mobile terminal may include a mobile phone, a personal digital assistant, a notebook Computers and desktop computers, etc., LBS applications can include social LBS applications, life service LBS applications and game LBS applications. Each LBS application can be integrated with SDKs provided by third-party network positioning providers, such as those provided by Google, AutoNavi, and Baidu.
步骤S220,根据网络定位请求从共享文件中读取最新写入的无线网络信息。Step S220: Read the newly written wireless network information from the shared file according to the network positioning request.
移动终端的操作系统接收由LBS应用发送的网络定位请求,可根据网络定位请求从共享文件中读取最新写入的无线网络信息,其中,共享文件用于存储移动终端连接的无线网络信息,可将移动终端每一次连接的无线网络信息写入共享文件中。无线网络信息可包括WiFi(Wireless Fidelity,无线保真)的热点信息和/或移动通讯中的基站信息等,其中,WiFi热点指的是WiFi的接入点(Access Point,AP),可主要包括路由交换接入一体设备和纯接入点设备等,路由交换接入一体设备可执行接入和路由功能,纯接入设备只负责无线接入,移动终端可通过接入WiFi热点使用WiFi网络。WiFi的热点信息可包括WiFi热点的BSSID(Basic Service Set Identifier,基本服务集标识)、SSID(Service SetIdentifier,服务集标识)及信号强度等,其中,BSSID用于标识一个基本服务集,一般可为WiFi热点的MAC(Media Access Control,介质访问控制)地址,SSID用于标识WiFi热点,一般可为WiFi热点的名称。基站信息可包括基站的CID(Cell Identity,基站编号)、LAC(Location Area Code,位置区域码)及信号强度等。The operating system of the mobile terminal receives the network location request sent by the LBS application, and can read the newly written wireless network information from the shared file according to the network location request. Write the wireless network information of each connection of the mobile terminal into the shared file. The wireless network information may include WiFi (Wireless Fidelity, wireless fidelity) hotspot information and/or base station information in mobile communication, etc., wherein the WiFi hotspot refers to a WiFi access point (Access Point, AP), which may mainly include Routing, switching and accessing integrated devices and pure access point devices, etc. Routing, switching and accessing integrated devices can perform access and routing functions. Pure access devices are only responsible for wireless access. Mobile terminals can use WiFi networks by accessing WiFi hotspots. The WiFi hotspot information may include the BSSID (Basic Service Set Identifier, basic service set identifier), SSID (Service SetIdentifier, service set identifier) and signal strength of the WiFi hotspot, where the BSSID is used to identify a basic service set, which generally can be The MAC (Media Access Control, Media Access Control) address of the WiFi hotspot, and the SSID is used to identify the WiFi hotspot, which can generally be the name of the WiFi hotspot. The base station information may include CID (Cell Identity, base station number), LAC (Location Area Code, location area code) of the base station, signal strength, and the like.
当将移动终端每一次连接的无线网络信息写入共享文件时,可同时在共享文件中记录写入时间,操作系统可按照写入时间的先后,从共享文件中选取写入时间最后的无线网络信息,即为最新写入的无线网络信息进行读取。When the wireless network information of each connection of the mobile terminal is written into the shared file, the writing time can be recorded in the shared file at the same time, and the operating system can select the wireless network with the last writing time from the shared file according to the order of writing time. information, that is, read the newly written wireless network information.
在其它的实施例中,可预先规定共享文件中无线网络信息的写入位置,例如,每次都将无线网络信息写入共享文件的最末端,其中,写入共享文件的最末端指的是在共享文件原内容的末尾写入新的无线网络信息,不同次写入的无线网络信息中间可用空格或空行隔开。当移动终端的操作系统接收到网络定位请求,可从共享文件中选取位于文件内容最后面的无线网络信息,即为最新写入的无线网络信息进行读取。In other embodiments, the writing position of the wireless network information in the shared file may be pre-specified, for example, the wireless network information is written to the very end of the shared file each time, wherein the writing to the very end of the shared file refers to Write new wireless network information at the end of the original content of the shared file. The wireless network information written in different times can be separated by spaces or blank lines. When the operating system of the mobile terminal receives the network location request, it can select the wireless network information located at the end of the file content from the shared file, that is, read the newly written wireless network information.
步骤S230,根据无线网络信息确定对应的位置信息。Step S230: Determine the corresponding location information according to the wireless network information.
移动终端的操作系统从共享文件中读取无线网络信息后,可根据无线网络信息获取对应的位置信息,其中,位置信息可包含经纬度信息等,经纬度是经度与纬度组成的一个坐标系统,称为地理坐标系统,它是一种利用三度空间的球面来定义地球上的空间的球面坐标系统,能够标示地球上的任何一个位置。位置信息可以是移动终端上预先存储的与无线网络信息对应的位置信息,也可以是由定位服务器根据无线网络信息实时进行计算得到。After the operating system of the mobile terminal reads the wireless network information from the shared file, it can obtain the corresponding location information according to the wireless network information, where the location information can include longitude and latitude information, etc. The geographic coordinate system is a spherical coordinate system that uses the spherical surface of the three-dimensional space to define the space on the earth, and can mark any position on the earth. The location information may be the location information corresponding to the wireless network information pre-stored on the mobile terminal, or may be calculated by the positioning server in real time according to the wireless network information.
移动终端的操作系统获取与无线网络信息对应的位置信息后,可将位置信息返回给发送网络定位请求的LBS应用,LBS应用可根据位置信息进行展示,例如,在地图上展示与位置信息对应的点,或是展示与该位置信息相关的美食、银行、超市等生活服务等,但不限于此,具体的展示内容可根据LBS应用提供的具体服务功能确定。After the operating system of the mobile terminal obtains the location information corresponding to the wireless network information, it can return the location information to the LBS application that sends the network positioning request, and the LBS application can display it according to the location information. point, or display life services such as food, banks, supermarkets, etc. related to the location information, but not limited to this, and the specific display content can be determined according to the specific service functions provided by the LBS application.
上述网络定位方法,接收网络定位请求,根据网络定位请求从共享文件中读取最新写入的无线网络信息,根据无线网络信息确定对应的位置信息,通过共享文件实现各LBS应用之间无线网络信息的共享,无需每次进行网络定位时都主动发起无线网络信息扫描,可降低扫描无线网络信息频率,从而有效降低网络定位时的系统功耗,并减少无线上网延迟。The above network positioning method receives a network positioning request, reads newly written wireless network information from a shared file according to the network positioning request, determines corresponding location information according to the wireless network information, and implements wireless network information between LBS applications through the shared file. There is no need to actively initiate wireless network information scanning every time network positioning is performed, which can reduce the frequency of scanning wireless network information, thereby effectively reducing system power consumption during network positioning and reducing wireless Internet access delays.
如图3所示,在一个实施例中,在步骤S210接收网络定位请求之前,还包括以下步骤:As shown in FIG. 3, in one embodiment, before step S210 receives the network positioning request, the following steps are further included:
步骤S302,对无线网络信息进行监听。Step S302, monitoring wireless network information.
移动终端中可预先建立用于监听网络状态的进程,对无线网络信息进行监听,当移动终端的操作系统中的无线网络信息发生了变化,例如,移动终端连接的WiFi热点发生变化,或移动终端连接的基站发生变化等,操作系统可向监听无线网络信息的进程广播无线网络变化消息。A process for monitoring network status can be pre-established in the mobile terminal to monitor wireless network information. When the wireless network information in the operating system of the mobile terminal changes, for example, the WiFi hotspot connected to the mobile terminal changes, or the mobile terminal changes When the connected base station changes, etc., the operating system can broadcast a wireless network change message to the process monitoring wireless network information.
步骤S304,当检测到无线网络信息发生变化时,将变化后的无线网络信息写入共享文件。Step S304, when it is detected that the wireless network information changes, write the changed wireless network information into the shared file.
当移动终端中用于监听无线网络信息的进程接收到无线网络变化消息,也即,当检测到无线网络信息发生变化时,该进程解析接收到的无线网络变化消息,可得到变化后的WiFi热点信息或基站信息等无线网络信息,并将变化后的无线网络信息写入预先创建的共享文件中,其中,共享文件除了存储移动终端连接的无线网络信息外,也可存储其它共享数据,移动终端上的不同应用可通过共享文件实现数据共享。When the process for monitoring wireless network information in the mobile terminal receives the wireless network change message, that is, when it is detected that the wireless network information changes, the process parses the received wireless network change message, and can obtain the changed WiFi hotspot information or base station information and other wireless network information, and write the changed wireless network information into a pre-created shared file, where the shared file can store other shared data in addition to the wireless network information connected to the mobile terminal. Different applications on the Internet can share data by sharing files.
在本实施例中,可对无线网络信息进行监听,并将变化后的无线网络信息写入共享文件,通过共享文件实现各LBS应用之间无线网络信息的共享,无需每次进行网络定位时都主动发起无线网络信息扫描,可降低扫描无线网络信息频率,从而有效降低网络定位时的系统功耗,并减少无线上网延迟。In this embodiment, wireless network information can be monitored, and the changed wireless network information can be written into a shared file, and wireless network information sharing among LBS applications can be realized through the shared file, without the need for every time network positioning is performed. Actively initiates wireless network information scanning, which can reduce the frequency of scanning wireless network information, thereby effectively reducing system power consumption during network positioning and reducing wireless Internet access delays.
如图4所示,在一个实施例中,步骤S220根据网络定位请求从共享文件中读取最新写入的无线网络信息,包括以下步骤:As shown in FIG. 4 , in one embodiment, step S220 reads the newly written wireless network information from the shared file according to the network positioning request, including the following steps:
步骤S402,判断共享文件中是否包含无线网络信息,若是,则执行步骤S404,若否,则执行步骤S406。Step S402, it is judged whether the shared file contains wireless network information, if yes, go to step S404, if not, go to step S406.
在本发明实施例中,LBS应用向移动终端的操作系统发送网络定位请求,当操作系统接收到网络定位请求时,可从共享文件中读取最新写入的无线网络信息。在一个实施例中,可每隔预设时间对共享文件中写入的数据进行清空,例如,每隔12小时、24小时等,可减少操作系统从共享文件中读取数据的时间,提高网络定位的速度。当操作系统要从共享文件中读取最新写入的无线网络信息时,可先判断共享文件中是否包含无线网络信息,若共享文件中存储有无线网络信息,则操作系统可从共享文件中读取最新写入的无线网络信息,并根据读取的无线网络信息确定对应的位置信息。In this embodiment of the present invention, the LBS application sends a network positioning request to the operating system of the mobile terminal, and when the operating system receives the network positioning request, the newly written wireless network information can be read from the shared file. In one embodiment, the data written in the shared file can be cleared every preset time, for example, every 12 hours, 24 hours, etc., which can reduce the time for the operating system to read data from the shared file, and improve the network efficiency. positioning speed. When the operating system wants to read the newly written wireless network information from the shared file, it can first determine whether the shared file contains wireless network information. If the wireless network information is stored in the shared file, the operating system can read the wireless network information from the shared file. Get the latest written wireless network information, and determine the corresponding location information according to the read wireless network information.
步骤S404,从共享文件中读取最新写入的无线网络信息。Step S404, read the newly written wireless network information from the shared file.
步骤S406,扫描在移动终端预设范围内的无线网络设备,并获取无线网络设备的无线网络信息。Step S406, scanning for wireless network devices within a preset range of the mobile terminal, and acquiring wireless network information of the wireless network devices.
若共享文件中不包含无线网络信息,也即共享文件中的无线网络信息为空,则移动终端的操作系统可扫描在移动终端预设范围内的无线网络设备,其中,预设范围可根据移动终端实际所处区域中各无线网络设备发出的信号强度而定,若无线网络设备发出的信号强度较强,则预设范围较大,若无线网络设备发出的信号强度较弱,则预设范围较小,例如移动终端扫描300米内的无线网络设备,或扫描500米内的无线网络设备等,并不限于此。无线网络设备可以是作为WiFi热点的设备,例如路由交换接入一体设备、路由器及纯接入设备等,也可以是基站等。If the shared file does not contain wireless network information, that is, the wireless network information in the shared file is empty, the operating system of the mobile terminal can scan for wireless network devices within a preset range of the mobile terminal, wherein the preset range can be determined according to the mobile terminal. It depends on the signal strength of each wireless network device in the area where the terminal is actually located. If the signal strength sent by the wireless network device is strong, the preset range is larger; Smaller, for example, the mobile terminal scans for wireless network devices within 300 meters, or scans for wireless network devices within 500 meters, etc., but not limited to this. The wireless network device may be a device serving as a WiFi hotspot, such as an integrated routing switching access device, a router, a pure access device, etc., or a base station.
在一个实施例中,移动终端对预设范围内的无线网络设备进行扫描,可以采用主动扫描或被动扫描等方式。主动扫描指的是移动终端以主动的方式在每个信道上发出探测请求(Probe Request)帧,当预设范围内的无线网络设备接收到探测请求帧时,可发送探测应答(Probe Request)帧进行回应。若移动终端在某信道上接收到探测应答帧,则可进一步获取发出该探测应答帧的无线网络设备的无线网络信息。被动扫描指的是预设范围内的无线网络设备以定时广播的方式发送Beacon(信标)帧,移动终端会在各个信道中切换,接收Beacon帧并进行记录,从而进一步获取发送Beacon帧的无线网络设备的无线网信息。移动终端可采用被动扫描的方式对预设范围内的无线网络设备进行扫描,并获取无线网络信号,因在扫描过程中不需要传送任何信号,可以节省移动终端的功耗。In one embodiment, the mobile terminal scans wireless network devices within a preset range, and may use active scanning or passive scanning. Active scanning means that the mobile terminal actively sends a probe request (Probe Request) frame on each channel. When a wireless network device within a preset range receives a probe request frame, it can send a probe response (Probe Request) frame. respond. If the mobile terminal receives the probe response frame on a certain channel, it can further acquire the wireless network information of the wireless network device that sent the probe response frame. Passive scanning means that the wireless network devices within the preset range send Beacon (beacon) frames in a timed broadcast, and the mobile terminal will switch between each channel, receive and record Beacon frames, so as to further obtain the wireless transmission of Beacon frames. Wireless network information of the network device. The mobile terminal can scan wireless network devices within a preset range by passive scanning, and obtain wireless network signals. Since no signal needs to be transmitted during the scanning process, the power consumption of the mobile terminal can be saved.
在本实施例中,当LBS应用进行网络定位时,可直接从共享文件中读取最新写入的无线网络信息,无需每次进行网络定位时都主动发起无线网络信息扫描,可降低扫描无线网络信息频率,从而有效降低网络定位时的系统功耗,并减少无线上网延迟。In this embodiment, when the LBS application performs network positioning, the newly written wireless network information can be directly read from the shared file, and there is no need to actively initiate wireless network information scanning each time network positioning is performed, which can reduce the need for scanning wireless network information. information frequency, thereby effectively reducing the system power consumption during network positioning and reducing the delay of wireless Internet access.
如图5所示,在一个实施例中,步骤S230根据无线网络信息确定对应的位置信息,还包括:As shown in FIG. 5, in one embodiment, step S230 determines the corresponding location information according to the wireless network information, and further includes:
步骤S502,获取与最新写入的无线网络信息匹配的标志位。In step S502, a flag bit matching the newly written wireless network information is acquired.
在一个实施例中,移动终端可通过预先建立的监听进程监听无线网络信息,当无线网络信息发送变化时,监听进程可将变化后的无线网络信息写入共享文件中,并将写入的无线网络信息的标志位置为第二标志位。无线网络信息的标志位可用于标志无线网络信息是否曾被用于计算位置信息,也即,标志位可用于表示在共享文件中是否存储有与无线网络信息对应的位置信息。在本实施例中,当无线网络信息的标志位为第一标志位时,表示该无线网络信息曾被用于计算位置信息,也即共享文件中存储有与该无线网络信息对应的位置信息;当无线网络信息的标志位为第二标志位时,表示该无线网络信息不曾被用于计算位置信息,也即共享文件中没有存储与该无线网络信息对应的位置信息。第一标志位、第二标志位可根据实际需求设定不同的表示方式,例如第一标志位为false,第二标志位为true,或是第一标志位为0,第二标志位为1等,并不限于此。In one embodiment, the mobile terminal can monitor wireless network information through a pre-established monitoring process. When the wireless network information is changed, the monitoring process can write the changed wireless network information into the shared file, and write the wireless network information written into the shared file. The flag position of the network information is the second flag bit. The flag bit of the wireless network information can be used to indicate whether the wireless network information has been used to calculate the location information, that is, the flag bit can be used to indicate whether the location information corresponding to the wireless network information is stored in the shared file. In this embodiment, when the flag bit of the wireless network information is the first flag bit, it means that the wireless network information has been used to calculate the location information, that is, the shared file stores the location information corresponding to the wireless network information; When the flag bit of the wireless network information is the second flag bit, it means that the wireless network information has never been used to calculate the location information, that is, the location information corresponding to the wireless network information is not stored in the shared file. The first flag bit and the second flag bit can be set in different representations according to actual needs. For example, the first flag bit is false and the second flag bit is true, or the first flag bit is 0 and the second flag bit is 1. etc., not limited to this.
步骤S504,判断标志位为第一标志位还是第二标志位,若是第一标志位,则执行步骤S506,若是第二标志位,则执行步骤S508。Step S504, it is determined whether the flag bit is the first flag bit or the second flag bit, if it is the first flag bit, then step S506 is performed, and if it is the second flag bit, then step S508 is performed.
当共享文件中包含无线网络信息时,移动终端的操作系统可从共享文件中读取最新写入的无线网络信息,同时可获取该无线网络信息的标志位,并判断标志位为第一标志位还是第二标志位。When the shared file contains wireless network information, the operating system of the mobile terminal can read the newly written wireless network information from the shared file, obtain the flag bit of the wireless network information at the same time, and determine that the flag bit is the first flag bit or the second flag.
步骤S506,从共享文件中读取与最新写入的无线网络信息对应的位置信息,并根据位置信息进行展示。In step S506, the location information corresponding to the newly written wireless network information is read from the shared file, and displayed according to the location information.
若获取的标志位为第一标志位,则说明共享文件中存储有与最新写入的无线网络信息对应的位置信息,操作系统可直接从共享文件中读取与最新写入的无线网络信息对应的位置信息,并将该位置信息返回给发起网络定位请求的LBS应用。LBS应用可根据位置信息进行展示,例如,在地图上展示与位置信息对应的点,或是展示与该位置信息相关的美食、银行、超市等生活服务等,但不限于此,具体的展示内容可根据LBS应用提供的具体服务功能确定。If the acquired flag bit is the first flag bit, it means that the shared file stores the location information corresponding to the newly written wireless network information, and the operating system can directly read from the shared file corresponding to the newly written wireless network information and return the location information to the LBS application that initiates the network positioning request. The LBS application can be displayed according to the location information, for example, the point corresponding to the location information can be displayed on the map, or the food, bank, supermarket and other life services related to the location information can be displayed, but not limited to this, the specific display content It can be determined according to the specific service function provided by the LBS application.
步骤S508,将最新写入的无线网络信息发送至定位服务器,以使定位服务器根据无线网络信息计算对应的位置信息。Step S508: Send the newly written wireless network information to the positioning server, so that the positioning server calculates the corresponding position information according to the wireless network information.
若获取的标志位为第二标志位,则说明共享文件中没有存储与最新写入的无线网络信息对应的位置信息,移动终端可将从共享文件中读取的最新写入的无线网络信息发送至定位服务器。定位服务器可根据无线网络信息中WiFi热点的BSSID、SSID或基站的CID等信息,在数据库中查询计算与接收的无线网络信息对应的位置信息。If the acquired flag bit is the second flag bit, it means that the location information corresponding to the newly written wireless network information is not stored in the shared file, and the mobile terminal can send the newly written wireless network information read from the shared file. to the location server. The location server can query and calculate the location information corresponding to the received wireless network information in the database according to information such as the BSSID, SSID of the WiFi hotspot or the CID of the base station in the wireless network information.
步骤S510,接收定位服务器返回的位置信息。Step S510, receiving the location information returned by the location server.
步骤S512,将位置信息写入共享文件,并将标志位置为第一标志位。Step S512, write the location information into the shared file, and set the flag location as the first flag bit.
移动终端接收由定位服务器返回的与无线网络信息对应的位置信息后,可将位置信息写入共享文件中,在共享文件中建立该位置信息与无线网络信息的对应关系,并将无线网络信息的标志位置为第一标志位。After receiving the location information corresponding to the wireless network information returned by the positioning server, the mobile terminal can write the location information into the shared file, establish the correspondence between the location information and the wireless network information in the shared file, and store the wireless network information in the shared file. The flag position is the first flag bit.
步骤S514,根据位置信息进行展示。Step S514, displaying according to the location information.
移动终端的操作系统可将该位置信息返回给发送网络定位请求的LBS应用,LBS应用可根据位置信息进行展示,例如,在地图上展示与位置信息对应的点,或是展示与该位置信息相关的美食、银行、超市等生活服务等,但不限于此,具体的展示内容可根据LBS应用提供的具体服务功能确定。The operating system of the mobile terminal can return the location information to the LBS application that sends the network positioning request, and the LBS application can display it according to the location information, for example, display the point corresponding to the location information on the map, or display the location information related to the location information. Life services such as food, banks, supermarkets, etc., but not limited to this, the specific display content can be determined according to the specific service functions provided by the LBS application.
在本实施例中,当LBS应用进行网络定位时,除了可直接从共享文件中读取最新写入的无线网络信息外,也可从共享文件中读取对应的位置信息,无需每次进行网络定位时都主动发起无线网络信息扫描,也无需每次进行网络定位时都对定位服务器进行访问,可降低扫描无线网络信息及访问定位服务器的频率,在有效降低网络定位的系统功耗的同时,也可快速响应网络定位请求。In this embodiment, when the LBS application performs network positioning, in addition to directly reading the newly written wireless network information from the shared file, it can also read the corresponding location information from the shared file, without the need to perform network positioning every time. When positioning, the wireless network information scanning is actively initiated, and there is no need to access the positioning server every time network positioning is performed, which can reduce the frequency of scanning wireless network information and accessing the positioning server, while effectively reducing the system power consumption of network positioning. It can also respond quickly to network positioning requests.
如图6所示,在一个实施例中,步骤S230根据无线网络信息确定对应的位置信息,包括以下步骤:As shown in FIG. 6 , in one embodiment, step S230 determines the corresponding location information according to the wireless network information, including the following steps:
步骤S602,当共享文件中不包含无线网络信息时,将扫描获取的无线网络信息发送至定位服务器,以使定位服务器根据无线网络信息计算对应的位置信息。Step S602, when the shared file does not contain wireless network information, send the wireless network information obtained by scanning to the positioning server, so that the positioning server calculates the corresponding position information according to the wireless network information.
当共享文件中不包含无线网络信息时,移动终端可扫描预设范围内的无线网络设备,并获取无线网络信息。在一个实施例中,移动终端扫描获取的无线网络信息可以是一份或多份,移动终端可从中选取信号强度最强的无线网络设备的无线网络信息发送至定位服务器,也可以根据获取的多份无线网络信息生成无线网络信息列表,并将无线网络信息列表发送至定位服务器,从而提高位置信息的准确度。定位服务器可根据接收的无线网络信息或无线网络信息列表,在数据库中查询计算对应的位置信息。When the shared file does not contain wireless network information, the mobile terminal can scan for wireless network devices within a preset range and obtain wireless network information. In one embodiment, the wireless network information obtained by scanning by the mobile terminal may be one or more copies, from which the mobile terminal may select the wireless network information of the wireless network device with the strongest signal strength and send it to the positioning server. The wireless network information list is generated by copying the wireless network information, and the wireless network information list is sent to the positioning server, thereby improving the accuracy of the location information. The location server can query and calculate the corresponding location information in the database according to the received wireless network information or wireless network information list.
步骤S604,接收定位服务器返回的位置信息。Step S604, receiving the location information returned by the location server.
步骤S606,将位置信息及扫描获取的无线网络信息写入共享文件,并将扫描获取的无线网络信息的标志位置为第一标志位。Step S606, write the location information and the wireless network information obtained by scanning into the shared file, and set the flag position of the wireless network information obtained by scanning as the first flag bit.
移动终端接收由定位服务器返回的位置信息后,可将位置信息与发送给定位服务器的无线网络信息或无线网络信息列表一起写入共享文件中,建立写入的位置信息与无线网络信息或无线网络信息列表的对应关系,并将写入的无线网络信息或无线网络信息列表的标志位置为第一标志位,当下一LBS应用发起网络定位请求时,移动终端的操作系统可直接从共享文件中读取无线网络信息及对应的位置信息。After the mobile terminal receives the location information returned by the location server, it can write the location information together with the wireless network information or wireless network information list sent to the location server into the shared file, and establish the location information and the wireless network information or wireless network information written. The corresponding relationship of the information list, and the written wireless network information or the flag position of the wireless network information list is the first flag bit. When the next LBS application initiates a network positioning request, the operating system of the mobile terminal can directly read from the shared file. Get wireless network information and corresponding location information.
步骤S608,根据位置信息进行展示。Step S608, displaying according to the location information.
移动终端的操作系统可将该位置信息返回给发送网络定位请求的LBS应用,LBS应用可根据位置信息进行展示,例如,在地图上展示与位置信息对应的点,或是展示与该位置信息相关的美食、银行、超市等生活服务等,但不限于此,具体的展示内容可根据LBS应用提供的具体服务功能确定。The operating system of the mobile terminal can return the location information to the LBS application that sends the network positioning request, and the LBS application can display it according to the location information, for example, display the point corresponding to the location information on the map, or display the location information related to the location information. Life services such as food, banks, supermarkets, etc., but not limited to this, the specific display content can be determined according to the specific service functions provided by the LBS application.
可以理解地,将无线网络信息写入共享文件中,除了实现各LBS应用间无线网络信息的共享外,其它非LBS应用当需要获取无线网络信息时,也可直接从共享文件中读取,并不仅限于LBS应用及网络定位功能。Understandably, writing the wireless network information into the shared file, in addition to realizing the sharing of wireless network information among LBS applications, other non-LBS applications can also directly read the wireless network information from the shared file when they need to obtain the wireless network information. Not limited to LBS applications and network positioning functions.
在本实施例中,可将扫描获取的无线网络信息及由定位服务器查询计算的位置信息写入共享文件中,实现各LBS应用间无线网络信息与位置信息的共享,可降低扫描无线网络信息及访问定位服务器的频率,在有效降低网络定位时的系统功耗的同时,也可快速响应网络定位请求。In this embodiment, the wireless network information obtained by scanning and the location information queried and calculated by the positioning server can be written into the shared file, so as to realize the sharing of wireless network information and location information among LBS applications, which can reduce the need for scanning wireless network information and The frequency of accessing the positioning server can effectively reduce the system power consumption during network positioning, and can also quickly respond to network positioning requests.
如图7所示,在一个实施例中,提供一种网络定位装置700,包括接收模块710、读取模块720及确定模块730。As shown in FIG. 7 , in one embodiment, a network positioning apparatus 700 is provided, including a receiving module 710 , a reading module 720 and a determining module 730 .
接收模块710,用于接收网络定位请求。The receiving module 710 is configured to receive a network positioning request.
读取模块720,用于根据网络定位请求从共享文件中读取最新写入的无线网络信息,所述共享文件用于存储移动终端连接的无线网络信息。The reading module 720 is configured to read the newly written wireless network information from the shared file according to the network positioning request, where the shared file is used to store the wireless network information connected to the mobile terminal.
确定模块730,用于根据无线网络信息确定对应的位置信息。The determining module 730 is configured to determine the corresponding location information according to the wireless network information.
上述网络定位装置,接收网络定位请求,根据网络定位请求从共享文件中读取最新写入的无线网络信息,根据无线网络信息确定对应的位置信息,无需每次进行网络定位时都主动发起无线网络信息扫描,可降低扫描无线网络信息频率,从而有效降低网络定位时的系统功耗,并减少无线上网延迟。The above-mentioned network positioning device receives the network positioning request, reads the newly written wireless network information from the shared file according to the network positioning request, and determines the corresponding position information according to the wireless network information, and does not need to actively initiate the wireless network every time the network positioning is performed. Information scanning can reduce the frequency of scanning wireless network information, thereby effectively reducing system power consumption during network positioning and reducing wireless Internet access delays.
如图8所示,在一个实施例中,上述网络定位装置700,除了包括接收模块710、读取模块720及确定模块730,还包括监听模块740及写入模块750。As shown in FIG. 8 , in one embodiment, the above-mentioned network positioning apparatus 700 includes a receiving module 710 , a reading module 720 and a determining module 730 , and also includes a monitoring module 740 and a writing module 750 .
监听模块740,用于对无线网络信息进行监听。The monitoring module 740 is configured to monitor wireless network information.
写入模块750,用于当检测到无线网络信息发生变化时,将变化后的无线网络信息写入共享文件。The writing module 750 is configured to write the changed wireless network information into the shared file when it is detected that the wireless network information changes.
在本实施例中,可对无线网络信息进行监听,并将变化后的无线网络信息写入共享文件,通过共享文件实现各LBS应用之间无线网络信息的共享,无需每次进行网络定位时都主动发起无线网络信息扫描,可降低扫描无线网络信息频率,从而有效降低网络定位时的系统功耗,并减少无线上网延迟。In this embodiment, wireless network information can be monitored, and the changed wireless network information can be written into a shared file, and wireless network information sharing among LBS applications can be realized through the shared file, without the need for every time network positioning is performed. Actively initiates wireless network information scanning, which can reduce the frequency of scanning wireless network information, thereby effectively reducing system power consumption during network positioning and reducing wireless Internet access delays.
如图9所示,在一个实施例中,读取模块720包括判断单元722、读取单元724及扫描单元726。As shown in FIG. 9 , in one embodiment, the reading module 720 includes a determining unit 722 , a reading unit 724 and a scanning unit 726 .
判断单元722,用于判断共享文件中是否包含无线网络信息。The determining unit 722 is configured to determine whether the shared file contains wireless network information.
读取单元724,用于若共享文件中包含无线网络信息,则从共享文件中读取最新写入的无线网络信息。The reading unit 724 is configured to read the newly written wireless network information from the shared file if the shared file contains wireless network information.
扫描单元726,用于若共享文件中不包含无线网络信息,则扫描在移动终端预设范围内的无线网络设备,并获取无线网络设备的无线网络信息。The scanning unit 726 is configured to scan for wireless network devices within a preset range of the mobile terminal if the shared file does not contain wireless network information, and obtain wireless network information of the wireless network devices.
在本实施例中,当LBS应用进行网络定位时,可直接从共享文件中读取最新写入的无线网络信息,无需每次进行网络定位时都主动发起无线网络信息扫描,可降低扫描无线网络信息频率,从而有效降低网络定位时的系统功耗,并减少无线上网延迟。In this embodiment, when the LBS application performs network positioning, the newly written wireless network information can be directly read from the shared file, and there is no need to actively initiate wireless network information scanning each time network positioning is performed, which can reduce the need for scanning wireless network information. information frequency, thereby effectively reducing the system power consumption during network positioning and reducing the delay of wireless Internet access.
如图10所示,在一个实施例中,确定模块730包括标志位获取单元1002、位置信息读取单元1004、第一展示单元1006、第一发送单元1008、第一接收单元1010及第一写入单元1012。As shown in FIG. 10, in one embodiment, the determining module 730 includes a flag bit acquiring unit 1002, a position information reading unit 1004, a first displaying unit 1006, a first sending unit 1008, a first receiving unit 1010, and a first writing unit into unit 1012.
标志位获取单元1002,用于获取与最新写入的无线网络信息匹配的标志位。The flag bit obtaining unit 1002 is configured to obtain a flag bit matching the latest written wireless network information.
位置信息读取单元1004,用于若标志位为第一标志位,则从共享文件中读取与最新写入的无线网络信息对应的位置信息。The location information reading unit 1004 is configured to read the location information corresponding to the newly written wireless network information from the shared file if the flag bit is the first flag bit.
第一展示单元1006,用于根据读取的位置信息进行展示。The first display unit 1006 is configured to display according to the read position information.
第一发送单元1008,用于若标志位为第二标志位,则将最新写入的无线网络信息发送至定位服务器,以使定位服务器根据无线网络信息计算对应的位置信息。The first sending unit 1008 is configured to send the newly written wireless network information to the positioning server if the flag bit is the second flag bit, so that the positioning server can calculate the corresponding position information according to the wireless network information.
第一接收单元1010,用于接收定位服务器返回的位置信息。The first receiving unit 1010 is configured to receive the location information returned by the location server.
第一写入单元1012,用于将位置信息写入共享文件,并将标志位置为第一标志位。The first writing unit 1012 is configured to write the location information into the shared file, and set the flag location as the first flag bit.
第一展示单元1006,还用于根据接收的位置信息进行展示。The first display unit 1006 is further configured to display according to the received location information.
在本实施例中,当LBS应用进行网络定位时,除了可直接从共享文件中读取最新写入的无线网络信息外,也可从共享文件中读取对应的位置信息,无需每次进行网络定位时都主动发起无线网络信息扫描,也无需每次进行网络定位时都对定位服务器进行访问,可降低扫描无线网络信息及访问定位服务器的频率,在有效降低网络定位的系统功耗的同时,也可快速响应网络定位请求。In this embodiment, when the LBS application performs network positioning, in addition to directly reading the newly written wireless network information from the shared file, it can also read the corresponding location information from the shared file, without the need to perform network positioning every time. When positioning, the wireless network information scanning is actively initiated, and there is no need to access the positioning server every time network positioning is performed, which can reduce the frequency of scanning wireless network information and accessing the positioning server, while effectively reducing the system power consumption of network positioning. It can also respond quickly to network positioning requests.
如图11所示,在一个实施例中,确定模块730包括第二发送单元1102、第二接收单元1104、第二写入单元1106及第二展示单元1108。As shown in FIG. 11 , in one embodiment, the determining module 730 includes a second sending unit 1102 , a second receiving unit 1104 , a second writing unit 1106 and a second displaying unit 1108 .
第二发送单元1102,用于当共享文件中不包含无线网络信息时,将扫描获取的无线网络信息发送至定位服务器,以使定位服务器根据无线网络信息计算对应的位置信息。The second sending unit 1102 is configured to send the wireless network information obtained by scanning to the location server when the shared file does not contain wireless network information, so that the location server can calculate the corresponding location information according to the wireless network information.
第二接收单元1104,用于接收定位服务器返回的位置信息。The second receiving unit 1104 is configured to receive the location information returned by the location server.
第二写入单元1106,用于将位置信息及扫描获取的无线网络信息写入共享文件,并将扫描获取的无线网络信息的标志位置为第一标志位。The second writing unit 1106 is configured to write the location information and the wireless network information obtained by scanning into the shared file, and set the flag position of the wireless network information obtained by scanning as the first flag bit.
第二展示单元1108,用于根据位置信息进行展示。The second display unit 1108 is configured to display according to the location information.
在本实施例中,可将扫描获取的无线网络信息及由定位服务器查询计算的位置信息写入共享文件中,实现各LBS应用间无线网络信息与位置信息的共享,可降低扫描无线网络信息及访问定位服务器的频率,在有效降低网络定位时的系统功耗的同时,也可快速响应网络定位请求。In this embodiment, the wireless network information obtained by scanning and the location information queried and calculated by the positioning server can be written into the shared file, so as to realize the sharing of wireless network information and location information among LBS applications, which can reduce the need for scanning wireless network information and The frequency of accessing the positioning server can effectively reduce the system power consumption during network positioning, and can also quickly respond to network positioning requests.
本发明实施例还提供了一种计算机设备。如图12所示,为了便于说明,仅示出了与本发明实施例相关的部分,具体技术细节未揭示的,请参照本发明实施例方法部分。该计算机设备可以为包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑、穿戴式设备等任意终端设备,以计算机设备为手机为例:The embodiment of the present invention also provides a computer device. As shown in FIG. 12 , for the convenience of description, only the part related to the embodiment of the present invention is shown, and the specific technical details are not disclosed, please refer to the method part of the embodiment of the present invention. The computer device can be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales, a sales terminal), a vehicle-mounted computer, a wearable device, etc. The computer device is a mobile phone as an example :
图12为与本发明实施例提供的计算机设备相关的手机的部分结构的框图。参考图12,手机包括:射频(Radio Frequency,RF)电路1210、存储器1220、输入单元1230、显示单元1240、传感器1250、音频电路1260、WiFi模块1270、处理器1280、以及电源1290等部件。本领域技术人员可以理解,图12所示的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。FIG. 12 is a block diagram of a partial structure of a mobile phone related to a computer device provided by an embodiment of the present invention. 12 , the mobile phone includes: a radio frequency (RF) circuit 1210 , a memory 1220 , an input unit 1230 , a display unit 1240 , a sensor 1250 , an audio circuit 1260 , a WiFi module 1270 , a processor 1280 , and a power supply 1290 . Those skilled in the art can understand that the structure of the mobile phone shown in FIG. 12 does not constitute a limitation on the mobile phone, and may include more or less components than shown, or combine some components, or arrange different components.
其中,RF电路1210可用于收发信息或通话过程中,信号的接收和发送,可将基站的下行信息接收后,给处理器1280处理;也可以将上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路1210还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于GSM、通用分组无线服务(GeneralPacket Radio Service,GPRS)、CDMA、宽带码分多址(Wideband Code Division MultipleAccess,WCDMA)、长期演进(Long Term Evolution,LTE))、电子邮件、短消息服务(ShortMessaging Service,SMS)等。The RF circuit 1210 can be used for receiving and sending signals during sending and receiving of information or during a call. After receiving the downlink information of the base station, it can be processed by the processor 1280; it can also send the uplink data to the base station. Typically, the RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuitry 1210 may also communicate with networks and other devices via wireless communications. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to GSM, General Packet Radio Service (GPRS), CDMA, Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (Long Term Evolution, LTE)), email, Short Messaging Service (Short Messaging Service, SMS), etc.
存储器1220可用于存储软件程序以及模块,处理器1280通过运行存储在存储器1220的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器1220可主要包括程序存储区和数据存储区,其中,程序存储区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能的应用程序、图像播放功能的应用程序等)等;数据存储区可存储根据手机的使用所创建的数据(比如音频数据、通讯录等)等。此外,存储器1220可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 1220 can be used to store software programs and modules, and the processor 1280 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 1220 . The memory 1220 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as an application program for a sound playback function, an application program for an image playback function, etc.), etc.; The data storage area may store data (such as audio data, address book, etc.) created according to the usage of the mobile phone, and the like. Additionally, memory 1220 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
输入单元1230可用于接收输入的数字或字符信息,以及产生与手机1200的用户设置以及功能控制有关的键信号输入。具体地,输入单元1230可包括触控面板1232以及其他输入设备1234。触控面板1232,也可称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板1232上或在触控面板1232附近的操作),并根据预先设定的程式驱动相应的连接装置。在一个实施例中,触控面板1232可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器1280,并能接收处理器1280发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板1232。除了触控面板1232,输入单元1230还可以包括其他输入设备1234。具体地,其他输入设备1234可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)等中的一种或多种。The input unit 1230 may be used to receive input numerical or character information, and generate key signal input related to user settings and function control of the mobile phone 1200 . Specifically, the input unit 1230 may include a touch panel 1232 and other input devices 1234 . The touch panel 1232, which may also be referred to as a touch screen, collects the user's touch operations on or near it (such as the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel 1232). operation), and drive the corresponding connection device according to the preset program. In one embodiment, the touch panel 1232 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the touch controller. To the processor 1280, and can receive the command sent by the processor 1280 and execute it. In addition, the touch panel 1232 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 1232 , the input unit 1230 may also include other input devices 1234 . Specifically, other input devices 1234 may include, but are not limited to, one or more of physical keyboards, function keys (such as volume control keys, switch keys, etc.), and the like.
显示单元1240可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元1240可包括显示面板1242。在一个实施例中,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板1242。在一个实施例中,触控面板1232可覆盖显示面板1242,当触控面板1232检测到在其上或附近的触摸操作后,传送给处理器1280以确定触摸事件的类型,随后处理器1280根据触摸事件的类型在显示面板1242上提供相应的视觉输出。虽然在图12中,触控面板1232与显示面板1242是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板1232与显示面板1242集成而实现手机的输入和输出功能。The display unit 1240 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 1240 may include a display panel 1242 . In one embodiment, the display panel 1242 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like. In one embodiment, the touch panel 1232 may cover the display panel 1242. When the touch panel 1232 detects a touch operation on or near it, the touch panel 1232 transmits it to the processor 1280 to determine the type of the touch event, and then the processor 1280 determines the type of the touch event according to the The type of touch event provides a corresponding visual output on display panel 1242 . Although in FIG. 12, the touch panel 1232 and the display panel 1242 are used as two independent components to realize the input and input functions of the mobile phone, in some embodiments, the touch panel 1232 and the display panel 1242 can be integrated to form a Realize the input and output functions of the mobile phone.
手机1200还可包括至少一种传感器1250,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板1242的亮度,接近传感器可在手机移动到耳边时,关闭显示面板1242和/或背光。运动传感器可包括加速度传感器,通过加速度传感器可检测各个方向上加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换)、振动识别相关功能(比如计步器、敲击)等;此外,手机还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器等。Cell phone 1200 may also include at least one sensor 1250, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1242 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 1242 and/or when the mobile phone is moved to the ear. or backlight. Motion sensors can include acceleration sensors, which can detect the magnitude of acceleration in all directions, and can detect the magnitude and direction of gravity when stationary. It can be used for applications that recognize the posture of mobile phones (such as switching between horizontal and vertical screens), and vibration recognition related functions (such as Pedometer, tapping), etc.; in addition, the mobile phone can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc.
音频电路1260、扬声器1262和传声器1264可提供用户与手机之间的音频接口。音频电路1260可将接收到的音频数据转换后的电信号,传输到扬声器1262,由扬声器1262转换为声音信号输出;另一方面,传声器1264将收集的声音信号转换为电信号,由音频电路1260接收后转换为音频数据,再将音频数据输出处理器1280处理后,经RF电路1210可以发送给另一手机,或者将音频数据输出至存储器1220以便后续处理。Audio circuitry 1260, speaker 1262, and microphone 1264 may provide an audio interface between the user and the cell phone. The audio circuit 1260 can convert the received audio data into an electrical signal, and transmit it to the speaker 1262, and the speaker 1262 converts it into a sound signal for output; on the other hand, the microphone 1264 converts the collected sound signal into an electrical signal, which is converted by the audio circuit 1260 After receiving, the audio data is converted into audio data, and then the audio data is processed by the output processor 1280, and can be sent to another mobile phone via the RF circuit 1210, or the audio data can be output to the memory 1220 for subsequent processing.
WiFi属于短距离无线传输技术,手机通过WiFi模块1270可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。WiFi is a short-distance wireless transmission technology. The mobile phone can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 1270. It provides users with wireless broadband Internet access.
处理器1280是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器1220内的软件程序和/或模块,以及调用存储在存储器1220内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。在一个实施例中,处理器1280可包括一个或多个处理单元。在一个实施例中,处理器1280可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等;调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1280中。The processor 1280 is the control center of the mobile phone, and uses various interfaces and lines to connect various parts of the entire mobile phone, by running or executing the software programs and/or modules stored in the memory 1220, and calling the data stored in the memory 1220. Various functions of the mobile phone and processing data, so as to monitor the mobile phone as a whole. In one embodiment, the processor 1280 may include one or more processing units. In one embodiment, the processor 1280 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface and application programs, etc.; the modem processor mainly handles wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 1280.
手机1200还包括给各个部件供电的电源1290(比如电池),优选的,电源1290可以通过电源管理系统与处理器1280逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The mobile phone 1200 also includes a power supply 1290 (such as a battery) for supplying power to various components. Preferably, the power supply 1290 can be logically connected to the processor 1280 through a power management system, so that functions such as managing charging, discharging, and power consumption management are implemented through the power management system. .
在一个实施例中,手机1200还可以包括摄像头、蓝牙模块等。In one embodiment, the mobile phone 1200 may further include a camera, a Bluetooth module, and the like.
在本发明实施例中,该移动终端所包括的处理器1280执行存储在存储器上的计算机程序时实现以下步骤:In this embodiment of the present invention, the processor 1280 included in the mobile terminal implements the following steps when executing the computer program stored in the memory:
接收网络定位请求;Receive network positioning requests;
根据所述网络定位请求从共享文件中读取最新写入的无线网络信息;Read the newly written wireless network information from the shared file according to the network positioning request;
根据所述无线网络信息确定对应的位置信息。Corresponding location information is determined according to the wireless network information.
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-described embodiments can be combined arbitrarily. For the sake of brevity, all possible combinations of the technical features in the above-described embodiments are not described. However, as long as there is no contradiction between the combinations of these technical features, All should be regarded as the scope described in this specification.
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present invention, and the descriptions thereof are specific and detailed, but should not be construed as a limitation on the scope of the invention patent. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can also be made, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the appended claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710150922.4ACN106993327B (en) | 2017-03-14 | 2017-03-14 | Network positioning method and device and computer equipment |
| PCT/CN2017/106764WO2018166202A1 (en) | 2017-03-14 | 2017-10-18 | Network positioning method, computer equipment and non-volatile readable storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710150922.4ACN106993327B (en) | 2017-03-14 | 2017-03-14 | Network positioning method and device and computer equipment |
| Publication Number | Publication Date |
|---|---|
| CN106993327A CN106993327A (en) | 2017-07-28 |
| CN106993327Btrue CN106993327B (en) | 2019-07-23 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201710150922.4AActiveCN106993327B (en) | 2017-03-14 | 2017-03-14 | Network positioning method and device and computer equipment |
| Country | Link |
|---|---|
| CN (1) | CN106993327B (en) |
| WO (1) | WO2018166202A1 (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106993327B (en)* | 2017-03-14 | 2019-07-23 | Oppo广东移动通信有限公司 | Network positioning method and device and computer equipment |
| KR101986634B1 (en)* | 2017-11-13 | 2019-09-30 | (주)에프씨아이 | Method for power saving of internet of things devices and apparatus therefor |
| CN109104261A (en)* | 2018-09-28 | 2018-12-28 | 深圳高新兴物联科技有限公司 | Local zone time acquisition methods, terminal and storage medium based on LBS |
| CN110430559A (en)* | 2019-07-08 | 2019-11-08 | 深圳市优博讯科技股份有限公司 | The localization method of intelligent terminal, system and communication equipment under private network environment |
| CN112367613B (en)* | 2020-11-20 | 2023-07-18 | 惠州Tcl移动通信有限公司 | Positioning method, positioning device, storage medium and terminal |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7996021B2 (en)* | 2002-06-28 | 2011-08-09 | Hewlett-Packard Development Company, L.P. | Location determination in a wireless communication network |
| US8744478B2 (en)* | 2008-02-20 | 2014-06-03 | Qualcomm Incorporated | Method and apparatus for executing location dependent application in a mobile handset |
| US9641978B2 (en)* | 2011-08-18 | 2017-05-02 | Rivada Research, Llc | Method and system for providing enhanced location based information for wireless handsets |
| CN103906235A (en)* | 2014-04-04 | 2014-07-02 | 小米科技有限责任公司 | Terminal positioning method and terminal |
| CN105163275B (en)* | 2015-07-31 | 2019-08-27 | 腾讯科技(深圳)有限公司 | A kind of data transmission method for uplink, relevant apparatus and system |
| CN106993327B (en)* | 2017-03-14 | 2019-07-23 | Oppo广东移动通信有限公司 | Network positioning method and device and computer equipment |
| Publication number | Publication date |
|---|---|
| WO2018166202A1 (en) | 2018-09-20 |
| CN106993327A (en) | 2017-07-28 |
| Publication | Publication Date | Title |
|---|---|---|
| TWI606416B (en) | Method, terminal and system for sharing geographic position | |
| CN104253740B (en) | Picture is registered method, Apparatus and system | |
| CN106993327B (en) | Network positioning method and device and computer equipment | |
| WO2018103492A1 (en) | Method for setting wifi roaming, and terminal device | |
| WO2018090933A1 (en) | Method, apparatus, and system for resolving service platform address | |
| CN108702602A (en) | Image sharing method, electronic device and system | |
| US11394871B2 (en) | Photo taking control method and system based on mobile terminal, and storage medium | |
| WO2019184016A1 (en) | Sim card authentication method and terminal | |
| CN107872875A (en) | Method and device for network positioning | |
| WO2019140657A1 (en) | Method and device for network connection and terminal | |
| CN108848547A (en) | WiFi scanning method and device, mobile terminal and computer readable medium | |
| WO2018145477A1 (en) | Network access method and terminal | |
| WO2018033031A1 (en) | Positioning method and device | |
| CN106997052B (en) | Position information processing method and device and computer equipment | |
| CN111314900B (en) | Wireless connection method, wireless connection device and mobile terminal | |
| CN107969025B (en) | Mobile terminal wireless local area network scanning method and device and computer equipment | |
| CN105282692A (en) | Speed measurement information display method and device | |
| CN104901992B (en) | A kind of method and apparatus of resource transfers | |
| CN106851784B (en) | network scanning method and terminal equipment | |
| CN108471630B (en) | Transmission rate adjustment method, device, mobile terminal, and computer-readable medium | |
| CN108494851B (en) | Application program recommended method, device and server | |
| CN110234068A (en) | A kind of localization method and terminal device | |
| CN107508931B (en) | Wireless network communication method, device, storage medium and computer equipment | |
| CN107332996A (en) | Screen lock control method, device, computer storage medium and mobile terminal | |
| CN110602766B (en) | Personal hotspot identification method and method for determining association relationship between terminals |
| 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 | ||
| CB02 | Change of applicant information | ||
| CB02 | Change of applicant information | Address after:523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong Applicant after:OPPO Guangdong Mobile Communications Co., Ltd. Address before:523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong Applicant before:Guangdong OPPO Mobile Communications Co., Ltd. | |
| GR01 | Patent grant | ||
| GR01 | Patent grant |