HK1228153B - Method and system for identifying geo-fence, server and mobile terminal - Google Patents
Method and system for identifying geo-fence, server and mobile terminal Download PDFInfo
- Publication number
- HK1228153B HK1228153B HK17101276.4A HK17101276A HK1228153B HK 1228153 B HK1228153 B HK 1228153B HK 17101276 A HK17101276 A HK 17101276A HK 1228153 B HK1228153 B HK 1228153B
- Authority
- HK
- Hong Kong
- Prior art keywords
- wireless device
- geofence
- mobile terminal
- identifier
- server
- Prior art date
Links
Description
技术领域Technical Field
本申请涉及位置服务技术领域,特别涉及一种识别地理围栏的方法、系统、服务器及移动终端。The present application relates to the field of location-based service technology, and in particular to a method, system, server, and mobile terminal for identifying geographic fences.
背景技术Background Art
随着移动通信技术的发展和计算机技术的普及,基于位置的服务(LBS,Location-Based Service)技术正在走进人们的生活。利用LBS技术,可以通过对移动终端进行定位来获取移动终端的位置,进而为移动终端提供与其所处的位置相关的服务。例如,利用LBS技术,可以通过GPS等定位装置获取移动终端的位置,并在该位置附近一定距离范围内,搜寻宾馆、影院、购物商场、加油站等的名称和地址,以提供给该移动终端进行选择。With the development of mobile communication technology and the popularization of computer technology, location-based services (LBS) are becoming increasingly commonplace. LBS technology allows mobile terminals to be located and their locations determined, providing them with services relevant to their locations. For example, LBS technology can be used to obtain the location of a mobile terminal using a positioning device such as GPS, and then search for the names and addresses of hotels, cinemas, shopping malls, gas stations, and other locations within a certain distance of that location, providing them to the mobile terminal for selection.
近年来,随着LBS技术的飞速发展,基于LBS技术的新应用也层出不穷。地理围栏(Geo-fencing)技术作为LBS技术的一种新应用,越来越受到人们的关注。地理围栏技术可以用一个虚拟的栅栏围出一个地理围栏区域。当移动终端在该地理围栏区域中或者在该地理围栏区域附近活动时,便可以接收该地理围栏区域对应的通知和提醒。例如,当移动终端进入一个地理围栏区域时,位于该地理围栏区域中的商家便可以向该移动终端发送促销、优惠或者新品信息。In recent years, with the rapid development of location-based services (LBS), new applications based on this technology have emerged in an endless stream. Geo-fencing technology, as a new application of LBS, is gaining increasing attention. Geo-fencing technology uses a virtual fence to enclose a geo-fenced area. When a mobile terminal is active within or near this geo-fenced area, it can receive notifications and alerts specific to that geo-fenced area. For example, when a mobile terminal enters a geo-fenced area, merchants within that area can send promotions, discounts, or new product information to the mobile terminal.
现有技术中一般基于移动终端的GPS定位装置来识别移动终端所属的地理围栏区域。在现有技术中,首先可以根据商家所处的经纬度将该商家划分至一定的地理围栏区域中。例如,可以将一定的经纬度区域范围划分为一个地理围栏区域。这样,经纬度位于该范围内的商家,即属于该地理围栏区域。移动终端可以通过GPS定位装置来获取自身的经纬度,并将该经纬度上传至服务器;进而,服务器可以查询上传的移动终端的经纬度所属的地理围栏区域。获得了移动终端所处的地理围栏区域后,根据划分至该地理围栏区域中的商家,也就可以获得该移动终端当前所处的地理围栏区域对应的商家。In the prior art, the geographical fence area to which the mobile terminal belongs is generally identified based on the GPS positioning device of the mobile terminal. In the prior art, the merchant can first be divided into a certain geographical fence area based on the longitude and latitude of the merchant. For example, a certain latitude and longitude area range can be divided into a geographical fence area. In this way, the merchants whose longitude and latitude are within the range belong to the geographical fence area. The mobile terminal can obtain its own longitude and latitude through the GPS positioning device and upload the longitude and latitude to the server; then, the server can query the geographical fence area to which the uploaded longitude and latitude of the mobile terminal belongs. After obtaining the geographical fence area where the mobile terminal is located, based on the merchants divided into the geographical fence area, the merchants corresponding to the geographical fence area where the mobile terminal is currently located can also be obtained.
利用该技术,可以实现信息的推送。例如,所述服务器可以建立地理围栏区域与商家及该商家关联信息的对应关系。后续,服务器可以获得该移动终端所属的地理围栏区域,进而可以将所述地理围栏区域对应商家的信息推送至所述移动终端。This technology can be used to push information. For example, the server can establish a correspondence between geo-fenced areas and merchants and their associated information. Subsequently, the server can obtain the geo-fenced area to which the mobile terminal belongs and push information about the merchants in the geo-fenced area to the mobile terminal.
在实现本申请的过程中,发明人发现现有技术至少存在以下问题:In the process of implementing this application, the inventors discovered that the prior art has at least the following problems:
现有技术中识别移动终端所属的地理围栏区域,要求移动终端开启GPS之类能够实现定位的装置。这类实现定位的装置在定位过程中会消耗移动终端设备的较多电能;并且,这类定位装置在室内或者建筑物环境中往往无法完成定位,或者定位精度不高。Conventional technology requires that a mobile terminal be equipped with a positioning device, such as GPS, to identify the geofenced area it belongs to. These devices consume significant power during the positioning process and often fail to provide accurate positioning in indoor environments or buildings.
发明内容Summary of the Invention
本申请实施例提供一种识别地理围栏的方法、系统、服务器及移动终端,而不需要依赖于GPS之类的定位装置。The embodiments of the present application provide a method, system, server, and mobile terminal for identifying geographic fences without relying on positioning devices such as GPS.
本申请实施例提供的一种识别地理围栏的方法、系统、服务器及移动终端是这样实现的:The present invention provides a method, system, server, and mobile terminal for identifying geo-fences, which are implemented as follows:
一种识别地理围栏的方法,包括:A method for identifying a geofence, comprising:
服务器建立无线设备的标识与地理围栏区域的对应关系;The server establishes a correspondence between the identification of the wireless device and the geo-fenced area;
移动终端获取至少一个无线设备的标识并将所述标识上传至所述服务器;The mobile terminal obtains an identification of at least one wireless device and uploads the identification to the server;
所述服务器基于所述无线设备标识与地理围栏区域的对应关系查询所述上传的无线设备的标识对应的地理围栏区域。The server queries the geo-fenced area corresponding to the uploaded wireless device identifier based on the correspondence between the wireless device identifier and the geo-fenced area.
一种识别地理围栏的方法,包括:A method for identifying a geofence, comprising:
服务器建立无线设备的标识与地理围栏区域的对应关系;The server establishes a correspondence between the identification of the wireless device and the geo-fenced area;
移动终端从所述服务器中获取所述建立的无线设备的标识与地理围栏区域的对应关系;The mobile terminal obtains the established correspondence between the identifier of the wireless device and the geo-fenced area from the server;
所述移动终端获取至少一个无线设备的标识并基于所述无线设备的标识与地理围栏区域的对应关系查询所述获取的无线设备的标识对应的地理围栏区域。The mobile terminal obtains an identifier of at least one wireless device and queries the geo-fenced area corresponding to the obtained identifier of the wireless device based on a correspondence between the identifier of the wireless device and the geo-fenced area.
一种识别地理围栏的方法,包括:A method for identifying a geofence, comprising:
服务器建立无线设备的标识与地理围栏区域的对应关系;The server establishes a correspondence between the identification of the wireless device and the geo-fenced area;
所述服务器接收移动终端上传的无线设备的标识;The server receives the identification of the wireless device uploaded by the mobile terminal;
所述服务器基于所述无线设备标识与地理围栏区域的对应关系查询所述上传的无线设备的标识对应的地理围栏区域。The server queries the geo-fenced area corresponding to the uploaded wireless device identifier based on the correspondence between the wireless device identifier and the geo-fenced area.
一种识别地理围栏的方法,包括:A method for identifying a geofence, comprising:
移动终端从服务器中获取建立的无线设备的标识与地理围栏区域的对应关系;The mobile terminal obtains the established correspondence between the wireless device identifier and the geo-fenced area from the server;
所述移动终端获取至少一个无线设备的标识;The mobile terminal obtains an identification of at least one wireless device;
所述移动终端基于所述无线设备的标识与地理围栏区域的对应关系查询所述获取的无线设备的标识对应的地理围栏区域。The mobile terminal queries the geo-fenced area corresponding to the obtained wireless device identifier based on the correspondence between the wireless device identifier and the geo-fenced area.
一种识别地理围栏的系统,包括服务器和移动终端,其中:A system for identifying geographic fences includes a server and a mobile terminal, wherein:
所述服务器,用来建立无线设备的标识与地理围栏区域的对应关系;基于所述无线设备标识与地理围栏区域的对应关系查询上传的无线设备的标识对应的地理围栏区域;将预存的与所述查询到的地理围栏区域对应的推送信息推送至所述移动终端;The server is configured to establish a correspondence between the wireless device identifier and the geo-fenced area; query the geo-fenced area corresponding to the uploaded wireless device identifier based on the correspondence between the wireless device identifier and the geo-fenced area; and push pre-stored push information corresponding to the queried geo-fenced area to the mobile terminal;
所属移动终端,用来获取至少一个无线设备的标识并将所述标识上传至所述服务器;接收与所述查询的地理围栏区域对应的推送信息。The mobile terminal is used to obtain the identification of at least one wireless device and upload the identification to the server; and receive push information corresponding to the queried geographical fence area.
一种识别地理围栏的系统,包括服务器和移动终端,其中:A system for identifying geographic fences includes a server and a mobile terminal, wherein:
所述服务器,用来建立无线设备的标识与地理围栏区域的对应关系;将预存的与查询的地理围栏区域对应的推送信息推送至所述移动终端;The server is used to establish a correspondence between the identification of the wireless device and the geo-fenced area; and push pre-stored push information corresponding to the queried geo-fenced area to the mobile terminal;
所述移动终端,用来从所述服务器中获取所述建立的无线设备的标识与地理围栏区域的对应关系;获取至少一个无线设备的标识并基于所述无线设备的标识与地理围栏区域的对应关系查询所述获取的无线设备的标识对应的地理围栏区域;将所述查询的地理围栏区域发送至所述服务器;接收与所述查询的地理围栏区域对应的推送信息。The mobile terminal is used to obtain the correspondence between the identification of the established wireless device and the geo-fence area from the server; obtain the identification of at least one wireless device and query the geo-fence area corresponding to the obtained wireless device identification based on the correspondence between the identification of the wireless device and the geo-fence area; send the queried geo-fence area to the server; and receive push information corresponding to the queried geo-fence area.
一种识别地理围栏的服务器,包括:A server for identifying geo-fences, comprising:
对应关系建立单元,用来建立无线设备的标识与地理围栏区域的对应关系;a correspondence establishing unit, configured to establish a correspondence between an identifier of a wireless device and a geo-fenced area;
地理围栏查询单元,用来基于所述无线设备标识与地理围栏区域的对应关系查询上传的无线设备的标识对应的地理围栏区域;a geo-fence query unit, configured to query the geo-fence area corresponding to the uploaded wireless device identifier based on the correspondence between the wireless device identifier and the geo-fence area;
信息推送单元,用来将预存的与所述查询到的地理围栏区域对应的推送信息推送至所述移动终端。The information push unit is used to push pre-stored push information corresponding to the queried geographical fence area to the mobile terminal.
一种识别地理围栏的移动终端,包括:A mobile terminal for identifying geographic fences, comprising:
对应关系获取单元,用来从所述服务器中获取所述建立的无线设备的标识与地理围栏区域的对应关系;a correspondence obtaining unit, configured to obtain the established correspondence between the identifier of the wireless device and the geo-fenced area from the server;
无线设备标识获取单元,用来获取至少一个无线设备的标识;a wireless device identification acquisition unit, configured to acquire an identification of at least one wireless device;
地理围栏区域查询单元,用来基于所述无线设备的标识与地理围栏区域的对应关系查询所述获取的无线设备的标识对应的地理围栏区域;a geo-fenced area query unit, configured to query the geo-fenced area corresponding to the obtained wireless device identifier based on a correspondence between the wireless device identifier and the geo-fenced area;
地理围栏区域发送单元,用来将所述查询的地理围栏区域发送至所述服务器;a geo-fence area sending unit, configured to send the queried geo-fence area to the server;
信息接收单元,用来接收与所述查询的地理围栏区域对应的推送信息。The information receiving unit is used to receive push information corresponding to the queried geographical fence area.
本申请实施例基于无线设备的标识所处的位置进行地理围栏的划分和识别,当移动终端搜索或连接到无线设备的信号时,就可以认为该移动终端处于该无线设备附近。本申请实施例通过搜索无线设备的信号进行地理围栏的识别,在不需要依赖GPS之类的定位装置的情况下,也能够识别划分的地理围栏。The present embodiment of the present invention divides and identifies geofences based on the location of a wireless device's identifier. When a mobile terminal searches for or connects to a wireless device's signal, it is considered to be in the vicinity of the wireless device. The present embodiment of the present invention identifies geofences by searching for wireless device signals, and can identify geofences without relying on positioning devices such as GPS.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本申请实施例提供的一种识别地理围栏的方法流程图;FIG1 is a flow chart of a method for identifying a geo-fence according to an embodiment of the present application;
图2为本申请的一个例子中根据geohash值划分预设范围内地理位置的的示意图;FIG2 is a schematic diagram showing the division of geographical locations within a preset range according to geohash values in an example of the present application;
图3为本申请另一实施例提供的一种识别地理围栏的方法流程图;FIG3 is a flow chart of a method for identifying a geo-fence according to another embodiment of the present application;
图4为本申请实施例提供的一种识别地理围栏的系统;FIG4 is a system for identifying geographic fences provided by an embodiment of the present application;
图5为本申请实施例中提供的一种识别地理围栏的服务器;FIG5 is a server for identifying geographic fences provided in an embodiment of the present application;
图6为本申请实施例提供的一种识别地理围栏的移动终端;FIG6 is a mobile terminal for identifying geographic fences provided by an embodiment of the present application;
图7为本申请实施例中提供的以服务器为主体的一种识别地理围栏的方法;FIG7 is a method for identifying geographic fences using a server as the main body provided in an embodiment of the present application;
图8为本申请实施例中提供的以移动终端为主体的一种识别地理围栏的方法。FIG8 is a method for identifying geographic fences using a mobile terminal as the main body provided in an embodiment of the present application.
具体实施方式DETAILED DESCRIPTION
本申请实施例提供一种识别地理围栏的方法、系统、服务器及移动终端。为了使本技术领域的人员更好地理解本申请中的技术方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都应当属于本申请保护的范围。The embodiments of the present application provide a method, system, server, and mobile terminal for identifying geographic fences. To help those skilled in the art better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative work should fall within the scope of protection of this application.
随着智能移动终端的普及,利用WIFI或者蓝牙进行通信已较为普遍。由于商家处设置的用于提供接入的WIFI设备或蓝牙设备部署的地址变动频率较低,因此可以用WIFI设备或蓝牙设备所处的地理位置来反映商家所处的位置。一般的WIFI或蓝牙信号可以覆盖几米至几百米的范围,当移动终端处于WIFI设备或者蓝牙设备附近时,移动终端可以搜索到WIFI或者蓝牙信号,或连接到WIFI设备或蓝牙设备。With the widespread adoption of smart mobile devices, communication via Wi-Fi or Bluetooth has become commonplace. Because the addresses of Wi-Fi or Bluetooth devices deployed at businesses to provide access rarely change, the geographic location of the Wi-Fi or Bluetooth device can be used to reflect the location of the business. Typical Wi-Fi or Bluetooth signals can cover a range of several meters to several hundred meters. When a mobile terminal is near a Wi-Fi or Bluetooth device, it can search for the Wi-Fi or Bluetooth signal or connect to it.
图1为本申请实施例提供的一种识别地理围栏的方法流程图。本申请实施例中涉及的提供接入的无线设备可以是WIFI设备或者蓝牙设备或者其他可以设置于商家处的短距离无线通信设备。每个这样的无线设备具有一个唯一标识,这样的唯一标识例如可以是WIFI设备或蓝牙设备的MAC地址。以下本申请的实施例以WIFI设备及WIFI设备的MAC地址为例,对本申请实施例的技术方案进行阐述。利用蓝牙设备或者其他无线设备实现的技术方案与WIFI设备类似,都应属于本申请的保护范围。如图1所示,所述方法包括:Figure 1 is a flow chart of a method for identifying geographic fences provided in an embodiment of the present application. The wireless device providing access involved in the embodiment of the present application may be a WIFI device or a Bluetooth device or other short-range wireless communication device that can be set up at a merchant. Each such wireless device has a unique identifier, and such a unique identifier may be, for example, the MAC address of a WIFI device or a Bluetooth device. The following embodiments of the present application use WIFI devices and the MAC addresses of WIFI devices as examples to illustrate the technical solutions of the embodiments of the present application. The technical solutions implemented using Bluetooth devices or other wireless devices are similar to those of WIFI devices and should all fall within the scope of protection of this application. As shown in Figure 1, the method includes:
S100:服务器建立无线设备的标识与地理围栏区域的对应关系。S100: The server establishes a correspondence between the identifier of the wireless device and the geo-fenced area.
无线设备发出的无线信号一般具有一定的覆盖范围。超出这个范围的情况下,移动终端无法检测到该无线设备。在本申请一实施例中,服务器可以将无线设备信号的覆盖范围划分为所述无线设备的标识对应的地理围栏区域。The wireless signal emitted by a wireless device generally has a certain coverage range. If it exceeds this range, the mobile terminal cannot detect the wireless device. In one embodiment of the present application, the server can divide the coverage range of the wireless device signal into a geo-fenced area corresponding to the identifier of the wireless device.
例如,服务器可以将每一无线设备的无线信号覆盖范围设置为一个单独的地理围栏区域。该无线设备的标识,例如其MAC地址,可以与设置的地理围栏区域对应。在该情况下,例如有M个无线信号设备,则该M个不同的无线信号设备中的每一个的覆盖范围可以设置为一个单独的地理围栏区域,即对应M个不同的地理围栏区域。For example, the server can set the wireless signal coverage range of each wireless device as a separate geo-fenced area. The wireless device's identifier, such as its MAC address, can correspond to the set geo-fenced area. In this case, for example, if there are M wireless signal devices, the coverage range of each of the M different wireless signal devices can be set as a separate geo-fenced area, that is, corresponding to M different geo-fenced areas.
再例如,服务器可以将至少一个无线设备的信号覆盖总范围设置为一个地理围栏区域。具体的,例如位于相近位置的多个无线设备,各无线设备的无线信号可能存在重合的情况。可以将这些多个无线设备的无线信号能够覆盖的总范围设置为一个地理围栏区域。For another example, the server may set the total signal coverage range of at least one wireless device as a geo-fenced area. Specifically, for example, if multiple wireless devices are located in a close location, their wireless signals may overlap. The total coverage range of the wireless signals of these multiple wireless devices may be set as a geo-fenced area.
服务器将无线设备划分至对应的地理围栏区域后,可以建立无线设备的标识与对应的地理围栏区域的对应关系。具体地,服务器可以将无线设备的标识以及对应的地理围栏利用key-value的形式进行存储。例如,WIFI设备的MAC地址为E0-9D-0B-9D-1C,该WIFI设备的MAC地址可以作为value。假设该WIFI设备的MAC地址对应的地理围栏为围栏1,那么该围栏1可以作为与上述value对应的key。通过WIFI设备的MAC地址的value,可以在服务器中查找到与该value相对应的key,也就是说可以找到对应的地理围栏。After the server divides the wireless device into the corresponding geo-fence area, it can establish a correspondence between the wireless device's identifier and the corresponding geo-fence area. Specifically, the server can store the wireless device's identifier and the corresponding geo-fence in the form of key-value. For example, the MAC address of the WIFI device is E0-9D-0B-9D-1C, and the MAC address of the WIFI device can be used as the value. Assuming that the geo-fence corresponding to the MAC address of the WIFI device is fence 1, then fence 1 can be used as the key corresponding to the above value. Through the value of the MAC address of the WIFI device, the key corresponding to the value can be found in the server, that is, the corresponding geo-fence can be found.
在本申请另一实施例中,还可以根据下述方法建立无线设备的标识与地理围栏区域的对应关系:In another embodiment of the present application, the correspondence between the identifier of the wireless device and the geo-fenced area may be established according to the following method:
S101:服务器将预设范围内的地理位置按照预设规则划分为不同的地理围栏区域,所述不同的地理围栏区域对应不同的地理位置编码。S101: The server divides the geographical location within a preset range into different geographical fence areas according to preset rules, and the different geographical fence areas correspond to different geographical location codes.
服务器可以按照预设规则,将预设范围内的地理位置划分为不同的地理围栏区域。这些划分后的每个地理围栏区域可以对应唯一的一个地理位置编码。本申请实施例可以通过去尾算法或者geohash算法对预设范围内的地理位置进行处理,从而能够将预设范围内的地理位置划分为不同的地理围栏区域。所述去尾算法或者geohash算法可以为所述预设规则中的一种。The server may divide the geographic locations within a preset range into different geo-fenced areas according to preset rules. Each of these divided geo-fenced areas may correspond to a unique geographic location code. In embodiments of the present application, the geographic locations within the preset range may be processed using a tail-removal algorithm or a geohash algorithm, thereby dividing the geographic locations within the preset range into different geo-fenced areas. The tail-removal algorithm or geohash algorithm may be one of the preset rules.
下面以去尾经纬度为例来进行阐述:The following is an example of truncated longitude and latitude:
在预设范围内某一地理位置的纬度为39.928167,经度为116.389550。服务器可以将该经纬度进行去尾处理,例如可以将小数点以后的第二位及之后的内容全部去掉。经该方式处理后的去尾经纬度分别为39.9和116.3。显然的,足够相近的两个地理位置,经纬度经过去尾处理后的可以得到相同的去尾经纬度。例如,第一地理位置的经纬度为(39.928167,116.389550),与第一地理位置相近的第二地理位置的经纬度为(39.925014,116.3893215),分别经过去尾处理后,去尾经纬度均为(39.9,116.3)。那么,这些相近的地理位置可以划定至同一块地理围栏区域中,并且该地理围栏区域中地理位置的去尾经纬度均相同。该地理围栏区域中的去尾经纬度便可以作为所述的地理围栏区域的地理位置编码。从上述描述可以得知,去尾处理的精度决定最终划定的地理围栏区域的范围。例如,去尾经纬度的精度越高(小数点后的位数越多),最终划定的地理围栏区域范围则会越小;相应地,去尾纬度的精度越低(小数点后的位数越少),最终划定的地理围栏区域范围则会越大。The latitude of a certain geographic location within the preset range is 39.928167, and the longitude is 116.389550. The server can truncate the longitude and latitude, for example, it can remove all the content after the second decimal point and beyond. The truncation longitude and latitude after processing in this way are 39.9 and 116.3 respectively. Obviously, two geographic locations that are close enough can obtain the same truncation longitude and latitude after truncation of the longitude and latitude. For example, the longitude and latitude of the first geographic location are (39.928167, 116.389550), and the longitude and latitude of the second geographic location close to the first geographic location are (39.925014, 116.3893215). After truncation, the truncation longitude and latitude are both (39.9, 116.3). Then, these similar geographic locations can be demarcated into the same geo-fenced area, and the truncation longitude and latitude of the geographic locations in the geo-fenced area are the same. The truncated longitude and latitude in the geo-fenced area can then be used as the geographic location code of the geo-fenced area. As can be seen from the above description, the accuracy of the truncated longitude and latitude determines the scope of the final geo-fenced area. For example, the higher the accuracy of the truncated longitude and latitude (the more digits after the decimal point), the smaller the scope of the final geo-fenced area will be; correspondingly, the lower the accuracy of the truncated longitude and latitude (the fewer digits after the decimal point), the larger the scope of the final geo-fenced area will be.
下面再以geohash值为例来进行阐述:Let's take the geohash value as an example to illustrate:
在预设范围内某一地理位置的纬度为39.928167,经度为116.389550。服务器可以利用geohash算法将该经纬度映射为geohash值。利用geohash算法计算geohash值具体如下所述:The latitude of a certain geographic location within the preset range is 39.928167 and the longitude is 116.389550. The server can use the geohash algorithm to map the longitude and latitude to a geohash value. The specific steps for calculating the geohash value using the geohash algorithm are as follows:
通过下面算法对该地理位置的纬度39.928167进行逼近编码:The latitude of the geographic location 39.928167 is approximated by the following algorithm:
1)将地球纬度区间[-90,90]二分为[-90,0),[0,90]左右两个区间。1) Divide the Earth's latitude interval [-90, 90] into two intervals: [-90, 0) and [0, 90].
将一个区间划分成的两个区间分别称为左右区间。其中,左区间为较小数值所在的区间,右区间为较大数值所在的区间。进一步的,利用如下规则对纬度进行标记:The two intervals divided into one interval are called the left and right intervals. The left interval is the interval with the smaller value, and the right interval is the interval with the larger value. Furthermore, the latitude is marked using the following rules:
对于属于右区间的,标记为1;对于属于左区间的,标记为0。Those belonging to the right interval are marked as 1; those belonging to the left interval are marked as 0.
这样,39.928167属于右区间[0,90],按照上述规则,标记为1。Thus, 39.928167 belongs to the right interval [0, 90] and is marked as 1 according to the above rules.
2)将39.928167所在的右区间[0,90]二分为[0,45),[45,90]左右两个区间。判断39.928167属于左区间[0,45),标记为0。2) Divide the right interval [0, 90] where 39.928167 is located into two intervals, [0, 45) and [45, 90]. Determine that 39.928167 belongs to the left interval [0, 45] and mark it as 0.
3)按照下面表1递归上述步骤1)和步骤2)的过程直到标记了预定位数。3) The above steps 1) and 2) are repeated recursively according to Table 1 below until a predetermined number of bits are marked.
按照前述规则,可以在纬度39.928167属于二分区间的右区间时标记为1,属于左区间时给标记为0。According to the above rules, the latitude 39.928167 can be marked as 1 when it belongs to the right interval of the binary partition, and marked as 0 when it belongs to the left interval.
随着每次迭代区间的缩小,区间中值(表1中的Mid值)越来越逼近39.928167;As the interval shrinks with each iteration, the median of the interval (Mid value in Table 1) gets closer and closer to 39.928167;
对区间经过一定次数的二分,判断纬度值与二分后的区间的关系并标记,可以得到一个由0和1组成的序列号,序列号的长度与对区间进行二分的次数有关。表1中列出了纬度为39.928167的区间迭代表。After a certain number of binary divisions of an interval, the relationship between the latitude value and the interval after the binary division is determined and marked. This yields a sequence number consisting of 0s and 1s. The length of the sequence number is related to the number of binary divisions of the interval. Table 1 lists the interval iteration table for a latitude of 39.928167.
表1纬度为39.928167的区间迭代表Table 1 Interval iteration table with latitude 39.928167
如表1中所示,经过10次区间迭代,最终可以得到纬度为39.928167对应的序列号为1011100011(标记的数值按照先后顺序由左至右排列),并且纬度区间已经缩小至[39.9024375,40.07825]。As shown in Table 1, after 10 interval iterations, the sequence number corresponding to the latitude of 39.928167 is 1011100011 (the marked values are arranged from left to right in order), and the latitude interval has been narrowed to [39.9024375, 40.07825].
利用相同的方法,经过10次区间迭代,可以得到经度为116.389550对应的序列号为1101001011,并且经度区间已经缩小至[116.3671875,116.71875]。Using the same method, after 10 interval iterations, we can get the serial number 1101001011 corresponding to the longitude 116.389550, and the longitude interval has been narrowed to [116.3671875, 116.71875].
进一步的,可以对经度和纬度对应的序列号进行编码,生成该经纬度对应的geohash值。编码的方法为:将经度和纬度对应的序列号依次相互内插,生成新的序列号。新生成序列号的第一位为经度对应的序列号的第一位。继续以上述例子来进行说明:Furthermore, the serial numbers corresponding to the longitude and latitude can be encoded to generate the geohash values corresponding to the longitude and latitude. The encoding method is: the serial numbers corresponding to the longitude and latitude are interpolated with each other in sequence to generate a new serial number. The first digit of the newly generated serial number is the first digit of the serial number corresponding to the longitude. Continuing with the above example, we can explain:
对于纬度对应的序列号为10111 00011,经度对应的序列号为11010 01011的情况,将经度对应的序列号的第一位作为新生成序列号的第一位,将经度和纬度对应的序列号依次相互内插,可以形成11100 11101 00100 01111这样的新序列号。新生成的序列号从左至右顺序的奇数位为经度对应的序列号,偶数位为纬度对应的序列号。进一步地,可以使用0-9、b-z这32个字符(去掉a,i,l,o)对新生成的序列号进行base32编码。0-9、b-z这32个字符与十进制数的对应关系如表2所示。For the case where the sequence number corresponding to the latitude is 10111 00011 and the sequence number corresponding to the longitude is 11010 01011, the first bit of the sequence number corresponding to the longitude is used as the first bit of the newly generated sequence number, and the sequence numbers corresponding to the longitude and latitude are interpolated in sequence to form a new sequence number such as 11100 11101 00100 01111. The odd bits of the newly generated sequence number from left to right are the sequence number corresponding to the longitude, and the even bits are the sequence number corresponding to the latitude. Furthermore, the newly generated sequence number can be base32 encoded using the 32 characters 0-9, b-z (excluding a, i, l, o). The correspondence between the 32 characters 0-9, b-z and decimal numbers is shown in Table 2.
表2十进制数与Base32码的对应关系Table 2 Correspondence between decimal numbers and Base32 codes
注:Dec代表Decimal,表示十进制数;B32代表Base32码。Note: Dec stands for Decimal, which means decimal number; B32 stands for Base32 code.
在对新序列号进行编码时,首先可以将11100 11101 00100 01111中每五位转成十进制,即对应28、29、4、15;然后再将这4个十进制数利用表2中的对应关系进行编码。28对应w,29对应x,4对应4,15对应g,那么就可以得到wx4g。将wx4g作为经纬度(39.928167,116.389550)的geohash值。When encoding the new serial number, first convert every five digits in 11100 11101 00100 01111 into decimal, corresponding to 28, 29, 4, and 15. Then, encode these four decimal digits using the correspondence in Table 2. 28 corresponds to w, 29 to x, 4 to 4, and 15 to g, resulting in wx4g. Use wx4g as the geohash value for the longitude and latitude (39.928167, 116.389550).
上述计算geohash值的过程,迭代的次数决定了生成的序列号的长度,从而决定了最终生成geohash值的长度。geohash值越长,代表迭代的次数越多,最终的区间也更加接近实际的经纬度。换句话说,geohash值的位数越多,与经纬度的对应关系越精确。The number of iterations in the geohash calculation process above determines the length of the generated serial number, and thus the length of the final geohash value. A longer geohash value indicates a greater number of iterations, and the final interval is closer to the actual longitude and latitude. In other words, the more digits in the geohash value, the more accurate its correspondence with the latitude and longitude.
在一定的迭代次数下,即在一定长度的geohash值前提下,如果两个地理位置比较相近,对应经纬度的geohash值也会相同或比较接近。对于具有相同geohash值的地理位置,可以划分至同一地理围栏区域中。该地理围栏区域的geohash值便可以作为该地理围栏区域的地理位置编码。图2为本申请的一个例子中根据geohash值划分预设范围内地理位置的的示意图。从图2中可以看出,该预设范围内的地理位置被划分为9块矩形区域,每个矩形区域中的地理位置都具有一个唯一的geohash值。这9块矩形区域便可以作为划分后的地理围栏区域。Under a certain number of iterations, that is, under the premise of a certain length of geohash value, if two geographical locations are relatively close, the geohash values of the corresponding longitude and latitude will also be the same or relatively close. For geographical locations with the same geohash value, they can be divided into the same geofence area. The geohash value of the geofence area can be used as the geographical location code of the geofence area. Figure 2 is a schematic diagram of dividing the geographical locations within a preset range according to the geohash value in an example of the present application. It can be seen from Figure 2 that the geographical locations within the preset range are divided into 9 rectangular areas, and the geographical location in each rectangular area has a unique geohash value. These 9 rectangular areas can be used as the divided geofence areas.
服务器在将预设范围内的地理位置划分为不同的地理围栏区域后,可以通过所述的预设规则,将无线设备所处的地理位置转换为地理位置编码。通过对比无线设备的地理位置编码与已经划分好的地理围栏区域的地理位置编码,若无线设备的地理位置编码与划分好的某一个地理围栏区域的地理位置编码相同,便可以得知该无线设备处于该地理围栏区域中。具体的技术方案如下所述:After dividing the geographic location within a preset range into different geo-fenced areas, the server can convert the geographic location of the wireless device into a geo-code according to the preset rules. By comparing the geographic location code of the wireless device with the geographic location codes of the geo-fenced areas, if the geographic location code of the wireless device matches the geographic location code of a geo-fenced area, it can be determined that the wireless device is in the geo-fenced area. The specific technical solution is as follows:
S102:所述服务器获取无线设备的标识及对应的位置信息。S102: The server obtains the identification of the wireless device and the corresponding location information.
所述无线设备的标识及对应的位置信息可以是该无线设备的持有方发送至服务器的,所述无线设备的持有方例如可以是部署该无线设备的商家。所述无线设备的标识及对应的位置信息也可以是服务器从数据库中获取。所述数据库可以位于所述服务器上,也可以位于其它实体上或逻辑体上,后者例如可以是所述服务器可访问的实体或逻辑体。所述数据库,可以预存有无线设备的标识,及所述无线设备标识对应的该无线设备所处的位置信息。这些无线设备标识及其对应的位置信息,可以是由商家或服务器运营方预先登记或录入的。所述的无线设备的标识对应的位置信息可以包括所述无线设备所处地理位置的经纬度。The identification of the wireless device and the corresponding location information may be sent to the server by the holder of the wireless device, and the holder of the wireless device may be, for example, the merchant who deployed the wireless device. The identification of the wireless device and the corresponding location information may also be obtained by the server from a database. The database may be located on the server, or on other entities or logical entities, the latter of which may be, for example, an entity or logical entity accessible to the server. The database may pre-store the identification of the wireless device and the location information of the wireless device corresponding to the identification of the wireless device. These wireless device identifications and their corresponding location information may be pre-registered or entered by the merchant or server operator. The location information corresponding to the identification of the wireless device may include the longitude and latitude of the geographical location of the wireless device.
S103:所述服务器按照所述预设规则将所述无线设备的位置信息生成地理位置编码。S103: The server generates a geographic location code from the location information of the wireless device according to the preset rule.
服务器可以按照步骤S101中的去尾算法或者geohash算法,对所述无线设备的位置信息做同样的处理过程。例如,步骤S101中服务器是利用去尾算法对预设范围内的地理位置进行地理围栏的划分,那么在本步骤中,服务器也可以利用去尾算法对所述无线设备的位置信息进行处理,得到所述无线设备所处地理位置的去尾经纬度,该去尾经纬度便可以作为该无线设备所处地理位置的地理位置编码。The server may perform the same processing on the location information of the wireless device as the detent algorithm or geohash algorithm in step S101. For example, if the server in step S101 uses the detent algorithm to geo-fence the geographic location within a preset range, then in this step, the server may also use the detent algorithm to process the location information of the wireless device to obtain the detent longitude and latitude of the geographic location of the wireless device. The detent longitude and latitude may then be used as the geographic location code of the geographic location of the wireless device.
S104:所述服务器将所述无线设备的标识根据其对应的地理位置编码建立与所述地理围栏区域之间的对应关系。S104: The server establishes a correspondence between the identifier of the wireless device and the geo-fenced area according to its corresponding geographic location code.
服务器通过所述预设规则将所述无线设备的位置信息生成地理位置编码后,可以对比该无线设备的地理位置编码与已经划分好的地理围栏区域的地理位置编码,若该无线设备的地理位置编码与划分好的某一个地理围栏区域的地理位置编码相同,便可以得知该无线设备处于该地理围栏区域中。从而可以建立该无线设备的标识与所述地理围栏区域的对应关系。具体地,服务器可以将无线设备的标识以及对应的地理围栏利用key-value的形式进行存储。例如,WIFI设备的MAC地址为E0-9D-0B-9D-1C,该WIFI设备的MAC地址可以作为value。假设该WIFI设备的MAC地址对应的地理围栏为围栏1,那么该围栏1可以作为与上述value对应的key。通过WIFI设备的MAC地址的value,可以在服务器中查找到与该value相对应的key,也就是说可以找到对应的地理围栏。After the server generates a geographic location code from the location information of the wireless device according to the preset rules, it can compare the geographic location code of the wireless device with the geographic location code of the geo-fence area that has been divided. If the geographic location code of the wireless device is the same as the geographic location code of a certain geo-fence area that has been divided, it can be known that the wireless device is in the geo-fence area. In this way, a correspondence between the identification of the wireless device and the geo-fence area can be established. Specifically, the server can store the identification of the wireless device and the corresponding geo-fence in the form of key-value. For example, the MAC address of the WIFI device is E0-9D-0B-9D-1C, and the MAC address of the WIFI device can be used as the value. Assuming that the geo-fence corresponding to the MAC address of the WIFI device is fence 1, then fence 1 can be used as the key corresponding to the above value. Through the value of the MAC address of the WIFI device, the key corresponding to the value can be found in the server, that is, the corresponding geo-fence can be found.
所述服务器建立无线设备的标识与地理围栏区域的对应关系,可以是服务器响应于拥有无线设备的商家的指令建立或者响应于管理无线设备的运营商的指令建立。例如,服务器可以响应于拥有WIFI设备的商家的指令,建立该WIFI设备与地理围栏的对应关系或者服务器可以响应于管理WIFI设备的运营商的指令,建立该WIFI设备与地理围栏的对应关系。The server may establish a correspondence between the wireless device identifier and the geo-fence area in response to instructions from a merchant that owns the wireless device or in response to instructions from a carrier that manages the wireless device. For example, the server may establish a correspondence between the Wi-Fi device and the geo-fence in response to instructions from a merchant that owns the Wi-Fi device, or the server may establish a correspondence between the Wi-Fi device and the geo-fence in response to instructions from a carrier that manages the Wi-Fi device.
S200:移动终端获取至少一个无线设备的标识并将所述标识上传至所述服务器。S200: The mobile terminal obtains an identification of at least one wireless device and uploads the identification to the server.
步骤S200具体包括:Step S200 specifically includes:
所述移动终端通过预设手段查询搜索到的无线设备中至少一个无线设备的标识;The mobile terminal queries the identification of at least one wireless device among the searched wireless devices by a preset means;
或者,or,
所述移动终端通过预设手段查询连接到的无线设备中至少一个无线设备的标识。The mobile terminal queries the identification of at least one wireless device among the connected wireless devices through a preset means.
当移动终端进入或者靠近按照步骤S100划分的地理围栏区域时,可以进行WIFI信号的搜索。搜索到WIFI信号或者连接上WIFI设备后,移动终端可以利用操作系统的API(Application Programming Interface,应用程序编程接口)查询搜索到的WIFI信号对应的WIFI设备的MAC地址或者连接上的WIFI设备的MAC地址。所述利用操作系统的API进行查询可以为所述预设手段中的一种。When the mobile terminal enters or approaches the geo-fenced area defined in step S100, a search for a Wi-Fi signal can be performed. After a Wi-Fi signal is found or a Wi-Fi device is connected, the mobile terminal can use the operating system's application programming interface (API) to query the MAC address of the Wi-Fi device corresponding to the found Wi-Fi signal or the MAC address of the connected Wi-Fi device. Using the operating system's API to query can be one of the pre-defined methods.
在实际应用场景中,移动终端可能同时搜索到多个WIFI设备的信号或者先后连接上多个WIFI设备。移动终端可以通过操作系统的API查询搜索到的或者连接到的WIFI设备中至少一个WIFI设备的标识。In actual application scenarios, the mobile terminal may search for signals of multiple WIFI devices at the same time or connect to multiple WIFI devices in succession. The mobile terminal can query the identification of at least one WIFI device among the searched or connected WIFI devices through the API of the operating system.
移动终端查询到WIFI设备的MAC地址后,可以将该WIFI设备的MAC地址上传到服务器。服务器则可以根据移动终端上传的WIFI设备的MAC地址查询相对应的地理围栏。After the mobile terminal queries the MAC address of the Wi-Fi device, it can upload the MAC address of the Wi-Fi device to the server. The server can then query the corresponding geo-fence based on the MAC address of the Wi-Fi device uploaded by the mobile terminal.
S300:所述服务器基于所述无线设备标识与地理围栏区域的对应关系查询所述上传的无线设备的标识对应的地理围栏区域。S300: The server queries the geo-fenced area corresponding to the uploaded wireless device identifier based on the correspondence between the wireless device identifier and the geo-fenced area.
服务器接收到移动终端上传的WIFI设备的MAC地址后,可以根据建立的无线设备标识与对应地理围栏区域的对应关系,查询到上传的WIFI设备的MAC地址所属的地理围栏区域。例如,当无线设备的标识以及对应的地理围栏区域通过key-value的方式存储在服务器中时,服务器可以根据WIFI设备的MAC地址这个value,查找到与该value相对应的key,也就是该WIFI设备的MAC地址对应的地理围栏。After receiving the MAC address of the Wi-Fi device uploaded by the mobile terminal, the server can query the geo-fenced area to which the uploaded Wi-Fi device MAC address belongs based on the established correspondence between the wireless device identifier and the corresponding geo-fenced area. For example, if the wireless device identifier and the corresponding geo-fenced area are stored in the server as a key-value pair, the server can use the Wi-Fi device MAC address as the value to find the key corresponding to the value, that is, the geo-fence corresponding to the Wi-Fi device MAC address.
服务器查询到WIFI设备的MAC地址所属的地理围栏区域时,即可以获得移动终端所处的地理围栏区域。进而,服务器可以将存有的与地理围栏区域对应的推送信息推送至移动终端。所述存有的与地理围栏区域对应的推送信息,可以是商家预先在服务器中登记/录入的推送信息。所述商家的推送信息与地理围栏的对应关系,可以根据商家的无线设备的标识与与地理围栏区域的对应关系确定。When the server queries the geo-fenced area to which the WIFI device's MAC address belongs, it can obtain the geo-fenced area where the mobile terminal is located. Furthermore, the server can push existing push information corresponding to the geo-fenced area to the mobile terminal. The existing push information corresponding to the geo-fenced area can be push information pre-registered/entered by the merchant on the server. The correspondence between the merchant's push information and the geo-fence can be determined based on the merchant's wireless device identifier and the correspondence with the geo-fenced area.
在本申请另一实施例中,移动终端还可以将服务器中建立的无线设备的标识与地理围栏区域的对应关系同步到移动终端中。这样,当移动终端获取到无线设备的标识后,可以在该移动终端中直接查询获取到的无线设备的标识对应的地理围栏区域,而不需要将该无线设备的标识发送至服务器进行查询。图3为本申请另一实施例提供的一种识别地理围栏的方法流程图。如图3所示,所述方法包括:In another embodiment of the present application, the mobile terminal can also synchronize the correspondence between the wireless device identifier and the geo-fence area established in the server to the mobile terminal. In this way, after the mobile terminal obtains the wireless device identifier, the geo-fence area corresponding to the obtained wireless device identifier can be directly queried in the mobile terminal without sending the wireless device identifier to the server for query. Figure 3 is a flow chart of a method for identifying geo-fences provided in another embodiment of the present application. As shown in Figure 3, the method includes:
S110:服务器建立无线设备的标识与地理围栏区域的对应关系。S110: The server establishes a correspondence between the identifier of the wireless device and the geo-fenced area.
服务器可以将无线设备信号的覆盖范围划分为所述无线设备的标识对应的地理围栏区域,也可以按照预设规则预先将预设范围内的地理位置划分为不同的地理围栏区域,再通过所述预设规则将无线设备的位置信息生成地理位置编码并基于该生成的地理位置编码建立无线设备的标识与所述地理围栏区域之间的对应关系。本步骤的具体实现方案与步骤S100类似,这里不再赘述。The server can divide the coverage area of the wireless device signal into geo-fenced areas corresponding to the wireless device identifier, or it can pre-divide the geographic location within a preset range into different geo-fenced areas according to a preset rule, then generate a geo-location code from the wireless device's location information according to the preset rule, and establish a correspondence between the wireless device identifier and the geo-fenced area based on the generated geo-location code. The specific implementation scheme of this step is similar to step S100 and will not be repeated here.
S210:移动终端从所述服务器中获取所述建立的无线设备的标识与地理围栏区域的对应关系。S210: The mobile terminal obtains the established correspondence between the identifier of the wireless device and the geo-fenced area from the server.
服务器建立了无线设备的标识与地理围栏区域的对应关系后,移动终端可以从所述服务器中获取所述建立的无线设备的标识与地理围栏区域的对应关系。具体地,移动终端可以安装一地理围栏客户端,该地理围栏客户端可以按照预设时间周期自动地从服务器中同步无线设备的标识与地理围栏区域的对应关系;该地理围栏客户端还可以响应于移动终端用户的操作指令,从服务器中同步无线设备的标识与地理围栏区域的对应关系。After the server establishes a correspondence between the wireless device identifier and the geo-fenced area, the mobile terminal can obtain the established correspondence between the wireless device identifier and the geo-fenced area from the server. Specifically, the mobile terminal can be installed with a geo-fencing client that can automatically synchronize the correspondence between the wireless device identifier and the geo-fenced area from the server at a preset time period. The geo-fencing client can also synchronize the correspondence between the wireless device identifier and the geo-fenced area from the server in response to an operation instruction from the mobile terminal user.
S310:移动终端获取至少一个无线设备的标识并基于所述无线设备的标识与地理围栏区域的对应关系查询所述获取的无线设备的标识对应的地理围栏区域。S310: The mobile terminal obtains an identifier of at least one wireless device and queries the geo-fenced area corresponding to the obtained identifier of the wireless device based on the correspondence between the identifier of the wireless device and the geo-fenced area.
所述移动终端可以通过预设手段查询搜索到的无线设备中至少一个无线设备的标识或者通过预设手段查询连接到的无线设备中至少一个无线设备的标识。具体地,当移动终端进入或者靠近按照步骤S110划分的地理围栏区域时,可以进行WIFI信号的搜索。搜索到WIFI信号或者连接上WIFI设备后,移动终端可以利用操作系统的API(ApplicationProgramming Interface,应用程序编程接口)查询搜索到的WIFI信号对应的WIFI设备的MAC地址或者连接上的WIFI设备的MAC地址。所述利用操作系统的API进行查询可以为所述预设手段中的一种。The mobile terminal can query the identifier of at least one of the searched wireless devices or query the identifier of at least one of the connected wireless devices by a preset means. Specifically, when the mobile terminal enters or approaches the geo-fenced area divided according to step S110, a search for a WIFI signal can be performed. After searching for a WIFI signal or connecting to a WIFI device, the mobile terminal can use the operating system's API (Application Programming Interface) to query the MAC address of the WIFI device corresponding to the searched WIFI signal or the MAC address of the connected WIFI device. The query using the operating system's API can be one of the preset means.
在实际应用场景中,移动终端可能同时搜索到多个WIFI设备的信号或者先后连接上多个WIFI设备。移动终端可以通过操作系统的API查询搜索到的或者连接到的WIFI设备中至少一个WIFI设备的标识。In actual application scenarios, the mobile terminal may search for signals of multiple WIFI devices at the same time or connect to multiple WIFI devices in succession. The mobile terminal can query the identification of at least one WIFI device among the searched or connected WIFI devices through the API of the operating system.
移动终端查询到WIFI设备的MAC地址后,可以通过移动终端中无线设备的标识与地理围栏区域的对应关系,查询到该WIFI设备的MAC地址所属的地理围栏区域。After the mobile terminal queries the MAC address of the WIFI device, it can query the geo-fenced area to which the MAC address of the WIFI device belongs through the correspondence between the identification of the wireless device in the mobile terminal and the geo-fenced area.
移动终端查询到WIFI设备的MAC地址所属的地理围栏区域时,即可以获得移动终端所处的地理围栏区域。进而,移动终端可以将该识别出的地理围栏区域发送至服务器,服务器可以将存有的与该地理围栏区域对应的推送信息推送至移动终端。所述存有的与地理围栏区域对应的推送信息,可以是商家预先在服务器中登记/录入的推送信息。所述商家的推送信息与地理围栏的对应关系,可以根据商家的无线设备的标识与与地理围栏区域的对应关系确定。When a mobile terminal queries the geo-fenced area to which the MAC address of a Wi-Fi device belongs, it can obtain the geo-fenced area in which the mobile terminal is located. The mobile terminal can then send the identified geo-fenced area to a server, which can then push existing push information corresponding to the geo-fenced area to the mobile terminal. The existing push information corresponding to the geo-fenced area can be push information pre-registered/entered by the merchant on the server. The correspondence between the merchant's push information and the geo-fence can be determined based on the merchant's wireless device identifier and the correspondence between the geo-fenced area and the device.
下面介绍本申请以服务器为主体的实施例。图7为本申请实施例中提供的以服务器为主体的一种识别地理围栏的方法。如图7所示,所述方法包括:The following describes an embodiment of the present application using a server as the main body. FIG7 shows a method for identifying a geo-fence using a server as the main body provided in an embodiment of the present application. As shown in FIG7 , the method includes:
S410:服务器建立无线设备的标识与地理围栏区域的对应关系;S410: The server establishes a correspondence between the identifier of the wireless device and the geo-fenced area;
S420:所述服务器接收移动终端上传的无线设备的标识;S420: The server receives the identification of the wireless device uploaded by the mobile terminal;
S430:所述服务器基于所述无线设备标识与地理围栏区域的对应关系查询所述上传的无线设备的标识对应的地理围栏区域。S430: The server queries the geo-fenced area corresponding to the uploaded wireless device identifier based on the correspondence between the wireless device identifier and the geo-fenced area.
进一步地,在本申请一优选实施例中,上述方法还包括:Furthermore, in a preferred embodiment of the present application, the above method further includes:
S440:所述服务器将预存的与所述查询的地理围栏区域对应的推送信息推送至移动终端。S440: The server pushes pre-stored push information corresponding to the queried geo-fenced area to the mobile terminal.
进一步地,在本申请一优选实施例中,所述服务器建立无线设备的标识与地理围栏区域的对应关系包括:Furthermore, in a preferred embodiment of the present application, the server establishing a correspondence between the identifier of the wireless device and the geo-fenced area includes:
S411:服务器将无线设备信号的覆盖范围划分为所述无线设备的标识对应的地理围栏区域;S411: The server divides the coverage area of the wireless device signal into geo-fenced areas corresponding to the identifier of the wireless device;
或者,or,
S412:服务器将预设范围内的地理位置按照预设规则划分为不同的地理围栏区域,所述不同的地理围栏区域对应不同的地理位置编码;S412: The server divides the geographical locations within the preset range into different geographical fence areas according to preset rules, where the different geographical fence areas correspond to different geographical location codes;
S413:所述服务器获取无线设备的标识及对应的位置信息;S413: The server obtains the identification of the wireless device and the corresponding location information;
S414:所述服务器按照所述预设规则将所述无线设备的位置信息生成地理位置编码;S414: The server generates a geographic location code from the location information of the wireless device according to the preset rule;
S415:所述服务器将所述无线设备的标识根据其对应的地理位置编码建立与所述地理围栏区域之间的对应关系。S415: The server establishes a correspondence between the identifier of the wireless device and the geo-fenced area according to its corresponding geographic location code.
上述预设规则包括geohash算法或者去尾算法。The above preset rules include a geohash algorithm or a tail removal algorithm.
下面介绍本申请以移动终端为主体的实施例。图8为本申请实施例中提供的以移动终端为主体的一种识别地理围栏的方法。如图8所示,所述方法包括:The following describes an embodiment of the present application using a mobile terminal as the main body. FIG8 is a method for identifying a geo-fence using a mobile terminal as the main body provided in an embodiment of the present application. As shown in FIG8 , the method includes:
S510:移动终端从服务器中获取建立的无线设备的标识与地理围栏区域的对应关系;S510: The mobile terminal obtains the established correspondence between the wireless device identifier and the geo-fenced area from the server;
S520:所述移动终端获取至少一个无线设备的标识并基于所述无线设备的标识与地理围栏区域的对应关系查询所述获取的无线设备的标识对应的地理围栏区域。S520: The mobile terminal obtains an identifier of at least one wireless device and queries the geo-fenced area corresponding to the obtained identifier of the wireless device based on the correspondence between the identifier of the wireless device and the geo-fenced area.
进一步地,在本申请一优选实施例中,所述方法还包括:Furthermore, in a preferred embodiment of the present application, the method further includes:
S530:所述移动终端将所述查询的地理围栏区域发送至所述服务器;S530: The mobile terminal sends the queried geo-fenced area to the server;
S540:所述移动终端接收与所述查询的地理围栏区域对应的推送信息。S540: The mobile terminal receives push information corresponding to the queried geo-fenced area.
进一步地,在本申请一优选实施例中,所述移动终端获取至少一个无线设备的标识具体包括:Furthermore, in a preferred embodiment of the present application, the mobile terminal obtaining the identification of at least one wireless device specifically includes:
S521:所述移动终端通过预设手段查询搜索的无线设备中至少一个无线设备的标识;S521: The mobile terminal queries the identification of at least one wireless device among the searched wireless devices by a preset means;
或者,or,
S522:所述移动终端通过预设手段查询连接的无线设备中至少一个无线设备的标识。S522: The mobile terminal queries the identification of at least one wireless device among the connected wireless devices through a preset means.
上述通过预设手段查询包括利用操作系统的应用程序编程接口查询。The aforementioned querying by the preset means includes querying by utilizing the application programming interface of the operating system.
本申请实施例还提供一种识别地理围栏的系统。图4为本申请实施例提供的一种识别地理围栏的系统。如图4所示,所述系统包括:The present application also provides a system for identifying geofences. FIG4 shows a system for identifying geofences provided by an embodiment of the present application. As shown in FIG4 , the system includes:
服务器100,用来用来建立无线设备的标识与地理围栏区域的对应关系;基于所述无线设备标识与地理围栏区域的对应关系查询上传的无线设备的标识对应的地理围栏区域;将预存的与所述查询到的地理围栏区域对应的推送信息推送至所述移动终端;The server 100 is used to establish a correspondence between the wireless device identifier and the geo-fenced area; query the geo-fenced area corresponding to the uploaded wireless device identifier based on the correspondence between the wireless device identifier and the geo-fenced area; and push pre-stored push information corresponding to the queried geo-fenced area to the mobile terminal;
移动终端200,用来获取至少一个无线设备的标识并将所述标识上传至所述服务器;接收与所述查询的地理围栏区域对应的推送信息。The mobile terminal 200 is used to obtain the identification of at least one wireless device and upload the identification to the server; and receive push information corresponding to the queried geo-fenced area.
本申请另一实施例还提供一种识别地理围栏的系统,所述系统包括:Another embodiment of the present application further provides a system for identifying geo-fences, the system comprising:
服务器110,用来建立无线设备的标识与地理围栏区域的对应关系;将预存的与查询的地理围栏区域对应的推送信息推送至所述移动终端;The server 110 is used to establish a correspondence between the identification of the wireless device and the geo-fenced area; and push the pre-stored push information corresponding to the queried geo-fenced area to the mobile terminal;
移动终端210,用来从所述服务器中获取所述建立的无线设备的标识与地理围栏区域的对应关系;获取至少一个无线设备的标识并基于所述无线设备的标识与地理围栏区域的对应关系查询所述获取的无线设备的标识对应的地理围栏区域;将所述查询的地理围栏区域发送至所述服务器;接收与所述查询的地理围栏区域对应的推送信息。The mobile terminal 210 is used to obtain the correspondence between the identification of the established wireless device and the geo-fence area from the server; obtain the identification of at least one wireless device and query the geo-fence area corresponding to the identification of the obtained wireless device based on the correspondence between the identification of the wireless device and the geo-fence area; send the queried geo-fence area to the server; and receive push information corresponding to the queried geo-fence area.
图5为本申请实施例中提供的一种识别地理围栏的服务器。如图5所示,所述服务器100包括:FIG5 is a server for identifying geo-fences provided in an embodiment of the present application. As shown in FIG5 , the server 100 includes:
对应关系建立单元101,用来建立无线设备的标识与地理围栏区域的对应关系;A correspondence establishing unit 101 is used to establish a correspondence between the identifier of the wireless device and the geo-fenced area;
地理围栏查询单元102,用来基于所述无线设备标识与地理围栏区域的对应关系查询上传的无线设备的标识对应的地理围栏区域;A geo-fence query unit 102 is configured to query the geo-fence area corresponding to the uploaded wireless device identifier based on the correspondence between the wireless device identifier and the geo-fence area;
信息推送单元103,用来将预存的与所述查询到的地理围栏区域对应的推送信息推送至所述移动终端。The information push unit 103 is used to push pre-stored push information corresponding to the queried geo-fenced area to the mobile terminal.
进一步地,所述对应关系建立单元101具体包括:Furthermore, the correspondence establishing unit 101 specifically includes:
第一对应关系建立单元1011,用来将无线设备信号的覆盖范围划分为所述无线设备的标识对应的地理围栏区域。The first correspondence establishing unit 1011 is configured to divide the coverage area of the wireless device signal into geographic fence areas corresponding to the identifier of the wireless device.
进一步地,所述对应关系建立单元101具体包括:Furthermore, the correspondence establishing unit 101 specifically includes:
第二对应关系建立单元1012,用来将预设范围内的地理位置按照预设规则划分为不同的地理围栏区域,所述不同的地理围栏区域对应不同的地理位置编码;获取无线设备的标识及对应的位置信息;按照所述预设规则将所述无线设备的位置信息生成地理位置编码;将所述无线设备的标识根据其对应的地理位置编码建立与所述地理围栏区域之间的对应关系。The second correspondence establishing unit 1012 is used to divide the geographical locations within a preset range into different geographical fence areas according to preset rules, and the different geographical fence areas correspond to different geographical location codes; obtain the identification of the wireless device and the corresponding location information; generate a geographical location code from the location information of the wireless device according to the preset rules; and establish a correspondence between the identification of the wireless device and the geographical fence area according to its corresponding geographical location code.
图6为本申请实施例提供的一种识别地理围栏的移动终端。如图6所示,所述移动终端210包括:FIG6 is a mobile terminal for identifying a geo-fence according to an embodiment of the present application. As shown in FIG6 , the mobile terminal 210 includes:
无线设备标识获取单元211,用来获取至少一个无线设备的标识;A wireless device identification obtaining unit 211 is configured to obtain an identification of at least one wireless device;
地理围栏区域查询单元212,用来基于所述无线设备的标识与地理围栏区域的对应关系查询所述获取的无线设备的标识对应的地理围栏区域;a geo-fenced area query unit 212 configured to query the geo-fenced area corresponding to the obtained wireless device identifier based on the correspondence between the wireless device identifier and the geo-fenced area;
地理围栏区域发送单元213,用来将所述查询的地理围栏区域发送至所述服务器;a geo-fence area sending unit 213, configured to send the queried geo-fence area to the server;
信息接收单元214,用来接收与所述查询的地理围栏区域对应的推送信息。The information receiving unit 214 is used to receive push information corresponding to the queried geo-fenced area.
本申请实施例基于无线设备的标识所处的位置进行地理围栏的划分和识别,当移动终端搜索或连接到无线设备的信号时,就可以认为该移动终端处于该无线设备附近。本申请实施例通过搜索无线设备的信号进行地理围栏的识别,在不需要依赖GPS之类的定位装置的情况下,也能够识别划分的地理围栏。The present embodiment of the present invention divides and identifies geofences based on the location of a wireless device's identifier. When a mobile terminal searches for or connects to a wireless device's signal, it is considered to be in the vicinity of the wireless device. The present embodiment of the present invention identifies geofences by searching for wireless device signals, and can identify geofences without relying on positioning devices such as GPS.
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable GateArray,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片2。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware DescriptionLanguage)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(RubyHardware DescriptionLanguage)等,目前最普遍使用的是VHDL(Very-High-SpeedIntegrated Circuit Hardware Description Language)与Verilog2。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。In the 1990s, technological improvements could be clearly distinguished as either hardware improvements (for example, improvements to circuit structures such as diodes, transistors, and switches) or software improvements (improvements to process flows). However, with the advancement of technology, many process flow improvements today can now be considered direct improvements to hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved process flow into the hardware circuit. Therefore, it cannot be said that a process flow improvement cannot be implemented using hardware modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is an integrated circuit whose logical function is determined by user programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to hire a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this type of programming is mostly performed using "logic compiler" software. This is similar to the software compiler used when developing programs. Before compilation, the original code must also be written in a specific programming language, called a hardware description language (HDL). There is not just one HDL, but many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog2. Those skilled in the art will also understand that by simply programming the method flow in one of these hardware description languages and then programming it into an integrated circuit, a hardware circuit that implements the logic method flow can be easily obtained.
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller and an embedded microcontroller. Examples of controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory.
本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。Those skilled in the art will also appreciate that, in addition to implementing the controller in pure computer-readable program code, it is entirely possible to implement the same functionality by logically programming the method steps in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, embedded microcontrollers, and the like. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be considered structures within the hardware component. Alternatively, the devices for implementing various functions can be considered both software modules implementing the method and structures within the hardware component.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions.
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this application, the functions of each unit can be implemented in the same or multiple software and/or hardware.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例或者实施例的某些部分所述的方法。Through the description of the above embodiments, it can be seen that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a storage medium such as ROM/RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present application or certain parts of the embodiments.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.
本申请可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。The present application can be used in a wide variety of general-purpose or specialized computer system environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments that include any of the above.
本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
虽然通过实施例描绘了本申请,本领域普通技术人员知道,本申请有许多变形和变化而不脱离本申请的精神,希望所附的权利要求包括这些变形和变化而不脱离本申请的精神。Although the present application has been described with reference to the embodiments, those skilled in the art will appreciate that there are many modifications and variations to the present application without departing from the spirit of the present application. It is intended that the appended claims include these modifications and variations without departing from the spirit of the present application.
Claims (29)
Publications (3)
| Publication Number | Publication Date |
|---|---|
| HK1228153A1 HK1228153A1 (en) | 2017-10-27 |
| HK1228153A HK1228153A (en) | 2017-10-27 |
| HK1228153B true HK1228153B (en) | 2021-04-01 |
Family
ID=
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN105848099B (en) | Method, system, server and mobile terminal for identifying geo-fence | |
| US7127068B2 (en) | Geographical comparison system and method | |
| US9602966B2 (en) | Adding geo-fences based on time | |
| CN107534837B (en) | Location-based reminder method, pointing device, reminder device and mobile terminal | |
| CN108271120B (en) | Method, device and equipment for determining target area and target user | |
| JP5346811B2 (en) | Managing groups of location-based triggers | |
| TWI709353B (en) | Method for determining positioning interval of mobile terminal, mobile terminal and server | |
| CN105308567A (en) | Category-based fence | |
| US8478304B1 (en) | Methods and systems for associating location information with a wireless local area network | |
| WO2016095120A1 (en) | Geo-fencing implementation method and mobile device | |
| US20190253831A1 (en) | Method of balance of accuracy and power consumption for geofence | |
| CN108282843B (en) | Network query method, device and server | |
| CN106162542B (en) | Electronic certificate prompting method and server | |
| CN104994492B (en) | Method and server for saving pages in standard format | |
| CN106294449B (en) | Data processing method and device | |
| CN106375593B (en) | Method and device for determining a positioning mode | |
| US11086976B2 (en) | Identification preprocessing | |
| CN104596518A (en) | Mall exit navigation method and mall exit navigation device | |
| CN108882165B (en) | Navigation method and device | |
| HK1228153B (en) | Method and system for identifying geo-fence, server and mobile terminal | |
| CN103052021A (en) | Method and equipment for providing location-based service | |
| US11200409B2 (en) | Utilizing an array of cameras including IoT sensors with cameras to search for objects via a wireless communication network | |
| CN106303941A (en) | The processing method of terminal positional information and server | |
| HK1228153A (en) | Method and system for identifying geo-fence, server and mobile terminal | |
| HK1228153A1 (en) | Method and system for identifying geo-fence, server and mobile terminal |