A method for dividing a geo-fence and a related electronic device
By expanding the raster set and density clustering algorithm, the problem of not considering boundary and adjacent area point data in raster division is solved, realizing more accurate geofencing and improving user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2023-12-15
- Publication Date
- 2026-07-03
AI Technical Summary
Existing technologies for geofencing based on grid division fail to effectively consider the grid boundaries and the data points of adjacent areas, resulting in low accuracy of geofencing. This makes it impossible to accurately reflect urban geographical features and user behavior patterns, thus affecting user experience.
By expanding the grid set, the method considers the point data of the target grid and its neighboring grids, uses the association radius and grid size to determine the expanded grid set, and employs a density clustering algorithm to calculate the geofencing, reducing the separation of similar data in different grids and improving the accuracy of geofencing.
The accuracy of geofencing has been improved, enabling users to receive more accurate recommendations when entering the corresponding area, thus enhancing the user experience.
Smart Images

Figure CN120201079B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method for dividing geofencing and related electronic equipment. Background Technology
[0002] Geo-fencing is a new application based on Location Based Services (LBS). It uses a virtual fence to define a virtual geographic boundary. By collecting data from numerous users and performing clustering and feature mining on geofencing, phones can receive automatic notifications and warnings when entering, leaving, or moving within a specific geographic area. This allows for convenient recommendations within that area. For example, for locations requiring QR code payments, we can identify when users scan the code, collect corresponding geographic data, and cluster the geofencing to determine user habits and peak / off-peak payment times within each geofence. Then, when users return to the same location for payments, we can provide a quick QR code scanning shortcut on their home screen, enhancing their payment experience.
[0003] When clustering crowdsourced data on user tracking by city, the massive amount of data can lead to severely time-consuming computations, or even prevent the generation of geofencing results. Therefore, existing technologies typically employ rasterization, dividing the city's crowdsourced data into regular raster units and then clustering the data according to these raster units. However, raster-based data partitioning can result in data isolation. That is, data belonging to the same category may be separated into different raster units, preventing unified clustering and splitting data of the same category into multiple categories. Consequently, the calculated geofencing may not accurately reflect the city's actual geographical characteristics or user behavior patterns, preventing users from receiving appropriate recommendations within the corresponding geographical area and thus degrading the user experience. Summary of the Invention
[0004] This application provides a method for dividing geofencing and related electronic equipment, which can improve the accuracy of geofencing based on grid maps, thereby enhancing the user experience.
[0005] In a first aspect, embodiments of this application provide a method for delineating geofences. The method may include: acquiring crowdsourced data from a grid map, the crowdsourced data including data points of business activities reported by numerous electronic devices; based on the crowdsourced data, determining grid information for each grid cell in the grid map, the grid information including grid size, grid identifier, and a set of data points within the corresponding geographical area; and based on target precision and the grid size of the target grid cell, determining a set of M first grid cells corresponding to the target grid cell, wherein the target grid cell is any grid cell in the grid map, and the target grid cell corresponds to M extended grid cells. The M extended grids include the target grid and (M-1) grids associated with the target grid, where M is a positive integer; wherein, one extended grid corresponds to one first grid set, and one first grid set includes the corresponding extended grid and the grids associated with the corresponding extended grid; based on the M first grid sets corresponding to each target grid in the grid map, multiple first point data sets are determined, wherein one first grid set corresponds to one first point data set; based on the multiple first point data sets corresponding to each target grid in the grid map, the geofence of the grid map is determined.
[0006] In this embodiment of the application, since the data points (i.e., crowdsourced data) of the business activities reported by numerous electronic devices in the raster map are randomly distributed, data points may also be distributed on the boundary of any raster (i.e., the target raster) and / or in the area of adjacent raster near the boundary of the target raster. These data points have a high degree of similarity to the data points in the target raster and may belong to the same type of data points (e.g., data points with specific business activities). However, the existing method of dividing geofences is to generate the geofence corresponding to the entire raster map based on the data point set in each target raster in the raster map. The limitation of this method is that it does not consider the associated point data distributed on the boundary of each target raster and / or in the area of neighboring rasters close to the boundary of the target raster. This point data may not be sufficient to generate a geofence due to insufficient distribution and / or insufficient clustering in other corresponding rasters. Consequently, the geofences generated by existing geofence delineation methods are not accurate and cannot accurately reflect the actual geographical features or user behavior patterns of the corresponding geographical area of the raster map. This results in users not receiving timely and accurate recommendations when using location services based on the geofence, thus reducing the user experience. In the geofence delineation method of this application embodiment, in the process of generating the corresponding geofence (i.e., the geofence of the raster map) based on the set of point data within the geographical area corresponding to all target rasters in the raster map, it also considers all point data associated with the point data within the geographical area corresponding to the target raster (i.e., multiple first point data sets). By treating the multiple first point data sets corresponding to each target raster in the raster map as an independent computational unit, the geofences corresponding to all target rasters are calculated. Specifically, in this embodiment, M extended grids can be determined based on a target grid, which includes the target grid and (M-1) extended grids. Each extended grid may include point data associated with the target grid. In order to facilitate the determination of the point data associated with the point data in the target grid in each extended grid, it is necessary to determine the grids associated with each extended grid (that is, the first grid set). One extended grid corresponds to one first grid set, and one first grid set includes the corresponding extended grid and the grids associated with the extended grid, thereby obtaining M first grid sets based on M extended grids.Therefore, this embodiment of the application determines the M first grid sets corresponding to the target grid based on the target accuracy and the grid size of any grid in the grid map (i.e., the target grid). Then, based on the M first grid sets corresponding to each target grid in the grid map, the point data in the target grid and the set of all point data associated with the point data in the target grid (i.e., multiple first point data sets) are determined. Furthermore, the geofence of the grid map is determined based on the multiple first point data sets corresponding to each target grid in the grid map. In summary, the embodiments of this application, in the process of dividing geofences, treat the multiple sets of first marker data corresponding to each target grid in the grid map as an independent calculation unit. Compared with the prior art, which treats each target grid in the grid map as an independent calculation unit, this minimizes the problem that marker data that originally belong to the same category in the grid map (e.g., marker data with specific business behaviors) cannot be uniformly calculated because they are divided into different grids. Therefore, the geofences of the grid map determined by the embodiments of this application can more accurately reflect the actual geographical characteristics or user behavior patterns of the corresponding geographical area of the grid map, improve the accuracy of geofence division, and enable users to receive corresponding recommendation services more accurately when entering the geographical area corresponding to the geofence, thereby improving the user experience.
[0007] In one possible implementation, the target accuracy is determined based on the size of the association radius, which indicates the expected accuracy of the geofence; the association radius is a distance range used to determine whether the point data are associated.
[0008] In this embodiment, the target accuracy is used to indicate the desired precision of the generated geofence, which can be determined by the size of the association radius. Furthermore, since the association radius can be used to determine the distance range within which point data is associated, that is, when dividing geofences for point data in the raster map, if the distance between two point data is within the range of the association radius, then the two point data are considered associated. For example, the larger the association radius, the greater the distance between the point data associated with the point data in the geographic area corresponding to the target raster and the raster boundary of the target raster, and the larger the determined geofence range. Conversely, the smaller the association radius, the smaller the geofence range. Since a geofence range that is too large or too small will affect its precision, selecting an appropriate association radius allows the generated geofence to achieve the desired target accuracy, more accurately reflecting the actual geographic characteristics or user behavior patterns of the geographic area corresponding to the raster map, thus enabling more accurate recommendation services based on the geofence to improve the user experience.
[0009] In one possible implementation, determining the M first grid sets corresponding to the target grid based on the target precision and the grid size of the target grid may include: determining a first row and column range based on the associated radius and the grid size of the target grid; the first row and column range being the row and column range where a specific grid in the M first grid sets is located; and determining the M first grid sets corresponding to the target grid based on the first row and column range.
[0010] In this embodiment of the application, determining the M sets of first grids corresponding to a target grid based on the expected accuracy (i.e., target accuracy) of the geofence and the grid size of any grid (i.e., the target grid) in the grid map specifically includes: determining the row and column range (i.e., the first row and column range) of a specific grid in the M sets of first grids corresponding to the target grid, based on the association radius of the distance range used to determine whether the point data are related and the grid size of any grid (i.e., the target grid) in the grid map. For example, when the specific grid corresponding to the target grid is the grid located in the upper left corner of the M sets of first grids, the first row and column range is the row and column range of the grid located in the upper left corner of the M sets of first grids corresponding to the target grid; further, determining the M sets of first grids corresponding to the target grid based on the first row and column range. Since the desired accuracy (i.e., target accuracy) of a geofencing system can be determined by the size of the association radius, which is used to determine whether the data points are correlated, this embodiment of the application can determine the row and column range (i.e., the first row and column range) of a specific grid cell in the M first grid sets corresponding to the target grid cell by using the association radius and the grid size of any grid cell (i.e., the target grid cell) in the grid map. This further determines the M first grid sets corresponding to the target grid cell, so that the set of data points (i.e., the set of data points) within the geographic area corresponding to each of the M first grid sets in the grid map can be determined. It is a set of multiple first point data points. Based on the multiple first point data points corresponding to each target grid in the grid map, the geofence of the grid map is calculated. This allows the geofence to achieve the desired accuracy (i.e., target accuracy) while avoiding the problem that the geofence cannot accurately reflect the actual geographical features or user behavior patterns of the corresponding geographical area because the same type of point data in the grid map is divided into different grids and calculated separately. This improves the accuracy of geofence division, so that when users enter the geographical area corresponding to the geofence, they can receive the corresponding recommendation services more accurately, thereby improving the user experience.
[0011] In one possible implementation, determining the first row and column range based on the associated radius and the grid size of the target grid may include: determining the number of extended rows and columns of the target grid based on the associated radius and the grid size of the target grid; determining the first row and column range based on the row and column position of the target grid and the number of extended rows and columns; wherein the first row and column range includes the maximum and minimum row and column values of the specific grid, and the specific grid is the grid at a specific position in each of the M first grid sets.
[0012] This application embodiment describes how, based on the association radius used to determine whether the point data are related and the grid size of any grid (i.e., the target grid) in the grid map, the row and column range (i.e., the first row and column range) of a specific grid cell in the M first grid sets corresponding to the target grid cell can be determined. For example, the row and column range of the grid cell located in the upper left corner of the M first grid sets corresponding to the target grid cell can be determined by first determining the number of extended rows and columns of the target grid cell based on the association radius and the grid size of the target grid cell, and then determining the first grid range by extending the number of extended rows and columns based on the row and column positions of each target grid cell. That is, the maximum and minimum row and column values of the grid cell at a specific position in each of the M first grid sets corresponding to each target grid cell (e.g., the grid cell at the upper left corner). The grid cell at a specific position in each first grid set can also be a grid cell at other positions in the first grid set, which is not limited in this application embodiment. This application embodiment allows for the determination of the row and column range (i.e., the first row and column range) of a specific grid cell within the M first grid sets corresponding to the target grid cell, based on the associated radius, the grid size of any grid cell (i.e., the target grid cell), and the row and column position of the target grid cell. This facilitates the calculation of the M first grid sets corresponding to the target grid cell based on this first row and column range. Furthermore, it determines the set of point data (i.e., multiple first point data sets) within the geographic area corresponding to all grid cells in each of the M first grid sets. Then, it targets the grid map... For each target grid, multiple first point data sets are used to calculate the geofence of the grid map. This ensures that the geofence achieves the desired accuracy (i.e., target precision) while minimizing the problem of separate calculations for the same type of point data in the grid map due to being divided into different grids. This prevents the geofence from accurately reflecting the actual geographical features or user behavior patterns of the corresponding geographical area of the grid map. This improves the accuracy of geofence division, allowing users to receive more accurate recommendations when entering the geographical area corresponding to the geofence, thus enhancing the user experience.
[0013] In one possible implementation, determining the M first grid sets corresponding to the target grid based on the first row and column range may include: traversing from the minimum row and column value of the specific grid to the maximum row and column value of the specific grid to determine a second row and column range; the second row and column range includes the maximum and minimum row and column values of all grids in each of the M first grid sets corresponding to the target grid; and determining M first set identifiers based on the second row and column range; the first set identifier is used to indicate one of the M first grid sets.
[0014] In this embodiment of the application, determining the M first grid sets corresponding to a target grid based on the row and column range (i.e., the first row and column range) of a specific grid within the M first grid sets corresponding to the target grid specifically includes: First, for each grid set corresponding to the target grid, for the grid at a specific position (e.g., the grid located in the upper left corner), the maximum and minimum row and column values are traversed from the minimum to the maximum row and column values to determine the maximum and minimum row and column values of the first grid set containing the grid at each specific position. That is, the maximum and minimum row and column values of all grids in each of the M first grid sets corresponding to the target grid (i.e., the second row and column range); Further, based on the second row and column range, M first set identifiers are determined that can be used to indicate one of the first grid sets in the M first grid sets corresponding to the target grid, so that the target grid can be determined based on the first set identifiers. Each of the M corresponding first grid sets is used to determine the set of point data (i.e., multiple first point data sets) within the geographic area corresponding to all grids in each of the M first grid sets for each target grid in the grid map. Then, for the multiple first point data sets corresponding to each target grid in the grid map, the geofence of the grid map is further calculated. This ensures that the geofence achieves the desired accuracy (i.e., target precision) while minimizing the problem of the geofence failing to accurately reflect the actual geographic characteristics or user behavior patterns of the geographic area corresponding to the grid map due to the calculation of the same type of point data being divided into different grids. This improves the accuracy of geofence division, allowing users to receive more accurate recommendation services when entering the geographic area corresponding to the geofence, thus enhancing the user experience.
[0015] In one possible implementation, the method further includes: preprocessing the raster information of each target raster in the raster map to determine a first information list; the first information list includes a raster identifier for each target raster, a set of point data within the corresponding geographic area, and a second set identifier for the corresponding M first raster sets; the second set identifier includes the M first set identifiers, used to indicate the M first raster sets corresponding to each target raster.
[0016] This application embodiment preprocesses the grid information of each target grid in the grid map to obtain a first information list including the grid identifier of each target grid, the set of point data in the corresponding geographic area, and the corresponding second set identifiers that can be used to indicate the M first grid sets corresponding to each target grid. Based on the first information list, the grid identifier of each target grid in the grid map, the set of point data in the corresponding geographic area, and the corresponding M first grid sets can be quickly determined. Furthermore, the set of point data (i.e., multiple first point data sets) in the geographic area corresponding to the M first grid sets corresponding to each target grid in the grid map can be determined, thereby effectively improving the efficiency of calculating the geofencing of the grid map.
[0017] In one possible implementation, determining multiple first point data sets based on the M first grid sets corresponding to the target grid may include: based on the first information list, for each first set identifier in the second set identifier, expanding the grid identifier of the grid involved in each first set identifier, the set of point data in the corresponding geographic area, and the involved second set identifier to obtain a second information list; merging the sets of point data in the geographic areas corresponding to the same first set identifier in the second information list to obtain a third information list; the third information list includes the merged first set identifier and the corresponding multiple first point data sets; wherein, the multiple first point data sets include point data in the geographic areas corresponding to one or more grids involved in one of the merged first set identifiers.
[0018] The embodiments of this application, based on the M first grid sets corresponding to each target grid in the grid map, determine the set of point data (i.e., multiple first point data sets) within the geographic area corresponding to the M first grid sets. Specifically, this may include: firstly, based on the first information list obtained by preprocessing the grid information of each target grid in the grid map, for each first set identifier in the second set identifier in the first information list that can indicate the M first grid sets corresponding to each target grid, expanding the set of point data within the geographic area corresponding to each grid involved in each first set identifier to obtain a second information list; then, merging the sets of point data within the geographic area corresponding to the grids involved in the same first set identifier in the second information list to obtain a third information list including the merged first set identifier and the corresponding multiple first point data sets, wherein the multiple first point data sets include point data within one or more geographic areas corresponding to grids involved in a merged first set identifier. Since different target graticles in the raster map may have the same raster associated with one of the M extended graticles (i.e., the first raster set), there are a large number of identical first marker data sets among the multiple first marker data sets determined based on the M first raster sets corresponding to each target graticle in the raster map. Therefore, through the embodiments of this application, multiple first marker data sets corresponding to each target graticle after merging the identical first marker data sets can be obtained (i.e., the marker data sets in the geographic area corresponding to one or more graticles involved in each merged first set identifier in the third information list), so as to reduce the number of multiple first marker data sets corresponding to each target graticle in the raster map, thereby reducing the complexity of calculating the geofence of the raster map based on the multiple first marker data sets corresponding to each target graticle in the raster map. Furthermore, this embodiment of the application can quickly determine the set of point data (i.e., multiple sets of first point data) in the geographic area corresponding to each of the M sets of first grids corresponding to each target grid by querying the third information list, without having to query the set of point data in the geographic area corresponding to other grids around the target grid each time, thereby effectively reducing the number of database table query interactions and alleviating the computational burden.
[0019] In one possible implementation, determining the geofence of the raster map based on the plurality of first point data sets corresponding to each target raster in the raster map may include: calculating the target geofence using a density-based clustering algorithm based on the plurality of first point data sets corresponding to each target raster in the raster map; the target geofence includes the geofence within the geographic area corresponding to all rasters in each of the M first raster sets corresponding to each target raster after merging the same first raster sets; and determining the geofence of the raster map based on the target geofence.
[0020] This application embodiment describes how to determine the geofence of a raster map based on the set of point data (i.e., multiple first point data sets) within the geographic area corresponding to one of the M first raster sets corresponding to each target raster in the raster map. Specifically, this can be achieved by first calculating the target geofence within the geographic area corresponding to one of the M first raster sets corresponding to each target raster in the raster map (i.e., multiple first point data sets) using a density-based clustering algorithm, such as K-means clustering or Density-Based Spatial Clustering of Applications with Noise (DBSCAN). This calculation includes merging the identical first raster sets among the M first raster sets corresponding to each target raster, and then determining the geofence of the raster map based on the target geofence. In this embodiment, density-based clustering is first performed on multiple first point data sets corresponding to each target grid cell in the grid map. Since the amount of data to be calculated is relatively small, the target geofence can be calculated more easily, reducing computational complexity. Simultaneously, the calculation for the entire grid map can be decomposed into calculations for specific grid cells, facilitating parallel computation to obtain the target geofence within the geographic area corresponding to all grid cells in each of the M first grid cell sets corresponding to each target grid cell. This reduces computation time and improves computational efficiency. Furthermore, since different regions may have different geographic attributes and / or data distributions, the geofence of the grid map determined by the target geofence obtained through local computation can cover the entire area of the grid map while more accurately reflecting the actual geographic characteristics or user behavior patterns of each region, improving the accuracy of geofence segmentation. This allows users to receive more accurate recommendation services when entering the geographic area corresponding to the geofence, enhancing the user experience.
[0021] In one possible implementation, the step of calculating the target geofence based on the plurality of first point data sets corresponding to each target raster in the raster map using a density-based clustering algorithm includes: calculating the raster code of the core raster in the corresponding first raster set according to the identifier of each merged first set in the third information list; obtaining a second point data set based on the raster code of each core raster; the second point data set including point data within the geographic area corresponding to each core raster; determining associated point data for each point data by traversing the point data in the second point data set based on the association radius; determining a third point data set based on the second point data set and the associated point data; the third point data set including point data within the geographic area corresponding to each core raster and the corresponding associated point data; and calculating the target geofence by learning the density-based clustering algorithm on all point data in the third point data set.
[0022] This application embodiment describes how to calculate a target geofence based on a density-based clustering algorithm using a set of point data (i.e., multiple first point data sets) within a geographic area corresponding to one of the M first grid sets corresponding to each target grid in the grid map. Specifically, this may include: firstly, calculating the grid code of the core grid in the corresponding first grid set based on the identifier of each merged first set in the aforementioned third information list; then, based on the calculated grid code of the core grid in each corresponding first grid set, obtaining a second point data set including point data within the geographic area corresponding to each core grid. Furthermore, by traversing the point data in the second point data set, the associated point data for each point data is determined based on the association radius of the distance range used to determine whether the point data are related. Then, based on the second point data set and the determined associated point data, a third point data set is determined, which includes the point data and the corresponding associated point data within the geographic area corresponding to each core raster. Finally, by performing density-based clustering algorithm learning on all point data in the third point data set, such as the K-means method or the DBSCAN method, the target geofence within the geographic area corresponding to all rasters in each first raster set is calculated, including the first raster sets that are the same among the M first raster sets corresponding to each target raster. In this embodiment, since the third information list includes a set of point data within the geographic area corresponding to one or more rasters involved in the merged first set identifier, and each merged first set identifier is determined based on the maximum and minimum row and column values of all rasters in the corresponding first raster set, the raster code of the core raster can be determined by the maximum and minimum row and column values of all rasters in the corresponding first raster set, thereby determining the point data within the geographic area corresponding to each core raster to obtain the second point data set; then, the point data in the second point data set is traversed, and the associated point data associated with each point data is determined by the association radius, resulting in a third point data set including the point data within the geographic area corresponding to each core raster and the corresponding associated point data; finally, the target geofence can be obtained by learning the density-based clustering algorithm for all point data in the third point data set.Because the amount of data used for geofencing calculations on all data in the third set of markers is relatively small, the target geofencing can be calculated more easily, reducing computational complexity. Furthermore, the geofencing calculation for the entire raster map can be decomposed into calculations for the marker data within the geographic area corresponding to each target raster and its associated marker data. This facilitates parallel computation to obtain the target geofencing within the geographic areas corresponding to all rasters in each of the M first raster sets corresponding to each target raster, after merging identical first raster sets, thus reducing computation time and improving efficiency. In addition, since different regions may have different geographic attributes and / or data distributions, the geofencing of the raster map determined by the target geofencing obtained through local computation can cover the entire area of the raster map while more accurately reflecting the actual geographic characteristics or user behavior patterns of each area, improving the accuracy of geofencing. This allows users to receive more accurate recommendations when entering the geographic area corresponding to the geofencing, enhancing the user experience.
[0023] In one possible implementation, determining the geofence of the raster map based on the target geofence includes: traversing each target geofence in the target geofences, determining whether the center point of the target geofence is located in the core grid of the corresponding first grid set; if yes, then retaining the target geofence; if no, then deleting the target geofence; and merging the retained target geofences to obtain the geofence of the raster map.
[0024] In this embodiment of the application, since the target geofence determined by the density-based clustering algorithm may be duplicated, the geofence of the raster map may be determined based on the M first grid sets corresponding to each target grid in the raster map. Specifically, it may include: firstly, by traversing each target geofence, determining whether the center point of the target geofence is located in the core grid of the corresponding first grid set calculated according to the merged first set identifier in the third information list; then, retaining the target geofences whose center points are located in the core grids of the corresponding first grid set to remove duplicate geofences in the target geofences; and finally, generating the geofence of the raster map based on the retained target geofences. This application embodiment makes the process of generating geofences for the raster map more concise and efficient by removing duplicate geofences from the target geofence. It ensures that the generated geofences cover the entire area of the raster map while improving generation efficiency. Furthermore, since core grates may contain key resources or business centers, only geofences with their center points located in core grates are retained. This allows for more targeted focus on important areas while ignoring secondary areas, enabling the generated geofences to more accurately reflect the actual geographical characteristics or user behavior patterns of each area of the raster map. This improves the accuracy of geofence segmentation, allowing users to receive more accurate recommended services when entering the geographical area corresponding to the geofence, thus enhancing the user experience.
[0025] Secondly, embodiments of this application provide a geofencing device, which may include:
[0026] The first acquisition unit is used to acquire crowdsourced data of the grid map, wherein the crowdsourced data includes the data points of business behaviors reported by numerous electronic devices;
[0027] The first determining unit is used to determine the grid information of each grid in the grid map based on the crowdsourced data. The grid information includes the grid size, grid identifier, and a set of point data within the corresponding geographical area.
[0028] The second determining unit is used to determine M first grid sets corresponding to the target grid based on the target accuracy and the grid size of the target grid, wherein the target grid is any grid in the grid map, the target grid corresponds to M extended grids, the M extended grids include the target grid and (M-1) grids associated with the target grid, and M is a positive integer; wherein one extended grid corresponds to one first grid set, and one first grid set includes the corresponding extended grid and the grids associated with the corresponding extended grid;
[0029] The third determining unit is used to determine multiple first point data sets based on M first grid sets corresponding to each target grid in the grid map, wherein one first grid set corresponds to one first point data set;
[0030] The fourth determining unit is used to determine the geofence of the grid map based on the plurality of first point data sets corresponding to each target grid in the grid map.
[0031] In this embodiment of the application, the geofencing device first acquires crowdsourced data from a grid map, including data on business activities reported by numerous electronic devices. Then, a first determining unit, based on the acquired crowdsourced data, determines grid information such as the grid size, grid identifier, and the set of data points within the corresponding geographical area for each grid cell in the grid map. Further, a second determining unit, based on the target precision and the grid size of any grid cell (i.e., the target grid cell) in the grid map, determines M first grid sets corresponding to the target grid cell. Each target grid cell corresponds to M extended grid cells, which include the target grid cell and (M-1) grid cells associated with it. Each first grid set includes a grid cell associated with one of the M extended grid cells, where M is a positive integer. Finally, a third determining unit, based on the M first grid sets corresponding to each target grid cell in the grid map, determines multiple first data point sets, where one first grid set corresponds to one first data point set. Finally, the fourth determining unit determines the geofence of the grid map based on the plurality of first point data sets corresponding to each target grid in the grid map. This embodiment treats the plurality of first point data sets corresponding to each target grid in the grid map as an independent computational unit. Compared to the prior art, which treats each target grid in the grid map as an independent computational unit, this minimizes the problem of point data belonging to the same category (e.g., point data with similar business behaviors) being unable to be uniformly calculated due to being divided into different grids. Therefore, the geofence of the grid map determined by this embodiment can more accurately reflect the actual geographical characteristics or user behavior patterns of the corresponding geographical area, improving the accuracy of geofence division. This allows users to receive more accurate recommended services when entering the geographical area corresponding to the geofence, thus enhancing the user experience.
[0032] In one possible implementation, the target accuracy is determined based on the size of the association radius, which indicates the expected accuracy of the geofence; the association radius is a distance range used to determine whether the point data are associated.
[0033] In one possible implementation, the second determining unit is specifically used for:
[0034] Based on the associated radius and the grid size of the target grid, a first row and column range is determined; the first row and column range is the row and column range of a specific grid in the M sets of first grids;
[0035] Based on the first row and column range, determine the M first grid sets corresponding to the target grid.
[0036] In one possible implementation, the second determining unit is specifically used for:
[0037] Based on the associated radius and the grid size of the target grid, determine the number of expanded rows and columns of the target grid;
[0038] Based on the row and column position of the target grid and the number of extended rows and columns, the first row and column range is determined; wherein, the first row and column range includes the maximum and minimum row and column values of the specific grid, and the specific grid is the grid at a specific position in each of the M first grid sets.
[0039] In one possible implementation, the second determining unit is specifically used for:
[0040] The second row and column range is determined by traversing from the minimum row and column value of the specific grid to the maximum row and column value of the specific grid; the second row and column range includes the maximum row and column value and the minimum row and column value of all grids in each of the M first grid sets corresponding to the target grid;
[0041] Based on the second row and column range, M first set identifiers are determined; the first set identifier is used to indicate one of the M first grid sets.
[0042] In one possible implementation, the geofencing device further includes:
[0043] The fifth determining unit is used to preprocess the grid information of each target grid in the grid map to determine a first information list; the first information list includes the grid identifier of each target grid, the set of point data in the corresponding geographical area, and the second set identifier of the corresponding M first grid sets; the second set identifier includes the M first set identifiers, which are used to indicate the M first grid sets corresponding to each target grid.
[0044] In one possible implementation, the third determining unit is specifically used for:
[0045] Based on the first information list, for each first set identifier in the second set identifier, expand the raster identifier of the raster involved in each first set identifier, the set of point data in the corresponding geographical area, and the second set identifier involved to obtain the second information list;
[0046] The sets of point data within the corresponding geographic areas of the same first set identifier in the second information list are merged to obtain a third information list; the third information list includes the merged first set identifier and the corresponding plurality of first point data sets; wherein, the plurality of first point data sets include point data within one or more geographic areas of the same first set identifier.
[0047] In one possible implementation, the fourth determining unit is specifically used for:
[0048] Based on the plurality of first point data sets corresponding to each target grid in the grid map, a target geofence is calculated by a density-based clustering algorithm; the target geofence includes the geofence within the geographic area corresponding to all grids in each first grid set after merging the same first grid sets in the M first grid sets corresponding to each target grid.
[0049] The geofence of the raster map is determined based on the target geofence.
[0050] In one possible implementation, the fourth determining unit is specifically used for:
[0051] Based on each of the merged first set identifiers in the third information list, the raster code of the core raster in the corresponding first raster set is calculated;
[0052] Based on the raster code of each core raster, a second point data set is obtained; the second point data set includes point data within the geographic area corresponding to each core raster.
[0053] By traversing the point data in the second point data set, the associated point data for each point data is determined based on the association radius;
[0054] A third set of point data is determined based on the second set of point data and the associated point data; the third set of point data includes point data within the geographic area corresponding to each core grid and the corresponding associated point data;
[0055] The target geofence is calculated by learning the density-based clustering algorithm from all the data points in the third data set.
[0056] In one possible implementation, the fourth determining unit is specifically used for:
[0057] By traversing each target geofence in the target geofence, it is determined whether the center point of the target geofence is located in the core grid of the corresponding first grid set;
[0058] If so, then retain the target geofence;
[0059] If not, then delete the target geofence;
[0060] The retained target geofences are merged to obtain the geofences of the raster map.
[0061] Thirdly, embodiments of this application provide an electronic device that may include a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, causing the routing device to perform the method described in any of the possible implementations of the first aspect above.
[0062] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that is executed by the processor to implement the method described in any of the possible implementations of the first aspect above.
[0063] Fifthly, embodiments of this application provide a computer program, the computer program including instructions, the computer program being executed by a computing device to implement the method described in any of the possible implementations of the first aspect above. Attached Figure Description
[0064] Figure 1 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application.
[0065] Figure 2 This is a schematic diagram of the software structure of the electronic device 100 provided in the embodiments of this application.
[0066] Figure 3 This is a schematic diagram of a raster map based on crowdsourced data provided in an embodiment of this application.
[0067] Figure 4 This is a schematic diagram of an application scenario for geofencing based on raster map division in existing technologies.
[0068] Figure 5 This is a flowchart illustrating a method for dividing a geofence, as provided in an embodiment of this application.
[0069] Figure 6This is a flowchart illustrating another method for dividing geofencing provided in this application.
[0070] Figure 7 This is a schematic diagram illustrating how to determine a set of M first grids corresponding to a target grid based on a target grid, according to an embodiment of this application.
[0071] Figure 8 This is a schematic diagram of an application scenario for a geofence based on a grid map, provided in an embodiment of this application.
[0072] Figures 9A-9C These are schematic diagrams illustrating some user interfaces using geofences based on raster maps, provided for embodiments of this application.
[0073] Figure 10 This is a schematic diagram of a geofencing delineation device provided in an embodiment of this application.
[0074] Figure 11 This is a schematic diagram of the hardware structure of another electronic device provided in an embodiment of this application. Detailed Implementation
[0075] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. The term "embodiment" as used herein means that a specific feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of this application. The appearance of this phrase in different places in the specification does not necessarily indicate the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0076] The terms "first," "second," "third," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects and not to describe a particular order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, it may include a series of steps or units, or optionally, steps or units not listed, or other steps or units inherent to these processes, methods, products, or devices.
[0077] The term "user interface (UI)" used in the following embodiments of this application refers to the medium interface through which an application or operating system interacts and exchanges information with the user. It realizes the conversion between the internal form of information and the form that the user can accept. The user interface is source code written in a specific computer language such as Java or Extensible Markup Language (XML). The interface source code is parsed and rendered on the electronic device, ultimately presenting content that the user can recognize. A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be visible interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets displayed on the screen of an electronic device.
[0078] The electronic device is a smart terminal device and can be of various types; the specific type is not limited in this application embodiment. For example, the electronic device may be a mobile phone, and may also include tablet computers, desktop computers, desktop computers with touch-sensitive surfaces or touch panels, laptop computers, handheld computers, smart screens, wearable devices (such as smartwatches, smart bracelets, etc.), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, in-vehicle systems, smart headphones, game consoles, and may also be Internet of Things (IoT) devices or smart home devices such as smart water heaters, smart lights, smart air conditioners, etc.
[0079] The accompanying drawings show only the portions relevant to this application, not all of them. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts depict operations (or steps) as sequential processes, many of these operations may be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations may be rearranged. The process may be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process may correspond to a method, function, procedure, subroutine, subprogram, etc.
[0080] The terms “component,” “module,” “system,” “unit,” etc., used in this specification are used to refer to computer-related entities, hardware, firmware, combinations of hardware and software, software, or software in execution. For example, a unit can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, a thread of execution, a program, and / or distributed between two or more computers. Furthermore, these units can be executed from various computer-readable media on which various data structures are stored. Units can communicate, for example, via local and / or remote processes based on signals having one or more data packets (e.g., data from a second unit interacting with another unit between a local system, a distributed system, and / or a network; for example, the Internet interacting with other systems via signals).
[0081] First, some terms used in this application will be explained to help those skilled in the art understand the embodiments of this application.
[0082] (1) A raster map (RM) is an electronic map that uses a grid to represent geospatial information. In a raster map, the map is divided into multiple regular rectangular areas (geographic grids), and each grid contains information about that area.
[0083] (2) Crowdsourced data (hereinafter referred to as crowdsourcing) refers to the data of specific business behaviors of numerous electronic devices. The types of specific business behaviors include, but are not limited to, any one or more of the following: business behaviors of entering and exiting subway stations, business behaviors of entering and exiting express delivery stations, business behaviors of entering and exiting high-speed rail stations, business behaviors of entering and exiting airports, and business behaviors of entering and exiting shopping malls.
[0084] (3) Tracking data refers to data reported by electronic devices that record changes caused by user operations, providing business data information for development, product, and operation and maintenance analysis. In map or spatial analysis, this data may represent specific locations in actual geographic locations, coordinates of events, device locations, or any other location information that can be represented by coordinate values.
[0085] (4) Clustering algorithms are a type of machine learning algorithm whose main goal is to divide samples in a dataset into several groups, such that samples within the same group have high similarity, while samples between different groups have low similarity. The goal of clustering is to discover natural, implicit group structures in the data in order to better understand the characteristics and distribution of the data.
[0086] (5) K-means clustering is an iterative algorithm that divides a dataset into K clusters, where K is a user-specified parameter. The core idea of this algorithm is to iteratively assign samples to clusters and update the cluster centers until convergence.
[0087] (6) Density-Based Spatial Clustering of Applications with Noise (DBSCAN) is a density-based clustering algorithm. DBSCAN defines a cluster as the largest set of density-connected points. It can divide regions with sufficiently high density into clusters and can discover clusters of arbitrary shapes in noisy spatial databases.
[0088] (7) A geofence is a virtual geographical boundary, typically an area defined on a map, used to trigger specific events or actions associated with that area. This technology primarily utilizes the Global Positioning System (GPS) and other location services.
[0089] To facilitate the introduction of the technical problems to be solved and the application scenarios of this application, the electronic devices involved in the embodiments of this application are first introduced.
[0090] Please see Figure 1 , Figure 1 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device 100 can be used to execute geofencing methods in the prior art and the geofencing method provided in this embodiment. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0091] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0092] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0093] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0094] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0095] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth (BT), BLE broadcasting, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2. In this embodiment, the wireless communication module 160 can receive base station information, enabling the electronic device to establish a geofence based on the acquired base station information.
[0096] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0097] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0098] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0099] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, converting it into an image visible to the naked eye. The ISP can also perform algorithmic optimization on image noise and brightness. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0100] In this embodiment of the application, the camera 193 can be turned on after the electronic device enables the scanning function, and can acquire a preview image in real time and display the preview image on the display screen 194.
[0101] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.
[0102] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0103] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0104] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0105] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0106] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.
[0107] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or make hands-free calls through the speaker 170A.
[0108] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.
[0109] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.
[0110] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.
[0111] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example: when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.
[0112] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100.
[0113] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.
[0114] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover.
[0115] The 180E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.
[0116] Distance sensor 180F is used to measure distance.
[0117] The proximity light sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode.
[0118] The 180L ambient light sensor is used to detect ambient light intensity.
[0119] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.
[0120] Temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 uses the temperature detected by temperature sensor 180J to execute a temperature processing strategy.
[0121] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.
[0122] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bone segments of the human vocal cords. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 180M can also be incorporated into headphones to form bone conduction headphones. The audio module 170 can parse the voice signals from the vibrating bone segments of the vocal cords acquired by the bone conduction sensor 180M to realize voice functionality. The application processor can parse heart rate information from the blood pressure signals acquired by the bone conduction sensor 180M to realize heart rate detection functionality.
[0123] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.
[0124] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to different touch operations applied to different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations applied to different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.
[0125] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.
[0126] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0127] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100. Figure 2 This is a schematic diagram of the software structure of the electronic device 100 provided in this application embodiment. The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0128] The application layer can include a series of application packages. For example... Figure 2 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, music, geofencing recognition application, and service recommendation application.
[0129] Among them, the geofence recognition application is used to determine whether a geofence should be triggered, and the service recommendation application is used to trigger a geofence of the corresponding service type according to the instructions sent by the geofence recognition application.
[0130] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example... Figure 2 As shown, the application framework layer may include a base station module, a positioning module, a Wi-Fi module, a phone manager, a resource manager, a notification manager, etc.
[0131] The base station module can determine the current location of the electronic device by using information such as signal strength and latency between the electronic device and multiple base stations, and then send the determined location information of the electronic device to the geofence recognition module.
[0132] The positioning module is used to obtain the geographic location information (e.g., latitude and longitude) of the current location.
[0133] The Wifi module is used to scan for Wifi information at the current location.
[0134] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).
[0135] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0136] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0137] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0138] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0139] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0140] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0141] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0142] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0143] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0144] A 2D graphics engine is a graphics engine for 2D drawing.
[0145] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0146] Based on the above Figures 1-2 The following describes the relevant hardware and software structures of the electronic device 100. The following is an exemplary description of a grid map applicable to the geofencing division method provided by the prior art and the embodiments of this application.
[0147] Please see Figure 3 , Figure 3 This is a schematic diagram of a raster map based on crowdsourced data, provided as an embodiment of this application. Figure 3 As shown, the raster map divides a certain geographical area into multiple geographical rasters (referred to as rasters in this embodiment). Each raster contains point data collected from different locations and service types within the corresponding geographical area. When a geofence is generated based on the raster map, all the point data contained in the raster map can be point data based on specific business behaviors reported by numerous electronic devices (each point data corresponds to...). Figure 3A point (one of the points in a map) is crowdsourced geofencing data. Each grid's information can include grid size, grid identifier, and a set of geofencing data within its corresponding geographic area. The grid size is the size of the geographic area corresponding to each grid, typically divided in meters or kilometers, and its length is related to the resolution of the grid map. The grid identifier can be a code (e.g., 1-36) for each grid. The set of geofencing data within the geographic area corresponding to each grid can include the service tag (TagID) of the geofencing data, the time information of the geofencing, and the geographic location information of the geofencing. There are different types of geofencing data, each with different service tags, resulting in different geofencing structures. For example, for ride-hailing services, geofencing data can include the scanning time of the ride code, the geographic location information of the ride code, and the service tag of the ride code. For venue code services, geofencing data can include the scanning time of the venue code, the geographic location information of the venue code, and the service tag of the venue code. For payment services, geofencing data can include the scanning time of the payment code, the geographic location information of the payment code, and the service tag of the payment code.
[0148] The geographic location information of the points can include latitude and longitude information, community information, and Wi-Fi information. A certain area (e.g., a city) can be divided into multiple geographic grids (referred to as grids in this embodiment), and each grid is assigned identification information. Within this area, the grid identification information of each grid is unique. The geographic location range of each grid is converted into a latitude and longitude range. Then, based on the latitude and longitude of the collected point data, point data whose latitude and longitude are within the latitude and longitude range of the grid can be mapped to that grid, thereby obtaining the mapping relationship between the latitude and longitude information of the point data and the grid identification information. In this way, after associating the point data with the grid, when establishing a geofence, the geofence can be trained by traversing only the point data of a portion of the grids, thereby obtaining a geofence of a preset service type. It is not necessary to traverse the service tag and geographic location information of every point data to select the point data that meets the conditions as training samples for the geofence. This greatly saves the manpower and resources for training and generating geofences.
[0149] For example, when targeting Figure 3 When using density-based clustering to learn geofencing from the data points in grid cell 15, it can be visually observed that the data points in grid cell 15 can be clustered into two clusters, which may include, for example... Figure 3The data sets within circle 301 and circle 302 are shown. The data set within circle 302 falls within the geographic area corresponding to grid cell 15, while the data set within circle 301 is divided into four grids (grids 8, 9, 14, and 15) due to grid division. Therefore, when using existing geofencing methods to learn geofencing using density-based clustering algorithms on the data set in grid cell 15, no... The point data in graticules 8, 9, 14, and 15 are used. Furthermore, when using density-based clustering to learn geofences for the point data in graticules 8, 9, 14, and 15 respectively, the amount of data and cluster density of point data closely related to graticule 15 in graticules 8, 9, 14, or 15 (i.e., point data within circle 301) may be insufficient. This could result in the geographical locations corresponding to these point data not being included within the geofence of the calculated raster map. To improve clustering accuracy, when clustering the point data in graticule 15, it is necessary to simultaneously obtain the point data from graticules 8, 9, and 14. Therefore, in this embodiment of the application, the point data of grids 8, 9, 10, 14, 15, 16, 20, 21 and 22 can be regarded as a whole, and grid 15 can be calculated as the core grid. Thus, while learning geofencing by density-based clustering algorithm on the point data in the core grid, it can also be associated with the point data of the other 8 surrounding grids. Compared to existing technologies that treat each raster data point as an independent computational unit, such as performing parallel clustering calculations on the point data within rasters 1, 2, 3, 4, etc., without affecting each other, this improved approach treats each raster and the set of rasters associated with it as an independent computational unit. For example, parallel clustering calculations are performed on the sets of rasters (1, 2, 3, 7, 8, 9, 13, 14, 15), (2, 3, 4, 8, 9, 10, 14, 15, 16), etc., with every 9 rasters forming an independent computational unit. Furthermore, the rasters contained in the new unit may overlap. Therefore, this embodiment can identify the core rasters, perform the main clustering calculations on the point data of the core rasters, and use the surrounding rasters to find their nearest associated point data.
[0150] It is understood that the embodiments of this application only exemplify one possible distribution of crowdsourced data contained in the above-mentioned grid map, and several possible types of point data contained in the crowdsourced data. In addition, the grid map may also include crowdsourced data with other different distributions, as well as more types of point data, which will not be listed here.
[0151] The above Figures 1-2The relevant descriptions of the hardware and software structure of electronic device 100, combined with Figure 3 The diagram provides a raster map based on crowdsourced data, which is further analyzed and the specific technical problem to be solved in this application is proposed. For example, please refer to... Figure 4 , Figure 4 This is a schematic diagram illustrating an application scenario of geofencing based on raster map partitioning in existing technologies. For example... Figure 4 As shown, corresponding to Figure 3 The grid map in the middle, Figure 4 The geographical regions in include those with Figure 3 The geographic region corresponding to each grid cell (e.g., grid cells labeled 1-36) in the data, its geofence (e.g., Figure 4 The geofence 401 in the middle is based on Figure 3 The data set of each raster (e.g., raster labeled 1-36) is treated as an independent computational unit, and density-based clustering algorithms (e.g., K-means or DBSCAN methods) are applied to the data set within it. Furthermore, when... Figure 3 The crowdsourced data refers to the tracking data of numerous electronic devices reporting their entry and exit behaviors at subway station 402. Specific examples of these behaviors include scanning a QR code or swiping a card to enter / exit the station. Figure 4 The geofence 401 in the image refers to the geofence used to receive recommendations for subway ride codes when a user enters or exits subway station 402. Since the data points (i.e., crowdsourced data) representing the business activities of numerous electronic devices in the raster map are randomly distributed, data points may also be distributed on the boundary of any raster (i.e., the target raster) and / or in adjacent raster areas near the boundary of the target raster. These data points have a high degree of similarity to the data points within the target raster and may belong to the same category (e.g., data points with specific business activities). However, existing methods for defining geofences involve counting the number of data points within each target raster in the raster map... The existing geofencing method treats the entire set as an independent computational unit, failing to consider the associated point data distributed along the boundary of each target grid and / or in adjacent grids near the boundary of that target grid. This point data may be insufficient to generate a corresponding geofence due to its limited distribution and / or insufficient clustering in other corresponding grids. Consequently, the geofence 401 generated by the existing geofence delineation method lacks accuracy; for example, the geographical area covered by geofence 401 may be too small, causing the user to have already entered the vicinity of subway station 402 (e.g.,...). Figure 4 Point A in the map still hasn't received the ride code recommendation, causing users to miss the push notification for the subway ride code service, thus reducing the user experience.
[0152] Based on the aforementioned technical problems, this application discloses a method for dividing geofencing, which can specifically solve one or more of the following technical problems:
[0153] (1) This invention addresses the problem in the prior art where grid division causes point data that originally belonged to the same category in a grid map to be divided into different grids and thus cannot be calculated uniformly. This invention ensures that the generated geofence will not be split due to grid processing and can more accurately reflect the actual geographical features or user behavior patterns of the corresponding geographical area of the grid map, thereby improving the accuracy of geofence division and enhancing the user experience.
[0154] (2) To solve the problem that when determining the associated point data corresponding to the point data in each grid in a grid map, if the point data in each grid is stored in a table, and then when performing cluster calculations on the data of each grid, it is necessary to query the data of other nearby grid tables, which generates a large number of database table query interactions and increases the computational burden, it is possible to quickly determine the associated point data corresponding to the point data in each grid, so as to improve the efficiency of calculating geofencing.
[0155] (3) Solve the problem of low efficiency in generating geofences for the raster map caused by the redundancy of the corresponding geofences calculated from the associated point data corresponding to the point data in each raster in the raster map. Make the process of generating geofences for the raster map based on the geofences corresponding to each raster more concise and efficient. Ensure that the generated geofences can cover the entire area of the raster map, and improve the generation efficiency of geofences.
[0156] The above Figures 1-2 The hardware and software structures of electronic devices are introduced, based on the above. Figure 3 The text provides a description of a raster map based on crowdsourced data, combined with... Figure 4 The previous section described the application scenarios of geofencing based on raster map division in the prior art. The following section provides a detailed analysis and solution to the technical problems raised in this application.
[0157] This application provides a method for dividing geofencing, please refer to [link to relevant documentation]. Figure 5 , Figure 5 This is a flowchart illustrating a geofencing method provided in an embodiment of this application. This method can be applied to the above-mentioned... Figure 1 The hardware structure of the provided electronic devices Figure 2 The software architecture of the provided electronic devices and Figure 3 A raster map based on crowdsourced data may include the following steps.
[0158] Step 501: Obtain crowdsourced data for the grid map.
[0159] Specifically, crowdsourced data includes data points on business activities reported by numerous electronic devices. For example, the cloud can collect data points on various business activities reported by numerous electronic devices (referred to as crowdsourced data). Crowdsourced data specifically includes types of specific business activities, such as the ride-hailing code service, venue code service, and payment code service mentioned earlier, which will not be elaborated upon here. The raster map includes multiple geographic raster units (referred to as rasters in this embodiment), each raster corresponding to a geographic area within the actual geographic space. The data point set in each raster unit of the raster map can include data points on specific business activities reported by numerous electronic devices within the corresponding geographic area.
[0160] Step 502: Based on crowdsourced data, determine the raster information of each grid cell in the raster map.
[0161] Specifically, the raster information includes the raster size, raster identifier, and a set of point data within the corresponding geographic area. For example, an electronic device determines the raster size, raster identifier, and set of point data within the corresponding geographic area for each raster in the raster map based on crowdsourced data acquired from the raster map. The raster size is the size of the geographic area corresponding to each raster, typically divided in units of meters or kilometers, and its length is related to the resolution of the raster map; the raster identifier can be a code corresponding to each raster (e.g., ...). Figure 3 The raster codes (1-36) in the raster code can include the collection of point data within the geographic area corresponding to each raster, which may include point data of specific business behaviors reported by numerous electronic devices within the geographic area.
[0162] Step 503: Based on the target accuracy and the grid size of the target grid, determine the M first grid sets corresponding to the target grid.
[0163] Specifically, the target grid is any grid in the grid map, and the target grid corresponds to M extended grids. The M extended grids include the target grid and (M-1) grids associated with it, where M is a positive integer. Each extended grid corresponds to a first grid set, which includes the corresponding extended grid and the grids associated with it. For example, when the target grid is... Figure 3In the case of grid number 15, with a target accuracy of 50 meters and a grid size of 100 meters, the electronic device determines that the target grid corresponds to M sets of first grids, which are nine sets of first grids expanded from grids 8, 9, 10, 14, 15, 16, 20, 21, and 22, respectively. It is understood that in this embodiment, M is a positive integer, and the value of M is related to the target accuracy and the grid size of the target grid. In this embodiment, the value of M can be 9. In some embodiments, the value of M can also be other positive integers, and this embodiment does not limit this. Furthermore, the number of corresponding extended grids and the number of grids associated with each extended grid in each set of first grids can be M, or other positive integers smaller than M, and this application does not limit this.
[0164] In one possible implementation, the target accuracy is determined based on the size of the association radius, which indicates the desired accuracy of the geofence; the association radius is the distance range used to determine whether the point data is related. Specifically, the target accuracy is used to indicate the desired accuracy of the generated geofence, and this target accuracy can be determined by the size of the association radius; furthermore, since the association radius can be used to determine the distance range whether the point data is related, that is, when geofencing the point data in the raster map, if the distance between two point data is within the range of the association radius (e.g., 50 meters), then the two point data are considered to be related. This application embodiment can determine the related point data that can be used for geofence division based on association radii of different sizes, so that the generated geofence can achieve the desired target accuracy, and can more accurately reflect the actual geographical features or user behavior patterns of the corresponding geographical area of the raster map, so as to provide more accurate recommendation services based on the geofence to improve the user experience.
[0165] In one possible implementation, this embodiment of the application determines the row and column range (i.e., the first row and column range) of a specific grid cell within the M first grid sets corresponding to the target grid cell based on the association radius and the grid size of the target grid cell; further, based on the first row and column range, it determines the M first grid sets corresponding to the target grid cell. Specifically, since the expected accuracy (i.e., target accuracy) of the geofencing can be determined by the size of the association radius used to determine whether the data points are related, this embodiment of the application can determine the row and column range (i.e., the first row and column range) of a specific grid cell within the M first grid sets corresponding to the target grid cell by using the association radius and the grid size of any grid cell (i.e., the target grid cell) in the grid map. For example, the row and column range of the grid cell located in the upper left corner of the M first grid sets corresponding to the target grid cell; further, it determines the M first grid sets corresponding to the target grid cell so that the M geofencing sets corresponding to the target grid cell can be determined through the M first grid sets corresponding to each target grid cell in the grid map. The first grid set corresponds to the set of point data within the geographic area (i.e., multiple first point data sets). Further, based on the multiple first point data sets corresponding to each target grid in the grid map, the geofence of the grid map is calculated. This allows the geofence to achieve the desired accuracy (i.e., target precision) while minimizing the problem of the same type of point data in the grid map being calculated separately due to being divided into different grids, which could lead to the geofence not accurately reflecting the actual geographic characteristics or user behavior patterns of the geographic area corresponding to the grid map. This improves the accuracy of geofence division, enabling users to receive more accurate recommendations when entering the geographic area corresponding to the geofence, thus enhancing the user experience.
[0166] Optionally, how to determine the row and column range (i.e., the first row and column range) of a specific grid cell in the M first grid sets corresponding to the target grid cell, based on the association radius used to determine whether the point data are related and the grid size of any grid cell (i.e., the target grid cell) in the raster map, for example, the row and column range of the grid cell located in the upper left corner of the M first grid sets corresponding to the target grid cell, can specifically include: firstly, determining the number of extended rows and columns of the target grid cell based on the association radius and the grid size of the target grid cell, for example, when the target grid cell is... Figure 3 For grid number 15 in the target grid, with a target accuracy of 50 meters and a grid size of 100 meters, the determined number of extended rows and columns is 2. Further, based on the row and column position of each target grid, by extending the grid by the specified number of rows and columns, the first grid range can be determined. That is, the maximum and minimum row and column values of the grid at a specific position (e.g., the grid located in the upper left corner) in each of the M first grid sets corresponding to each target grid. Figure 3 If the row and column position of grid 15 is (3, 3), then the maximum row and column value of the grid at the top left corner of each of the nine first grid sets corresponding to grid 15 is (3, 3), and the minimum row and column value is (1, 1). The grid at a specific position in each first grid set can also be a grid at other positions within that first grid set; this embodiment does not limit this. This embodiment allows for the determination of the row and column range (i.e., the first row and column range) of a specific grid within the M first grid sets corresponding to the target grid, based on the associated radius, the grid size of any grid (i.e., the target grid), and the row and column position of the target grid. This facilitates the calculation of the M first grid sets corresponding to the target grid based on this first row and column range. Furthermore, it determines the set of point data (i.e., multiple first point data sets) within the geographic area corresponding to all grids in each of the M first grid sets. Then, for the grid map... For each target grid, multiple first point data sets are used to calculate the geofence of the grid map. This ensures that the geofence achieves the desired accuracy (i.e., target precision) while minimizing the problem of separate calculations for the same type of point data in the grid map due to being divided into different grids. This prevents the geofence from accurately reflecting the actual geographical features or user behavior patterns of the corresponding geographical area of the grid map. This improves the accuracy of geofence division, allowing users to receive more accurate recommendations when entering the geographical area corresponding to the geofence, thus enhancing the user experience.
[0167] Furthermore, determining the M first grid sets corresponding to the target grid based on the row and column range (i.e., the first row and column range) of a specific grid within the M first grid sets corresponding to the target grid can specifically include: firstly, for each grid set corresponding to the target grid, the grid at a specific position (e.g., located in...) within each of the M first grid sets. Figure 3The maximum and minimum row and column values of the grid cell at the top left corner are determined. For example, if the maximum row and column value is (3, 3) and the minimum row and column value is (1, 1), the maximum and minimum row and column values are determined by traversing from the minimum row and column value to the maximum row and column value, for example, traversing from (1, 1) to (3, 3). This determines the maximum and minimum row and column values of the first grid set to which the grid cell at each specific location belongs. That is, the maximum and minimum row and column values of all grid cells in each of the M first grid sets corresponding to the target grid cell (i.e., the second row and column range). Further, based on this second row and column range, M first set identifiers are determined that can be used to indicate one of the M first grid sets corresponding to the target grid cell. This allows each of the M first grid sets corresponding to the target grid cell to be identified based on the first set identifier, so that each grid set in the grid map can be identified. For each target raster, there are M sets of first raster cells. Within each of these M sets, the set of point data (i.e., multiple sets of first point data) corresponding to all raster cells in the geographic area is determined. Then, for each target raster cell in the raster map, the geofence is further calculated using these multiple sets of first point data. This ensures the geofence achieves the desired accuracy (i.e., target precision) while minimizing the problem of separate calculations for the same type of point data in the raster map due to being divided into different raster cells. This prevents the geofence from accurately reflecting the actual geographic characteristics or user behavior patterns of the corresponding geographic area, thus improving the accuracy of geofence division. Consequently, when users enter the geographic area corresponding to the geofence, they can receive more accurate recommendations, enhancing the user experience.
[0168] Optionally, embodiments of this application can further preprocess the grid information of each target grid in the grid map to obtain a first information list including the grid identifier of each target grid, the set of point data in the corresponding geographic area, and the corresponding second set identifiers that can be used to indicate the M first grid sets corresponding to each target grid. This allows for the rapid determination of the grid identifier of each target grid in the grid map, the set of point data in the corresponding geographic area, and the corresponding M first grid sets based on the first information list. Furthermore, it allows for the determination of the set of point data (i.e., multiple first point data sets) in the geographic area corresponding to the M first grid sets corresponding to each target grid in the grid map, thereby effectively improving the efficiency of calculating the geofence of the grid map.
[0169] Step 504: Based on the M first grid sets corresponding to each target grid in the grid map, determine multiple first point data sets.
[0170] In this embodiment, one first grid set corresponds to one first point data set. Specifically, how this application describes how, based on the M first grid sets corresponding to each target grid in the grid map, the point data sets (i.e., multiple first point data sets) within the corresponding geographical area of the M first grid sets corresponding to each target grid in the grid map can be determined includes: firstly, based on the first information list obtained by preprocessing the grid information of each target grid in the grid map, for each first set identifier in the second set identifier in the first information list that can indicate the M first grid sets corresponding to each target grid, expanding the set of point data within the corresponding geographical area of the grid involved by each first set identifier to obtain a second information list; then, merging the sets of point data within the corresponding geographical area of the grid involved by the same first set identifier in the second information list to obtain a third information list including the merged first set identifier and the corresponding multiple first point data sets, wherein the multiple first point data sets include point data within one or more corresponding geographical areas of the grid involved by a merged first set identifier. Since different target graticles in the raster map may have the same raster associated with one of the M extended graticles (i.e., the first raster set), there are a large number of identical first marker data sets among the multiple first marker data sets determined based on the M first raster sets corresponding to each target graticle in the raster map. Therefore, through the embodiments of this application, multiple first marker data sets corresponding to each target graticle after merging the identical first marker data sets can be obtained (i.e., the marker data sets in the geographic area corresponding to one or more graticles involved in each merged first set identifier in the third information list), so as to reduce the number of multiple first marker data sets corresponding to each target graticle in the raster map, thereby reducing the complexity of calculating the geofence of the raster map based on the multiple first marker data sets corresponding to each target graticle in the raster map. Furthermore, this embodiment of the application can quickly determine the set of point data (i.e., multiple sets of first point data) in the geographic area corresponding to the M first grid sets corresponding to each target grid by querying the third information list, without having to query the set of point data in the geographic area corresponding to other grids around the target grid each time, thereby effectively reducing the number of database table query interactions and alleviating the computational burden.
[0171] Step 505: Determine the geofence of the grid map based on the plurality of first point data sets corresponding to each target grid in the grid map.
[0172] In one possible implementation, determining the geofence of a raster map based on one of the M extended rasters corresponding to each target raster in the raster map, and the set of point data (i.e., multiple first point data sets) within the geographic area corresponding to the associated rasters, may specifically include: firstly, for one of the M extended rasters corresponding to each target raster in the raster map, and the set of point data (i.e., multiple first point data sets) within the geographic area corresponding to the associated rasters, using a density-based clustering algorithm, such as K-means clustering or Density-Based Spatial Clustering of Applications with Noise (DBSCAN), to calculate the target geofence within the geographic area corresponding to all rasters in each of the M first raster sets, after merging the identical first raster sets in each target raster set; and further determining the geofence of the raster map based on the target geofence. In this embodiment, density-based clustering is first performed on multiple first point data sets corresponding to each target grid cell in the grid map. Since the amount of data to be calculated is relatively small, the target geofence can be calculated more easily, reducing computational complexity. Simultaneously, the calculation for the entire grid map can be decomposed into calculations for specific grid cells, facilitating parallel computation to obtain the target geofence within the geographic area corresponding to all grid cells in each of the M first grid cell sets corresponding to each target grid cell. This reduces computation time and improves computational efficiency. Furthermore, since different regions may have different geographic attributes and / or data distributions, the geofence of the grid map determined by the target geofence obtained through local computation can cover the entire area of the grid map while more accurately reflecting the actual geographic characteristics or user behavior patterns of each region, improving the accuracy of geofence segmentation. This allows users to receive more accurate recommendation services when entering the geographic area corresponding to the geofence, enhancing the user experience.
[0173] Optionally, the method for calculating the target geofence using a density-based clustering algorithm based on the set of point data (i.e., multiple first point data sets) within the geographic area corresponding to each target raster in the raster map's M first raster sets may specifically include: firstly, calculating the raster code of the core raster in the corresponding first raster set based on the identifier of each merged first set in the aforementioned third information list; then, based on the calculated raster code of the core raster in each corresponding first raster set, obtaining a second point data set including point data within the geographic area corresponding to each core raster. Further, by traversing the point data in this second point data set, determining the associated point data for each point data based on the association radius of the distance range used to determine whether the point data are associated, for example, in... Figure 3 In the process, when the raster code of the calculated core raster is 15, the second point data set may include the acquired data such as... Figure 3The 15th grid shown corresponds to the geographic area's marker data. When the association radius used to determine whether the marker data are related is 50 meters, all marker data within the 15th grid are traversed. The determined related marker data includes marker data in other grids besides the 15th grid that are within 50 meters of any marker data in the 15th grid. Further, based on this second marker data set and the determined related marker data, a third marker data set is determined, including the marker data and corresponding related marker data within the geographic area corresponding to each core grid. Finally, by performing density-based clustering algorithms on all marker data in this third marker data set, such as the K-means method or the DBSCAN method, the target geofence within the geographic area corresponding to all grids in each of the M first grid sets corresponding to each target grid is calculated. This includes the target geofence within the geographic area corresponding to all grids in each first grid set after merging identical first grid sets. In this embodiment, since the third information list includes a set of point data within the geographic area corresponding to one or more rasters involved in the merged first set identifier, and each merged first set identifier is determined based on the maximum and minimum row and column values of all rasters in the corresponding first raster set, the raster code of the core raster can be determined by the maximum and minimum row and column values of all rasters in the corresponding first raster set, thereby determining the point data within the geographic area corresponding to each core raster to obtain the second point data set; then, the point data in the second point data set is traversed, and the associated point data associated with each point data is determined by the association radius, resulting in a third point data set including the point data within the geographic area corresponding to each core raster and the corresponding associated point data; finally, the target geofence can be obtained by learning the density-based clustering algorithm for all point data in the third point data set. Since the amount of data for geofencing calculation for all data in the third set of marker data is relatively small, the target geofencing can be calculated more easily, reducing the complexity of the calculation. At the same time, the geofencing calculation for the marker data of the entire raster map can be decomposed into the calculation of the marker data and the corresponding associated marker data within the geographic area corresponding to each target raster. This is beneficial for achieving parallel calculation to obtain the target geofencing within the geographic area corresponding to all rasters in each of the M first raster sets corresponding to each target raster, after merging the same first raster sets, thus reducing the calculation time and improving the calculation efficiency.Furthermore, since different regions may have different geographical attributes and / or data distributions, the geofence of the raster map determined by the target geographic boundary obtained through local calculation can cover the entire area of the raster map while more accurately reflecting the actual geographical characteristics or user behavior patterns of each area of the raster map. This improves the accuracy of geofence division, allowing users to receive more accurate recommended services when entering the geographic area corresponding to the geofence, thereby enhancing the user experience.
[0174] Furthermore, the specific method for determining the geofence of the raster map based on the target geofence may include the following: Since the target geofence determined by the density-based clustering algorithm may be duplicated, based on the set of point data (i.e., multiple sets of first point data) in the geographic area corresponding to one of the M first grid sets corresponding to each target grid in the raster map, each target geofence is first traversed to determine whether the center point of the target geofence is located in the core grid of the corresponding first grid set calculated according to the merged first set identifier in the third information list. Then, the target geofences whose center points are located in the core grids of the corresponding first grid set are retained to remove duplicate geofences in the target geofences. Finally, the geofence of the raster map is generated based on the retained target geofences. This application embodiment makes the process of generating geofences for the raster map more concise and efficient by removing duplicate geofences from the target geofence. It ensures that the generated geofences cover the entire area of the raster map while improving generation efficiency. Furthermore, since core grates may contain key resources or business centers, only geofences with their center points located in core grates are retained. This allows for more targeted focus on important areas while ignoring secondary areas, enabling the generated geofences to more accurately reflect the actual geographical characteristics or user behavior patterns of each area of the raster map. This improves the accuracy of geofence segmentation, allowing users to receive more accurate recommended services when entering the geographical area corresponding to the geofence, thus enhancing the user experience.
[0175] For example, please see Figure 6 , Figure 6 This is a flowchart illustrating another method for geofencing provided in this application embodiment. This method can be applied to the above-mentioned... Figure 1 The hardware structure of electronic devices and Figure 2 The software architecture of electronic devices, this method can be applied to the above. Figure 1 The hardware structure of the provided electronic devices Figure 2 The software architecture of the provided electronic devices and Figure 3 The specific steps in the provided raster map based on crowdsourced data are as follows:
[0176] Step 601: Obtain crowdsourced data for the grid map.
[0177] Crowdsourced data includes data on business activities reported by numerous electronic devices.
[0178] Step 602: Based on crowdsourced data, determine the raster information of each grid cell in the raster map.
[0179] The raster information includes the raster size, raster identifier, and a set of point data within the corresponding geographic area;
[0180] For a detailed description of steps 601-602, please refer to the relevant descriptions of steps 501-502 above, which will not be repeated here.
[0181] Step 603: Determine the number of rows and columns to be expanded for the target raster based on the association radius and the raster size of the target raster.
[0182] Step 604: Determine the first row and column range based on the row and column position of the target grid and the number of extended rows and columns.
[0183] The first row and column range includes the maximum and minimum row and column values of a specific grid, and the specific grid is the grid at a specific position in each of the M first grid sets.
[0184] Step 605: Traverse from the minimum row and column value of a specific grid to the maximum row and column value of the specific grid to determine the range of the second row and column.
[0185] The second row and column range includes the maximum and minimum row and column values of all cells in each of the M first grid sets corresponding to the target grid.
[0186] Step 606: Based on the second row and column range, determine M first set identifiers.
[0187] The first set identifier is used to indicate one of the M first grid sets.
[0188] Specifically, steps 603-604 above describe how to determine the row and column range (i.e., the first row and column range) of a specific grid in the M first grid sets corresponding to the target grid, based on the association radius used to determine whether the point data are related and the grid size of any grid (i.e., the target grid) in the grid map. Steps 605-606 describe how to determine the M first grid sets corresponding to the target grid, based on the row and column range (i.e., the first row and column range) of a specific grid in the M first grid sets corresponding to the target grid. The specific steps can be found in the relevant description of step 503 above, and will not be repeated here.
[0189] For example, based on the above Figure 3 The provided raster map is based on crowdsourced data. Assuming the association radius for determining the correlation between data points is 50 meters, and the size of any raster (i.e., the target raster) is 100 meters, when the target raster is... Figure 3 For example, when using grid cell number 15 in a grid map, please refer to [link to relevant documentation]. Figure 7 , Figure 7 This is a schematic diagram of determining a set of M first grids corresponding to a target grid based on a target grid, provided in an embodiment of this application. The specific steps may include, but are not limited to, the following steps 1-4.
[0190] Step 1: Based on the association radius and the target raster size, determine the number of rows and columns to be expanded for the target raster; the number of rows and columns to be expanded for the target raster is:
[0191] extendGrid=(radius / gridSize+1)×2;
[0192] Where `extendGrid` represents the number of rows and columns to be expanded in the target grid, `radius` is the length of the associated radius, and `gridSize` is the size of any grid cell in the grid map (i.e., the target grid). When the length of the associated radius is 50 meters and the size of the target grid cell is 100 meters, the integer value of `radius / gridSize` is used to calculate that the number of rows and columns to be expanded in the target grid is 2. That is, all the grid cells in the grid set obtained after expanding both the rows and columns of the original target grid (e.g., grid 15) by 2 cells are the M expanded grid cells corresponding to the target grid, where M is a positive integer. For example, as shown... Figure 7As shown in (A), the row and column position of the 15th grid is (3, 3). After the 15th grid is expanded by 2 cells in both row and column, all the grids in the resulting grid set are grids 8, 9, 10, 14, 15, 16, 20, 21 and 22. At this time, the value of M is 9. Grids 8, 9, 10, 14, 15, 16, 20, 21 and 22 are the 9 expanded grids corresponding to the 15th grid.
[0193] It should be noted that the embodiments of this application only exemplify a possible implementation of determining the number of extended rows and columns of the target grid based on the associated radius and the grid size of the target grid. In some embodiments, the number of extended rows and columns may be calculated in other ways. Accordingly, the specific method of determining the corresponding M extended grids based on the row and column value of the target grid and the number of extended rows and columns will also change. The embodiments of this application do not specifically limit this.
[0194] Step 2: Based on the row and column position of the target grid and the number of extended rows and columns, determine the row and column range (i.e., the first row and column range) of the specific grid within the M first grid sets corresponding to the target grid. For example, when the specific grid is the grid located in the upper left corner of the M first grid sets corresponding to the target grid, the minimum row and column value of that specific grid is:
[0195] (XminRow, YmincurCol) = (curRow-extentGrid, curCol-extendGrid)
[0196] The maximum row and column value for a specific grid is:
[0197] (XmaxRow, YmaxcurCol) = (curRow, curCol)
[0198] Specifically, the first row and column range is the row and column range of a specific grid in the M first grid sets corresponding to the target grid. The first row and column range includes the maximum and minimum row and column values of the specific grid. Here, (XminRow, YmincurCol) are the minimum row and column values of the specific grid located in the upper left corner of the M first grid sets corresponding to the target grid, (XmaxRow, YmaxcurCol) are the maximum row and column values of the specific grid located in the upper left corner of the M first grid sets corresponding to the target grid, and (curRow, curCol) are the row and column of the target grid.
[0199] For example, since the target grid in this embodiment is grid number 15, the value of (curRow, curCol) is (3, 3), and the number of extended rows and columns is 2. Therefore, it can be calculated that the row and column range (i.e., the first row and column range) of the specific grid (e.g., the grid located in the upper left corner) in the M first grid set corresponding to the target grid (e.g., grid number 15) includes: the minimum row and column value of the specific grid is (1, 1), and the maximum row and column value is (3, 3). It is understood that this embodiment only illustrates one possible calculation method when the specific grid is the grid located in the upper left corner of the M first grid set corresponding to the target grid. In some embodiments, the specific grid can also be any other grid in the M first grid set corresponding to the target grid. Accordingly, the calculation method for the specific grid will also change accordingly, and this embodiment does not limit it.
[0200] Step 3: Traverse from the minimum row and column value of a specific grid to the maximum row and column value of a specific grid, and determine the maximum and minimum row and column values (i.e., the second row and column range) of all grids in each of the M first grid sets corresponding to the target grid.
[0201] Specifically, for each of the M first grid sets corresponding to a target grid, the maximum and minimum row and column values of the grid at a specific position (e.g., the grid located at the top left corner) are determined by traversing from the minimum to the maximum row and column values. This process determines the maximum and minimum row and column values of the first grid set containing the grid at each specific position. In other words, it determines the maximum and minimum row and column values (i.e., the second row and column range) of all grids within each of the M first grid sets corresponding to the target grid. For example, traversing from the minimum to the maximum row and column values of a specific grid determines the row and column values of each specific grid as (1,1), (1,2), (1,3), (2,1), (2,2), (2,3), (3,1), (3,2), (3,3), corresponding to... Figure 7 In the example, (A) is numbered as grids 1, 2, 3, 7, 8, 9, 13, 14, and 15. Since the specific grid in this embodiment is located at the upper left corner of each first grid set, the maximum row and column value of the first grid set containing each specific grid can be determined as follows:
[0202] (maxRow, maxcurCol) = (XRow+extentGrid, YcurCol+extendGrid)
[0203] The minimum row and column values of the first set of grid cells containing each grid cell at a specific location are:
[0204] (minRow,mincurCol)=(XcurRow,YcurCol)
[0205] Where (maxRow, maxcurCol) is the maximum row and column value of the first grid set containing the grid at each specific location, (minRow, mincurCol) is the minimum row and column value of the first grid set containing the grid at each specific location, and (XRow, YcurCol) is the row and column value of the grid at each specific location. Therefore, according to the above calculation method, the maximum and minimum row and column values of the first grid set containing the grid at each specific location can be obtained. That is, the maximum and minimum row and column values of all grids in each of the M first grid sets corresponding to the target grid (i.e., the second row and column range).
[0206] It is understood that the embodiments of this application merely exemplify one possible calculation method for determining the maximum and minimum row and column values (i.e., the second row and column range) of all grids in each of the M first grid sets corresponding to the target grid when a specific grid is the grid located in the upper left corner of the M first grid sets corresponding to the target grid. In some embodiments, the specific grid may also be a grid at any other position in the M first grid sets corresponding to the target grid. Accordingly, the calculation method for the second row and column range will also change accordingly. The embodiments of this application do not limit this.
[0207] Step 4: Based on the second row and column range, determine M first set identifiers that can be used to indicate one of the M first grid sets corresponding to the target grid.
[0208] Specifically, based on the maximum and minimum row and column values of the first grid set to which each grid cell at a specific position within the calculated second row and column range belongs, a first set identifier for the corresponding first grid set can be determined. This first set identifier facilitates the identification of each of the M first grid sets corresponding to the target grid cell. For example, the definition method for the first set identifier in this embodiment can be (minRow:maxRow:minCol:maxCol), corresponding to... Figure 7 The nine first grid sets shown in Figure (B) are the M first grid sets corresponding to the target grid number 15. The first set identifiers corresponding to all grids in each first grid set are shown in Table 1. Table 1 is as follows:
[0209] Table 1
[0210]
[0211] It is understandable that, due to the different desired accuracy (i.e., target accuracy) of the geofencing and the different grid sizes of any grid in the raster map (i.e., the target grid), the number of M first grid sets corresponding to the determined target grid will vary. Each first grid set can be defined using (minRow:maxRow:minCol:maxCol) or other methods, which are not limited in this embodiment. This embodiment only describes one possible implementation for determining the corresponding M first grid sets based on grid 15 as the target grid. The steps for determining the corresponding M first grid sets for other grids in the raster map as target grids are similar to the above steps and will not be repeated here.
[0212] Step 607: Preprocess the raster information of each target raster in the raster map to determine the first information list.
[0213] Specifically, before the electronic device processes the M first grid sets and multiple first point data sets corresponding to each target grid in the grid map, it can obtain a first information list by preprocessing the grid information of each target grid in the grid map. The first information list includes the grid identifier of each target grid, the set of point data within the corresponding geographical area, and the second set identifier of the corresponding M first grid sets. The second set identifier includes M first set identifiers, used to indicate the M first grid sets corresponding to each target grid. A detailed description of step 607 can be found in the preceding description and will not be repeated here. It should be noted that there is no explicit sequential relationship between step 607 and the aforementioned steps 603-606; that is, step 607 can be performed before or after steps 603-606, or simultaneously with steps 603-606. This embodiment of the application does not limit this.
[0214] For example, based on the above Figure 3 A raster map based on crowdsourced data is provided. The raster information of each target raster in the raster map is preprocessed, and the determined first information list is shown in Table 2:
[0215] Table 2
[0216]
[0217] As shown in Table 2, Morton codes 1 to 36 are respectively as follows: Figure 3In the raster map shown, the raster identifiers of graticles 1 to 36 (i.e., the raster identifiers of each target raster) are: raw1, raw2, raw3...raw36, representing the set of point data in graticles 1 to 36 (i.e., the set of point data within the geographic area corresponding to each target raster). mortonListlds are the second set identifiers of the nine first raster sets corresponding to graticles 1 to 36 (i.e., the second set identifiers of the M first raster sets corresponding to each target raster). For example, the second set identifiers of the M first raster sets corresponding to each target raster include M first set identifiers; that is, set1, set2, set3...set114 in Table 2 can be used to indicate one of the M first raster sets corresponding to each target raster. Each first set identifier can be defined using the method described above (minRow:maxRow:minCol:maxCol). For example, all first set identifiers in the second set identifiers of the M first grid sets corresponding to the grid with grid identifier 15 [set9,set27,set45,set46,set47,set48,set49,set50,set51] include all first set identifiers shown in Table 1, the specific description of which can be found above and will not be repeated here. It is understood that the second set identifiers of the M first grid sets corresponding to each other target grid can also be represented using this definition method. Each second set identifier can be used to represent one of the M first grid sets corresponding to the target grid. These are not listed one by one in the embodiments of this application.
[0218] Step 608: Based on the first information list, for each first set identifier in the second set identifier, expand the raster identifier of the raster involved in each first set identifier, the set of point data in the corresponding geographical area, and the second set identifier involved to obtain the second information list;
[0219] For example, based on the first information list shown in Table 2, for each first set identifier in the second set identifier (e.g., set1, set2, set3...set114 in Table 2), expand the raster identifier of the raster involved in each first set identifier, the set of point data in the corresponding geographic area, and the second set identifier involved. The resulting second information list can be as shown in Table 3:
[0220] Table 3
[0221]
[0222]
[0223] As shown in Table 3, set1, set1, set1...set114 are the first set identifiers expanded from each first set identifier in the second set identifier in Table 2. The corresponding Morton codes 1 to 36 are the grid identifiers of the target grids in Table 2 corresponding to the second set identifiers of the first set identifiers (that is, the grid identifiers of the grids involved by the first set identifiers). The corresponding raw1, raw1, raw1...raw36 are the sets of point data in the geographic area corresponding to the grids involved. mortonListlds are the second set identifiers of the first set identifiers (that is, the second set identifiers involved). It is understood that, in this embodiment of the application, the raster identifier of the raster involved in each of the first set identifiers in one of the second set identifiers in Table 2 (e.g., [set1, set2, set3, set4, set5, set6, set7, set8, set9]), the set of point data in the corresponding geographical area, and the second set identifier involved are expanded. The expansion process of the first set identifiers in other second set identifiers in Table 2 is similar, and the second information list can be obtained by referring to the above description. It will not be repeated here.
[0224] Step 609: Merge the sets of point data within the corresponding geographic areas of the same first set identifier in the second information list to obtain the third information list.
[0225] The third information list includes a merged first set identifier and a corresponding set of multiple first point data sets; wherein the multiple first point data sets include point data within a geographic area corresponding to one or more grids involved in a merged first set identifier.
[0226] For example, by merging the sets of point data within the corresponding geographic areas of the same first set identifier in the second information list as shown in Table 3, the resulting third information list is shown in Table 4:
[0227] Table 4
[0228]
[0229] In mortonListld, set1, set2, set3...set114 are the identifiers of the merged first set, and the String sets are the multiple first point data sets corresponding to the merged first set identifiers, which are the sets of point data within the geographic areas corresponding to all rasters involved in the first set identifier in Table 2. This embodiment of the application can quickly determine the set of point data (i.e., the multiple corresponding first point data sets) within the geographic areas corresponding to all rasters in each of the M first raster sets corresponding to each target raster (e.g., all rasters in the first raster sets indicated by set1, set2, set3...set114) by querying the third information list, without having to query the set of point data within the geographic areas corresponding to other nearby rasters each time. This effectively reduces the number of database table query interactions and alleviates the computational burden.
[0230] Step 610: Calculate the raster code of the core raster in the corresponding first raster set based on each merged first set identifier in the third information list.
[0231] For example, based on each merged first set identifier (e.g., set1, set2, set3...set114) in the third information list shown in Table 4, since each merged first set identifier is determined based on the maximum and minimum row and column values of all rasters in the corresponding first raster set, each merged first set identifier can be defined in the form of (minRow:maxRow:minCol:maxCol). For example, for a merged first set identifier with a first set identifier of (1:3:1:3), its core raster's row and column value can be determined to be (2, 2). Figure 3 In the raster map shown, the raster code is 8. Accordingly, based on the identifier of each merged first set, the raster code of the core raster in the corresponding first raster set can be calculated.
[0232] Step 611: Obtain the second set of point data based on the raster encoding of each core raster.
[0233] The second point data set includes point data within the geographic area corresponding to each core raster. For example, based on the raster code of the core raster in the first raster set corresponding to each merged first set identifier, point data (i.e., the second point data) within the geographic area corresponding to each core raster can be obtained.
[0234] Step 612: By traversing the point data in the second point data set, determine the associated point data for each point data based on the associated radius.
[0235] Specifically, iterate through all the point data within the geographic area corresponding to each core raster, and determine the associated point data related to each point data by using the association radius. This results in a third point data set that includes the point data within the geographic area corresponding to each core raster and the corresponding associated point data.
[0236] Step 613: Determine the third set of data points based on the second set of data points and the associated data points.
[0237] Furthermore, the point data within the geographic area corresponding to each core raster (i.e., the second point data set) and the associated point data determined in step 612 above are aggregated to obtain the third point data set, which includes the point data within the geographic area corresponding to each core raster and the corresponding associated point data.
[0238] Step 614: Calculate the target geofence by learning density-based clustering algorithm from all the point data in the third point dataset.
[0239] For example, the target geofence is calculated by performing density-based clustering algorithms, such as the K-means method or the DBSCAN method, on all the point data in the third point dataset.
[0240] Step 615: By traversing each target geofence in the target geofence, determine whether the center point of the target geofence is located in the core grid of the corresponding first grid set.
[0241] Step 616A: If so, retain the target geofence.
[0242] Step 616B: If not, delete the target geofence.
[0243] Step 617: Merge the retained target geofences to obtain the geofences of the raster map.
[0244] Specifically, for a detailed description of steps 610-617 above, please refer to the relevant description of step 505 above, which will not be repeated here. Through this application embodiment, multiple first point data sets corresponding to each target grid in the grid map can be treated as an independent computational unit. Compared to the prior art, which treats each target grid in the grid map as an independent computational unit, this minimizes the problem of point data belonging to the same category in the grid map (e.g., point data with specific business behaviors) being unable to be uniformly calculated due to being divided into different grids. Therefore, the geofence of the grid map determined through this application embodiment can more accurately reflect the actual geographical characteristics or user behavior patterns of the corresponding geographical area of the grid map, improving the accuracy of geofence division. This allows users to receive more accurate recommended services when entering the geographical area corresponding to the geofence, thereby enhancing the user experience.
[0245] The preceding text introduced the steps of the geofencing method provided in the embodiments of this application. The following section will combine... Figure 8 and Figures 9A-9C An exemplary description of an application scenario for a geofence provided in this application embodiment is given.
[0246] For example, Figure 8 This is a schematic diagram illustrating an application scenario of geofencing based on raster map partitioning, provided as an embodiment of this application. For example... Figure 8 As shown, based on Figure 3 The grid map in the middle, Figure 8 The geographical regions in include those with Figure 3 Each raster (e.g., raster labeled 1-36) corresponds to a geographic region, for example, when Figure 3 The crowdsourced data in the data refers to the tracking data of numerous electronic devices reporting their entry and exit behaviors near subway station 802, and its geofencing (such as...) Figure 8 The geofencing in 801 is based on Figure 3 Each raster (e.g., raster labeled 1-36) corresponds to point data within a geographic area and the data associated with these point data (i.e., multiple sets of first point data). And as... Figure 8 The geofence 803 in the text is a geofence defined using existing technology. Figure 3 The geofence 803 obtained from the raster map (the geographical extent of the geofence is related to...) Figure 4 (Geofence overlaps with geofence 401). For example, when the target grid is... Figure 3When using grid number 15 in the geofence, the density-based clustering algorithm is used to learn the geofence for the data points of grid number 15. Simultaneously, data associated with the data points within grid number 15 (i.e., data points within circles 301 divided by the grid into grid numbers 8, 9, and 14) are also considered. Therefore, the geofence 801 generated by the geofence division method provided in this embodiment has higher accuracy than the geofence 803 generated by existing technologies, making it easier for users to navigate near subway station 802 (e.g., [missing information]). Figure 8 When the user enters geofence 801 (point A in the map), the phone will automatically recognize that the user has entered the geofence and receive the services the user needs, such as a quick access to the subway ride code, thereby improving the user's experience of using the subway code to ride in the subway station scenario.
[0247] It should be noted that the above Figure 3 The crowdsourced data may also include other possible distribution methods and / or other types of business activity tracking data. Accordingly, the generated geofences (e.g., the range of geofence 801 and / or service tags) will also be different, which is not limited in this application embodiment.
[0248] For example, please see Figures 9A-9C , Figures 9A-9C These are schematic diagrams illustrating user interfaces using geofences based on raster maps, provided as embodiments of this application. For example... Figure 9A As shown, when the geofence generated based on the raster map is the geofence for the subway QR code ride service, the electronic device automatically recognizes that the user has entered the geographical area corresponding to the geofence and triggers the recommended ride code service, displaying user interface 91. This user interface 91 is the main interface of the electronic device 100, which includes application cards 901 and other application icons. Application card 901 includes one or more application widgets. Application card 901 includes a subway ride code control 9011. When the electronic device 100 detects a click operation on the subway ride code control 9011 on the main interface, in response to this operation, the electronic device can launch the application corresponding to the icon and display as shown below. Figure 9B The user interface 92 shown includes a display box 902 for displaying the subway ride code, which greatly enhances the user experience of using the subway ride code in subway station scenarios.
[0249] like Figure 9BAs shown, when the geofence generated based on the raster map is the geofence for the payment service, the electronic device automatically detects when the user enters the geographical area corresponding to the geofence and triggers the recommended payment code service, presenting user interface 93. User interface 93 is the main interface of the electronic device 100, which includes application cards 903 and other application icons. Application card 901 includes one or more application widgets. Application card 903 includes a payment code control 9031. When the electronic device 100 detects a click operation on the payment code control 9031 on the main interface, in response to this operation, the electronic device can launch the application corresponding to the icon and display as shown below. Figure 9B The user interface 94 shown includes a display box 904 for displaying the payment code, which greatly enhances the user experience when using the payment code to pay in payment scenarios.
[0250] like Figure 9C As shown, when the geofence generated based on the raster map is a geofence for the venue code service, the electronic device automatically detects when a user enters the geographical area corresponding to the geofence and triggers the venue code scanning service, displaying user interface 95. This user interface 95 is the main interface of the electronic device 100, which includes application cards 905 and other application icons. Application card 905 includes one or more application widgets. Application card 905 includes a venue code scanning control 9051. When the electronic device 100 detects a click operation on the venue code scanning control 9051 on the main interface, in response to this operation, the electronic device can launch the application corresponding to the icon and display as shown below. Figure 9C The user interface 96 shown includes a display box 906 for displaying the scanned venue code, thereby greatly improving the user experience of using the venue code scanning function to enter and exit venues in scenarios where venue codes need to be scanned.
[0251] It should be noted that the above Figures 9A-9C The user interface diagrams shown are exemplary illustrations of the embodiments of this application. The user interface diagrams during actual operation may also be of other styles. In addition, this application only describes the application scenarios of geofencing for several possible business types. In some embodiments, application scenarios of geofencing for other business types may also be included. This application does not limit these aspects.
[0252] The foregoing has detailed the methods and application scenarios of the embodiments of this application. It is understood that each device, in order to achieve the corresponding functions, includes hardware structures and / or software modules for executing each function. Based on the units and steps described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application. The following describes the devices provided in the embodiments of this application.
[0253] Please see Figure 10 , Figure 10 This is a schematic diagram of a geofencing delineation device provided in an embodiment of this application. The geofencing delineation device 1000 may include a first acquisition unit 1001, a first determination unit 1002, a second determination unit 1003, a third determination unit 1004, and a fourth determination unit 1005, wherein each unit is described in detail below:
[0254] The first acquisition unit 1001 is used to acquire crowdsourced data of the grid map, wherein the crowdsourced data includes the data points of business behaviors reported by numerous electronic devices.
[0255] The first determining unit 1002 is used to determine the grid information of each grid in the grid map based on the crowdsourced data. The grid information includes the grid size, grid identifier, and a set of point data within the corresponding geographical area.
[0256] The second determining unit 1003 is used to determine M first grid sets corresponding to the target grid based on the target accuracy and the grid size of the target grid, wherein the target grid is any grid in the grid map, the target grid corresponds to M extended grids, the M extended grids include the target grid and (M-1) grids associated with the target grid, and M is a positive integer; wherein one extended grid corresponds to one first grid set, and one first grid set includes the corresponding extended grid and the grids associated with the corresponding extended grid;
[0257] The third determining unit 1004 is used to determine multiple first point data sets based on M first grid sets corresponding to each target grid in the grid map, wherein one first grid set corresponds to one first point data set;
[0258] The fourth determining unit 1005 is used to determine the geofence of the grid map based on the plurality of first point data sets corresponding to each target grid in the grid map.
[0259] In this embodiment of the application, the geofencing device first acquires crowdsourced data, including data on business activities reported by numerous electronic devices, from a grid map via a first acquisition unit 1001. Then, based on the acquired crowdsourced data, a first determination unit 1002 determines grid information such as the grid size, grid identifier, and set of data points within the corresponding geographical area for each grid in the grid map. Further, based on the target accuracy and the grid size of any grid (i.e., the target grid) in the grid map, a second determination unit 1003 determines M first grid sets corresponding to the target grid. The target grid corresponds to M extended grids, and the M extended grids include the target grid and (M-1) grids associated with the target grid. Each first grid set includes a grid associated with one of the M extended grids, where M is a positive integer. Furthermore, the third determining unit 1004 determines multiple first marker data sets based on the M first grid sets corresponding to each target grid in the grid map, wherein one first grid set corresponds to one first marker data set. Finally, the fourth determining unit 1005 determines the geofence of the grid map based on the multiple first marker data sets corresponding to each target grid in the grid map. This application embodiment treats multiple sets of first point data corresponding to each target grid in the grid map as an independent calculation unit. Compared with the prior art, which treats each target grid in the grid map as an independent calculation unit, this minimizes the problem that point data belonging to the same category in the grid map (e.g., point data with similar business behaviors) cannot be uniformly calculated because they are divided into different grids. Therefore, the geofence of the grid map determined by this application embodiment can more accurately reflect the actual geographical features or user behavior patterns of the corresponding geographical area of the grid map, improve the accuracy of geofence division, and enable users to receive corresponding recommendation services more accurately when entering the geographical area corresponding to the geofence, thereby improving the user experience.
[0260] In one possible implementation, the target accuracy is determined based on the size of the association radius, which indicates the expected accuracy of the geofence; the association radius is a distance range used to determine whether the point data are associated.
[0261] In one possible implementation, the second determining unit 1003 is specifically used for:
[0262] Based on the associated radius and the grid size of the target grid, a first row and column range is determined; the first row and column range is the row and column range of a specific grid in the M sets of first grids;
[0263] Based on the first row and column range, determine the M first grid sets corresponding to the target grid.
[0264] In one possible implementation, the second determining unit 1003 is specifically used for:
[0265] Based on the associated radius and the grid size of the target grid, determine the number of expanded rows and columns of the target grid;
[0266] Based on the row and column position of the target grid and the number of extended rows and columns, the first row and column range is determined; wherein, the first row and column range includes the maximum and minimum row and column values of the specific grid, and the specific grid is the grid at a specific position in each of the M first grid sets.
[0267] In one possible implementation, the second determining unit 1003 is specifically used for:
[0268] The second row and column range is determined by traversing from the minimum row and column value of the specific grid to the maximum row and column value of the specific grid; the second row and column range includes the maximum row and column value and the minimum row and column value of all grids in each of the M first grid sets corresponding to the target grid;
[0269] Based on the second row and column range, M first set identifiers are determined; the first set identifier is used to indicate one of the M first grid sets.
[0270] In one possible implementation, the geofencing device further includes:
[0271] The fifth determining unit is used to preprocess the grid information of each target grid in the grid map to determine a first information list; the first information list includes the grid identifier of each target grid, the set of point data in the corresponding geographical area, and the second set identifier of the corresponding M first grid sets; the second set identifier includes the M first set identifiers, which are used to indicate the M first grid sets corresponding to each target grid.
[0272] In one possible implementation, the third determining unit 1004 is specifically used for:
[0273] Based on the first information list, for each first set identifier in the second set identifier, expand the raster identifier of the raster involved in each first set identifier, the set of point data in the corresponding geographical area, and the second set identifier involved to obtain the second information list;
[0274] The sets of point data within the corresponding geographic areas of the same first set identifier in the second information list are merged to obtain a third information list; the third information list includes the merged first set identifier and the corresponding plurality of first point data sets; wherein, the plurality of first point data sets include point data within one or more geographic areas of the same first set identifier.
[0275] In one possible implementation, the fourth determining unit 1005 is specifically used for:
[0276] Based on the plurality of first point data sets corresponding to each target grid in the grid map, a target geofence is calculated by a density-based clustering algorithm; the target geofence includes the geofence within the geographic area corresponding to all grids in each first grid set after merging the same first grid sets in the M first grid sets corresponding to each target grid.
[0277] The geofence of the raster map is determined based on the target geofence.
[0278] In one possible implementation, the fourth determining unit 1005 is specifically used for:
[0279] Based on each of the merged first set identifiers in the third information list, the raster code of the core raster in the corresponding first raster set is calculated;
[0280] Based on the raster code of each core raster, a second point data set is obtained; the second point data set includes point data within the geographic area corresponding to each core raster.
[0281] By traversing the point data in the second point data set, the associated point data for each point data is determined based on the association radius;
[0282] A third set of point data is determined based on the second set of point data and the associated point data; the third set of point data includes point data within the geographic area corresponding to each core grid and the corresponding associated point data;
[0283] The target geofence is calculated by learning the density-based clustering algorithm from all the data points in the third data set.
[0284] In one possible implementation, the fourth determining unit 1005 is specifically used for:
[0285] By traversing each target geofence in the target geofence, it is determined whether the center point of the target geofence is located in the core grid of the corresponding first grid set;
[0286] If so, then retain the target geofence;
[0287] If not, then delete the target geofence;
[0288] The retained target geofences are merged to obtain the geofences of the raster map.
[0289] It should be noted that the functions of each unit in the geofencing delineation device 1000 described in the embodiments of this application can be found in the relevant descriptions of the method embodiments above, and will not be repeated here. It is understood that the devices and methods provided in the embodiments of this application can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the above modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be electrical, mechanical, or other forms.
[0290] Please see Figure 11 , Figure 11 This is a schematic diagram of the hardware structure of another electronic device provided in an embodiment of this application. For example... Figure 11 As shown, the electronic device 1100 includes at least one processor 1101 and a memory 1102. The processor 1101 is coupled to the memory 1102; this coupling in this embodiment can be a communication connection, an electrical connection, or other forms. The processor 1101 and the memory 1102 can be connected via a bus 1103. Specifically, the memory 1102 stores program instructions. The processor 1101 calls the program instructions stored in the memory 1102, enabling the electronic device 1100 to execute the steps in the geofencing method provided in this embodiment. The descriptions of its various components and related steps can be found above and will not be repeated here.
[0291] It should be noted that the electronic device 1100 provided in this application embodiment may include more or fewer components than those shown in the figure, or combine some components, or split some components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or any combination of software and hardware.
[0292] This application also provides a computer-readable storage medium, wherein the computer-readable storage medium may store a program, which, when executed by a processor, implements some or all of the steps of any of the geofencing methods described in the above method embodiments.
[0293] This application also provides a computer program that includes instructions that, when executed by a computing device, enable the computing device to perform some or all of the steps of any of the above-described geofencing methods.
[0294] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0295] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0296] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps may be performed in other orders or simultaneously, or some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps. Secondly, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application. It should also be noted that the features and functions of two or more devices according to this disclosure can be embodied in one device. Conversely, the features and functions of one device described above can be further divided and embodied by multiple devices.
[0297] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive).
[0298] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
[0299] In summary, the above description is merely an embodiment of the technical solution of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made according to the disclosure of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for delineating geofencing, characterized in that, include: Obtain crowdsourced data from a grid map, the crowdsourced data including data points of business activities reported by numerous electronic devices; Based on the crowdsourced data, the grid information of each grid in the grid map is determined, and the grid information includes the grid size, grid identifier and a set of point data within the corresponding geographical area; Based on the target accuracy and the grid size of the target grid, M first grid sets corresponding to the target grid are determined, wherein the target grid is any grid in the grid map, the target grid corresponds to M extended grids, the M extended grids include the target grid and (M-1) grids associated with the target grid, where M is a positive integer; wherein one extended grid corresponds to one first grid set, and one first grid set includes the corresponding extended grid and the grids associated with the corresponding extended grid; Based on the M first grid sets corresponding to each target grid in the grid map, multiple first point data sets are determined, wherein one first grid set corresponds to one first point data set; The geofence of the grid map is determined based on the plurality of first point data sets corresponding to each target grid in the grid map.
2. The method of claim 1, wherein, The target accuracy is determined based on the size of the correlation radius, which is used to indicate the expected accuracy of the geofence; the correlation radius is the distance range used to determine whether the point data are correlated.
3. The method of claim 2, wherein, The determination of the M first grid sets corresponding to the target grid based on the target precision and the grid size of the target grid includes: Based on the associated radius and the grid size of the target grid, a first row and column range is determined; the first row and column range is the row and column range of a specific grid in the M sets of first grids; Based on the first row and column range, determine the M first grid sets corresponding to the target grid.
4. The method of claim 3, wherein, Determining the first row and column range based on the associated radius and the grid size of the target grid includes: Based on the associated radius and the grid size of the target grid, determine the number of expanded rows and columns of the target grid; Based on the row and column position of the target grid and the number of extended rows and columns, the first row and column range is determined; wherein, the first row and column range includes the maximum and minimum row and column values of the specific grid, and the specific grid is the grid at a specific position in each of the M first grid sets.
5. The method of claim 4, wherein, The step of determining the set of M first grid cells corresponding to the target grid cell based on the first row and column range includes: The second row and column range is determined by traversing from the minimum row and column value of the specific grid to the maximum row and column value of the specific grid; the second row and column range includes the maximum row and column value and the minimum row and column value of all grids in each of the M first grid sets corresponding to the target grid; Based on the second row and column range, M first set identifiers are determined; the first set identifier is used to indicate one of the M first grid sets.
6. The method of claim 5, wherein, The method further includes: The raster information of each target raster in the raster map is preprocessed to determine a first information list; the first information list includes the raster identifier of each target raster, the set of point data in the corresponding geographical area, and the second set identifier of the corresponding M first raster sets; the second set identifier includes the M first set identifiers, which are used to indicate the M first raster sets corresponding to each target raster.
7. The method as described in claim 6, characterized in that, The determination of multiple first point data sets based on the M first grid sets corresponding to each target grid in the grid map includes: Based on the first information list, for each first set identifier in the second set identifier, expand the raster identifier of the raster involved in each first set identifier, the set of point data in the corresponding geographical area, and the second set identifier involved to obtain the second information list; The sets of point data within the corresponding geographic areas of the same first set identifier in the second information list are merged to obtain a third information list; the third information list includes the merged first set identifier and the corresponding plurality of first point data sets; wherein, the plurality of first point data sets include point data within one or more geographic areas of the same first set identifier.
8. The method of claim 7, wherein, Determining the geofence of the grid map based on the plurality of first point data sets corresponding to each target grid in the grid map includes: Based on the plurality of first point data sets corresponding to each target grid in the grid map, a target geofence is calculated by a density-based clustering algorithm; the target geofence includes the geofence within the geographic area corresponding to all grids in each first grid set after merging the same first grid sets in the M first grid sets corresponding to each target grid. The geofence of the raster map is determined based on the target geofence.
9. The method of claim 8, wherein, The target geofence is calculated using a density-based clustering algorithm based on the plurality of first point data sets corresponding to each target grid cell in the grid map, including: Based on each of the merged first set identifiers in the third information list, the raster code of the core raster in the corresponding first raster set is calculated; Based on the raster code of each core raster, a second point data set is obtained; the second point data set includes point data within the geographic area corresponding to each core raster. By traversing the point data in the second point data set, the associated point data for each point data is determined based on the association radius; A third set of point data is determined based on the second set of point data and the associated point data; the third set of point data includes point data within the geographic area corresponding to each core grid and the corresponding associated point data; The target geofence is calculated by learning the density-based clustering algorithm from all the data points in the third data set.
10. The method of claim 8 or 9, wherein, The step of determining the geofence of the raster map based on the target geofence includes: By traversing each target geofence in the target geofence, it is determined whether the center point of the target geofence is located in the core grid of the corresponding first grid set; If so, then retain the target geofence; If not, then delete the target geofence; The retained target geofences are merged to obtain the geofences of the raster map.
11. A device for dividing a geo-fence, characterized by, include: The first acquisition unit is used to acquire crowdsourced data of the grid map, wherein the crowdsourced data includes the data points of business behaviors reported by numerous electronic devices; The first determining unit is used to determine the grid information of each grid in the grid map based on the crowdsourced data. The grid information includes the grid size, grid identifier, and a set of point data within the corresponding geographical area. The second determining unit is used to determine M first grid sets corresponding to the target grid based on the target accuracy and the grid size of the target grid, wherein the target grid is any grid in the grid map, the target grid corresponds to M extended grids, the M extended grids include the target grid and (M-1) grids associated with the target grid, and M is a positive integer; wherein one extended grid corresponds to one first grid set, and one first grid set includes the corresponding extended grid and the grids associated with the corresponding extended grid; The third determining unit is used to determine multiple first point data sets based on M first grid sets corresponding to each target grid in the grid map, wherein one first grid set corresponds to one first point data set; The fourth determining unit is used to determine the geofence of the grid map based on the plurality of first point data sets corresponding to each target grid in the grid map.
12. An electronic device, comprising: The electronic device includes a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, causing the electronic device to perform the method according to any one of claims 1-9.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-9.
14. A computer program product, characterised in that, The computer program product includes instructions that are executed by a computing device to implement the method of any one of claims 1-9.